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