annotate IconFrameTable.cpp @ 2203:4bfee77e900d

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