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