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