summaryrefslogtreecommitdiff
path: root/src/rw
diff options
context:
space:
mode:
authoraap <aap@papnet.eu>2020-04-25 00:40:14 +0200
committeraap <aap@papnet.eu>2020-04-25 00:41:17 +0200
commitac19de45b88123b2284ecc3ab44cedcaa7ca496d (patch)
tree5e512242f7c7f41fcb9c685c2679c6b004bae8fd /src/rw
parent5bb4e9992679c9e8767d4eb6de54da1892ec13c6 (diff)
few fixes
Diffstat (limited to 'src/rw')
-rw-r--r--src/rw/RwHelper.cpp20
-rw-r--r--src/rw/RwHelper.h2
-rw-r--r--src/rw/TexRead.cpp5
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();