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