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