Skip to content

Commit a09898f

Browse files
committed
AnimFrameLoad_Z: Progress
1 parent 42168f9 commit a09898f

File tree

4 files changed

+91
-27
lines changed

4 files changed

+91
-27
lines changed

src/Engine/AnimFrameLoad_Z.cpp

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
#include "AnimFrame_Z.h"
2+
#include "Program_Z.h"
3+
4+
// TODO: Finish matching
5+
void AnimFrame_Z::Load(void** i_Data) {
6+
gData.ClassMgr->LoadLink(m_NodeHdl, i_Data);
7+
LOAD_Z(m_MaxTime);
8+
m_TransKfr.Load(i_Data);
9+
m_RotKfr.Load(i_Data);
10+
m_ScaleKfr.Load(i_Data);
11+
m_TimeKfr.Load(i_Data);
12+
m_ColorKfr.Load(i_Data);
13+
m_AmbientKfr.Load(i_Data);
14+
m_MsgKfr.Load(i_Data);
15+
S32 i;
16+
S32 l_Nb;
17+
LOAD_Z(l_Nb);
18+
m_FollowSplineKfr.SetNbKey(l_Nb);
19+
for (i = 0; i < l_Nb; i++) {
20+
Node_ZHdl& l_NodeHdl = m_FollowSplineKfr.m_Keys[i].m_NodeHdl;
21+
gData.ClassMgr->LoadLink(l_NodeHdl, i_Data);
22+
LOADRANGE_Z(m_FollowSplineKfr.m_Keys[i].m_Axis, m_FollowSplineKfr.m_Keys[i].m_Orient);
23+
}
24+
LOAD_Z(l_Nb);
25+
m_StartStopAnimKfr.m_Keys.SetSize(l_Nb);
26+
for (i = 0; i < l_Nb; i++) {
27+
S32 l_Nb2;
28+
LOAD_Z(l_Nb2);
29+
m_StartStopAnimKfr.m_Keys[i].m_StartStops.SetSize(l_Nb2);
30+
LOAD_Z(m_StartStopAnimKfr.m_Keys[i].m_Time);
31+
for (S32 j = 0; j < l_Nb2; j++) {
32+
gData.ClassMgr->LoadLink(m_StartStopAnimKfr.m_Keys[i].m_StartStops[j].m_AnimHdl, i_Data);
33+
LOAD_Z(m_StartStopAnimKfr.m_Keys[i].m_StartStops[j].m_Value);
34+
}
35+
}
36+
LOADRANGE_Z(m_CurTime, m_PlayFlag);
37+
}
38+
39+
void AnimFrame_Z::EndLoad() {
40+
S32 i;
41+
S32 j;
42+
m_ResObjLink.EndLoad();
43+
gData.ClassMgr->UpdateLink(m_NodeHdl);
44+
for (i = 0; i < m_FollowSplineKfr.GetNbKeys(); i++) {
45+
gData.ClassMgr->UpdateLink(m_FollowSplineKfr.m_Keys[i].m_NodeHdl);
46+
}
47+
for (i = 0; i < m_StartStopAnimKfr.GetNbKeys(); i++) {
48+
for (j = 0; j < m_StartStopAnimKfr.m_Keys[i].GetNb(); j++) {
49+
gData.ClassMgr->UpdateLink(m_StartStopAnimKfr.m_Keys[i].Get(j).m_AnimHdl);
50+
}
51+
}
52+
m_MsgKfr.EndLoad();
53+
}

src/Engine/includes/AnimFrame_Z.h

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,13 @@
66
#include "AnimFrame_ZHdl.h"
77

