Mercurial > mm7
annotate TileTable.cpp @ 1578:56cc81b1ed49
workaround for crash on startup
fixes for logs
author | Beri Levi berilevi@gmail.com |
---|---|
date | Tue, 10 Sep 2013 19:33:21 +0300 |
parents | c4ab816fcc5e |
children | 75fafd8ced59 |
rev | line source |
---|---|
1165
29a8defbad9e
temporary _CRT_SECURE_NO_WARNINGS to remove some warnings
Grumpy7
parents:
1104
diff
changeset
|
1 #ifdef _MSC_VER |
29a8defbad9e
temporary _CRT_SECURE_NO_WARNINGS to remove some warnings
Grumpy7
parents:
1104
diff
changeset
|
2 #define _CRT_SECURE_NO_WARNINGS |
29a8defbad9e
temporary _CRT_SECURE_NO_WARNINGS to remove some warnings
Grumpy7
parents:
1104
diff
changeset
|
3 #endif |
29a8defbad9e
temporary _CRT_SECURE_NO_WARNINGS to remove some warnings
Grumpy7
parents:
1104
diff
changeset
|
4 |
761 | 5 #include <stdio.h> |
6 #include <stdlib.h> | |
7 #include <string.h> | |
8 | |
9 #include "TileFrameTable.h" | |
10 #include "FrameTableInc.h" | |
11 #include "Allocator.h" | |
12 #include "PaletteManager.h" | |
13 #include "LOD.h" | |
14 | |
15 #include "mm7_data.h" | |
16 | |
17 | |
18 //----- (00487E1D) -------------------------------------------------------- | |
19 TileTable::~TileTable() | |
20 { | |
21 if ( pTiles ) | |
22 { | |
23 pAllocator->FreeChunk(pTiles); | |
24 pTiles = nullptr; | |
25 } | |
26 sNumTiles = 0; | |
27 } | |
28 | |
29 //----- (00487E3B) -------------------------------------------------------- | |
30 TileDesc *TileTable::GetTileById(unsigned int uTileID) | |
31 { | |
1545 | 32 Assert(uTileID < sNumTiles); |
761 | 33 return &pTiles[uTileID]; |
34 } | |
35 | |
36 //----- (00487E58) -------------------------------------------------------- | |
37 void TileTable::InitializeTileset(Tileset tileset) | |
38 { | |
39 for (int i = 0; i < sNumTiles; ++i ) | |
40 { | |
41 if (pTiles[i].tileset == tileset && pTiles[i].pTileName[0] ) | |
42 { | |
43 pTiles[i].uBitmapID = pBitmaps_LOD->LoadTexture(pTiles[i].pTileName); | |
44 if ( pTiles[i].uBitmapID != -1 ) | |
45 pBitmaps_LOD->pTextures[pTiles[i].uBitmapID].palette_id2 = pPaletteManager->LoadPalette(pBitmaps_LOD->pTextures[pTiles[i].uBitmapID].palette_id1); | |
46 } | |
47 } | |
48 } | |
49 | |
50 //----- (00487ED6) -------------------------------------------------------- | |
51 int TileTable::GetTileForTerrainType( signed int terrain_type, bool not_random ) | |
52 { | |
53 int v5; // edx@3 | |
54 int v6; // edx@11 | |
55 | |
56 if ( not_random || terrain_type > 8 ) | |
57 { | |
58 return GetTileId(terrain_type, 0); | |
59 } | |
60 v5 = rand() % 50; | |
61 if ( v5 < 20) | |
62 { | |
63 return GetTileId(terrain_type, 0); | |
64 } | |
65 else if ( v5 < 30 ) | |
66 { | |
67 return GetTileId(terrain_type, 1); | |
68 } | |
69 else if ( v5 < 40 ) | |
70 { | |
71 return GetTileId(terrain_type, 2); | |
72 } | |
73 else if ( v5 < 48 ) | |
74 { | |
75 return GetTileId(terrain_type, 3); | |
76 } | |
77 v6 = rand() % 8; | |
78 return GetTileId(terrain_type, v6+4); | |
79 return 0; | |
80 } | |
81 | |
82 //----- (00487F84) -------------------------------------------------------- | |
83 unsigned int TileTable::GetTileId(unsigned int uTerrainType, unsigned int uSection) | |
84 { | |
85 for (int i=0; i<sNumTiles; ++i) | |
86 { | |
87 if( (pTiles[i].tileset==uTerrainType)&&(pTiles[i].uSection==uSection)) | |
88 return i; | |
89 } | |
90 return 0; | |
91 } | |
92 | |
93 //----- (00487FB4) -------------------------------------------------------- | |
94 void TileTable::ToFile() | |
95 { | |
96 TileTable *v1; // esi@1 | |
97 FILE *v2; // eax@1 | |
98 FILE *v3; // edi@1 | |
99 | |
100 auto Str = this; | |
101 | |
102 v1 = Str; | |
103 v2 = fopen("data\\dtile.bin", "wb"); | |
104 v3 = v2; | |
105 if ( !v2 ) | |
1545 | 106 Error("Unable to save dtile.bin!"); |
761 | 107 fwrite(v1, 4u, 1u, v2); |
108 fwrite(v1->pTiles, 0x1Au, v1->sNumTiles, v3); | |
109 fclose(v3); | |
110 } | |
111 | |
112 //----- (00488000) -------------------------------------------------------- | |
1477
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1165
diff
changeset
|
113 void TileTable::FromFile(void *data_mm6, void *data_mm7, void *data_mm8) |
761 | 114 { |
1477
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1165
diff
changeset
|
115 uint num_mm6_tiles = data_mm6 ? *(int *)data_mm6 : 0, |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1165
diff
changeset
|
116 num_mm7_tiles = data_mm7 ? *(int *)data_mm7 : 0, |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1165
diff
changeset
|
117 num_mm8_tiles = data_mm8 ? *(int *)data_mm8 : 0; |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1165
diff
changeset
|
118 sNumTiles = num_mm6_tiles + num_mm7_tiles + num_mm8_tiles; |
1545 | 119 Assert(sNumTiles); |
120 Assert(!num_mm8_tiles); | |
1477
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1165
diff
changeset
|
121 |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1165
diff
changeset
|
122 pTiles = (TileDesc *)pAllocator->AllocNamedChunk(pTiles, sNumTiles * sizeof(TileDesc), "Tile Descrip"); |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1165
diff
changeset
|
123 memcpy(pTiles, (char *)data_mm7 + 4, num_mm7_tiles * sizeof(TileDesc)); |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1165
diff
changeset
|
124 memcpy(pTiles + num_mm7_tiles, (char *)data_mm6 + 4, num_mm6_tiles * sizeof(TileDesc)); |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1165
diff
changeset
|
125 memcpy(pTiles + num_mm6_tiles + num_mm7_tiles, (char *)data_mm8 + 4, num_mm8_tiles * sizeof(TileDesc)); |
761 | 126 } |
127 | |
128 //----- (00488047) -------------------------------------------------------- | |
129 int TileTable::FromFileTxt(const char *pFilename) | |
130 { | |
131 TileTable *v2; // ebp@1 | |
132 FILE *v3; // eax@1 | |
133 unsigned int v4; // ebx@3 | |
134 void *v5; // eax@9 | |
135 unsigned __int16 v6; // ax@14 | |
136 const char *v7; // ST14_4@14 | |
137 unsigned __int16 v8; // ax@14 | |
138 const char *v9; // esi@14 | |
139 int v10; // eax@17 | |
140 int v11; // eax@20 | |
141 int v12; // eax@22 | |
142 int v13; // eax@24 | |
143 int v14; // eax@26 | |
144 int v15; // eax@28 | |
145 int v16; // eax@30 | |
146 int v17; // eax@32 | |
147 int v18; // eax@34 | |
148 int v19; // eax@36 | |
149 int v20; // eax@38 | |
150 int v21; // eax@40 | |
151 int v22; // eax@42 | |
152 int v23; // eax@44 | |
153 int v24; // eax@46 | |
154 int v25; // eax@48 | |
155 int v26; // eax@50 | |
156 int v27; // eax@52 | |
157 int v28; // eax@54 | |
158 int v29; // eax@56 | |
159 int v30; // eax@58 | |
160 int v31; // eax@60 | |
161 int v32; // eax@62 | |
162 int v33; // eax@64 | |
163 int v34; // eax@66 | |
164 const char *v35; // esi@67 | |
165 int v36; // eax@70 | |
166 int v37; // eax@73 | |
167 int v38; // eax@75 | |
168 int v39; // eax@77 | |
169 int v40; // eax@79 | |
170 int v41; // eax@81 | |
171 int v42; // eax@83 | |
172 int v43; // eax@85 | |
173 int v44; // eax@87 | |
174 int v45; // eax@89 | |
175 int v46; // eax@91 | |
176 int v47; // eax@93 | |
177 int v48; // eax@108 | |
178 int v49; // eax@110 | |
179 int v50; // eax@112 | |
180 int v51; // eax@114 | |
181 int v52; // eax@116 | |
182 int v53; // eax@118 | |
183 int v54; // eax@120 | |
184 int v55; // eax@122 | |
185 int v56; // eax@124 | |
186 int v57; // eax@126 | |
187 int v58; // eax@128 | |
188 int v59; // eax@130 | |
189 int v60; // eax@132 | |
190 int v61; // eax@134 | |
191 int v62; // eax@136 | |
192 int v63; // eax@138 | |
193 int v64; // eax@140 | |
194 int v65; // eax@142 | |
195 int v66; // eax@144 | |
196 int v67; // eax@146 | |
197 int v68; // eax@148 | |
198 int v69; // eax@150 | |
199 int v70; // eax@151 | |
200 int j; // edi@152 | |
201 const char *v72; // esi@153 | |
202 int v73; // eax@154 | |
203 int v74; // eax@156 | |
204 int v75; // eax@160 | |
205 int v76; // eax@162 | |
206 int v77; // eax@164 | |
207 int v78; // eax@166 | |
208 int v79; // eax@168 | |
209 int v80; // eax@170 | |
210 FILE *i; // [sp-10h] [bp-304h]@3 | |
211 FILE *File; // [sp+4h] [bp-2F0h]@1 | |
212 FrameTableTxtLine v84; // [sp+8h] [bp-2ECh]@4 | |
213 FrameTableTxtLine v85; // [sp+84h] [bp-270h]@4 | |
214 char Buf; // [sp+100h] [bp-1F4h]@4 | |
215 | |
216 v2 = this; | |
217 v3 = fopen(pFilename, "r"); | |
218 File = v3; | |
219 if ( !v3 ) | |
1545 | 220 Error("TileTable::load - Unable to open file: %s."); |
761 | 221 v4 = 0; |
222 for ( i = v3; fgets(&Buf, 490, i); i = File ) | |
223 { | |
224 *strchr(&Buf, 10) = 0; | |
225 memcpy(&v84, txt_file_frametable_parser(&Buf, &v85), sizeof(v84)); | |
226 if ( v84.uPropCount && *v84.pProperties[0] != 47 ) | |
227 ++v4; | |
228 } | |
229 v2->sNumTiles = v4; | |
230 v5 = pAllocator->AllocNamedChunk(v2->pTiles, 26 * v4, "Tile Descrip"); | |
231 v2->pTiles = (TileDesc *)v5; | |
232 if ( !v5 ) | |
1545 | 233 Error("TileTable::Load - Out of Memory!"); |
761 | 234 memset(v5, 0, 26 * v2->sNumTiles); |
235 v2->sNumTiles = 0; | |
236 fseek(File, 0, 0); | |
237 if ( fgets(&Buf, 490, File) ) | |
238 { | |
239 while ( 1 ) | |
240 { | |
241 *strchr(&Buf, 10) = 0; | |
242 memcpy(&v84, txt_file_frametable_parser(&Buf, &v85), sizeof(v84)); | |
243 if ( v84.uPropCount ) | |
244 { | |
245 if ( *v84.pProperties[0] != 47 ) | |
246 break; | |
247 } | |
248 LABEL_173: | |
249 if ( !fgets(&Buf, 490, File) ) | |
250 goto LABEL_174; | |
251 } | |
252 strcpy(v2->pTiles[v2->sNumTiles].pTileName, v84.pProperties[0]); | |
253 v6 = atoi(v84.pProperties[1]); | |
254 v7 = v84.pProperties[2]; | |
255 v2->pTiles[v2->sNumTiles].uTileID = v6; | |
256 v8 = atoi(v7); | |
257 v9 = v84.pProperties[3]; | |
258 v2->pTiles[v2->sNumTiles].uBitmapID = v8; | |
259 v2->pTiles[v2->sNumTiles].tileset = Tileset_Grass; | |
1104 | 260 if ( _stricmp(v9, "TTtype_NULL") ) |
761 | 261 { |
1104 | 262 if ( _stricmp(v9, "TTtype_Start") ) |
761 | 263 { |
1104 | 264 if ( _stricmp(v9, "TTtype_Grass") ) |
761 | 265 { |
1104 | 266 if ( _stricmp(v9, "TTtype_Cracked") ) |
761 | 267 { |
1104 | 268 if ( _stricmp(v9, "TTtype_Snow") ) |
761 | 269 { |
1104 | 270 if ( _stricmp(v9, "TTtype_Sand") ) |
761 | 271 { |
1104 | 272 if ( _stricmp(v9, "TTtype_Volcano") ) |
761 | 273 { |
1104 | 274 if ( _stricmp(v9, "TTtype_Dirt") ) |
761 | 275 { |
1104 | 276 if ( _stricmp(v9, "TTtype_Water") ) |
761 | 277 { |
1104 | 278 if ( _stricmp(v9, "TTtype_Tropical") ) |
761 | 279 { |
1104 | 280 if ( _stricmp(v9, "TTtype_Swamp") ) |
761 | 281 { |
1104 | 282 if ( _stricmp(v9, "TTtype_City") ) |
761 | 283 { |
1104 | 284 if ( _stricmp(v9, "TTtype_RoadGrassCobble") ) |
761 | 285 { |
1104 | 286 if ( _stricmp(v9, "TTtype_RoadGrassDirt") ) |
761 | 287 { |
1104 | 288 if ( _stricmp(v9, "TTtype_RoadCrackedCobble") ) |
761 | 289 { |
1104 | 290 if ( _stricmp(v9, "TTtype_RoadCrackedDirt") ) |
761 | 291 { |
1104 | 292 if ( _stricmp(v9, "TTtype_RoadSandCobble") ) |
761 | 293 { |
1104 | 294 if ( _stricmp(v9, "TTtype_RoadSandDirt") ) |
761 | 295 { |
1104 | 296 if ( _stricmp(v9, "TTtype_RoadVolcanoCobble") ) |
761 | 297 { |
1104 | 298 if ( _stricmp(v9, "TTtype_RoadVolcanoDirt") ) |
761 | 299 { |
1104 | 300 if ( _stricmp(v9, "TTtype_RoadSwampCobble") ) |
761 | 301 { |
1104 | 302 if ( _stricmp(v9, "TTtype_RoadSwampDirt") ) |
761 | 303 { |
1104 | 304 if ( _stricmp(v9, "TTtype_RoadTropicalCobble") ) |
761 | 305 { |
1104 | 306 if ( _stricmp(v9, "TTtype_RoadTropicalDirt") ) |
761 | 307 { |
1104 | 308 if ( _stricmp(v9, "TTtype_RoadSnowCobble") ) |
761 | 309 { |
1104 | 310 if ( _stricmp(v9, "TTtype_RoadSnowDirt") ) |
761 | 311 { |
1104 | 312 if ( !_stricmp(v9, "TTtype_RoadCityStone") ) |
761 | 313 { |
314 v34 = (int)&v2->pTiles[v2->sNumTiles].tileset; | |
315 *(char *)v34 |= 0x1Cu; | |
316 } | |
317 } | |
318 else | |
319 { | |
320 v33 = (int)&v2->pTiles[v2->sNumTiles].tileset; | |
321 *(char *)v33 |= 0xDu; | |
322 } | |
323 } | |
324 else | |
325 { | |
326 v32 = (int)&v2->pTiles[v2->sNumTiles].tileset; | |
327 *(char *)v32 |= 0xCu; | |
328 } | |
329 } | |
330 else | |
331 { | |
332 v31 = (int)&v2->pTiles[v2->sNumTiles].tileset; | |
333 *(char *)v31 |= 0x1Bu; | |
334 } | |
335 } | |
336 else | |
337 { | |
338 v30 = (int)&v2->pTiles[v2->sNumTiles].tileset; | |
339 *(char *)v30 |= 0x1Au; | |
340 } | |
341 } | |
342 else | |
343 { | |
344 v29 = (int)&v2->pTiles[v2->sNumTiles].tileset; | |
345 *(char *)v29 |= 0x19u; | |
346 } | |
347 } | |
348 else | |
349 { | |
350 v28 = (int)&v2->pTiles[v2->sNumTiles].tileset; | |
351 *(char *)v28 |= 0x18u; | |
352 } | |
353 } | |
354 else | |
355 { | |
356 v27 = (int)&v2->pTiles[v2->sNumTiles].tileset; | |
357 *(char *)v27 |= 0x11u; | |
358 } | |
359 } | |
360 else | |
361 { | |
362 v26 = (int)&v2->pTiles[v2->sNumTiles].tileset; | |
363 *(char *)v26 |= 0x10u; | |
364 } | |
365 } | |
366 else | |
367 { | |
368 v25 = (int)&v2->pTiles[v2->sNumTiles].tileset; | |
369 *(char *)v25 |= 0xFu; | |
370 } | |
371 } | |
372 else | |
373 { | |
374 v24 = (int)&v2->pTiles[v2->sNumTiles].tileset; | |
375 *(char *)v24 |= 0xEu; | |
376 } | |
377 } | |
378 else | |
379 { | |
380 v23 = (int)&v2->pTiles[v2->sNumTiles].tileset; | |
381 *(char *)v23 |= 0x17u; | |
382 } | |
383 } | |
384 else | |
385 { | |
386 v22 = (int)&v2->pTiles[v2->sNumTiles].tileset; | |
387 *(char *)v22 |= 0x16u; | |
388 } | |
389 } | |
390 else | |
391 { | |
392 v21 = (int)&v2->pTiles[v2->sNumTiles].tileset; | |
393 *(char *)v21 |= 0xBu; | |
394 } | |
395 } | |
396 else | |
397 { | |
398 v20 = (int)&v2->pTiles[v2->sNumTiles].tileset; | |
399 *(char *)v20 |= 0xAu; | |
400 } | |
401 } | |
402 else | |
403 { | |
404 v19 = (int)&v2->pTiles[v2->sNumTiles].tileset; | |
405 *(char *)v19 |= 9u; | |
406 } | |
407 } | |
408 else | |
409 { | |
410 v18 = (int)&v2->pTiles[v2->sNumTiles].tileset; | |
411 *(char *)v18 |= 7u; | |
412 } | |
413 } | |
414 else | |
415 { | |
416 v17 = (int)&v2->pTiles[v2->sNumTiles].tileset; | |
417 *(char *)v17 |= 8u; | |
418 } | |
419 } | |
420 else | |
421 { | |
422 v16 = (int)&v2->pTiles[v2->sNumTiles].tileset; | |
423 *(char *)v16 |= 5u; | |
424 } | |
425 } | |
426 else | |
427 { | |
428 v15 = (int)&v2->pTiles[v2->sNumTiles].tileset; | |
429 *(char *)v15 |= 4u; | |
430 } | |
431 } | |
432 else | |
433 { | |
434 v14 = (int)&v2->pTiles[v2->sNumTiles].tileset; | |
435 *(char *)v14 |= 3u; | |
436 } | |
437 } | |
438 else | |
439 { | |
440 v13 = (int)&v2->pTiles[v2->sNumTiles].tileset; | |
441 *(char *)v13 |= 2u; | |
442 } | |
443 } | |
444 else | |
445 { | |
446 v12 = (int)&v2->pTiles[v2->sNumTiles].tileset; | |
447 *(char *)v12 |= 1u; | |
448 } | |
449 } | |
450 else | |
451 { | |
452 v11 = (int)&v2->pTiles[v2->sNumTiles].tileset; | |
453 *(char *)v11 |= 6u; | |
454 } | |
455 } | |
456 } | |
457 else | |
458 { | |
459 v10 = (int)&v2->pTiles[v2->sNumTiles].uSection; | |
460 *(char *)v10 |= 0xFEu; | |
461 } | |
462 } | |
463 else | |
464 { | |
465 LOBYTE(v2->pTiles[v2->sNumTiles].tileset) = -1; | |
466 } | |
467 v35 = v84.pProperties[4]; | |
468 v2->pTiles[v2->sNumTiles].uSection = 0; | |
469 v2->pTiles[v2->sNumTiles].uAttributes = 0; | |
1104 | 470 if ( !_stricmp(v35, "TTsect_NULL") ) |
761 | 471 { |
472 LOBYTE(v2->pTiles[v2->sNumTiles].uSection) = -1; | |
473 LABEL_152: | |
474 for ( j = 5; j < v84.uPropCount; ++j ) | |
475 { | |
476 v72 = v84.pProperties[j]; | |
1104 | 477 if ( _stricmp(v84.pProperties[j], "TTattr_Burn") ) |
761 | 478 { |
1104 | 479 if ( _stricmp(v72, "TTattr_Water") ) |
761 | 480 { |
1104 | 481 if ( _stricmp(v72, "TTattr_Water2") ) |
761 | 482 { |
1104 | 483 if ( _stricmp(v72, "TTattr_Block") ) |
761 | 484 { |
1104 | 485 if ( _stricmp(v72, "TTattr_Repulse") ) |
761 | 486 { |
1104 | 487 if ( _stricmp(v72, "TTattr_Flat") ) |
761 | 488 { |
1104 | 489 if ( _stricmp(v72, "TTattr_Wave") ) |
761 | 490 { |
1104 | 491 if ( _stricmp(v72, "TTattr_NoDraw") ) |
761 | 492 { |
1104 | 493 if ( !_stricmp(v72, "TTattr_Transition") ) |
761 | 494 { |
495 v80 = (int)&v2->pTiles[v2->sNumTiles].uAttributes; | |
496 *(short *)v80 |= 0x200u; | |
497 } | |
498 } | |
499 else | |
500 { | |
501 v79 = (int)&v2->pTiles[v2->sNumTiles].uAttributes; | |
502 *(char *)v79 |= 0x40u; | |
503 } | |
504 } | |
505 else | |
506 { | |
507 v78 = (int)&v2->pTiles[v2->sNumTiles].uAttributes; | |
508 *(char *)v78 |= 0x20u; | |
509 } | |
510 } | |
511 else | |
512 { | |
513 v77 = (int)&v2->pTiles[v2->sNumTiles].uAttributes; | |
514 *(char *)v77 |= 0x10u; | |
515 } | |
516 } | |
517 else | |
518 { | |
519 v76 = (int)&v2->pTiles[v2->sNumTiles].uAttributes; | |
520 *(char *)v76 |= 8u; | |
521 } | |
522 } | |
523 else | |
524 { | |
525 v75 = (int)&v2->pTiles[v2->sNumTiles].uAttributes; | |
526 *(char *)v75 |= 4u; | |
527 } | |
528 } | |
529 else | |
530 { | |
531 HIBYTE(v2->pTiles[v2->sNumTiles].uAttributes) |= 1u; | |
532 } | |
533 } | |
534 else | |
535 { | |
536 v74 = (int)&v2->pTiles[v2->sNumTiles].uAttributes; | |
537 *(char *)v74 |= 2u; | |
538 } | |
539 } | |
540 else | |
541 { | |
542 v73 = (int)&v2->pTiles[v2->sNumTiles].uAttributes; | |
543 *(char *)v73 |= 1u; | |
544 } | |
545 } | |
546 ++v2->sNumTiles; | |
547 goto LABEL_173; | |
548 } | |
1104 | 549 if ( !_stricmp(v35, "TTsect_Start") ) |
761 | 550 { |
551 v36 = (int)&v2->pTiles[v2->sNumTiles].uSection; | |
552 *(char *)v36 |= 0xFEu; | |
553 goto LABEL_152; | |
554 } | |
1104 | 555 if ( !_stricmp(v35, "TTsect_Base1") ) |
761 | 556 goto LABEL_152; |
1104 | 557 if ( !_stricmp(v35, "TTsect_Base2") ) |
761 | 558 { |
559 v37 = (int)&v2->pTiles[v2->sNumTiles].uSection; | |
560 *(char *)v37 |= 1u; | |
561 goto LABEL_152; | |
562 } | |
1104 | 563 if ( !_stricmp(v35, "TTsect_Base3") ) |
761 | 564 { |
565 v38 = (int)&v2->pTiles[v2->sNumTiles].uSection; | |
566 *(char *)v38 |= 2u; | |
567 goto LABEL_152; | |
568 } | |
1104 | 569 if ( !_stricmp(v35, "TTsect_Base4") ) |
761 | 570 { |
571 v39 = (int)&v2->pTiles[v2->sNumTiles].uSection; | |
572 *(char *)v39 |= 3u; | |
573 goto LABEL_152; | |
574 } | |
1104 | 575 if ( !_stricmp(v35, "TTsect_Special1") ) |
761 | 576 { |
577 v40 = (int)&v2->pTiles[v2->sNumTiles].uSection; | |
578 *(char *)v40 |= 4u; | |
579 goto LABEL_152; | |
580 } | |
1104 | 581 if ( !_stricmp(v35, "TTsect_Special2") ) |
761 | 582 { |
583 v41 = (int)&v2->pTiles[v2->sNumTiles].uSection; | |
584 *(char *)v41 |= 5u; | |
585 goto LABEL_152; | |
586 } | |
1104 | 587 if ( !_stricmp(v35, "TTsect_Special3") ) |
761 | 588 { |
589 v42 = (int)&v2->pTiles[v2->sNumTiles].uSection; | |
590 *(char *)v42 |= 6u; | |
591 goto LABEL_152; | |
592 } | |
1104 | 593 if ( !_stricmp(v35, "TTsect_Special4") ) |
761 | 594 { |
595 v43 = (int)&v2->pTiles[v2->sNumTiles].uSection; | |
596 *(char *)v43 |= 7u; | |
597 goto LABEL_152; | |
598 } | |
1104 | 599 if ( !_stricmp(v35, "TTsect_Special5") ) |
761 | 600 { |
601 v44 = (int)&v2->pTiles[v2->sNumTiles].uSection; | |
602 *(char *)v44 |= 8u; | |
603 goto LABEL_152; | |
604 } | |
1104 | 605 if ( !_stricmp(v35, "TTsect_Special6") ) |
761 | 606 { |
607 v45 = (int)&v2->pTiles[v2->sNumTiles].uSection; | |
608 *(char *)v45 |= 9u; | |
609 goto LABEL_152; | |
610 } | |
1104 | 611 if ( !_stricmp(v35, "TTsect_Special7") ) |
761 | 612 { |
613 v46 = (int)&v2->pTiles[v2->sNumTiles].uSection; | |
614 *(char *)v46 |= 0xAu; | |
615 goto LABEL_152; | |
616 } | |
1104 | 617 if ( !_stricmp(v35, "TTsect_Special8") ) |
761 | 618 { |
619 v47 = (int)&v2->pTiles[v2->sNumTiles].uSection; | |
620 *(char *)v47 |= 0xBu; | |
621 goto LABEL_152; | |
622 } | |
1104 | 623 if ( !_stricmp(v35, "TTsect_NE1") ) |
761 | 624 goto LABEL_130; |
1104 | 625 if ( !_stricmp(v35, "TTsect_NW1") ) |
761 | 626 goto LABEL_134; |
1104 | 627 if ( !_stricmp(v35, "TTsect_SE1") ) |
761 | 628 goto LABEL_130; |
1104 | 629 if ( !_stricmp(v35, "TTsect_SW1") ) |
761 | 630 goto LABEL_134; |
1104 | 631 if ( !_stricmp(v35, "TTsect_E1") ) |
761 | 632 goto LABEL_138; |
1104 | 633 if ( !_stricmp(v35, "TTsect_W1") ) |
761 | 634 goto LABEL_140; |
1104 | 635 if ( !_stricmp(v35, "TTsect_N1") ) |
761 | 636 goto LABEL_142; |
1104 | 637 if ( !_stricmp(v35, "TTsect_S1") ) |
761 | 638 goto LABEL_144; |
1104 | 639 if ( !_stricmp(v35, "TTsect_XNE1") ) |
761 | 640 goto LABEL_146; |
1104 | 641 if ( _stricmp(v35, "TTsect_XNW1") ) |
761 | 642 { |
1104 | 643 if ( !_stricmp(v35, "TTsect_XSE1") ) |
761 | 644 goto LABEL_146; |
1104 | 645 if ( _stricmp(v35, "TTsect_XSW1") ) |
761 | 646 { |
1104 | 647 if ( !_stricmp(v35, "TTsect_CROS") ) |
761 | 648 { |
649 LABEL_151: | |
650 v70 = (int)&v2->pTiles[v2->sNumTiles].uAttributes; | |
651 *(short *)v70 |= 0x200u; | |
652 goto LABEL_152; | |
653 } | |
1104 | 654 if ( !_stricmp(v35, "TTsect_NS") ) |
761 | 655 { |
656 v48 = (int)&v2->pTiles[v2->sNumTiles].uSection; | |
657 *(char *)v48 |= 1u; | |
658 goto LABEL_151; | |
659 } | |
1104 | 660 if ( !_stricmp(v35, "TTsect_EW") ) |
761 | 661 { |
662 v49 = (int)&v2->pTiles[v2->sNumTiles].uSection; | |
663 *(char *)v49 |= 2u; | |
664 goto LABEL_151; | |
665 } | |
1104 | 666 if ( !_stricmp(v35, "TTsect_N_E") ) |
761 | 667 { |
668 v50 = (int)&v2->pTiles[v2->sNumTiles].uSection; | |
669 *(char *)v50 |= 3u; | |
670 goto LABEL_151; | |
671 } | |
1104 | 672 if ( !_stricmp(v35, "TTsect_N_W") ) |
761 | 673 { |
674 v51 = (int)&v2->pTiles[v2->sNumTiles].uSection; | |
675 *(char *)v51 |= 4u; | |
676 goto LABEL_151; | |
677 } | |
1104 | 678 if ( !_stricmp(v35, "TTsect_S_E") ) |
761 | 679 { |
680 v52 = (int)&v2->pTiles[v2->sNumTiles].uSection; | |
681 *(char *)v52 |= 5u; | |
682 goto LABEL_151; | |
683 } | |
1104 | 684 if ( !_stricmp(v35, "TTsect_S_W") ) |
761 | 685 { |
686 v53 = (int)&v2->pTiles[v2->sNumTiles].uSection; | |
687 *(char *)v53 |= 6u; | |
688 goto LABEL_151; | |
689 } | |
1104 | 690 if ( !_stricmp(v35, "TTsect_NS_E") ) |
761 | 691 { |
692 v54 = (int)&v2->pTiles[v2->sNumTiles].uSection; | |
693 *(char *)v54 |= 7u; | |
694 goto LABEL_151; | |
695 } | |
1104 | 696 if ( !_stricmp(v35, "TTsect_NS_W") ) |
761 | 697 { |
698 v55 = (int)&v2->pTiles[v2->sNumTiles].uSection; | |
699 *(char *)v55 |= 8u; | |
700 goto LABEL_151; | |
701 } | |
1104 | 702 if ( !_stricmp(v35, "TTsect_EW_N") ) |
761 | 703 { |
704 v56 = (int)&v2->pTiles[v2->sNumTiles].uSection; | |
705 *(char *)v56 |= 9u; | |
706 goto LABEL_151; | |
707 } | |
1104 | 708 if ( !_stricmp(v35, "TTsect_EW_S") ) |
761 | 709 { |
710 v57 = (int)&v2->pTiles[v2->sNumTiles].uSection; | |
711 *(char *)v57 |= 0xAu; | |
712 goto LABEL_151; | |
713 } | |
1104 | 714 if ( !_stricmp(v35, "TTsect_NCAP") ) |
761 | 715 { |
716 v58 = (int)&v2->pTiles[v2->sNumTiles].uSection; | |
717 *(char *)v58 |= 0xBu; | |
718 goto LABEL_151; | |
719 } | |
1104 | 720 if ( !_stricmp(v35, "TTsect_ECAP") ) |
761 | 721 { |
722 LABEL_130: | |
723 v59 = (int)&v2->pTiles[v2->sNumTiles].uSection; | |
724 *(char *)v59 |= 0xCu; | |
725 goto LABEL_151; | |
726 } | |
1104 | 727 if ( !_stricmp(v35, "TTsect_SCAP") ) |
761 | 728 { |
729 v60 = (int)&v2->pTiles[v2->sNumTiles].uSection; | |
730 *(char *)v60 |= 0xDu; | |
731 goto LABEL_151; | |
732 } | |
1104 | 733 if ( !_stricmp(v35, "TTsect_WCAP") ) |
761 | 734 { |
735 LABEL_134: | |
736 v61 = (int)&v2->pTiles[v2->sNumTiles].uSection; | |
737 *(char *)v61 |= 0xEu; | |
738 goto LABEL_151; | |
739 } | |
1104 | 740 if ( !_stricmp(v35, "TTsect_DN") ) |
761 | 741 { |
742 v62 = (int)&v2->pTiles[v2->sNumTiles].uSection; | |
743 *(char *)v62 |= 0xFu; | |
744 goto LABEL_151; | |
745 } | |
1104 | 746 if ( !_stricmp(v35, "TTsect_DS") ) |
761 | 747 { |
748 LABEL_138: | |
749 v63 = (int)&v2->pTiles[v2->sNumTiles].uSection; | |
750 *(char *)v63 |= 0x10u; | |
751 goto LABEL_151; | |
752 } | |
1104 | 753 if ( !_stricmp(v35, "TTsect_DW") ) |
761 | 754 { |
755 LABEL_140: | |
756 v64 = (int)&v2->pTiles[v2->sNumTiles].uSection; | |
757 *(char *)v64 |= 0x11u; | |
758 goto LABEL_151; | |
759 } | |
1104 | 760 if ( !_stricmp(v35, "TTsect_DE") ) |
761 | 761 { |
762 LABEL_142: | |
763 v65 = (int)&v2->pTiles[v2->sNumTiles].uSection; | |
764 *(char *)v65 |= 0x12u; | |
765 goto LABEL_151; | |
766 } | |
1104 | 767 if ( !_stricmp(v35, "TTsect_DSW") ) |
761 | 768 { |
769 LABEL_144: | |
770 v66 = (int)&v2->pTiles[v2->sNumTiles].uSection; | |
771 *(char *)v66 |= 0x13u; | |
772 goto LABEL_151; | |
773 } | |
1104 | 774 if ( !_stricmp(v35, "TTsect_DNE") ) |
761 | 775 { |
776 LABEL_146: | |
777 v67 = (int)&v2->pTiles[v2->sNumTiles].uSection; | |
778 *(char *)v67 |= 0x14u; | |
779 goto LABEL_151; | |
780 } | |
1104 | 781 if ( !_stricmp(v35, "TTsect_DSE") ) |
761 | 782 { |
783 v68 = (int)&v2->pTiles[v2->sNumTiles].uSection; | |
784 *(char *)v68 |= 0x15u; | |
785 goto LABEL_151; | |
786 } | |
1104 | 787 if ( _stricmp(v35, "TTsect_DNW") ) |
761 | 788 goto LABEL_152; |
789 } | |
790 } | |
791 v69 = (int)&v2->pTiles[v2->sNumTiles].uSection; | |
792 *(char *)v69 |= 0x16u; | |
793 goto LABEL_151; | |
794 } | |
795 LABEL_174: | |
796 fclose(File); | |
797 return 1; | |
798 } | |
799 |