@@ -65,15 +65,15 @@ bool CClientIFP::LoadIFPFile ( const char * szFilePath )
65
65
66
66
void CClientIFP::ReadIFPVersion1 ( )
67
67
{
68
- IFP_INFO Info;
68
+ SInfo Info;
69
69
ReadHeaderVersion1 ( Info );
70
70
71
71
m_pVecAnimations->resize ( Info.Entries );
72
72
for ( auto it = m_pVecAnimations->begin (); it != m_pVecAnimations->end (); ++it )
73
73
{
74
74
ReadAnimationNameVersion1 ( *it );
75
75
76
- IFP_DGAN Dgan;
76
+ SDgan Dgan;
77
77
ReadDgan ( Dgan );
78
78
79
79
std::unique_ptr < CAnimBlendHierarchy > pAnimationHierarchy = m_pAnimManager->GetCustomAnimBlendHierarchy ( &it->Hierarchy );
@@ -89,13 +89,13 @@ void CClientIFP::ReadIFPVersion1 ( )
89
89
90
90
void CClientIFP::ReadIFPVersion2 ( bool bAnp3 )
91
91
{
92
- IFPHeaderV2 Header;
93
- ReadBuffer < IFPHeaderV2 > ( &Header );
92
+ SIFPHeaderV2 Header;
93
+ ReadBuffer < SIFPHeaderV2 > ( &Header );
94
94
95
95
m_pVecAnimations->resize ( Header.TotalAnimations );
96
96
for ( auto it = m_pVecAnimations->begin (); it != m_pVecAnimations->end (); ++it )
97
97
{
98
- Animation AnimationNode;
98
+ SAnimationHeaderV2 AnimationNode;
99
99
ReadAnimationHeaderVersion2 ( AnimationNode, bAnp3 );
100
100
101
101
it->Name = AnimationNode.Name ;
@@ -140,7 +140,7 @@ WORD CClientIFP::ReadSequencesVersion1 ( std::unique_ptr < CAnimBlendHierarchy >
140
140
WORD wUnknownSequences = 0 ;
141
141
for (size_t SequenceIndex = 0 ; SequenceIndex < pAnimationHierarchy->GetNumSequences ( ); SequenceIndex++)
142
142
{
143
- IFP_ANIM Anim;
143
+ SAnim Anim;
144
144
int32_t iBoneID = ReadSequenceVersion1 ( Anim );
145
145
if ( Anim.Frames == 0 )
146
146
{
@@ -161,7 +161,7 @@ WORD CClientIFP::ReadSequencesVersion1 ( std::unique_ptr < CAnimBlendHierarchy >
161
161
std::unique_ptr < CAnimBlendSequence > pAnimationSequence = m_pAnimManager->GetCustomAnimBlendSequence ( pAnimationSequenceInterface );
162
162
InitializeAnimationSequence ( pAnimationSequence, Anim.Name , iBoneID );
163
163
164
- IFP_FrameType iFrameType = ReadKfrm ( );
164
+ eFrameType iFrameType = ReadKfrm ( );
165
165
if ( ( ReadSequenceKeyFrames ( pAnimationSequence, iFrameType, Anim.Frames ) ) && ( !bUnknownSequence ) )
166
166
{
167
167
MapOfSequences [ iBoneID ] = *pAnimationSequence->GetInterface ();
@@ -175,7 +175,7 @@ WORD CClientIFP::ReadSequencesVersion2 ( std::unique_ptr < CAnimBlendHierarchy >
175
175
WORD wUnknownSequences = 0 ;
176
176
for (size_t SequenceIndex = 0 ; SequenceIndex < pAnimationHierarchy->GetNumSequences ( ); SequenceIndex++)
177
177
{
178
- Object ObjectNode;
178
+ SSequenceHeaderV2 ObjectNode;
179
179
ReadSequenceVersion2 ( ObjectNode );
180
180
181
181
bool bUnknownSequence = ObjectNode.BoneID == -1 ;
@@ -192,7 +192,7 @@ WORD CClientIFP::ReadSequencesVersion2 ( std::unique_ptr < CAnimBlendHierarchy >
192
192
std::unique_ptr < CAnimBlendSequence > pAnimationSequence = m_pAnimManager->GetCustomAnimBlendSequence ( pAnimationSequenceInterface );
193
193
InitializeAnimationSequence ( pAnimationSequence, ObjectNode.Name , ObjectNode.BoneID );
194
194
195
- IFP_FrameType iFrameType = static_cast < IFP_FrameType > ( ObjectNode.FrameType );
195
+ eFrameType iFrameType = static_cast < eFrameType > ( ObjectNode.FrameType );
196
196
if ( ( ReadSequenceKeyFrames ( pAnimationSequence, iFrameType, ObjectNode.TotalFrames ) ) && ( !bUnknownSequence ) )
197
197
{
198
198
MapOfSequences [ ObjectNode.BoneID ] = *pAnimationSequence->GetInterface ();
@@ -201,12 +201,12 @@ WORD CClientIFP::ReadSequencesVersion2 ( std::unique_ptr < CAnimBlendHierarchy >
201
201
return wUnknownSequences;
202
202
}
203
203
204
- int32_t CClientIFP::ReadSequenceVersion1 ( IFP_ANIM & Anim )
204
+ int32_t CClientIFP::ReadSequenceVersion1 ( SAnim & Anim )
205
205
{
206
- IFP_CPAN Cpan;
207
- ReadBuffer < IFP_CPAN > ( &Cpan );
206
+ SCpan Cpan;
207
+ ReadBuffer < SCpan > ( &Cpan );
208
208
RoundSize ( Cpan.Base .Size );
209
- ReadBytes ( &Anim, sizeof ( IFP_BASE ) );
209
+ ReadBytes ( &Anim, sizeof ( SBase ) );
210
210
RoundSize ( Anim.Base .Size );
211
211
ReadBytes ( &Anim.Name , Anim.Base .Size );
212
212
@@ -224,9 +224,9 @@ int32_t CClientIFP::ReadSequenceVersion1 ( IFP_ANIM & Anim )
224
224
return iBoneID;
225
225
}
226
226
227
- void CClientIFP::ReadSequenceVersion2 ( Object & ObjectNode )
227
+ void CClientIFP::ReadSequenceVersion2 ( SSequenceHeaderV2 & ObjectNode )
228
228
{
229
- ReadBuffer < Object > ( &ObjectNode );
229
+ ReadBuffer < SSequenceHeaderV2 > ( &ObjectNode );
230
230
std::string BoneName = ConvertStringToMapKey ( ObjectNode.Name );
231
231
std::string strCorrectBoneName;
232
232
if (ObjectNode.BoneID == -1 )
@@ -246,7 +246,7 @@ void CClientIFP::ReadSequenceVersion2 ( Object & ObjectNode )
246
246
strncpy ( ObjectNode.Name , strCorrectBoneName.c_str (), strCorrectBoneName.size () +1 );
247
247
}
248
248
249
- bool CClientIFP::ReadSequenceKeyFrames ( std::unique_ptr < CAnimBlendSequence > & pAnimationSequence, IFP_FrameType iFrameType, int32_t iFrames )
249
+ bool CClientIFP::ReadSequenceKeyFrames ( std::unique_ptr < CAnimBlendSequence > & pAnimationSequence, eFrameType iFrameType, int32_t iFrames )
250
250
{
251
251
size_t iCompressedFrameSize = GetSizeOfCompressedFrame ( iFrameType );
252
252
if ( iCompressedFrameSize )
@@ -259,20 +259,20 @@ bool CClientIFP::ReadSequenceKeyFrames ( std::unique_ptr < CAnimBlendSequence >
259
259
return false ;
260
260
}
261
261
262
- void CClientIFP::ReadHeaderVersion1 ( IFP_INFO & Info )
262
+ void CClientIFP::ReadHeaderVersion1 ( SInfo & Info )
263
263
{
264
264
uint32_t OffsetEOF;
265
265
ReadBuffer < uint32_t > ( &OffsetEOF );
266
266
RoundSize ( OffsetEOF );
267
- ReadBytes ( &Info, sizeof ( IFP_BASE ) );
267
+ ReadBytes ( &Info, sizeof ( SBase ) );
268
268
RoundSize ( Info.Base .Size );
269
269
ReadBytes ( &Info.Entries , Info.Base .Size );
270
270
}
271
271
272
- void CClientIFP::ReadAnimationNameVersion1 ( IFP_Animation & IfpAnimation )
272
+ void CClientIFP::ReadAnimationNameVersion1 ( SAnimation & IfpAnimation )
273
273
{
274
- IFP_NAME Name;
275
- ReadBuffer < IFP_NAME > ( &Name );
274
+ SName Name;
275
+ ReadBuffer < SName > ( &Name );
276
276
RoundSize ( Name.Base .Size );
277
277
278
278
char szAnimationName [ 24 ];
@@ -281,24 +281,24 @@ void CClientIFP::ReadAnimationNameVersion1 ( IFP_Animation & IfpAnimation )
281
281
IfpAnimation.u32NameHash = HashString ( IfpAnimation.Name .ToLower ( ) );
282
282
}
283
283
284
- void CClientIFP::ReadDgan ( IFP_DGAN & Dgan )
284
+ void CClientIFP::ReadDgan ( SDgan & Dgan )
285
285
{
286
- ReadBytes ( &Dgan, sizeof ( IFP_BASE ) * 2 );
286
+ ReadBytes ( &Dgan, sizeof ( SBase ) * 2 );
287
287
RoundSize ( Dgan.Base .Size );
288
288
RoundSize ( Dgan.Info .Base .Size );
289
289
ReadBytes ( &Dgan.Info .Entries , Dgan.Info .Base .Size );
290
290
}
291
291
292
- CClientIFP::IFP_FrameType CClientIFP::ReadKfrm ( void )
292
+ CClientIFP::eFrameType CClientIFP::ReadKfrm ( void )
293
293
{
294
- IFP_KFRM Kfrm;
295
- ReadBuffer < IFP_KFRM > ( &Kfrm );
294
+ SKfrm Kfrm;
295
+ ReadBuffer < SKfrm > ( &Kfrm );
296
296
return GetFrameTypeFromFourCC ( Kfrm.Base .FourCC );
297
297
}
298
298
299
- void CClientIFP::ReadAnimationHeaderVersion2 ( Animation & AnimationNode, bool bAnp3 )
299
+ void CClientIFP::ReadAnimationHeaderVersion2 ( SAnimationHeaderV2 & AnimationNode, bool bAnp3 )
300
300
{
301
- ReadCString ( ( char * ) &AnimationNode.Name , sizeof ( Animation ::Name ) );
301
+ ReadCString ( ( char * ) &AnimationNode.Name , sizeof ( SAnimationHeaderV2 ::Name ) );
302
302
ReadBuffer < int32_t > ( &AnimationNode.TotalObjects );
303
303
if ( bAnp3 )
304
304
{
@@ -307,33 +307,33 @@ void CClientIFP::ReadAnimationHeaderVersion2 ( Animation & AnimationNode, bool b
307
307
}
308
308
}
309
309
310
- void CClientIFP::ReadKeyFramesAsCompressed ( std::unique_ptr < CAnimBlendSequence > & pAnimationSequence, IFP_FrameType iFrameType, int32_t iFrames )
310
+ void CClientIFP::ReadKeyFramesAsCompressed ( std::unique_ptr < CAnimBlendSequence > & pAnimationSequence, eFrameType iFrameType, int32_t iFrames )
311
311
{
312
312
switch ( iFrameType )
313
313
{
314
- case IFP_FrameType ::KRTS:
314
+ case eFrameType ::KRTS:
315
315
{
316
316
ReadKrtsFramesAsCompressed ( pAnimationSequence, iFrames );
317
317
break ;
318
318
}
319
- case IFP_FrameType ::KRT0:
319
+ case eFrameType ::KRT0:
320
320
{
321
321
ReadKrt0FramesAsCompressed ( pAnimationSequence, iFrames );
322
322
break ;
323
323
}
324
- case IFP_FrameType ::KR00:
324
+ case eFrameType ::KR00:
325
325
{
326
326
ReadKr00FramesAsCompressed ( pAnimationSequence, iFrames );
327
327
break ;
328
328
}
329
- case IFP_FrameType ::KR00_COMPRESSED:
329
+ case eFrameType ::KR00_COMPRESSED:
330
330
{
331
- ReadCompressedFrames < IFP_Compressed_KR00 > ( pAnimationSequence, iFrames );
331
+ ReadCompressedFrames < SCompressed_KR00 > ( pAnimationSequence, iFrames );
332
332
break ;
333
333
}
334
- case IFP_FrameType ::KRT0_COMPRESSED:
334
+ case eFrameType ::KRT0_COMPRESSED:
335
335
{
336
- ReadCompressedFrames < IFP_Compressed_KRT0 > ( pAnimationSequence, iFrames );
336
+ ReadCompressedFrames < SCompressed_KRT0 > ( pAnimationSequence, iFrames );
337
337
break ;
338
338
}
339
339
}
@@ -343,9 +343,9 @@ void CClientIFP::ReadKrtsFramesAsCompressed ( std::unique_ptr < CAnimBlendSequen
343
343
{
344
344
for ( int32_t FrameIndex = 0 ; FrameIndex < TotalFrames; FrameIndex++ )
345
345
{
346
- IFP_Compressed_KRT0 * CompressedKrt0 = static_cast < IFP_Compressed_KRT0 * > ( pAnimationSequence->GetKeyFrame ( FrameIndex, sizeof ( IFP_Compressed_KRT0 ) ) );
347
- IFP_KRTS Krts;
348
- ReadBuffer < IFP_KRTS > ( &Krts );
346
+ SCompressed_KRT0 * CompressedKrt0 = static_cast < SCompressed_KRT0 * > ( pAnimationSequence->GetKeyFrame ( FrameIndex, sizeof ( SCompressed_KRT0 ) ) );
347
+ SKrts Krts;
348
+ ReadBuffer < SKrts > ( &Krts );
349
349
350
350
CompressedKrt0->Rotation .X = static_cast < int16_t > ( ( ( -Krts.Rotation .X ) * 4096 .0f ) );
351
351
CompressedKrt0->Rotation .Y = static_cast < int16_t > ( ( ( -Krts.Rotation .Y ) * 4096 .0f ) );
@@ -364,9 +364,9 @@ void CClientIFP::ReadKrt0FramesAsCompressed ( std::unique_ptr < CAnimBlendSequen
364
364
{
365
365
for ( int32_t FrameIndex = 0 ; FrameIndex < TotalFrames; FrameIndex++ )
366
366
{
367
- IFP_Compressed_KRT0 * CompressedKrt0 = static_cast < IFP_Compressed_KRT0 * > ( pAnimationSequence->GetKeyFrame ( FrameIndex, sizeof ( IFP_Compressed_KRT0 ) ) );
368
- IFP_KRT0 Krt0;
369
- ReadBuffer < IFP_KRT0 > ( &Krt0 );
367
+ SCompressed_KRT0 * CompressedKrt0 = static_cast < SCompressed_KRT0 * > ( pAnimationSequence->GetKeyFrame ( FrameIndex, sizeof ( SCompressed_KRT0 ) ) );
368
+ SKrt0 Krt0;
369
+ ReadBuffer < SKrt0 > ( &Krt0 );
370
370
371
371
CompressedKrt0->Rotation .X = static_cast < int16_t > ( ( ( -Krt0.Rotation .X ) * 4096 .0f ) );
372
372
CompressedKrt0->Rotation .Y = static_cast < int16_t > ( ( ( -Krt0.Rotation .Y ) * 4096 .0f ) );
@@ -385,9 +385,9 @@ void CClientIFP::ReadKr00FramesAsCompressed ( std::unique_ptr < CAnimBlendSequen
385
385
{
386
386
for ( int32_t FrameIndex = 0 ; FrameIndex < TotalFrames; FrameIndex++ )
387
387
{
388
- IFP_Compressed_KR00 * CompressedKr00 = static_cast < IFP_Compressed_KR00 * > ( pAnimationSequence->GetKeyFrame ( FrameIndex, sizeof ( IFP_Compressed_KR00 ) ) );
389
- IFP_KR00 Kr00;
390
- ReadBuffer < IFP_KR00 > ( &Kr00 );
388
+ SCompressed_KR00 * CompressedKr00 = static_cast < SCompressed_KR00 * > ( pAnimationSequence->GetKeyFrame ( FrameIndex, sizeof ( SCompressed_KR00 ) ) );
389
+ SKr00 Kr00;
390
+ ReadBuffer < SKr00 > ( &Kr00 );
391
391
392
392
CompressedKr00->Rotation .X = static_cast < int16_t > ( ( ( -Kr00.Rotation .X ) * 4096 .0f ) );
393
393
CompressedKr00->Rotation .Y = static_cast < int16_t > ( ( ( -Kr00.Rotation .Y ) * 4096 .0f ) );
@@ -398,29 +398,29 @@ void CClientIFP::ReadKr00FramesAsCompressed ( std::unique_ptr < CAnimBlendSequen
398
398
}
399
399
}
400
400
401
- size_t CClientIFP::GetSizeOfCompressedFrame ( IFP_FrameType iFrameType )
401
+ size_t CClientIFP::GetSizeOfCompressedFrame ( eFrameType iFrameType )
402
402
{
403
403
switch ( iFrameType )
404
404
{
405
- case IFP_FrameType ::KRTS:
405
+ case eFrameType ::KRTS:
406
406
{
407
- return sizeof ( IFP_Compressed_KRT0 );
407
+ return sizeof ( SCompressed_KRT0 );
408
408
}
409
- case IFP_FrameType ::KRT0:
409
+ case eFrameType ::KRT0:
410
410
{
411
- return sizeof ( IFP_Compressed_KRT0 );
411
+ return sizeof ( SCompressed_KRT0 );
412
412
}
413
- case IFP_FrameType ::KR00:
413
+ case eFrameType ::KR00:
414
414
{
415
- return sizeof ( IFP_Compressed_KR00 );
415
+ return sizeof ( SCompressed_KR00 );
416
416
}
417
- case IFP_FrameType ::KR00_COMPRESSED:
417
+ case eFrameType ::KR00_COMPRESSED:
418
418
{
419
- return sizeof ( IFP_Compressed_KR00 );
419
+ return sizeof ( SCompressed_KR00 );
420
420
}
421
- case IFP_FrameType ::KRT0_COMPRESSED:
421
+ case eFrameType ::KRT0_COMPRESSED:
422
422
{
423
- return sizeof ( IFP_Compressed_KRT0 );
423
+ return sizeof ( SCompressed_KRT0 );
424
424
}
425
425
}
426
426
return 0 ;
@@ -478,22 +478,22 @@ BYTE * CClientIFP::AllocateSequencesMemory ( std::unique_ptr < CAnimBlendHierarc
478
478
return static_cast < BYTE * > ( operator new ( 12 * cMaxSequences + 4 ) );
479
479
}
480
480
481
- CClientIFP::IFP_FrameType CClientIFP::GetFrameTypeFromFourCC ( const char * szFourCC )
481
+ CClientIFP::eFrameType CClientIFP::GetFrameTypeFromFourCC ( const char * szFourCC )
482
482
{
483
483
if ( strncmp ( szFourCC, " KRTS" , 4 ) == 0 )
484
484
{
485
- return IFP_FrameType ::KRTS;
485
+ return eFrameType ::KRTS;
486
486
}
487
487
else if ( strncmp ( szFourCC, " KRT0" , 4 ) == 0 )
488
488
{
489
- return IFP_FrameType ::KRT0;
489
+ return eFrameType ::KRT0;
490
490
}
491
491
else if ( strncmp ( szFourCC, " KR00" , 4 ) == 0 )
492
492
{
493
- return IFP_FrameType ::KR00;
493
+ return eFrameType ::KR00;
494
494
}
495
495
496
- return IFP_FrameType ::UNKNOWN_FRAME;
496
+ return eFrameType ::UNKNOWN_FRAME;
497
497
}
498
498
499
499
@@ -510,12 +510,12 @@ void CClientIFP::InsertAnimationDummySequence ( std::unique_ptr < CAnimBlendSequ
510
510
// We only need 1 dummy key frame to make the animation work
511
511
const size_t cKeyFrames = 1 ;
512
512
// KR00 is child key frame and KRT0 is Root key frame
513
- size_t FrameSize = sizeof ( IFP_Compressed_KR00 );
513
+ size_t FrameSize = sizeof ( SCompressed_KR00 );
514
514
515
515
if ( bRootBone )
516
516
{
517
517
// This key frame will have translation values.
518
- FrameSize = sizeof ( IFP_Compressed_KRT0 );
518
+ FrameSize = sizeof ( SCompressed_KRT0 );
519
519
bHasTranslationValues = true ;
520
520
}
521
521
@@ -746,15 +746,15 @@ constexpr void CClientIFP::RoundSize ( uint32_t & u32Size )
746
746
}
747
747
}
748
748
749
- constexpr bool CClientIFP::IsKeyFramesTypeRoot ( IFP_FrameType iFrameType )
749
+ constexpr bool CClientIFP::IsKeyFramesTypeRoot ( eFrameType iFrameType )
750
750
{
751
751
switch ( iFrameType )
752
752
{
753
- case IFP_FrameType ::KR00:
753
+ case eFrameType ::KR00:
754
754
{
755
755
return false ;
756
756
}
757
- case IFP_FrameType ::KR00_COMPRESSED:
757
+ case eFrameType ::KR00_COMPRESSED:
758
758
{
759
759
return false ;
760
760
}
0 commit comments