88
struct KeyFollow_Z : public Key_Z {
9+
friend class KeyframerFollow_Z;
10+
friend class AnimFrame_Z;
11+
912
public:
10-
KeyFollow_Z() { }
13+
KeyFollow_Z() {
14+
m_NodeHdl = Node_ZHdl();
15+
}
1116

1217
KeyFollow_Z(const Float i_Time) {
1318
SetTime(i_Time);
@@ -43,6 +48,8 @@ struct KeyFollow_Z : public Key_Z {
4348
};
4449

4550
class KeyframerFollow_Z {
51+
friend class AnimFrame_Z;
52+
4653
public:
4754
inline S32 GetNbKeys() const {
4855
return m_Keys.GetSize();
@@ -56,11 +63,11 @@ class KeyframerFollow_Z {
5663
return m_Keys[i];
5764
}
5865

59-
inline DynArray_Z<KeyFollow_Z, 32, 1, 1>& GetKeys() {
66+
inline DynArray_Z<KeyFollow_Z, 4, 1, 1>& GetKeys() {
6067
return m_Keys;
6168
}
6269

63-
inline void SetNbKey(U32 NbKey) {
70+
inline void SetNbKey(S32 NbKey) {
6471
m_Keys.SetSize(NbKey);
6572
}
6673

@@ -88,7 +95,7 @@ class KeyframerFollow_Z {
8895
void MarkHandles();
8996

9097
private:
91-
DynArray_Z<KeyFollow_Z, 32, 1, 1> m_Keys;
98+
DynArray_Z<KeyFollow_Z, 4, 1, 1> m_Keys;
9299
};
93100

94101
struct StartStop_Z {
@@ -99,6 +106,8 @@ struct StartStop_Z {
99106
typedef DynArray_Z<StartStop_Z, 4> StartStop_ZDA;
100107

101108
struct KeyStartStop_Z : public Key_Z {
109+
friend class AnimFrame_Z;
110+
102111
public:
103112
KeyStartStop_Z() { }
104113

@@ -145,6 +154,8 @@ struct KeyStartStop_Z : public Key_Z {
145154
};
146155

147156
class KeyframerStartStop_Z {
157+
friend class AnimFrame_Z;
158+
148159
public:
149160
inline S32 GetNbKeys() const {
150161
return m_Keys.GetSize();
@@ -162,7 +173,7 @@ class KeyframerStartStop_Z {
162173
return m_Keys;
163174
}
164175

165-
inline void SetNbKey(U32 NbKey) {
176+
inline void SetNbKey(S32 NbKey) {
166177
m_Keys.SetSize(NbKey);
167178
}
168179

@@ -198,11 +209,11 @@ class AnimFrame_Z : public ResourceObject_Z {
198209
AnimFrame_Z();
199210

200211
// clang-format off
201-
virtual ~AnimFrame_Z() { } /* 0x08 */
202-
virtual void Load(void* a1); /* 0x0C */
203-
virtual void EndLoad(); /* 0x10 */
204-
virtual Bool MarkHandles(); /* 0x14 */
205-
virtual void Update(Float a1); /* 0x18 */
212+
virtual ~AnimFrame_Z() { } /* 0x08 */
213+
virtual void Load(void** i_Data); /* 0x0C */
214+
virtual void EndLoad(); /* 0x10 */
215+
virtual Bool MarkHandles(); /* 0x14 */
216+
virtual void Update(Float i_DeltaTime); /* 0x18 */
206217
// clang-format on
207218

208219
private:

src/Engine/includes/AnimMessage_Z.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ class KeyframerMessage_Z {
137137
return m_Keys;
138138
}
139139

140-
inline void SetNbKey(U32 NbKey) {
140+
inline void SetNbKey(S32 NbKey) {
141141
m_Keys.SetSize(NbKey);
142142
}
143143

src/Engine/includes/Keyframer_Z.h

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -541,7 +541,7 @@ class KeyframerFlag_Z {
541541
return m_Keys[i];
542542
}
543543

544-
inline void SetNbKey(U32 NbKey) {
544+
inline void SetNbKey(S32 NbKey) {
545545
m_Keys.SetSize(NbKey);
546546
}
547547

@@ -586,7 +586,7 @@ class KeyframerHdl_Z {
586586
return m_Keys[i];
587587
}
588588

589-
inline void SetNbKey(U32 NbKey) {
589+
inline void SetNbKey(S32 NbKey) {
590590
m_Keys.SetSize(NbKey);
591591
}
592592

@@ -637,7 +637,7 @@ class KeyframerFloat_Z : public Keyframer_Z {
637637
return m_Keys;
638638
}
639639

640-
inline void SetNbKey(U32 NbKey) {
640+
inline void SetNbKey(S32 NbKey) {
641641
m_Keys.SetSize(NbKey);
642642
}
643643

@@ -688,7 +688,7 @@ class KeyframerFloatComp_Z : public Keyframer_Z {
688688
return m_Keys;
689689
}
690690

691-
inline void SetNbKey(U32 NbKey) {
691+
inline void SetNbKey(S32 NbKey) {
692692
m_Keys.SetSize(NbKey);
693693
}
694694

@@ -735,7 +735,7 @@ class KeyframerFloatLinear_Z : public Keyframer_Z {
735735
return m_Keys[i];
736736
}
737737

738-
inline void SetNbKey(U32 NbKey) {
738+
inline void SetNbKey(S32 NbKey) {
739739
m_Keys.SetSize(NbKey);
740740
}
741741

@@ -786,7 +786,7 @@ class KeyframerFloatLinearComp_Z : public Keyframer_Z {
786786
return m_Keys[i];
787787
}
788788

789-
inline void SetNbKey(U32 NbKey) {
789+
inline void SetNbKey(S32 NbKey) {
790790
m_Keys.SetSize(NbKey);
791791
}
792792

@@ -837,7 +837,7 @@ class KeyframerRot_Z {
837837
return m_Keys[i];
838838
}
839839

840-
inline void SetNbKey(U32 NbKey) {
840+
inline void SetNbKey(S32 NbKey) {
841841
m_Keys.SetSize(NbKey);
842842
}
843843

@@ -884,7 +884,7 @@ class KeyframerBezierRot_Z {
884884
return m_Keys[i];
885885
}
886886

887-
inline void SetNbKey(U32 NbKey) {
887+
inline void SetNbKey(S32 NbKey) {
888888
m_Keys.SetSize(NbKey);
889889
}
890890

@@ -930,7 +930,7 @@ class KeyframerVec3f_Z : public Keyframer_Z {
930930
return m_Keys[i];
931931
}
932932

933-
inline void SetNbKey(U32 NbKey) {
933+
inline void SetNbKey(S32 NbKey) {
934934
m_Keys.SetSize(NbKey);
935935
}
936936

@@ -975,7 +975,7 @@ class KeyframerVec3fComp_Z : public Keyframer_Z {
975975
return m_Keys[i];
976976
}
977977

978-
inline void SetNbKey(U32 NbKey) {
978+
inline void SetNbKey(S32 NbKey) {
979979
m_Keys.SetSize(NbKey);
980980
}
981981

@@ -1022,7 +1022,7 @@ class KeyframerVec3fLinear_Z : public Keyframer_Z {
10221022
return m_Keys[i];
10231023
}
10241024

1025-
inline void SetNbKey(U32 NbKey) {
1025+
inline void SetNbKey(S32 NbKey) {
10261026
m_Keys.SetSize(NbKey);
10271027
}
10281028

@@ -1073,7 +1073,7 @@ class KeyframerExtVec3f_Z : public Keyframer_Z {
10731073
return m_Keys[i];
10741074
}
10751075

1076-
inline void SetNbKey(U32 NbKey) {
1076+
inline void SetNbKey(S32 NbKey) {
10771077
m_Keys.SetSize(NbKey);
10781078
}
10791079

@@ -1118,7 +1118,7 @@ class KeyframerVec2fLinear_Z : public Keyframer_Z {
11181118
return m_Keys[i];
11191119
}
11201120

1121-
inline void SetNbKey(U32 NbKey) {
1121+
inline void SetNbKey(S32 NbKey) {
11221122
m_Keys.SetSize(NbKey);
11231123
}
11241124

@@ -1170,7 +1170,7 @@ class KeyframerVec2fLinearComp_Z : public Keyframer_Z {
11701170
return m_Keys[i];
11711171
}
11721172

1173-
inline void SetNbKey(U32 NbKey) {
1173+
inline void SetNbKey(S32 NbKey) {
11741174
m_Keys.SetSize(NbKey);
11751175
}
11761176

@@ -1221,7 +1221,7 @@ class KeyframerVec4fLinear_Z : public Keyframer_Z {
12211221
return m_Keys[i];
12221222
}
12231223

1224-
inline void SetNbKey(U32 NbKey) {
1224+
inline void SetNbKey(S32 NbKey) {
12251225
m_Keys.SetSize(NbKey);
12261226
}
12271227

@@ -1272,7 +1272,7 @@ class KeyframerVec4fLinearComp_Z : public Keyframer_Z {
12721272
return m_Keys[i];
12731273
}
12741274

1275-
inline void SetNbKey(U32 NbKey) {
1275+
inline void SetNbKey(S32 NbKey) {
12761276
m_Keys.SetSize(NbKey);
12771277
}
12781278

0 commit comments

Comments
 (0)