This repository was archived by the owner on Oct 4, 2026. It is now read-only.
Repository navigation
Expand file tree
/
Copy pathFrameTables.cpp
More file actions
733 lines (580 loc) · 20.6 KB
/
Copy pathFrameTables.cpp
File metadata and controls
733 lines (580 loc) · 20.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
#include "FrameTables.h"
#include "mm7_unparsed_data.h"
#include "AudioPlayer.h"
#include "data.h"
#include "_lod.h"
#ifndef OLD_CODE
template<> unsigned int ImageTableLoader<IconFrame>::LoadFromFile(const wchar_t *pFilename, struct ImageTable<IconFrame> **ppOut)
{
char pFilenameA[256];
wsprintfA(pFilenameA, "%S", pFilename);
unsigned char *pRawData = (unsigned char *)LODFile_Events_LOD.LODFile_LoadRaw(pFilenameA, 1);
ImageTable<IconFrame> *pImageTable = MemAlloc(ImageTable<IconFrame>, 1);
pImageTable->uNumImages = *(unsigned int *)pRawData;
pImageTable->pImages = MemAlloc(IconFrame, pImageTable->uNumImages);
memcpy(pImageTable->pImages, pRawData + 4, pImageTable->uNumImages * sizeof(IconFrame));
*ppOut = pImageTable;
return 0;
}
#endif
#ifdef OLD_CODE
template<> unsigned int ImageTableLoader<IconFrame>::LoadFromFile(const char *pFilename, struct ImageTable<IconFrame> **ppOut)
{
unsigned char *pRawData = (unsigned char *)LODFile_Events_LOD.LODFile_LoadRaw(pFilename, 1);
ImageTable<IconFrame> *pImageTable = MemAlloc(ImageTable<IconFrame>, 1);
pImageTable->uNumImages = *(unsigned int *)pRawData;
pImageTable->pImages = MemAlloc(IconFrame, pImageTable->uNumImages);
memcpy(pImageTable->pImages, pRawData + 4, pImageTable->uNumImages * sizeof(IconFrame));
*ppOut = pImageTable;
return 0;
}
#endif
void MonsterDescriptionList_ctor(struct MonsterDescriptionList *_this)
{
_this->uNumDescriptions = 0;
_this->pDescriptions = 0;
}
//----- (004598AF) --------------------------------------------------------
void MonsterDescriptionList_Initialize(struct MonsterDescriptionList *_this, unsigned int *pSrc)
{
_this->uNumDescriptions = pSrc[0];
//_this->pDescriptions = (MonsterDescription *)mem_mng.AllocatedNamedBuffer( _this->pDescriptions, _this->uNumDescriptions * sizeof(struct MonsterDescription), "Mon Race");
_this->pDescriptions = NamedMemAlloc(MonsterDescription, _this->uNumDescriptions, "Monster Race descr");
memcpy(_this->pDescriptions, pSrc + 1, _this->uNumDescriptions * sizeof(struct MonsterDescription));
}
//----- (0044E0A0) --------------------------------------------------------
void CTextureFrameTable_Initialize(struct CTextureFrameTable *_this, unsigned char *pSrc)
{
_this->uNumTextures = *(int *)(pSrc);
//_this->pTextures = (TextureFrame *)mem_mng.AllocatedNamedBuffer(_this->pTextures, _this->uNumTextures * sizeof(struct TextureFrame), "Txt Frames");
_this->pTextures = NamedMemAlloc(TextureFrame, _this->uNumTextures, "Texture Frames");
memcpy(_this->pTextures, pSrc + 4, _this->uNumTextures * sizeof(struct TextureFrame));
}
void CTextureFrameTable_ctor(struct CTextureFrameTable *_this)
{
memset(_this, 0, sizeof(struct CTextureFrameTable));
}
void CIconFrameTable_ctor(struct CIconFrameTable *_this)
{
memset(_this, 0, sizeof(struct CIconFrameTable));
}
//----- (MM7.exe::00495056) --------------------------------------------------------
void CIconFrameTable_Initialize(struct CIconFrameTable *_this, void *pSrc)
{
_this->uNumIcons = *(int *)pSrc;
_this->pIcons = NamedMemAlloc(IconFrame, _this->uNumIcons, "Icon Frames");
memcpy(_this->pIcons, (char *)pSrc + 4, _this->uNumIcons * sizeof(struct IconFrame));
}
#ifndef OLD_CODE
//----- (MM7.exe::00494F3A) --------------------------------------------------------
unsigned int CIconFrameTable_FindIcon_New(struct CIconFrameTable *_this, const wchar_t *pIconName)
{
char pIconNameA[256];
int i;
if (!_this->uNumIcons)
return 0;
wsprintfA(pIconNameA, "%S", pIconName);
for (i = 0; i < _this->uNumIcons; ++i)
{
if (!_strcmpi(pIconNameA, (char *)_this->pIcons[i].sAnimationName))
return i;
}
return 0;
}
//----- (MM7.exe::00494F3A) --------------------------------------------------------
unsigned int CIconFrameTable_FindIcon(struct CIconFrameTable *_this, const char *pIconName)
{
wchar_t pIconNameW[256];
wsprintfW(pIconNameW, L"%S", pIconName);
return CIconFrameTable_FindIcon_New(_this, pIconNameW);
}
#endif
//----- (MM7.exe::00494FBF) --------------------------------------------------------
void CIconFrameTable_InitializeIcon(struct CIconFrameTable *_this, unsigned int uIconIdx)
{
int i;
if (uIconIdx >= _this->uNumIcons)
return;
i = uIconIdx;
do
{
#ifndef OLD_CODE
wchar_t pFilepath[256];
wsprintfW(pFilepath, L"%S", _this->pIcons[i].sTextureName);
_this->pIcons[i].uTextureIdx = LODFile_Icons_LOD.LODFile_LoadTexture_New( pFilepath);
#endif
#ifdef OLD_CODE
_this->pIcons[i].uTextureIdx = LODFile_Icons_LOD.LODFile_LoadTexture( _this->pIcons[i].sTextureName,2);
#endif
}
while (_this->pIcons[i++].word_00001C & 1);
}
//----- (00494F70) --------------------------------------------------------
struct IconFrame *CIconFrameTable_GetFrame(struct CIconFrameTable *_this, unsigned int uIconIdx, unsigned int uFrame)
{
signed __int16 v5; // dx@2
int v6; // eax@3
int v7; // edx@3
int i; // ecx@3
int v9; // esi@5
v5 = _this->pIcons[uIconIdx].word_00001A;
if ( _this->pIcons[uIconIdx].word_00001C & 0x0001 && v5 != 0 )
{
v7 = (uFrame / 8) % (unsigned __int16)v5;
v6 = uIconIdx;
for ( i = uIconIdx; ; ++i)
{
v9 = _this->pIcons[i].word_000018;
if ( v7 <= v9 )
break;
v7 -= v9;
++v6;
}
return &_this->pIcons[v6];
}
else
return &_this->pIcons[uIconIdx];
}
void SpriteFrameTable_ctor(struct SpriteFrameTable *_this)
{
_this->uNumSpriteFrames = 0;
_this->dword_000004 = 0;
_this->dword_000008 = 0;
_this->pSpriteSFrames = 0;
_this->pSpritePFrames = 0;
_this->pSpriteEFrames = 0;
}
//----- (MM7.exe::0044D9D7) --------------------------------------------------------
int SpriteFrameTable_Initialize(struct SpriteFrameTable *_this, unsigned int *pSrc)
{
int i;
_this->uNumSpriteFrames = pSrc[0];
_this->dword_000004 = pSrc[1];
//_this->pSpriteSFrames = (SpriteFrame *)mem_mng.AllocatedNamedBuffer( _this->pSpriteSFrames, _this->uNumSpriteFrames * sizeof(struct SpriteFrame), "S Frames");
//_this->pSpritePFrames = (SpriteFrame **)mem_mng.AllocatedNamedBuffer( _this->pSpritePFrames, 4 * _this->uNumSpriteFrames, "P Frames");
//_this->pSpriteEFrames = (unsigned short *)mem_mng.AllocatedNamedBuffer( _this->pSpriteEFrames, 2 * _this->uNumSpriteFrames, "E Frames");
_this->pSpriteSFrames = NamedMemAlloc(SpriteFrame, _this->uNumSpriteFrames, "S Frames");
_this->pSpritePFrames = NamedMemAlloc(SpriteFrame *, _this->uNumSpriteFrames, "P Frames");
_this->pSpriteEFrames = NamedMemAlloc(unsigned short, _this->uNumSpriteFrames, "E Frames");
pSrc += 2;
memcpy(_this->pSpriteSFrames, pSrc, _this->uNumSpriteFrames * sizeof(struct SpriteFrame));
pSrc = (unsigned int *)((char *)pSrc + _this->uNumSpriteFrames * sizeof(struct SpriteFrame));
memcpy(_this->pSpriteEFrames, pSrc, _this->dword_000004 * sizeof(short));
for (i = 0; i < _this->uNumSpriteFrames; ++i)
_this->pSpritePFrames[i] = &_this->pSpriteSFrames[_this->pSpriteEFrames[i]];
return _this->uNumSpriteFrames;
}
//----- (0044D8D0) --------------------------------------------------------
struct SpriteFrame *CSpriteFrameTable_fn1(struct SpriteFrameTable *_this, unsigned int uID, signed int a3)
{
int v3; // ecx@1
signed __int16 v5; // dx@2
int v6; // eax@3
int v7; // edx@3
int i; // ecx@3
int v9; // esi@5
int result; // eax@6
v3 = (int)&_this->pSpriteSFrames[uID];
v5 = _this->pSpriteSFrames[uID].word_000038;
if (_this->pSpriteSFrames[uID].dword_00002C & 0x01 && v5 != 0 )
{
v7 = (a3 >> 3) % v5;
v6 = uID;
for ( i = uID; ; ++i)
{
v9 = _this->pSpriteSFrames[i].word_000036;
if ( v7 <= v9 )
break;
v7 -= v9;
++v6;
}
return &_this->pSpriteSFrames[v6];
}
else
{
return &_this->pSpriteSFrames[uID];
}
}
//----- (0044D91F) --------------------------------------------------------
struct SpriteFrame *CSpriteFrameTable_fn2(struct SpriteFrameTable *_this, int a2, signed int a3)
{
int v3; // edi@1
int v4; // esi@1
signed __int16 v5; // ax@2
int v6; // eax@3
int i; // edx@3
int v8; // ecx@3
int v9; // ecx@3
int v10; // edx@3
int v11; // esi@5
int result; // eax@6
v3 = *(_DWORD *)(_this + 12);
v4 = 60 * a2 + v3;
if ( *(_BYTE *)(v4 + 44) & 1 && (v5 = *(_WORD *)(v4 + 56)) != 0 )
{
v9 = v5;
v10 = a3 % v5;
v6 = a2;
v8 = v9 - v10;
for ( i = v4 + 54; ; i += 60 )
{
v11 = *(_WORD *)i;
if ( v8 <= v11 )
break;
v8 -= v11;
++v6;
}
result = v3 + 60 * v6;
}
else
{
result = 60 * a2 + v3;
}
return (SpriteFrame *)result;
}
//----- (0044D4F6) --------------------------------------------------------
void SpriteFrameTable_fn3(struct SpriteFrameTable *_this)
{
for (unsigned int i = 0; i < _this->uNumSpriteFrames; ++i)
_this->pSpriteSFrames[i].dword_00002C &= 0xFFFFFF7F;
}
//----- (0044D513) --------------------------------------------------------
void SpriteFrameTable_InitializeSpriteFrame(struct SpriteFrameTable *_this, unsigned int uSpriteFrameID)
{
int v2; // esi@1
__int16 v10; // ax@6
signed int v11; // edi@10
__int16 v12; // ax@16
signed int v14; // edi@19
size_t v15; // eax@19
__int16 v16; // ax@27
struct SpriteFrame *v19; // eax@30
__int16 v20; // ax@45
const char *v22; // [sp-8h] [bp-50h]@12
const char *v23; // [sp-8h] [bp-50h]@21
char *v26; // [sp-4h] [bp-4Ch]@21
char v28; // [sp+9h] [bp-3Fh]@19
char Str; // [sp+Ch] [bp-3Ch]@19
char Size[20]; // [sp+2Ch] [bp-1Ch]@15
char Source[4]; // [sp+40h] [bp-8h]@19
int i, j;
v2 = (int)_this;
if (uSpriteFrameID > _this->uNumSpriteFrames)
return;
if (_this->pSpriteSFrames[uSpriteFrameID].dword_00002C & 0x80000000)
return;
_this->pSpriteSFrames[uSpriteFrameID].dword_00002C |= 0x80;
for (i = uSpriteFrameID; true; ++i)
{
_this->pSpriteSFrames[i].word_000034 = class35_sub_48A3BC_MessWithPalettes(&class35_obj, _this->pSpriteSFrames[i].word_000032);
if (_this->pSpriteSFrames[i].dword_00002C & 0x10)
{
v10 = LODFile_Sprites_LOD.LODFile_LoadSprite((char *)_this->pSpriteSFrames[i].sTextureName, _this->pSpriteSFrames[i].word_000032);
for (j = 0; j < 8; ++j)
_this->pSpriteSFrames[i].pSpriteIDs[j] = v10;
}
else if (_this->pSpriteSFrames[i].dword_00002C & 0x10000)
{
v11 = 0;
do
{
switch ( v11 )
{
case 3:
case 4:
case 5:
v22 = "%s4";
case 2:
case 6:
v22 = "%s2";
case 0:
case 1:
case 7:
v22 = "%s0";
break;
}
wsprintfA(Size, v22, _this->pSpriteSFrames[i].sTextureName);
v12 = LODFile_Sprites_LOD.LODFile_LoadSprite( (char *)&Size, _this->pSpriteSFrames[i].word_000032);
_this->pSpriteSFrames[i].pSpriteIDs[v11++] = v12;
}
while ( v11 < 8 );
}
else if (!(_this->pSpriteSFrames[i].dword_00002C & 0x40))
{
for (j = 0; j < 8; ++j)
{
v19 = &_this->pSpriteSFrames[i];
if ( !((0x100 << j) & v19->dword_00002C) )
wsprintfA(Size, "%s%i", v19->sTextureName, j);
else
wsprintfA(Size, "%s%i", v19->sTextureName, 8 - j);
v20 = LODFile_Sprites_LOD.LODFile_LoadSprite(Size, _this->pSpriteSFrames[i].word_000032);
_this->pSpriteSFrames[i].pSpriteIDs[j] = v20;
}
}
else
{
strcpy(Source, "stA");
strcpy(&Str, (char *)_this->pSpriteSFrames[i].sTextureName);
v15 = strlen(&Str);
strcpy(&v28 + v15, Source);
v14 = 0;
do
{
switch ( v14 )
{
case 0:
v26 = (char *)_this->pSpriteSFrames[i].sTextureName;
v23 = "%s0";
goto LABEL_26;
case 4:
v26 = &Str;
v23 = "%s4";
goto LABEL_26;
case 3:
case 5:
v26 = &Str;
v23 = "%s3";
goto LABEL_26;
case 2:
case 6:
v26 = (char *)_this->pSpriteSFrames[i].sTextureName;
v23 = "%s2";
goto LABEL_26;
case 1:
case 7:
v26 = (char *)_this->pSpriteSFrames[i].sTextureName;
v23 = "%s1";
LABEL_26:
wsprintfA(Size, v23, v26);
break;
default:
break;
}
v16 = LODFile_Sprites_LOD.LODFile_LoadSprite( (char *)&Size, _this->pSpriteSFrames[i].word_000032);
_this->pSpriteSFrames[i].pSpriteIDs[v14++] = v16;
}
while ( v14 < 8 );
}
if (!(_this->pSpriteSFrames[i].dword_00002C & 0x01))
break;
}
}
//----- (0044D813) --------------------------------------------------------
unsigned int SpriteFrameTable_FastFindSprite(struct SpriteFrameTable *_this, const char *pSpriteName)
{
SpriteFrameTablsub_SpriteBinarySearch(_this, 0, _this->dword_000004, pSpriteName);
if (_this->dword_000008 < 0)
return 0;
else return _this->pSpriteEFrames[_this->dword_000008];
}
//----- (MM7.exe::0044D4D8) --------------------------------------------------------
int SpriteFrameTable_sub_44D4D8(struct SpriteFrameTable *_this)
{
if (_this->pSpriteSFrames)
{
//MemFree( (void *)_this->pSpriteSFrames);
MemFree(_this->pSpriteSFrames);
_this->pSpriteSFrames = 0;
}
_this->uNumSpriteFrames = 0;
return 0;
}
//----- (0044D83A) --------------------------------------------------------
void SpriteFrameTablsub_SpriteBinarySearch(struct SpriteFrameTable *_this, int a2, int a3, const char *pSpriteName)
{
int v4; // ebx@1
void *v5; // edi@1
int result; // eax@2
int v7; // esi@2
int v8; // [sp+14h] [bp+8h]@2
v4 = a2;
v5 = _this;
while ( 1 )
{
v8 = a3 - v4;
v7 = (a3 - v4) / 2 + v4;
result = strcmpi(pSpriteName, (char *)_this->pSpritePFrames[v7]->sIconName);
if (!result)
_this->dword_000008 = v7;
if ( v4 == a3 )
break;
if ( v8 <= 4 )
{
while ( v4 < a3 )
{
result = strcmpi(pSpriteName, (char *)_this->pSpritePFrames[v4]->sIconName);
if ( !result )
{
_this->dword_000008 = v4;
return;
}
++v4;
}
break;
}
if (result >= 0)
{
v4 += (a3 - v4) / 2;
}
else
{
a3 = (a3 - v4) / 2 + v4;
}
}
_this->dword_000008 = -1;
}
CPlayerFrameTable::CPlayerFrameTable()
{
this->uNumFrames = 0;
this->pFrames = nullptr;
}
//----- (00494C0F) --------------------------------------------------------
void CPlayerFrameTable::pft_Initialize(unsigned char *pSrc)
{
uNumFrames = *(int *)(pSrc);
//pFrames = (PlayerFrame *)mem_mng.AllocatedNamedBuffer( this->pFrames, this->uNumFrames * sizeof(struct PlayerFrame), "P Frames");
pFrames = NamedMemAlloc(PlayerFrame, uNumFrames, "Player Frames");
memcpy(pFrames, pSrc + 4, uNumFrames * sizeof(PlayerFrame));
}
//----- (00494B10) --------------------------------------------------------
struct PlayerFrame *CPlayerFrameTable::GetFrameFromFrameset(unsigned int uFramesetID, unsigned int uFrameID)
{
int v8; // edx@3
int i;
if (pFrames[uFramesetID].word_000008 & 0x0001 &&
pFrames[uFramesetID].word_000006)
{
v8 = (uFrameID / 8) % pFrames[uFramesetID].word_000006;
for (i = 0; ; ++i)
{
if ( v8 <= pFrames[i].word_000004)
break;
v8 -= pFrames[i].word_000004;
}
return &pFrames[i];
}
else
return &pFrames[uFramesetID];
}
//----- (00494AED) --------------------------------------------------------
int CPlayerFrameTable::GetFrameByNum( unsigned int uNumFrame)
{
int i;
i = 0;
if ( uNumFrames> 0 )
while( pFrames[i].word_000000!= uNumFrame )
{
++i;
if ( i >= uNumFrames )
{
i=0;
break;
}
}
return i;
}
//----- (00494B5E) --------------------------------------------------------
PlayerFrame *CPlayerFrameTable::PlayerFrameTable_sub_494B5E(int a2, int a3, int a4)
{
signed int v5; // esi@1
int v6; // eax@2
v5 = a4 + a3;
if ( v5 < 8 * pFrames[*(_DWORD *)a2].word_000004 )
{
a3 = v5;
}
else
{
v6 = rand() % 4 + 21;
a2 = v6;
a3 = 8 * v5 % pFrames[v6].word_000004;
}
return &pFrames[a2];
}
void DecorationDescriptionList_ctor(struct DecorationDescriptionList *_this)
{
memset(_this, 0, sizeof(struct DecorationDescriptionList));
}
//----- (0045864C) --------------------------------------------------------
void *DecorationDescriptionList_Initialize(struct DecorationDescriptionList *_this, unsigned char *pSrc)
{
_this->uNumLevelDecorations = *(int *)(pSrc);
//_this->pDescriptions = (DecorationDescription *)mem_mng.AllocatedNamedBuffer( _this->pDescriptions, _this->uNumLevelDecorations * sizeof(struct DecorationDescription), "Dec Descrip");
_this->pDescriptions = NamedMemAlloc(DecorationDescription, _this->uNumLevelDecorations, "Decoration Descrip");
memcpy(_this->pDescriptions, pSrc + 4, _this->uNumLevelDecorations * sizeof(struct DecorationDescription));
return 0;
}
//----- (004488B6) --------------------------------------------------------
__int16 DecorationList_FindDecoration(struct DecorationDescriptionList *_this, const char *Str1)
{
void *v2; // esi@1
signed int v3; // edi@2
signed int v4; // ebx@3
__int16 result; // ax@6
v2 = _this;
if ( Str1 && _this->uNumLevelDecorations > 1)
{
v3 = 1;
v4 = 84;
while ( _strcmpi(Str1, (char *)_this->pDescriptions[v3].array_000000) )
{
++v3;
v4 += 84;
if ( v3 >= _this->uNumLevelDecorations)
return 0;
}
return v3;
}
return 0;
}
//----- (00458693) --------------------------------------------------------
void sub_458693(struct DecorationDescriptionList *_this, unsigned int uDecorationDescriptionID)
{
SpriteFrameTable_InitializeSpriteFrame(pSpriteFrameTable, _this->pDescriptions[uDecorationDescriptionID].uSpriteID);
}
void CObjectDescriptionList_ctor(struct CObjectDescriptionList *_this)
{
memset(_this, 0, sizeof(struct CObjectDescriptionList));
}
//----- (004590DC) --------------------------------------------------------
void *CObjectDescriptionList_Initialize(struct CObjectDescriptionList *_this, unsigned char *pSrc)
{
_this->uNumObjects = *(int *)(pSrc);
//_this->pDescriptions = (ObjectDescription *)mem_mng.AllocatedNamedBuffer( _this->pDescriptions, _this->uNumObjects * sizeof(struct ObjectDescription), "Obj Descrip");
_this->pDescriptions = NamedMemAlloc(ObjectDescription,_this->uNumObjects, "Object Descrip");
memcpy(_this->pDescriptions, pSrc + 4, _this->uNumObjects * sizeof(struct ObjectDescription));
return 0;
}
//----- (00459064) --------------------------------------------------------
void sub_459064(struct CObjectDescriptionList *_this)
{
for (unsigned int i = 0; i < _this->uNumObjects; ++i)
SpriteFrameTable_InitializeSpriteFrame(pSpriteFrameTable, _this->pDescriptions[i].uSpriteID);
}
//----- (00458E08) --------------------------------------------------------
Result::Code OverlayDescriptionList::Initialize(const char *pSourceFile)
{
unsigned int *pRawData = (unsigned int *)LODFile_Events_LOD.LODFile_LoadRaw(pSourceFile, 1);
uNumOverlays = *pRawData;
pOverlays = NamedMemAlloc(OverlayDesc, uNumOverlays, "Overlay descriptions");
memcpy(pOverlays, pRawData + 1, uNumOverlays * sizeof(OverlayDesc));
MemFree(pRawData);
return Result::Success;
}
//----- (00458D97) --------------------------------------------------------
void sub_458D97(OverlayDescriptionList *_this)
{
for (unsigned int i = 0; i < _this->uNumOverlays; ++i)
SpriteFrameTable_InitializeSpriteFrame(pSpriteFrameTable, _this->pOverlays[i].uSpriteFramesetID);
}
//----- (00458B4F) --------------------------------------------------------
Result::Code ChestDescriptionList::Initialize(const char *pSourceFile)
{
unsigned int *pRawData = (unsigned int *)LODFile_Events_LOD.LODFile_LoadRaw(pSourceFile, 1);
uNumElements = *pRawData;
pElements = NamedMemAlloc(ChestDesc, uNumElements, "Chest descriptions");
memcpy(pElements, pRawData + 1, uNumElements * sizeof(ChestDesc));
MemFree(pRawData);
return Result::Success;
}