annotate Engine/Tables/IconFrameTable.cpp @ 2575:a76d408c5132 tip

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