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