本文整理汇总了C++中hsTArray::Remove方法的典型用法代码示例。如果您正苦于以下问题:C++ hsTArray::Remove方法的具体用法?C++ hsTArray::Remove怎么用?C++ hsTArray::Remove使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类hsTArray
的用法示例。
在下文中一共展示了hsTArray::Remove方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Remove
bool Remove( plCommonObjLib *lib )
{
int idx = fLibs.Find( lib );
if( idx != fLibs.kMissingIndex )
fLibs.Remove( idx );
else
{
hsAssert( false, "Common Object Lib not found in list upon deletion. Are you misusing this class? Tsk tsk!" );
}
fRefCount--;
return ( fRefCount == 0 ) ? true : false;
}
示例2: MsgReceive
hsBool plMorphSequence::MsgReceive(plMessage* msg)
{
plRenderMsg* rend = plRenderMsg::ConvertNoRef(msg);
if( rend )
{
// For now, I'm ignoring the target weight stuff for shared meshes.
// Can always add it in later if desired.
if( fTgtWgts.GetCount() )
{
float delWgt = hsTimer::GetDelSysSeconds() / (kMorphTime > 0 ? kMorphTime : 1.e-3f);
int i;
for( i = 0; i < fTgtWgts.GetCount(); i++ )
{
float currWgt = GetWeight(fTgtWgts[i].fLayer, fTgtWgts[i].fDelta);
if( fTgtWgts[i].fWeight < currWgt )
{
if( fTgtWgts[i].fWeight >= (currWgt -= delWgt) )
currWgt = fTgtWgts[i].fWeight;
}
else if( fTgtWgts[i].fWeight > currWgt )
{
if( fTgtWgts[i].fWeight <= (currWgt += delWgt) )
currWgt = fTgtWgts[i].fWeight;
}
fMorphs[fTgtWgts[i].fLayer].SetWeight(fTgtWgts[i].fDelta, currWgt);
if( fTgtWgts[i].fWeight == currWgt )
{
fTgtWgts.Remove(i);
i--;
}
}
ISetDirty(true);
}
if( !(fMorphFlags & kDirty) )
{
// We went a whole frame without getting dirty,
// we can stop refreshing now.
plgDispatch::Dispatch()->UnRegisterForExactType(plRenderMsg::Index(), GetKey());
return true;
}
ISetDirty(false);
if( fMorphFlags & kDirtyIndices )
IFindIndices();
if( fMorphFlags & kHaveShared )
{
IApplyShared();
}
else
{
Apply();
}
return true;
}
plSharedMeshBCMsg *smMsg = plSharedMeshBCMsg::ConvertNoRef(msg);
if (smMsg)
{
if (IGetDrawInterface()->GetKey() == smMsg->GetSender() || IIsUsingDrawable(smMsg->fDraw))
fMorphFlags |= kDirtyIndices;
}
plGenRefMsg *refMsg = plGenRefMsg::ConvertNoRef(msg);
if (refMsg)
{
plSharedMesh *mesh = plSharedMesh::ConvertNoRef(refMsg->GetRef());
if (mesh)
{
if( refMsg->GetContext() & (plRefMsg::kOnCreate|plRefMsg::kOnRequest) )
{
AddSharedMesh(mesh);
}
else if( refMsg->GetContext() & plRefMsg::kOnReplace)
{
plSharedMesh *oldMesh = plSharedMesh::ConvertNoRef(refMsg->GetOldRef());
if (oldMesh)
RemoveSharedMesh(oldMesh);
AddSharedMesh(mesh);
}
else if( refMsg->GetContext() & (plRefMsg::kOnDestroy|plRefMsg::kOnRemove) )
RemoveSharedMesh(mesh);
return true;
}
}
return plSingleModifier::MsgReceive(msg);
}