2499
|
1 #define _CRTDBG_MAP_ALLOC
|
|
2 #include <stdlib.h>
|
|
3 #include <crtdbg.h>
|
|
4
|
|
5 #define _CRT_SECURE_NO_WARNINGS
|
|
6 #include <stdio.h>
|
|
7 #include <stdlib.h>
|
|
8 #include <string.h>
|
|
9
|
2541
|
10 #include "Engine/Engine.h"
|
|
11
|
2499
|
12 #include "TileFrameTable.h"
|
|
13 #include "FrameTableInc.h"
|
|
14 #include "Engine/Graphics/PaletteManager.h"
|
|
15 #include "../LOD.h"
|
|
16
|
|
17
|
|
18 //----- (00487E1D) --------------------------------------------------------
|
|
19 TileTable::~TileTable()
|
|
20 {
|
|
21 free(pTiles);
|
|
22 pTiles = nullptr;
|
|
23 sNumTiles = 0;
|
|
24 }
|
|
25
|
|
26 //----- (00487E3B) --------------------------------------------------------
|
|
27 TileDesc *TileTable::GetTileById(unsigned int uTileID)
|
|
28 {
|
|
29 Assert(uTileID < sNumTiles);
|
|
30 return &pTiles[uTileID];
|
|
31 }
|
|
32
|
|
33 //----- (00487E58) --------------------------------------------------------
|
|
34 void TileTable::InitializeTileset(Tileset tileset)
|
|
35 {
|
|
36 for (int i = 0; i < sNumTiles; ++i )
|
|
37 {
|
|
38 if (pTiles[i].tileset == tileset && pTiles[i].pTileName[0] )
|
|
39 {
|
|
40 pTiles[i].uBitmapID = pBitmaps_LOD->LoadTexture(pTiles[i].pTileName);
|
|
41 if ( pTiles[i].uBitmapID != -1 )
|
|
42 pBitmaps_LOD->pTextures[pTiles[i].uBitmapID].palette_id2 = pPaletteManager->LoadPalette(pBitmaps_LOD->pTextures[pTiles[i].uBitmapID].palette_id1);
|
|
43 }
|
|
44 }
|
|
45 }
|
|
46
|
|
47 //----- (00487ED6) --------------------------------------------------------
|
|
48 int TileTable::GetTileForTerrainType( signed int terrain_type, bool not_random )
|
|
49 {
|
|
50 int v5; // edx@3
|
|
51 int v6; // edx@11
|
|
52
|
|
53 if ( not_random || terrain_type > 8 )
|
|
54 {
|
|
55 return GetTileId(terrain_type, 0);
|
|
56 }
|
|
57 v5 = rand() % 50;
|
|
58 if ( v5 < 20)
|
|
59 {
|
|
60 return GetTileId(terrain_type, 0);
|
|
61 }
|
|
62 else if ( v5 < 30 )
|
|
63 {
|
|
64 return GetTileId(terrain_type, 1);
|
|
65 }
|
|
66 else if ( v5 < 40 )
|
|
67 {
|
|
68 return GetTileId(terrain_type, 2);
|
|
69 }
|
|
70 else if ( v5 < 48 )
|
|
71 {
|
|
72 return GetTileId(terrain_type, 3);
|
|
73 }
|
|
74 v6 = rand() % 8;
|
|
75 return GetTileId(terrain_type, v6+4);
|
|
76 return 0;
|
|
77 }
|
|
78
|
|
79 //----- (00487F84) --------------------------------------------------------
|
|
80 unsigned int TileTable::GetTileId(unsigned int uTerrainType, unsigned int uSection)
|
|
81 {
|
|
82 for (int i=0; i<sNumTiles; ++i)
|
|
83 {
|
|
84 if( (pTiles[i].tileset==uTerrainType)&&(pTiles[i].uSection==uSection))
|
|
85 return i;
|
|
86 }
|
|
87 return 0;
|
|
88 }
|
|
89
|
|
90 //----- (00487FB4) --------------------------------------------------------
|
|
91 void TileTable::ToFile()
|
|
92 {
|
|
93 TileTable *v1; // esi@1
|
|
94 FILE *v2; // eax@1
|
|
95 FILE *v3; // edi@1
|
|
96
|
|
97 TileTable* Str = this;
|
|
98
|
|
99 v1 = Str;
|
|
100 v2 = fopen("data\\dtile.bin", "wb");
|
|
101 v3 = v2;
|
|
102 if ( !v2 )
|
|
103 Error("Unable to save dtile.bin!");
|
|
104 fwrite(v1, 4u, 1u, v2);
|
|
105 fwrite(v1->pTiles, 0x1Au, v1->sNumTiles, v3);
|
|
106 fclose(v3);
|
|
107 }
|
|
108
|
|
109 //----- (00488000) --------------------------------------------------------
|
|
110 void TileTable::FromFile(void *data_mm6, void *data_mm7, void *data_mm8)
|
|
111 {
|
|
112 uint num_mm6_tiles = data_mm6 ? *(int *)data_mm6 : 0,
|
|
113 num_mm7_tiles = data_mm7 ? *(int *)data_mm7 : 0,
|
|
114 num_mm8_tiles = data_mm8 ? *(int *)data_mm8 : 0;
|
|
115 sNumTiles = num_mm6_tiles + num_mm7_tiles + num_mm8_tiles;
|
|
116 Assert(sNumTiles);
|
|
117 Assert(!num_mm8_tiles);
|
|
118
|
|
119 pTiles = (TileDesc *)malloc(sNumTiles * sizeof(TileDesc));
|
|
120 memcpy(pTiles, (char *)data_mm7 + 4, num_mm7_tiles * sizeof(TileDesc));
|
|
121 memcpy(pTiles + num_mm7_tiles, (char *)data_mm6 + 4, num_mm6_tiles * sizeof(TileDesc));
|
|
122 memcpy(pTiles + num_mm6_tiles + num_mm7_tiles, (char *)data_mm8 + 4, num_mm8_tiles * sizeof(TileDesc));
|
|
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 Error("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 = malloc(26 * v4);
|
|
228 v2->pTiles = (TileDesc *)v5;
|
|
229 if ( !v5 )
|
|
230 Error("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 ( _stricmp(v9, "TTtype_NULL") )
|
|
258 {
|
|
259 if ( _stricmp(v9, "TTtype_Start") )
|
|
260 {
|
|
261 if ( _stricmp(v9, "TTtype_Grass") )
|
|
262 {
|
|
263 if ( _stricmp(v9, "TTtype_Cracked") )
|
|
264 {
|
|
265 if ( _stricmp(v9, "TTtype_Snow") )
|
|
266 {
|
|
267 if ( _stricmp(v9, "TTtype_Sand") )
|
|
268 {
|
|
269 if ( _stricmp(v9, "TTtype_Volcano") )
|
|
270 {
|
|
271 if ( _stricmp(v9, "TTtype_Dirt") )
|
|
272 {
|
|
273 if ( _stricmp(v9, "TTtype_Water") )
|
|
274 {
|
|
275 if ( _stricmp(v9, "TTtype_Tropical") )
|
|
276 {
|
|
277 if ( _stricmp(v9, "TTtype_Swamp") )
|
|
278 {
|
|
279 if ( _stricmp(v9, "TTtype_City") )
|
|
280 {
|
|
281 if ( _stricmp(v9, "TTtype_RoadGrassCobble") )
|
|
282 {
|
|
283 if ( _stricmp(v9, "TTtype_RoadGrassDirt") )
|
|
284 {
|
|
285 if ( _stricmp(v9, "TTtype_RoadCrackedCobble") )
|
|
286 {
|
|
287 if ( _stricmp(v9, "TTtype_RoadCrackedDirt") )
|
|
288 {
|
|
289 if ( _stricmp(v9, "TTtype_RoadSandCobble") )
|
|
290 {
|
|
291 if ( _stricmp(v9, "TTtype_RoadSandDirt") )
|
|
292 {
|
|
293 if ( _stricmp(v9, "TTtype_RoadVolcanoCobble") )
|
|
294 {
|
|
295 if ( _stricmp(v9, "TTtype_RoadVolcanoDirt") )
|
|
296 {
|
|
297 if ( _stricmp(v9, "TTtype_RoadSwampCobble") )
|
|
298 {
|
|
299 if ( _stricmp(v9, "TTtype_RoadSwampDirt") )
|
|
300 {
|
|
301 if ( _stricmp(v9, "TTtype_RoadTropicalCobble") )
|
|
302 {
|
|
303 if ( _stricmp(v9, "TTtype_RoadTropicalDirt") )
|
|
304 {
|
|
305 if ( _stricmp(v9, "TTtype_RoadSnowCobble") )
|
|
306 {
|
|
307 if ( _stricmp(v9, "TTtype_RoadSnowDirt") )
|
|
308 {
|
|
309 if ( !_stricmp(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 ( !_stricmp(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 ( _stricmp(v84.pProperties[j], "TTattr_Burn") )
|
|
475 {
|
|
476 if ( _stricmp(v72, "TTattr_Water") )
|
|
477 {
|
|
478 if ( _stricmp(v72, "TTattr_Water2") )
|
|
479 {
|
|
480 if ( _stricmp(v72, "TTattr_Block") )
|
|
481 {
|
|
482 if ( _stricmp(v72, "TTattr_Repulse") )
|
|
483 {
|
|
484 if ( _stricmp(v72, "TTattr_Flat") )
|
|
485 {
|
|
486 if ( _stricmp(v72, "TTattr_Wave") )
|
|
487 {
|
|
488 if ( _stricmp(v72, "TTattr_NoDraw") )
|
|
489 {
|
|
490 if ( !_stricmp(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 |= 4;
|
|
524 }
|
|
525 }
|
|
526 else
|
|
527 HIBYTE(v2->pTiles[v2->sNumTiles].uAttributes) |= 1;
|
|
528 }
|
|
529 else
|
|
530 {
|
|
531 v74 = (int)&v2->pTiles[v2->sNumTiles].uAttributes;
|
|
532 *(char *)v74 |= 2;
|
|
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 }
|
|
544 if ( !_stricmp(v35, "TTsect_Start") )
|
|
545 {
|
|
546 v36 = (int)&v2->pTiles[v2->sNumTiles].uSection;
|
|
547 *(char *)v36 |= 0xFEu;
|
|
548 goto LABEL_152;
|
|
549 }
|
|
550 if ( !_stricmp(v35, "TTsect_Base1") )
|
|
551 goto LABEL_152;
|
|
552 if ( !_stricmp(v35, "TTsect_Base2") )
|
|
553 {
|
|
554 v37 = (int)&v2->pTiles[v2->sNumTiles].uSection;
|
|
555 *(char *)v37 |= 1u;
|
|
556 goto LABEL_152;
|
|
557 }
|
|
558 if ( !_stricmp(v35, "TTsect_Base3") )
|
|
559 {
|
|
560 v38 = (int)&v2->pTiles[v2->sNumTiles].uSection;
|
|
561 *(char *)v38 |= 2u;
|
|
562 goto LABEL_152;
|
|
563 }
|
|
564 if ( !_stricmp(v35, "TTsect_Base4") )
|
|
565 {
|
|
566 v39 = (int)&v2->pTiles[v2->sNumTiles].uSection;
|
|
567 *(char *)v39 |= 3u;
|
|
568 goto LABEL_152;
|
|
569 }
|
|
570 if ( !_stricmp(v35, "TTsect_Special1") )
|
|
571 {
|
|
572 v40 = (int)&v2->pTiles[v2->sNumTiles].uSection;
|
|
573 *(char *)v40 |= 4u;
|
|
574 goto LABEL_152;
|
|
575 }
|
|
576 if ( !_stricmp(v35, "TTsect_Special2") )
|
|
577 {
|
|
578 v41 = (int)&v2->pTiles[v2->sNumTiles].uSection;
|
|
579 *(char *)v41 |= 5u;
|
|
580 goto LABEL_152;
|
|
581 }
|
|
582 if ( !_stricmp(v35, "TTsect_Special3") )
|
|
583 {
|
|
584 v42 = (int)&v2->pTiles[v2->sNumTiles].uSection;
|
|
585 *(char *)v42 |= 6u;
|
|
586 goto LABEL_152;
|
|
587 }
|
|
588 if ( !_stricmp(v35, "TTsect_Special4") )
|
|
589 {
|
|
590 v43 = (int)&v2->pTiles[v2->sNumTiles].uSection;
|
|
591 *(char *)v43 |= 7u;
|
|
592 goto LABEL_152;
|
|
593 }
|
|
594 if ( !_stricmp(v35, "TTsect_Special5") )
|
|
595 {
|
|
596 v44 = (int)&v2->pTiles[v2->sNumTiles].uSection;
|
|
597 *(char *)v44 |= 8u;
|
|
598 goto LABEL_152;
|
|
599 }
|
|
600 if ( !_stricmp(v35, "TTsect_Special6") )
|
|
601 {
|
|
602 v45 = (int)&v2->pTiles[v2->sNumTiles].uSection;
|
|
603 *(char *)v45 |= 9u;
|
|
604 goto LABEL_152;
|
|
605 }
|
|
606 if ( !_stricmp(v35, "TTsect_Special7") )
|
|
607 {
|
|
608 v46 = (int)&v2->pTiles[v2->sNumTiles].uSection;
|
|
609 *(char *)v46 |= 0xAu;
|
|
610 goto LABEL_152;
|
|
611 }
|
|
612 if ( !_stricmp(v35, "TTsect_Special8") )
|
|
613 {
|
|
614 v47 = (int)&v2->pTiles[v2->sNumTiles].uSection;
|
|
615 *(char *)v47 |= 0xBu;
|
|
616 goto LABEL_152;
|
|
617 }
|
|
618 if ( !_stricmp(v35, "TTsect_NE1") )
|
|
619 goto LABEL_130;
|
|
620 if ( !_stricmp(v35, "TTsect_NW1") )
|
|
621 goto LABEL_134;
|
|
622 if ( !_stricmp(v35, "TTsect_SE1") )
|
|
623 goto LABEL_130;
|
|
624 if ( !_stricmp(v35, "TTsect_SW1") )
|
|
625 goto LABEL_134;
|
|
626 if ( !_stricmp(v35, "TTsect_E1") )
|
|
627 goto LABEL_138;
|
|
628 if ( !_stricmp(v35, "TTsect_W1") )
|
|
629 goto LABEL_140;
|
|
630 if ( !_stricmp(v35, "TTsect_N1") )
|
|
631 goto LABEL_142;
|
|
632 if ( !_stricmp(v35, "TTsect_S1") )
|
|
633 goto LABEL_144;
|
|
634 if ( !_stricmp(v35, "TTsect_XNE1") )
|
|
635 goto LABEL_146;
|
|
636 if ( _stricmp(v35, "TTsect_XNW1") )
|
|
637 {
|
|
638 if ( !_stricmp(v35, "TTsect_XSE1") )
|
|
639 goto LABEL_146;
|
|
640 if ( _stricmp(v35, "TTsect_XSW1") )
|
|
641 {
|
|
642 if ( !_stricmp(v35, "TTsect_CROS") )
|
|
643 {
|
|
644 LABEL_151:
|
|
645 v70 = (int)&v2->pTiles[v2->sNumTiles].uAttributes;
|
|
646 *(short *)v70 |= 0x200u;
|
|
647 goto LABEL_152;
|
|
648 }
|
|
649 if ( !_stricmp(v35, "TTsect_NS") )
|
|
650 {
|
|
651 v48 = (int)&v2->pTiles[v2->sNumTiles].uSection;
|
|
652 *(char *)v48 |= 1u;
|
|
653 goto LABEL_151;
|
|
654 }
|
|
655 if ( !_stricmp(v35, "TTsect_EW") )
|
|
656 {
|
|
657 v49 = (int)&v2->pTiles[v2->sNumTiles].uSection;
|
|
658 *(char *)v49 |= 2u;
|
|
659 goto LABEL_151;
|
|
660 }
|
|
661 if ( !_stricmp(v35, "TTsect_N_E") )
|
|
662 {
|
|
663 v50 = (int)&v2->pTiles[v2->sNumTiles].uSection;
|
|
664 *(char *)v50 |= 3u;
|
|
665 goto LABEL_151;
|
|
666 }
|
|
667 if ( !_stricmp(v35, "TTsect_N_W") )
|
|
668 {
|
|
669 v51 = (int)&v2->pTiles[v2->sNumTiles].uSection;
|
|
670 *(char *)v51 |= 4u;
|
|
671 goto LABEL_151;
|
|
672 }
|
|
673 if ( !_stricmp(v35, "TTsect_S_E") )
|
|
674 {
|
|
675 v52 = (int)&v2->pTiles[v2->sNumTiles].uSection;
|
|
676 *(char *)v52 |= 5u;
|
|
677 goto LABEL_151;
|
|
678 }
|
|
679 if ( !_stricmp(v35, "TTsect_S_W") )
|
|
680 {
|
|
681 v53 = (int)&v2->pTiles[v2->sNumTiles].uSection;
|
|
682 *(char *)v53 |= 6u;
|
|
683 goto LABEL_151;
|
|
684 }
|
|
685 if ( !_stricmp(v35, "TTsect_NS_E") )
|
|
686 {
|
|
687 v54 = (int)&v2->pTiles[v2->sNumTiles].uSection;
|
|
688 *(char *)v54 |= 7u;
|
|
689 goto LABEL_151;
|
|
690 }
|
|
691 if ( !_stricmp(v35, "TTsect_NS_W") )
|
|
692 {
|
|
693 v55 = (int)&v2->pTiles[v2->sNumTiles].uSection;
|
|
694 *(char *)v55 |= 8u;
|
|
695 goto LABEL_151;
|
|
696 }
|
|
697 if ( !_stricmp(v35, "TTsect_EW_N") )
|
|
698 {
|
|
699 v56 = (int)&v2->pTiles[v2->sNumTiles].uSection;
|
|
700 *(char *)v56 |= 9u;
|
|
701 goto LABEL_151;
|
|
702 }
|
|
703 if ( !_stricmp(v35, "TTsect_EW_S") )
|
|
704 {
|
|
705 v57 = (int)&v2->pTiles[v2->sNumTiles].uSection;
|
|
706 *(char *)v57 |= 0xAu;
|
|
707 goto LABEL_151;
|
|
708 }
|
|
709 if ( !_stricmp(v35, "TTsect_NCAP") )
|
|
710 {
|
|
711 v58 = (int)&v2->pTiles[v2->sNumTiles].uSection;
|
|
712 *(char *)v58 |= 0xBu;
|
|
713 goto LABEL_151;
|
|
714 }
|
|
715 if ( !_stricmp(v35, "TTsect_ECAP") )
|
|
716 {
|
|
717 LABEL_130:
|
|
718 v59 = (int)&v2->pTiles[v2->sNumTiles].uSection;
|
|
719 *(char *)v59 |= 0xCu;
|
|
720 goto LABEL_151;
|
|
721 }
|
|
722 if ( !_stricmp(v35, "TTsect_SCAP") )
|
|
723 {
|
|
724 v60 = (int)&v2->pTiles[v2->sNumTiles].uSection;
|
|
725 *(char *)v60 |= 0xDu;
|
|
726 goto LABEL_151;
|
|
727 }
|
|
728 if ( !_stricmp(v35, "TTsect_WCAP") )
|
|
729 {
|
|
730 LABEL_134:
|
|
731 v61 = (int)&v2->pTiles[v2->sNumTiles].uSection;
|
|
732 *(char *)v61 |= 0xEu;
|
|
733 goto LABEL_151;
|
|
734 }
|
|
735 if ( !_stricmp(v35, "TTsect_DN") )
|
|
736 {
|
|
737 v62 = (int)&v2->pTiles[v2->sNumTiles].uSection;
|
|
738 *(char *)v62 |= 0xFu;
|
|
739 goto LABEL_151;
|
|
740 }
|
|
741 if ( !_stricmp(v35, "TTsect_DS") )
|
|
742 {
|
|
743 LABEL_138:
|
|
744 v63 = (int)&v2->pTiles[v2->sNumTiles].uSection;
|
|
745 *(char *)v63 |= 0x10u;
|
|
746 goto LABEL_151;
|
|
747 }
|
|
748 if ( !_stricmp(v35, "TTsect_DW") )
|
|
749 {
|
|
750 LABEL_140:
|
|
751 v64 = (int)&v2->pTiles[v2->sNumTiles].uSection;
|
|
752 *(char *)v64 |= 0x11u;
|
|
753 goto LABEL_151;
|
|
754 }
|
|
755 if ( !_stricmp(v35, "TTsect_DE") )
|
|
756 {
|
|
757 LABEL_142:
|
|
758 v65 = (int)&v2->pTiles[v2->sNumTiles].uSection;
|
|
759 *(char *)v65 |= 0x12u;
|
|
760 goto LABEL_151;
|
|
761 }
|
|
762 if ( !_stricmp(v35, "TTsect_DSW") )
|
|
763 {
|
|
764 LABEL_144:
|
|
765 v66 = (int)&v2->pTiles[v2->sNumTiles].uSection;
|
|
766 *(char *)v66 |= 0x13u;
|
|
767 goto LABEL_151;
|
|
768 }
|
|
769 if ( !_stricmp(v35, "TTsect_DNE") )
|
|
770 {
|
|
771 LABEL_146:
|
|
772 v67 = (int)&v2->pTiles[v2->sNumTiles].uSection;
|
|
773 *(char *)v67 |= 0x14u;
|
|
774 goto LABEL_151;
|
|
775 }
|
|
776 if ( !_stricmp(v35, "TTsect_DSE") )
|
|
777 {
|
|
778 v68 = (int)&v2->pTiles[v2->sNumTiles].uSection;
|
|
779 *(char *)v68 |= 0x15u;
|
|
780 goto LABEL_151;
|
|
781 }
|
|
782 if ( _stricmp(v35, "TTsect_DNW") )
|
|
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
|