mirror of
https://gitlab.com/GaryOderNichts/re3-wiiu.git
synced 2024-11-23 09:39:16 +01:00
hanim fix
This commit is contained in:
parent
7c7727e7da
commit
8bbb6a2a4a
@ -29,14 +29,14 @@
|
|||||||
#define STREAMFILE(str) (((rw::StreamFile*)(str))->file)
|
#define STREAMFILE(str) (((rw::StreamFile*)(str))->file)
|
||||||
#define HIERNODEINFO(hier) ((hier)->nodeInfo)
|
#define HIERNODEINFO(hier) ((hier)->nodeInfo)
|
||||||
#define HIERNODEID(hier, i) ((hier)->nodeInfo[i].id)
|
#define HIERNODEID(hier, i) ((hier)->nodeInfo[i].id)
|
||||||
#define HANIMFRAMES(anim) ((anim)->keyframes)
|
#define HANIMFRAME(anim, i) ((RwUInt8*)(anim)->keyframes + (i)*(anim)->interpInfo->animKeyFrameSize)
|
||||||
#else
|
#else
|
||||||
#define RWHALFPIXEL // always d3d
|
#define RWHALFPIXEL // always d3d
|
||||||
#define STREAMPOS(str) ((str)->Type.memory.position)
|
#define STREAMPOS(str) ((str)->Type.memory.position)
|
||||||
#define STREAMFILE(str) ((str)->Type.file.fpFile)
|
#define STREAMFILE(str) ((str)->Type.file.fpFile)
|
||||||
#define HIERNODEINFO(hier) ((hier)->pNodeInfo)
|
#define HIERNODEINFO(hier) ((hier)->pNodeInfo)
|
||||||
#define HIERNODEID(hier, i) ((hier)->pNodeInfo[i].nodeID)
|
#define HIERNODEID(hier, i) ((hier)->pNodeInfo[i].nodeID)
|
||||||
#define HANIMFRAMES(anim) ((anim)->pFrames)
|
#define HANIMFRAME(anim, i) ((RwUInt8*)(anim)->pFrames + (i)*(anim)->interpInfo->keyFrameSize)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef RWHALFPIXEL
|
#ifdef RWHALFPIXEL
|
||||||
|
@ -319,14 +319,20 @@ HAnimAnimationCreateForHierarchy(RpHAnimHierarchy *hier)
|
|||||||
RpHAnimAnimation *anim = RpHAnimAnimationCreate(rpHANIMSTDKEYFRAMETYPEID, numNodes, 0, 0.0f);
|
RpHAnimAnimation *anim = RpHAnimAnimationCreate(rpHANIMSTDKEYFRAMETYPEID, numNodes, 0, 0.0f);
|
||||||
if(anim == nil)
|
if(anim == nil)
|
||||||
return nil;
|
return nil;
|
||||||
RpHAnimStdKeyFrame *frame = (RpHAnimStdKeyFrame*)HANIMFRAMES(anim);
|
RpHAnimStdKeyFrame *frame;
|
||||||
for(i = 0; i < numNodes; i++){
|
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.real = 1.0f;
|
||||||
frame->q.imag.x = frame->q.imag.y = frame->q.imag.z = 0.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;
|
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;
|
frame->time = 0.0f;
|
||||||
|
#endif
|
||||||
frame->prevFrame = nil;
|
frame->prevFrame = nil;
|
||||||
frame++;
|
|
||||||
}
|
}
|
||||||
return anim;
|
return anim;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user