summaryrefslogtreecommitdiffstats
path: root/src/rw/RwHelper.cpp
diff options
context:
space:
mode:
authoraap <aap@papnet.eu>2020-06-01 20:28:04 +0200
committeraap <aap@papnet.eu>2020-06-01 20:28:04 +0200
commit8bbb6a2a4a104469f1c3a285f68088445332d671 (patch)
tree965cdf7d7fe4e248f308aea9d23762b72f236a29 /src/rw/RwHelper.cpp
parentfixed timebar toggle (diff)
downloadre3-8bbb6a2a4a104469f1c3a285f68088445332d671.tar
re3-8bbb6a2a4a104469f1c3a285f68088445332d671.tar.gz
re3-8bbb6a2a4a104469f1c3a285f68088445332d671.tar.bz2
re3-8bbb6a2a4a104469f1c3a285f68088445332d671.tar.lz
re3-8bbb6a2a4a104469f1c3a285f68088445332d671.tar.xz
re3-8bbb6a2a4a104469f1c3a285f68088445332d671.tar.zst
re3-8bbb6a2a4a104469f1c3a285f68088445332d671.zip
Diffstat (limited to '')
-rw-r--r--src/rw/RwHelper.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/rw/RwHelper.cpp b/src/rw/RwHelper.cpp
index 191fc7ab..cd2a1bf6 100644
--- a/src/rw/RwHelper.cpp
+++ b/src/rw/RwHelper.cpp
@@ -319,14 +319,20 @@ HAnimAnimationCreateForHierarchy(RpHAnimHierarchy *hier)
RpHAnimAnimation *anim = RpHAnimAnimationCreate(rpHANIMSTDKEYFRAMETYPEID, numNodes, 0, 0.0f);
if(anim == nil)
return nil;
- RpHAnimStdKeyFrame *frame = (RpHAnimStdKeyFrame*)HANIMFRAMES(anim);
+ RpHAnimStdKeyFrame *frame;
for(i = 0; i < numNodes; i++){
+ frame = (RpHAnimStdKeyFrame*)HANIMFRAME(anim, i); // games uses struct size here, not safe
frame->q.real = 1.0f;
frame->q.imag.x = frame->q.imag.y = frame->q.imag.z = 0.0f;
frame->t.x = frame->t.y = frame->t.z = 0.0f;
+#ifdef FIX_BUGS
+ // times are subtracted and divided giving NaNs
+ // so they can't both be 0
+ frame->time = i/hier->numNodes;
+#else
frame->time = 0.0f;
+#endif
frame->prevFrame = nil;
- frame++;
}
return anim;
}