summaryrefslogtreecommitdiffstats
path: root/src/rw/RwHelper.cpp
diff options
context:
space:
mode:
authoreray orçunus <erayorcunus@gmail.com>2020-06-01 17:35:04 +0200
committereray orçunus <erayorcunus@gmail.com>2020-06-01 17:35:04 +0200
commitabef04c6376cb45946ea363df20fbe6473a2252c (patch)
treedaa75bd4ac0ae3337b75b2484472139b77abf8a2 /src/rw/RwHelper.cpp
parentDrawStandardMenus, VC menu array and minor fixes (diff)
parenthanim fix (diff)
downloadre3-abef04c6376cb45946ea363df20fbe6473a2252c.tar
re3-abef04c6376cb45946ea363df20fbe6473a2252c.tar.gz
re3-abef04c6376cb45946ea363df20fbe6473a2252c.tar.bz2
re3-abef04c6376cb45946ea363df20fbe6473a2252c.tar.lz
re3-abef04c6376cb45946ea363df20fbe6473a2252c.tar.xz
re3-abef04c6376cb45946ea363df20fbe6473a2252c.tar.zst
re3-abef04c6376cb45946ea363df20fbe6473a2252c.zip
Diffstat (limited to 'src/rw/RwHelper.cpp')
-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 a87874d7..76c6c753 100644
--- a/src/rw/RwHelper.cpp
+++ b/src/rw/RwHelper.cpp
@@ -329,14 +329,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;
}