annotate IconFrameTable.cpp @ 1490:db0dfdb9871e

Fix indentation.
author yoctozepto
date Thu, 29 Aug 2013 22:36:48 +0200
parents 7ef4b64f6329
children c4ab816fcc5e
rev   line source
1295
86a83e12d795 moving files
Ritor1
parents:
diff changeset
1 #include "IconFrameTable.h"
86a83e12d795 moving files
Ritor1
parents:
diff changeset
2 #include "LOD.h"
86a83e12d795 moving files
Ritor1
parents:
diff changeset
3 #include "mm7_data.h"
86a83e12d795 moving files
Ritor1
parents:
diff changeset
4 #include "Allocator.h"
86a83e12d795 moving files
Ritor1
parents:
diff changeset
5 #include "FrameTableInc.h"
86a83e12d795 moving files
Ritor1
parents:
diff changeset
6
86a83e12d795 moving files
Ritor1
parents:
diff changeset
7 //----- (00494F3A) --------------------------------------------------------
86a83e12d795 moving files
Ritor1
parents:
diff changeset
8 unsigned int IconFrameTable::FindIcon(const char *pIconName)
86a83e12d795 moving files
Ritor1
parents:
diff changeset
9 {
86a83e12d795 moving files
Ritor1
parents:
diff changeset
10 IconFrameTable *v2; // esi@1
86a83e12d795 moving files
Ritor1
parents:
diff changeset
11 int v3; // ebx@1
86a83e12d795 moving files
Ritor1
parents:
diff changeset
12 unsigned int uID; // edi@1
86a83e12d795 moving files
Ritor1
parents:
diff changeset
13 unsigned int result; // eax@4
86a83e12d795 moving files
Ritor1
parents:
diff changeset
14
86a83e12d795 moving files
Ritor1
parents:
diff changeset
15 v2 = this;
86a83e12d795 moving files
Ritor1
parents:
diff changeset
16 v3 = 0;
86a83e12d795 moving files
Ritor1
parents:
diff changeset
17 uID = 0;
86a83e12d795 moving files
Ritor1
parents:
diff changeset
18 if ( (signed int)this->uNumIcons <= 0 )
86a83e12d795 moving files
Ritor1
parents:
diff changeset
19 {
86a83e12d795 moving files
Ritor1
parents:
diff changeset
20 LABEL_4:
86a83e12d795 moving files
Ritor1
parents:
diff changeset
21 result = 0;
86a83e12d795 moving files
Ritor1
parents:
diff changeset
22 }
86a83e12d795 moving files
Ritor1
parents:
diff changeset
23 else
86a83e12d795 moving files
Ritor1
parents:
diff changeset
24 {
86a83e12d795 moving files
Ritor1
parents:
diff changeset
25 while ( _stricmp(pIconName, v2->pIcons[v3].pAnimationName) )
86a83e12d795 moving files
Ritor1
parents:
diff changeset
26 {
86a83e12d795 moving files
Ritor1
parents:
diff changeset
27 ++uID;
86a83e12d795 moving files
Ritor1
parents:
diff changeset
28 ++v3;
86a83e12d795 moving files
Ritor1
parents:
diff changeset
29 if ( (signed int)uID >= (signed int)v2->uNumIcons )
86a83e12d795 moving files
Ritor1
parents:
diff changeset
30 goto LABEL_4;
86a83e12d795 moving files
Ritor1
parents:
diff changeset
31 }
86a83e12d795 moving files
Ritor1
parents:
diff changeset
32 result = uID;
86a83e12d795 moving files
Ritor1
parents:
diff changeset
33 }
86a83e12d795 moving files
Ritor1
parents:
diff changeset
34 return result;
86a83e12d795 moving files
Ritor1
parents:
diff changeset
35 }
86a83e12d795 moving files
Ritor1
parents:
diff changeset
36
86a83e12d795 moving files
Ritor1
parents:
diff changeset
37 //----- (00494F70) --------------------------------------------------------
86a83e12d795 moving files
Ritor1
parents:
diff changeset
38 IconFrame *IconFrameTable::GetFrame(unsigned int uIconID, unsigned int uFrameID)
86a83e12d795 moving files
Ritor1
parents:
diff changeset
39 {
86a83e12d795 moving files
Ritor1
parents:
diff changeset
40 IconFrame *v3; // edi@1
86a83e12d795 moving files
Ritor1
parents:
diff changeset
41 IconFrame *v4; // ecx@1
86a83e12d795 moving files
Ritor1
parents:
diff changeset
42 __int16 v5; // dx@2
86a83e12d795 moving files
Ritor1
parents:
diff changeset
43 int v6; // edx@3
86a83e12d795 moving files
Ritor1
parents:
diff changeset
44 unsigned int v7; // eax@3
86a83e12d795 moving files
Ritor1
parents:
diff changeset
45 char *i; // ecx@3
86a83e12d795 moving files
Ritor1
parents:
diff changeset
46 int v9; // esi@5
86a83e12d795 moving files
Ritor1
parents:
diff changeset
47 IconFrame *result; // eax@6
86a83e12d795 moving files
Ritor1
parents:
diff changeset
48
86a83e12d795 moving files
Ritor1
parents:
diff changeset
49 v3 = this->pIcons;
86a83e12d795 moving files
Ritor1
parents:
diff changeset
50 v4 = &v3[uIconID];
86a83e12d795 moving files
Ritor1
parents:
diff changeset
51 if ( v4->uFlags & 1 && (v5 = v4->uAnimLength) != 0 )
86a83e12d795 moving files
Ritor1
parents:
diff changeset
52 {
86a83e12d795 moving files
Ritor1
parents:
diff changeset
53 v6 = ((signed int)uFrameID >> 3) % (unsigned __int16)v5;
86a83e12d795 moving files
Ritor1
parents:
diff changeset
54 v7 = uIconID;
86a83e12d795 moving files
Ritor1
parents:
diff changeset
55 for ( i = (char *)&v4->uAnimTime; ; i += 32 )
86a83e12d795 moving files
Ritor1
parents:
diff changeset
56 {
86a83e12d795 moving files
Ritor1
parents:
diff changeset
57 v9 = *(short *)i;
86a83e12d795 moving files
Ritor1
parents:
diff changeset
58 if ( v6 <= v9 )
86a83e12d795 moving files
Ritor1
parents:
diff changeset
59 break;
86a83e12d795 moving files
Ritor1
parents:
diff changeset
60 v6 -= v9;
86a83e12d795 moving files
Ritor1
parents:
diff changeset
61 ++v7;
86a83e12d795 moving files
Ritor1
parents:
diff changeset
62 }
86a83e12d795 moving files
Ritor1
parents:
diff changeset
63 result = &v3[v7];
86a83e12d795 moving files
Ritor1
parents:
diff changeset
64 }
86a83e12d795 moving files
Ritor1
parents:
diff changeset
65 else
86a83e12d795 moving files
Ritor1
parents:
diff changeset
66 {
86a83e12d795 moving files
Ritor1
parents:
diff changeset
67 result = &v3[uIconID];
86a83e12d795 moving files
Ritor1
parents:
diff changeset
68 }
86a83e12d795 moving files
Ritor1
parents:
diff changeset
69 return result;
86a83e12d795 moving files
Ritor1
parents:
diff changeset
70 }
86a83e12d795 moving files
Ritor1
parents:
diff changeset
71
86a83e12d795 moving files
Ritor1
parents:
diff changeset
72 //----- (00494FBF) --------------------------------------------------------
86a83e12d795 moving files
Ritor1
parents:
diff changeset
73 void IconFrameTable::InitializeAnimation(unsigned int uIconID)
86a83e12d795 moving files
Ritor1
parents:
diff changeset
74 {
86a83e12d795 moving files
Ritor1
parents:
diff changeset
75 IconFrameTable *v2; // esi@1
86a83e12d795 moving files
Ritor1
parents:
diff changeset
76 unsigned int v3; // edi@3
86a83e12d795 moving files
Ritor1
parents:
diff changeset
77 const char *i; // eax@3
86a83e12d795 moving files
Ritor1
parents:
diff changeset
78 IconFrame *v5; // eax@5
86a83e12d795 moving files
Ritor1
parents:
diff changeset
79
86a83e12d795 moving files
Ritor1
parents:
diff changeset
80 v2 = this;
86a83e12d795 moving files
Ritor1
parents:
diff changeset
81 if ( (signed int)uIconID <= (signed int)this->uNumIcons && (uIconID & 0x80000000u) == 0 )
86a83e12d795 moving files
Ritor1
parents:
diff changeset
82 {
86a83e12d795 moving files
Ritor1
parents:
diff changeset
83 v3 = uIconID;
86a83e12d795 moving files
Ritor1
parents:
diff changeset
84 for ( i = this->pIcons[uIconID].pTextureName; ; i = v5[v3].pTextureName )
86a83e12d795 moving files
Ritor1
parents:
diff changeset
85 {
86a83e12d795 moving files
Ritor1
parents:
diff changeset
86 v2->pIcons[v3].uTextureID = pIcons_LOD->LoadTexture(i, TEXTURE_16BIT_PALETTE);
86a83e12d795 moving files
Ritor1
parents:
diff changeset
87 v5 = v2->pIcons;
86a83e12d795 moving files
Ritor1
parents:
diff changeset
88 if ( !(v5[v3].uFlags & 1) )
86a83e12d795 moving files
Ritor1
parents:
diff changeset
89 break;
86a83e12d795 moving files
Ritor1
parents:
diff changeset
90 ++v3;
86a83e12d795 moving files
Ritor1
parents:
diff changeset
91 }
86a83e12d795 moving files
Ritor1
parents:
diff changeset
92 }
86a83e12d795 moving files
Ritor1
parents:
diff changeset
93 }
86a83e12d795 moving files
Ritor1
parents:
diff changeset
94
86a83e12d795 moving files
Ritor1
parents:
diff changeset
95 //----- (0049500A) --------------------------------------------------------
86a83e12d795 moving files
Ritor1
parents:
diff changeset
96 void IconFrameTable::ToFile()
86a83e12d795 moving files
Ritor1
parents:
diff changeset
97 {
86a83e12d795 moving files
Ritor1
parents:
diff changeset
98 IconFrameTable *v1; // esi@1
86a83e12d795 moving files
Ritor1
parents:
diff changeset
99 FILE *v2; // eax@1
86a83e12d795 moving files
Ritor1
parents:
diff changeset
100 FILE *v3; // edi@1
86a83e12d795 moving files
Ritor1
parents:
diff changeset
101
86a83e12d795 moving files
Ritor1
parents:
diff changeset
102 auto Str = this;
86a83e12d795 moving files
Ritor1
parents:
diff changeset
103
86a83e12d795 moving files
Ritor1
parents:
diff changeset
104 v1 = Str;
86a83e12d795 moving files
Ritor1
parents:
diff changeset
105 v2 = fopen("data\\dift.bin", "wb");
86a83e12d795 moving files
Ritor1
parents:
diff changeset
106 v3 = v2;
86a83e12d795 moving files
Ritor1
parents:
diff changeset
107 if ( !v2 )
86a83e12d795 moving files
Ritor1
parents:
diff changeset
108 Abortf("Unable to save dift.bin!");
86a83e12d795 moving files
Ritor1
parents:
diff changeset
109 fwrite(v1, 4u, 1u, v2);
86a83e12d795 moving files
Ritor1
parents:
diff changeset
110 fwrite(v1->pIcons, 0x20u, v1->uNumIcons, v3);
86a83e12d795 moving files
Ritor1
parents:
diff changeset
111 fclose(v3);
86a83e12d795 moving files
Ritor1
parents:
diff changeset
112 }
86a83e12d795 moving files
Ritor1
parents:
diff changeset
113
86a83e12d795 moving files
Ritor1
parents:
diff changeset
114 //----- (00495056) --------------------------------------------------------
1477
7ef4b64f6329 * LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents: 1296
diff changeset
115 void IconFrameTable::FromFile(void *data_mm6, void *data_mm7, void *data_mm8)
1295
86a83e12d795 moving files
Ritor1
parents:
diff changeset
116 {
1477
7ef4b64f6329 * LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents: 1296
diff changeset
117 uint num_mm6_frames = data_mm6 ? *(int *)data_mm6 : 0,
7ef4b64f6329 * LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents: 1296
diff changeset
118 num_mm7_frames = data_mm7 ? *(int *)data_mm7 : 0,
7ef4b64f6329 * LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents: 1296
diff changeset
119 num_mm8_frames = data_mm8 ? *(int *)data_mm8 : 0;
7ef4b64f6329 * LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents: 1296
diff changeset
120
7ef4b64f6329 * LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents: 1296
diff changeset
121 uNumIcons = num_mm6_frames + num_mm7_frames + num_mm8_frames;
7ef4b64f6329 * LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents: 1296
diff changeset
122 assert(uNumIcons);
7ef4b64f6329 * LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents: 1296
diff changeset
123 assert(!num_mm8_frames);
7ef4b64f6329 * LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents: 1296
diff changeset
124
7ef4b64f6329 * LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents: 1296
diff changeset
125 pIcons = (IconFrame *)pAllocator->AllocNamedChunk(pIcons, uNumIcons * sizeof(IconFrame), "I Frames");
7ef4b64f6329 * LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents: 1296
diff changeset
126 memcpy(pIcons, (char *)data_mm7 + 4, num_mm7_frames * sizeof(IconFrame));
7ef4b64f6329 * LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents: 1296
diff changeset
127 memcpy(pIcons + num_mm7_frames, (char *)data_mm6 + 4, num_mm6_frames * sizeof(IconFrame));
7ef4b64f6329 * LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents: 1296
diff changeset
128 memcpy(pIcons + num_mm6_frames + num_mm7_frames, (char *)data_mm8 + 4, num_mm8_frames * sizeof(IconFrame));
1295
86a83e12d795 moving files
Ritor1
parents:
diff changeset
129 }
86a83e12d795 moving files
Ritor1
parents:
diff changeset
130
86a83e12d795 moving files
Ritor1
parents:
diff changeset
131 //----- (0049509D) --------------------------------------------------------
86a83e12d795 moving files
Ritor1
parents:
diff changeset
132 int IconFrameTable::FromFileTxt(const char *Args)
86a83e12d795 moving files
Ritor1
parents:
diff changeset
133 {
86a83e12d795 moving files
Ritor1
parents:
diff changeset
134 IconFrameTable *v2; // ebx@1
86a83e12d795 moving files
Ritor1
parents:
diff changeset
135 FILE *v3; // eax@1
86a83e12d795 moving files
Ritor1
parents:
diff changeset
136 int v4; // esi@3
86a83e12d795 moving files
Ritor1
parents:
diff changeset
137 void *v5; // eax@10
86a83e12d795 moving files
Ritor1
parents:
diff changeset
138 FILE *v6; // ST0C_4@12
86a83e12d795 moving files
Ritor1
parents:
diff changeset
139 char *i; // eax@12
86a83e12d795 moving files
Ritor1
parents:
diff changeset
140 const char *v8; // ST00_4@15
86a83e12d795 moving files
Ritor1
parents:
diff changeset
141 int v9; // eax@16
86a83e12d795 moving files
Ritor1
parents:
diff changeset
142 int v10; // edx@20
86a83e12d795 moving files
Ritor1
parents:
diff changeset
143 int v11; // ecx@21
86a83e12d795 moving files
Ritor1
parents:
diff changeset
144 int v12; // eax@22
86a83e12d795 moving files
Ritor1
parents:
diff changeset
145 signed int j; // edx@25
86a83e12d795 moving files
Ritor1
parents:
diff changeset
146 IconFrame *v14; // ecx@26
86a83e12d795 moving files
Ritor1
parents:
diff changeset
147 int v15; // esi@26
86a83e12d795 moving files
Ritor1
parents:
diff changeset
148 int k; // eax@27
86a83e12d795 moving files
Ritor1
parents:
diff changeset
149 signed int result; // eax@11
86a83e12d795 moving files
Ritor1
parents:
diff changeset
150 char Buf; // [sp+Ch] [bp-2F8h]@3
86a83e12d795 moving files
Ritor1
parents:
diff changeset
151 FrameTableTxtLine v19; // [sp+200h] [bp-104h]@4
86a83e12d795 moving files
Ritor1
parents:
diff changeset
152 FrameTableTxtLine v20; // [sp+27Ch] [bp-88h]@4
86a83e12d795 moving files
Ritor1
parents:
diff changeset
153 int v21; // [sp+2F8h] [bp-Ch]@3
86a83e12d795 moving files
Ritor1
parents:
diff changeset
154 int v22; // [sp+2FCh] [bp-8h]@3
86a83e12d795 moving files
Ritor1
parents:
diff changeset
155 FILE *File; // [sp+300h] [bp-4h]@1
86a83e12d795 moving files
Ritor1
parents:
diff changeset
156 int Argsa; // [sp+30Ch] [bp+8h]@26
86a83e12d795 moving files
Ritor1
parents:
diff changeset
157
86a83e12d795 moving files
Ritor1
parents:
diff changeset
158 v2 = this;
86a83e12d795 moving files
Ritor1
parents:
diff changeset
159 //TileTable::dtor((TileTable *)this);
86a83e12d795 moving files
Ritor1
parents:
diff changeset
160 v3 = fopen(Args, "r");
86a83e12d795 moving files
Ritor1
parents:
diff changeset
161 File = v3;
86a83e12d795 moving files
Ritor1
parents:
diff changeset
162 if ( !v3 )
86a83e12d795 moving files
Ritor1
parents:
diff changeset
163 Abortf("IconFrameTable::load - Unable to open file: %s.", Args);
86a83e12d795 moving files
Ritor1
parents:
diff changeset
164 v4 = 0;
86a83e12d795 moving files
Ritor1
parents:
diff changeset
165 v21 = 0;
86a83e12d795 moving files
Ritor1
parents:
diff changeset
166 v22 = 1;
86a83e12d795 moving files
Ritor1
parents:
diff changeset
167 if ( fgets(&Buf, 490, v3) )
86a83e12d795 moving files
Ritor1
parents:
diff changeset
168 {
86a83e12d795 moving files
Ritor1
parents:
diff changeset
169 do
86a83e12d795 moving files
Ritor1
parents:
diff changeset
170 {
86a83e12d795 moving files
Ritor1
parents:
diff changeset
171 *strchr(&Buf, 10) = 0;
86a83e12d795 moving files
Ritor1
parents:
diff changeset
172 memcpy(&v20, frame_table_txt_parser(&Buf, &v19), sizeof(v20));
86a83e12d795 moving files
Ritor1
parents:
diff changeset
173 if ( v20.uPropCount && *v20.pProperties[0] != 47 )
86a83e12d795 moving files
Ritor1
parents:
diff changeset
174 {
86a83e12d795 moving files
Ritor1
parents:
diff changeset
175 if ( v20.uPropCount < 3 )
86a83e12d795 moving files
Ritor1
parents:
diff changeset
176 Abortf("IconFrameTable::loadText, too few arguments, %s line %i.", Args, v22);
86a83e12d795 moving files
Ritor1
parents:
diff changeset
177 ++v21;
86a83e12d795 moving files
Ritor1
parents:
diff changeset
178 }
86a83e12d795 moving files
Ritor1
parents:
diff changeset
179 ++v22;
86a83e12d795 moving files
Ritor1
parents:
diff changeset
180 }
86a83e12d795 moving files
Ritor1
parents:
diff changeset
181 while ( fgets(&Buf, 490, File) );
86a83e12d795 moving files
Ritor1
parents:
diff changeset
182 v4 = v21;
86a83e12d795 moving files
Ritor1
parents:
diff changeset
183 }
86a83e12d795 moving files
Ritor1
parents:
diff changeset
184 v2->uNumIcons = v4;
86a83e12d795 moving files
Ritor1
parents:
diff changeset
185 v5 = pAllocator->AllocNamedChunk(v2->pIcons, 32 * v4, "I Frames");
86a83e12d795 moving files
Ritor1
parents:
diff changeset
186 v2->pIcons = (IconFrame *)v5;
86a83e12d795 moving files
Ritor1
parents:
diff changeset
187 if ( v5 )
86a83e12d795 moving files
Ritor1
parents:
diff changeset
188 {
86a83e12d795 moving files
Ritor1
parents:
diff changeset
189 v6 = File;
86a83e12d795 moving files
Ritor1
parents:
diff changeset
190 v2->uNumIcons = 0;
86a83e12d795 moving files
Ritor1
parents:
diff changeset
191 fseek(v6, 0, 0);
86a83e12d795 moving files
Ritor1
parents:
diff changeset
192 for ( i = fgets(&Buf, 490, File); i; i = fgets(&Buf, 490, File) )
86a83e12d795 moving files
Ritor1
parents:
diff changeset
193 {
86a83e12d795 moving files
Ritor1
parents:
diff changeset
194 *strchr(&Buf, 10) = 0;
86a83e12d795 moving files
Ritor1
parents:
diff changeset
195 memcpy(&v20, frame_table_txt_parser(&Buf, &v19), sizeof(v20));
86a83e12d795 moving files
Ritor1
parents:
diff changeset
196 if ( v20.uPropCount && *v20.pProperties[0] != 47 )
86a83e12d795 moving files
Ritor1
parents:
diff changeset
197 {
86a83e12d795 moving files
Ritor1
parents:
diff changeset
198 strcpy(v2->pIcons[v2->uNumIcons].pAnimationName, v20.pProperties[0]);
86a83e12d795 moving files
Ritor1
parents:
diff changeset
199 strcpy(v2->pIcons[v2->uNumIcons].pTextureName, v20.pProperties[1]);
86a83e12d795 moving files
Ritor1
parents:
diff changeset
200 v8 = v20.pProperties[2];
86a83e12d795 moving files
Ritor1
parents:
diff changeset
201 v2->pIcons[v2->uNumIcons].uFlags = 0;
86a83e12d795 moving files
Ritor1
parents:
diff changeset
202 if ( !_stricmp(v8, "new") )
86a83e12d795 moving files
Ritor1
parents:
diff changeset
203 {
86a83e12d795 moving files
Ritor1
parents:
diff changeset
204 v9 = (int)&v2->pIcons[v2->uNumIcons].uFlags;
86a83e12d795 moving files
Ritor1
parents:
diff changeset
205 *(char *)v9 |= 4u;
86a83e12d795 moving files
Ritor1
parents:
diff changeset
206 }
86a83e12d795 moving files
Ritor1
parents:
diff changeset
207 v2->pIcons[v2->uNumIcons].uAnimTime = atoi(v20.pProperties[3]);
86a83e12d795 moving files
Ritor1
parents:
diff changeset
208 v2->pIcons[v2->uNumIcons].uAnimLength = 0;
86a83e12d795 moving files
Ritor1
parents:
diff changeset
209 v2->pIcons[v2->uNumIcons++].uTextureID = 0;
86a83e12d795 moving files
Ritor1
parents:
diff changeset
210 }
86a83e12d795 moving files
Ritor1
parents:
diff changeset
211 }
86a83e12d795 moving files
Ritor1
parents:
diff changeset
212 fclose(File);
86a83e12d795 moving files
Ritor1
parents:
diff changeset
213 v10 = 0;
86a83e12d795 moving files
Ritor1
parents:
diff changeset
214 if ( (signed int)(v2->uNumIcons - 1) > 0 )
86a83e12d795 moving files
Ritor1
parents:
diff changeset
215 {
86a83e12d795 moving files
Ritor1
parents:
diff changeset
216 v11 = 0;
86a83e12d795 moving files
Ritor1
parents:
diff changeset
217 do
86a83e12d795 moving files
Ritor1
parents:
diff changeset
218 {
86a83e12d795 moving files
Ritor1
parents:
diff changeset
219 v12 = (int)&v2->pIcons[v11];
86a83e12d795 moving files
Ritor1
parents:
diff changeset
220 if ( !(*(char *)(v12 + 60) & 4) )
86a83e12d795 moving files
Ritor1
parents:
diff changeset
221 *(char *)(v12 + 28) |= 1u;
86a83e12d795 moving files
Ritor1
parents:
diff changeset
222 ++v10;
86a83e12d795 moving files
Ritor1
parents:
diff changeset
223 ++v11;
86a83e12d795 moving files
Ritor1
parents:
diff changeset
224 }
86a83e12d795 moving files
Ritor1
parents:
diff changeset
225 while ( v10 < (signed int)(v2->uNumIcons - 1) );
86a83e12d795 moving files
Ritor1
parents:
diff changeset
226 }
86a83e12d795 moving files
Ritor1
parents:
diff changeset
227 for ( j = 0; j < (signed int)v2->uNumIcons; *(short *)(Argsa + 26) = v15 )
86a83e12d795 moving files
Ritor1
parents:
diff changeset
228 {
86a83e12d795 moving files
Ritor1
parents:
diff changeset
229 v14 = v2->pIcons;
86a83e12d795 moving files
Ritor1
parents:
diff changeset
230 Argsa = (int)&v14[j];
86a83e12d795 moving files
Ritor1
parents:
diff changeset
231 v15 = *(short *)(Argsa + 24);
86a83e12d795 moving files
Ritor1
parents:
diff changeset
232 if ( *(char *)(Argsa + 28) & 1 )
86a83e12d795 moving files
Ritor1
parents:
diff changeset
233 {
86a83e12d795 moving files
Ritor1
parents:
diff changeset
234 ++j;
86a83e12d795 moving files
Ritor1
parents:
diff changeset
235 for ( k = (int)&v14[j]; *(char *)(k + 28) & 1; k += 32 )
86a83e12d795 moving files
Ritor1
parents:
diff changeset
236 {
86a83e12d795 moving files
Ritor1
parents:
diff changeset
237 v15 += *(short *)(k + 24);
86a83e12d795 moving files
Ritor1
parents:
diff changeset
238 ++j;
86a83e12d795 moving files
Ritor1
parents:
diff changeset
239 }
86a83e12d795 moving files
Ritor1
parents:
diff changeset
240 LOWORD(v15) = v14[j].uAnimTime + v15;
86a83e12d795 moving files
Ritor1
parents:
diff changeset
241 }
86a83e12d795 moving files
Ritor1
parents:
diff changeset
242 ++j;
86a83e12d795 moving files
Ritor1
parents:
diff changeset
243 }
86a83e12d795 moving files
Ritor1
parents:
diff changeset
244 result = 1;
86a83e12d795 moving files
Ritor1
parents:
diff changeset
245 }
86a83e12d795 moving files
Ritor1
parents:
diff changeset
246 else
86a83e12d795 moving files
Ritor1
parents:
diff changeset
247 {
86a83e12d795 moving files
Ritor1
parents:
diff changeset
248 fclose(File);
86a83e12d795 moving files
Ritor1
parents:
diff changeset
249 result = 0;
86a83e12d795 moving files
Ritor1
parents:
diff changeset
250 }
86a83e12d795 moving files
Ritor1
parents:
diff changeset
251 return result;
1296
c423f946dc99 moving files continue
Ritor1
parents: 1295
diff changeset
252 }
c423f946dc99 moving files continue
Ritor1
parents: 1295
diff changeset
253 //----- (0042EB78) --------------------------------------------------------
c423f946dc99 moving files continue
Ritor1
parents: 1295
diff changeset
254 int IconFrameTable::GetIconAnimLength(unsigned int uIconID)
c423f946dc99 moving files continue
Ritor1
parents: 1295
diff changeset
255 {
c423f946dc99 moving files continue
Ritor1
parents: 1295
diff changeset
256 return 8 * this->pIcons[uIconID].uAnimLength;
1295
86a83e12d795 moving files
Ritor1
parents:
diff changeset
257 }