mirror of https://github.com/yaz0r/FITD.git
Cleanup to the optimized animations
This commit is contained in:
parent
612b702790
commit
24c7d8fa23
|
@ -41,7 +41,6 @@ int SetAnimObjet(int frame, sAnimation* pAnimation, sBody* body)
|
||||||
if(body->m_flags & INFO_OPTIMISE)
|
if(body->m_flags & INFO_OPTIMISE)
|
||||||
{
|
{
|
||||||
body->m_groups[i].m_state.m_rotateDelta = keyframe.m_groups[i].m_rotateDelta;
|
body->m_groups[i].m_state.m_rotateDelta = keyframe.m_groups[i].m_rotateDelta;
|
||||||
body->m_groups[i].m_state.m_padding = keyframe.m_groups[i].m_padding;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -855,9 +854,9 @@ s16 SetInterAnimObjet(int frame, sAnimation* pAnim, sBody* pBody)
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
point3dStruct& state = pBody->m_groups[i].m_state.m_rotateDelta;
|
point3dStruct& state = pBody->m_groups[i].m_state.m_rotateDelta.value();
|
||||||
point3dStruct& previousState = pPreviousKeyframe->m_groups[i].m_rotateDelta;
|
point3dStruct& previousState = pPreviousKeyframe->m_groups[i].m_rotateDelta.value();
|
||||||
point3dStruct& nextState = pKeyframe->m_groups[i].m_rotateDelta;
|
point3dStruct& nextState = pKeyframe->m_groups[i].m_rotateDelta.value();
|
||||||
|
|
||||||
PatchInterAngle(&state.x, previousState.x, nextState.x, bp, bx);
|
PatchInterAngle(&state.x, previousState.x, nextState.x, bp, bx);
|
||||||
PatchInterAngle(&state.y, previousState.y, nextState.y, bp, bx);
|
PatchInterAngle(&state.y, previousState.y, nextState.y, bp, bx);
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <format>
|
#include <format>
|
||||||
|
#include <optional>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
|
|
|
@ -141,10 +141,11 @@ sAnimation* createAnimationFromPtr(void* ptr, int size)
|
||||||
pGroup->m_delta.y = READ_LE_S16(animPtr); animPtr += 2;
|
pGroup->m_delta.y = READ_LE_S16(animPtr); animPtr += 2;
|
||||||
pGroup->m_delta.z = READ_LE_S16(animPtr); animPtr += 2;
|
pGroup->m_delta.z = READ_LE_S16(animPtr); animPtr += 2;
|
||||||
if (bUseOptim) {
|
if (bUseOptim) {
|
||||||
pGroup->m_rotateDelta.x = READ_LE_S16(animPtr); animPtr += 2;
|
pGroup->m_rotateDelta.emplace();
|
||||||
pGroup->m_rotateDelta.y = READ_LE_S16(animPtr); animPtr += 2;
|
pGroup->m_rotateDelta.value().x = READ_LE_S16(animPtr); animPtr += 2;
|
||||||
pGroup->m_rotateDelta.z = READ_LE_S16(animPtr); animPtr += 2;
|
pGroup->m_rotateDelta.value().y = READ_LE_S16(animPtr); animPtr += 2;
|
||||||
pGroup->m_padding = READ_LE_S16(animPtr); animPtr += 2;
|
pGroup->m_rotateDelta.value().z = READ_LE_S16(animPtr); animPtr += 2;
|
||||||
|
animPtr += 2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -215,10 +216,11 @@ sBody* createBodyFromPtr(void* ptr)
|
||||||
newBody->m_groups[i].m_state.m_delta.x = READ_LE_S16(bodyBuffer); bodyBuffer += 2;
|
newBody->m_groups[i].m_state.m_delta.x = READ_LE_S16(bodyBuffer); bodyBuffer += 2;
|
||||||
newBody->m_groups[i].m_state.m_delta.y = READ_LE_S16(bodyBuffer); bodyBuffer += 2;
|
newBody->m_groups[i].m_state.m_delta.y = READ_LE_S16(bodyBuffer); bodyBuffer += 2;
|
||||||
newBody->m_groups[i].m_state.m_delta.z = READ_LE_S16(bodyBuffer); bodyBuffer += 2;
|
newBody->m_groups[i].m_state.m_delta.z = READ_LE_S16(bodyBuffer); bodyBuffer += 2;
|
||||||
newBody->m_groups[i].m_state.m_rotateDelta.x = READ_LE_S16(bodyBuffer); bodyBuffer += 2;
|
newBody->m_groups[i].m_state.m_rotateDelta.emplace();
|
||||||
newBody->m_groups[i].m_state.m_rotateDelta.y = READ_LE_S16(bodyBuffer); bodyBuffer += 2;
|
newBody->m_groups[i].m_state.m_rotateDelta.value().x = READ_LE_S16(bodyBuffer); bodyBuffer += 2;
|
||||||
newBody->m_groups[i].m_state.m_rotateDelta.z = READ_LE_S16(bodyBuffer); bodyBuffer += 2;
|
newBody->m_groups[i].m_state.m_rotateDelta.value().y = READ_LE_S16(bodyBuffer); bodyBuffer += 2;
|
||||||
newBody->m_groups[i].m_state.m_padding = READ_LE_S16(bodyBuffer); bodyBuffer += 2;
|
newBody->m_groups[i].m_state.m_rotateDelta.value().z = READ_LE_S16(bodyBuffer); bodyBuffer += 2;
|
||||||
|
bodyBuffer += 2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -344,7 +344,7 @@ int AnimNuage(int x,int y,int z,int alpha,int beta,int gamma, sBody* pBody)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
InitGroupeRot(pGroup[0].m_state.m_rotateDelta.x, pGroup[0].m_state.m_rotateDelta.y, pGroup[0].m_state.m_rotateDelta.z);
|
InitGroupeRot(pGroup->m_state.m_rotateDelta.value().x, pGroup->m_state.m_rotateDelta.value().y, pGroup->m_state.m_rotateDelta.value().z);
|
||||||
RotateGroupeOptimise(pGroup);
|
RotateGroupeOptimise(pGroup);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -504,8 +504,7 @@ struct sGroupState
|
||||||
s16 m_type; // 0
|
s16 m_type; // 0
|
||||||
point3dStruct m_delta; // 2
|
point3dStruct m_delta; // 2
|
||||||
// (AITD2+) if Info_optimise
|
// (AITD2+) if Info_optimise
|
||||||
point3dStruct m_rotateDelta; // 8
|
std::optional<point3dStruct> m_rotateDelta; // 8
|
||||||
s16 m_padding;
|
|
||||||
// 8 / 0x10
|
// 8 / 0x10
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue