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