annotate Overlays.cpp @ 33:c033691c2eca

Слияние
author Ritor1
date Tue, 16 Oct 2012 09:10:27 +0600
parents 8b8875f5b359
children 93bf1d5f6a6d
rev   line source
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1 #include <stdlib.h>
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3 #include "Overlays.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4 #include "Sprites.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5 #include "FrameTableInc.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6 #include "Allocator.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7 #include "IconFrameTable.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8 #include "Time.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9 #include "Party.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10 #include "TurnEngine.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11 #include "LOD.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12 #include "Render.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14 #include "mm7_data.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20 struct OtherOverlayList *pOtherOverlayList; // idb
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21 struct OverlayList *pOverlayList;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
30 //----- (004418B1) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
31 int OtherOverlayList::_4418B1(int a2, int a3, int a4, int a5)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
32 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
33 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
34 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
36 //----- (004418B6) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
37 int OtherOverlayList::_4418B6(int uOverlayID, __int16 a3, int a4, int a5, __int16 a6)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
38 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
39 signed int v6; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
40 OtherOverlayList *v7; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
41 signed int result; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
42 signed int v9; // esi@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
43 __int16 v10; // dx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
44 __int16 v11; // dx@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
45
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
46 v6 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
47 v7 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
48 while ( v7->pOverlays[0].field_6 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
49 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
50 ++v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
51 v7 = (OtherOverlayList *)((char *)v7 + 20);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
52 if ( v6 >= 50 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
53 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
54 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
55 v7->pOverlays[0].field_0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
56 v7->pOverlays[0].field_A = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
57 v7->pOverlays[0].field_8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
58 v7->pOverlays[0].field_C = a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
59 v9 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
60 if ( (signed int)pOverlayList->uNumOverlays <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
61 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
62 LABEL_9:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
63 v10 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
64 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
65 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
66 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
67 while ( uOverlayID != pOverlayList->pOverlays[v9].uOverlayID )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
68 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
69 ++v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
70 if ( v9 >= (signed int)pOverlayList->uNumOverlays )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
71 goto LABEL_9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
72 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
73 v10 = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
74 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
75 v7->pOverlays[0].field_2 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
76 v7->pOverlays[0].field_4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
77 if ( a4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
78 v11 = a4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
79 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
80 v11 = 8 * pSpriteFrameTable->pSpriteSFrames[pOverlayList->pOverlays[v10].uSpriteFramesetID].uAnimLength;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
81 v7->pOverlays[0].field_6 = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
82 v7->pOverlays[0].field_10 = a5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
83 v7->pOverlays[0].field_E = a6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
84 result = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
85 this->field_3EC = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
86 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
87 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
88
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
89 //----- (00441964) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
90 unsigned int OtherOverlayList::_441964(int a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
91 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
92 unsigned int result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
93 IconFrameTable *v3; // ecx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
94 void *v4; // eax@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
95 unsigned int v5; // [sp-8h] [bp-Ch]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
96 int v6; // [sp-4h] [bp-8h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
97 Texture *v7; // [sp-4h] [bp-8h]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
98
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
99 result = uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
100 if ( uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
101 || pParty->bTurnBasedModeOn != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
102 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
103 if ( pTurnEngine->field_4 == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
104 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
105 v6 = pEventTimer->uStartTime;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
106 v5 = pIconIDs_Turn[5 - pTurnEngine->uActionPointsLeft / 26];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
107 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
108 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
109 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
110 if ( pTurnEngine->field_4 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
111 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
112 v6 = dword_50C994;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
113 v3 = pIconsFrameTable;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
114 if ( dword_50C998_turnbased_icon_1A )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
115 v5 = uIconID_TurnStart;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
116 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
117 v5 = uIconID_TurnHour;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
118 goto LABEL_12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
119 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
120 if ( pTurnEngine->field_4 != 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
121 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
122 v4 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
123 goto LABEL_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
124 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
125 v6 = pEventTimer->uStartTime;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
126 v5 = uIconID_TurnStop;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
127 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
128 v3 = pIconsFrameTable;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
129 LABEL_12:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
130 v4 = pIconsFrameTable->GetFrame(v5, v6);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
131 LABEL_14:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
132 v7 = &pIcons_LOD->pTextures[*((short *)v4 + 15)];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
133 if ( pRenderer->pRenderD3D )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
134 pRenderer->DrawTextureIndexed(0x18Au, 0x120u, v7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
135 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
136 pRenderer->DrawTextureTransparent(0x18Au, 0x120u, v7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
137 result = dword_50C994;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
138 if ( dword_50C994 < dword_50C998_turnbased_icon_1A )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
139 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
140 result = pEventTimer->uTimeElapsed + dword_50C994;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
141 dword_50C994 = result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
142 if ( (signed int)result >= dword_50C998_turnbased_icon_1A )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
143 dword_50C998_turnbased_icon_1A = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
144 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
145 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
146 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
147 // 4E28F8: using guessed type int uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
148 // 50C994: using guessed type int dword_50C994;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
149 // 50C998: using guessed type int dword_50C998_turnbased_icon_1A;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
150
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
151
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
152 //----- (00458D97) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
153 void OverlayList::InitializeSprites()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
154 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
155 OverlayList *v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
156 signed int i; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
157
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
158 v1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
159 for ( i = 0; i < (signed int)v1->uNumOverlays; ++i )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
160 pSpriteFrameTable->InitializeSprite(v1->pOverlays[i].uSpriteFramesetID);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
161 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
162
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
163 //----- (00458DBC) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
164 void OverlayList::ToFile()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
165 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
166 OverlayList *v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
167 FILE *v2; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
168 FILE *v3; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
169
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
170 v1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
171 v2 = fopen("data\\doverlay.bin", "wb");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
172 v3 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
173 if ( !v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
174 Abortf("Unable to save doverlay.bin!");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
175 fwrite(v1, 4u, 1u, v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
176 fwrite(v1->pOverlays, 8u, v1->uNumOverlays, v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
177 fclose(v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
178 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
179
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
180 //----- (00458E08) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
181 void OverlayList::FromFile(void *pSerialized)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
182 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
183 uNumOverlays = *(int *)pSerialized;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
184 pOverlays = (OverlayDesc *)pAllocator->AllocNamedChunk(pOverlays, 8 * uNumOverlays, "Ovl Des.");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
185 memcpy(pOverlays, (char *)pSerialized + 4, 8 * uNumOverlays);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
186 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
187
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
188 //----- (00458E4F) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
189 bool OverlayList::FromFileTxt(const char *Args)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
190 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
191 OverlayList *v2; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
192 __int32 v3; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
193 FILE *v4; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
194 unsigned int v5; // esi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
195 const void *v6; // ST18_4@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
196 void *v7; // eax@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
197 FILE *v8; // ST0C_4@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
198 char *i; // eax@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
199 unsigned __int16 v10; // ax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
200 const char *v11; // ST1C_4@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
201 int v12; // eax@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
202 OverlayDesc *v13; // ecx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
203 char v14; // zf@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
204 unsigned int v15; // eax@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
205 char Buf; // [sp+10h] [bp-2F0h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
206 FrameTableTxtLine v18; // [sp+204h] [bp-FCh]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
207 FrameTableTxtLine v19; // [sp+280h] [bp-80h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
208 FILE *File; // [sp+2FCh] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
209 unsigned int Argsa; // [sp+308h] [bp+8h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
210
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
211 v2 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
212 pAllocator->FreeChunk(this->pOverlays);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
213 v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
214 v2->pOverlays = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
215 v2->uNumOverlays = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
216 v4 = fopen(Args, "r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
217 File = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
218 if ( !v4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
219 Abortf("ObjectDescriptionList::load - Unable to open file: %s.");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
220 v5 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
221 Argsa = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
222 if ( fgets(&Buf, 490, v4) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
223 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
224 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
225 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
226 *strchr(&Buf, 10) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
227 memcpy(&v19, texture_frame_table_txt_parser(&Buf, &v18), sizeof(v19));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
228 if ( v19.field_0 && *v19.pProperties[0] != 47 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
229 ++Argsa;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
230 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
231 while ( fgets(&Buf, 490, File) );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
232 v5 = Argsa;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
233 v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
234 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
235 v6 = v2->pOverlays;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
236 v2->uNumOverlays = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
237 v7 = pAllocator->AllocNamedChunk(v6, 8 * v5, "Ovl Des.");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
238 v2->pOverlays = (OverlayDesc *)v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
239 if ( v7 == (void *)v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
240 Abortf("OverlayDescriptionList::load - Out of Memory!");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
241 memset(v7, v3, 8 * v2->uNumOverlays);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
242 v8 = File;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
243 v2->uNumOverlays = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
244 fseek(v8, v3, v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
245 for ( i = fgets(&Buf, 490, File); i; i = fgets(&Buf, 490, File) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
246 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
247 *strchr(&Buf, 10) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
248 memcpy(&v19, texture_frame_table_txt_parser(&Buf, &v18), sizeof(v19));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
249 if ( v19.field_0 && *v19.pProperties[0] != 47 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
250 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
251 v10 = atoi(v19.pProperties[0]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
252 v11 = v19.pProperties[1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
253 v2->pOverlays[v2->uNumOverlays].uOverlayID = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
254 if ( _strcmpi(v11, "center") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
255 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
256 v12 = _strcmpi(v19.pProperties[1], "transparent");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
257 v13 = v2->pOverlays;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
258 v14 = v12 == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
259 v15 = v2->uNumOverlays;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
260 if ( v14 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
261 v13[v15].uOverlayType = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
262 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
263 v13[v15].uOverlayType = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
264 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
265 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
266 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
267 v2->pOverlays[v2->uNumOverlays].uOverlayType = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
268 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
269 v2->pOverlays[v2->uNumOverlays++].uSpriteFramesetID = pSpriteFrameTable->FastFindSprite(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
270 (char *)v19.pProperties[2]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
271 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
272 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
273 fclose(File);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
274 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
275 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
276
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
277
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
278 //----- (0045855F) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
279 void OtherOverlay::Reset()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
280 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
281 this->field_10 = 65536;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
282 this->field_A = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
283 this->field_8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
284 this->field_6 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
285 this->field_4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
286 this->field_2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
287 this->field_C = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
288 this->field_E = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
289 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
290
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
291 //----- (004584B8) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
292 OtherOverlay::OtherOverlay()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
293 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
294 this->field_A = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
295 this->field_8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
296 this->field_6 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
297 this->field_4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
298 this->field_2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
299 this->field_C = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
300 this->field_E = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
301 this->field_10 = 65536;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
302 }