annotate TileTable.cpp @ 2274:90f56da08d76

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