示例#1
0
RpClump *CClumpModelInfo::CreateInstance()
{
    if (GetRwObject() == NULL)
    {
        return NULL;
    }
    AddRef();
    RpClump *pCloned = RpClumpClone((RpClump*)GetRwObject());
    RpAtomic *pFirst = GetFirstAtomic(pCloned);
    if (pFirst)
    {
        if(RpSkinGeometryGetSkin(pFirst->geometry) != NULL)
        {
            if(!dwUnknownFlag10)
            {
                RpHAnimHierarchy *pHAnim = GetAnimHierarchyFromClump(pCloned);
                RpClumpForAllAtomics(pCloned, SetAtomicHAnimHierarchyCB, pHAnim);
                RtAnimAnimation *pAnim = RpAnimBlendCreateAnimationForHierarchy(pHAnim);
                RtAnimInterpolatorSetCurrentAnim(pHAnim->currentAnim, pAnim);
                pHAnim->flags = rpHANIMHIERARCHYUPDATEMODELLINGMATRICES | rpHANIMHIERARCHYUPDATELTMS;
            }
        }
    }
    if (GetIsRoad())
    {
        RpAnimBlendClumpInit(pCloned);
        CAnimBlendHierarchy *pAnim = CAnimManager::GetAnimationByID(GetHashKey(), &CAnimManager::AnimBlocks[m_AnimId]);
        if (pAnim)
        {
            CAnimManager::BlendAnimation(pCloned, pAnim, 2, 1.0f);
        }
    }
    RemoveRef();
    return pCloned;
}
示例#2
0
文件: CToken.hpp 项目: KalDragon/urde
 ~CToken()
 {
     if (x0_objRef)
     {
         if (x4_lockHeld)
             x0_objRef->Unlock();
         RemoveRef();
     }
 }
示例#3
0
文件: CToken.hpp 项目: KalDragon/urde
 CToken& operator=(CToken&& other)
 {
     Unlock();
     RemoveRef();
     x0_objRef = other.x0_objRef;
     other.x0_objRef = nullptr;
     x4_lockHeld = other.x4_lockHeld;
     other.x4_lockHeld = false;
     return *this;
 }
示例#4
0
文件: CToken.hpp 项目: KalDragon/urde
 CToken& operator=(const CToken& other)
 {
     Unlock();
     RemoveRef();
     x0_objRef = other.x0_objRef;
     if (x0_objRef)
     {
         ++x0_objRef->x0_refCount;
         if (other.x4_lockHeld)
             Lock();
     }
     return *this;
 }