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