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