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