diff options
Diffstat (limited to 'src/rw')
-rw-r--r-- | src/rw/RwHelper.cpp | 20 | ||||
-rw-r--r-- | src/rw/RwHelper.h | 2 | ||||
-rw-r--r-- | src/rw/TexRead.cpp | 5 |
3 files changed, 23 insertions, 4 deletions
diff --git a/src/rw/RwHelper.cpp b/src/rw/RwHelper.cpp index 02a07558..42e62105 100644 --- a/src/rw/RwHelper.cpp +++ b/src/rw/RwHelper.cpp @@ -312,6 +312,26 @@ HAnimAnimationCreateForHierarchy(RpHAnimHierarchy *hier) return anim; } +RpAtomic* +AtomicRemoveAnimFromSkinCB(RpAtomic *atomic, void *data) +{ + if(RpSkinGeometryGetSkin(RpAtomicGetGeometry(atomic))){ + RpHAnimHierarchy *hier = RpSkinAtomicGetHAnimHierarchy(atomic); +#ifdef LIBRW + if(hier && hier->interpolator->currentAnim){ + RpHAnimAnimationDestroy(hier->interpolator->currentAnim); + hier->interpolator->currentAnim = nil; + } +#else + if(hier && hier->pCurrentAnim){ + RpHAnimAnimationDestroy(hier->pCurrentAnim); + hier->pCurrentAnim = nil; + } +#endif + } + return atomic; +} + void RenderSkeleton(RpHAnimHierarchy *hier) { diff --git a/src/rw/RwHelper.h b/src/rw/RwHelper.h index e6740031..8a55a832 100644 --- a/src/rw/RwHelper.h +++ b/src/rw/RwHelper.h @@ -21,6 +21,8 @@ RpHAnimHierarchy *GetAnimHierarchyFromClump(RpClump *clump); // get from frame RwFrame *GetHierarchyFromChildNodesCB(RwFrame *frame, void *data); void SkinGetBonePositionsToTable(RpClump *clump, RwV3d *boneTable); RpHAnimAnimation *HAnimAnimationCreateForHierarchy(RpHAnimHierarchy *hier); +RpAtomic *AtomicRemoveAnimFromSkinCB(RpAtomic *atomic, void *data); +void RenderSkeleton(RpHAnimHierarchy *hier); #endif RwTexDictionary *RwTexDictionaryGtaStreamRead(RwStream *stream); diff --git a/src/rw/TexRead.cpp b/src/rw/TexRead.cpp index d1ff3dc0..9f0cae3c 100644 --- a/src/rw/TexRead.cpp +++ b/src/rw/TexRead.cpp @@ -66,10 +66,7 @@ RwTexDictionaryGtaStreamRead(RwStream *stream) if(!RwStreamFindChunk(stream, rwID_STRUCT, &size, &version)) return nil; - assert(size == 4); -int foo = RwStreamRead(stream, &numTextures, size); -if(foo != size) -// if(RwStreamRead(stream, &numTextures, size) != size) + if(RwStreamRead(stream, &numTextures, size) != size) return nil; texDict = RwTexDictionaryCreate(); |