author | tron |
Fri, 04 Feb 2005 20:17:15 +0000 | |
changeset 1293 | be96e2bf9b3c |
parent 1209 | 2e00193652b2 |
child 1298 | d04721ba07f9 |
permissions | -rw-r--r-- |
0 | 1 |
#include "stdafx.h" |
2 |
#include "ttd.h" |
|
507
04b5403aaf6b
(svn r815) Include strings.h only in the files which need it.
tron
parents:
473
diff
changeset
|
3 |
#include "table/strings.h" |
679
04ca2cd69420
(svn r1117) Move map arrays and some related macros into their own files map.c and map.h
tron
parents:
507
diff
changeset
|
4 |
#include "map.h" |
1209
2e00193652b2
(svn r1713) Split off several functions which query/set information about a single tile from map.h and put them into a seperate file tile.h
tron
parents:
1202
diff
changeset
|
5 |
#include "tile.h" |
0 | 6 |
#include "viewport.h" |
7 |
#include "command.h" |
|
8 |
||
9 |
typedef struct TerraformerHeightMod { |
|
10 |
TileIndex tile; |
|
11 |
byte height; |
|
12 |
} TerraformerHeightMod; |
|
13 |
||
14 |
typedef struct TerraformerState { |
|
15 |
int height[4]; |
|
16 |
uint32 flags; |
|
17 |
||
18 |
int direction; |
|
19 |
int modheight_count; |
|
20 |
int tile_table_count; |
|
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
159
diff
changeset
|
21 |
|
0 | 22 |
int32 cost; |
23 |
||
24 |
TileIndex *tile_table; |
|
25 |
TerraformerHeightMod *modheight; |
|
26 |
||
27 |
} TerraformerState; |
|
28 |
||
29 |
static int TerraformAllowTileProcess(TerraformerState *ts, TileIndex tile) |
|
30 |
{ |
|
31 |
TileIndex *t; |
|
32 |
int count; |
|
33 |
||
926
a6d140a6a4de
(svn r1414) Move TileIndex, TILE_MASK and GET_TILE_[XY] to map.h and turn the latter into inline functions names Tile[XY]
tron
parents:
909
diff
changeset
|
34 |
if (TileX(tile) == MapMaxX() || TileY(tile) == MapMaxY()) |
0 | 35 |
return -1; |
36 |
||
37 |
t = ts->tile_table; |
|
38 |
for(count = ts->tile_table_count; count != 0; count--,t++) { |
|
39 |
if (*t == tile) |
|
40 |
return 0; |
|
41 |
} |
|
42 |
||
43 |
return 1; |
|
44 |
} |
|
45 |
||
46 |
static int TerraformGetHeightOfTile(TerraformerState *ts, TileIndex tile) |
|
47 |
{ |
|
48 |
TerraformerHeightMod *mod = ts->modheight; |
|
49 |
int count; |
|
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
159
diff
changeset
|
50 |
|
0 | 51 |
for(count = ts->modheight_count; count != 0; count--, mod++) { |
52 |
if (mod->tile == tile) |
|
53 |
return mod->height; |
|
54 |
} |
|
55 |
||
1044
63e0601a43cc
(svn r1545) Add TileHeight() which returns the height (not multiplied by 8)
tron
parents:
1035
diff
changeset
|
56 |
return TileHeight(tile); |
0 | 57 |
} |
58 |
||
59 |
static void TerraformAddDirtyTile(TerraformerState *ts, TileIndex tile) |
|
60 |
{ |
|
61 |
int count; |
|
62 |
TileIndex *t; |
|
63 |
||
64 |
count = ts->tile_table_count; |
|
65 |
||
66 |
if (count >= 625) |
|
67 |
return; |
|
68 |
||
69 |
for(t = ts->tile_table; count != 0; count--,t++) { |
|
70 |
if (*t == tile) |
|
71 |
return; |
|
72 |
} |
|
73 |
||
74 |
ts->tile_table[ts->tile_table_count++] = tile; |
|
75 |
} |
|
76 |
||
77 |
static void TerraformAddDirtyTileAround(TerraformerState *ts, TileIndex tile) |
|
78 |
{ |
|
79 |
TerraformAddDirtyTile(ts, tile+TILE_XY(0,-1)); |
|
80 |
TerraformAddDirtyTile(ts, tile+TILE_XY(-1,-1)); |
|
81 |
TerraformAddDirtyTile(ts, tile+TILE_XY(-1,0)); |
|
82 |
TerraformAddDirtyTile(ts, tile); |
|
83 |
} |
|
84 |
||
85 |
static int TerraformProc(TerraformerState *ts, uint tile, int mode) |
|
86 |
{ |
|
87 |
int r; |
|
88 |
int32 ret; |
|
89 |
||
863
6a1444534f62
(svn r1344) Use MapSize[XY]() (or MapSize()/MapMax[XY]() where appropriate) instead of TILES_[XY]
tron
parents:
856
diff
changeset
|
90 |
assert(tile < MapSize()); |
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
159
diff
changeset
|
91 |
|
0 | 92 |
if ((r=TerraformAllowTileProcess(ts, tile)) <= 0) |
93 |
return r; |
|
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
159
diff
changeset
|
94 |
|
1044
63e0601a43cc
(svn r1545) Add TileHeight() which returns the height (not multiplied by 8)
tron
parents:
1035
diff
changeset
|
95 |
if (IsTileType(tile, MP_RAILWAY)) { |
0 | 96 |
static const byte _railway_modes[4] = {8, 0x10, 4, 0x20}; |
97 |
static const byte _railway_dangslopes[4] = {0xd, 0xe, 7, 0xb}; |
|
345
ba68d5714caf
(svn r526) -Fix: [1035303] bug about lowering tracks built on slopes
tron
parents:
193
diff
changeset
|
98 |
static const byte _railway_dangslopes2[4] = {0x2, 0x1, 0x8, 0x4}; |
0 | 99 |
|
100 |
// Nothing could be built at the steep slope - this avoids a bug |
|
101 |
// when you have a single diagonal track in one corner on a |
|
345
ba68d5714caf
(svn r526) -Fix: [1035303] bug about lowering tracks built on slopes
tron
parents:
193
diff
changeset
|
102 |
// basement and then you raise/lower the other corner. |
ba68d5714caf
(svn r526) -Fix: [1035303] bug about lowering tracks built on slopes
tron
parents:
193
diff
changeset
|
103 |
int tileh = GetTileSlope(tile, NULL) & 0xF; |
ba68d5714caf
(svn r526) -Fix: [1035303] bug about lowering tracks built on slopes
tron
parents:
193
diff
changeset
|
104 |
if (tileh == _railway_dangslopes[mode] || |
ba68d5714caf
(svn r526) -Fix: [1035303] bug about lowering tracks built on slopes
tron
parents:
193
diff
changeset
|
105 |
tileh == _railway_dangslopes2[mode]) { |
ba68d5714caf
(svn r526) -Fix: [1035303] bug about lowering tracks built on slopes
tron
parents:
193
diff
changeset
|
106 |
_terraform_err_tile = tile; |
0 | 107 |
_error_message = STR_1008_MUST_REMOVE_RAILROAD_TRACK; |
108 |
return -1; |
|
109 |
} |
|
110 |
||
111 |
// If we have a single diagonal track there, the other side of |
|
112 |
// tile can be terraformed. |
|
113 |
if ((_map5[tile]&~0x40) == _railway_modes[mode]) |
|
114 |
return 0; |
|
115 |
} |
|
116 |
||
117 |
ret = DoCommandByTile(tile, 0,0, ts->flags & ~DC_EXEC, CMD_LANDSCAPE_CLEAR); |
|
118 |
||
119 |
if (ret == CMD_ERROR) { |
|
120 |
_terraform_err_tile = tile; |
|
121 |
return -1; |
|
122 |
} |
|
123 |
||
124 |
ts->cost += ret; |
|
125 |
||
126 |
if (ts->tile_table_count >= 625) |
|
127 |
return -1; |
|
128 |
ts->tile_table[ts->tile_table_count++] = tile; |
|
129 |
||
130 |
return 0; |
|
131 |
} |
|
132 |
||
133 |
static bool TerraformTileHeight(TerraformerState *ts, uint tile, int height) |
|
134 |
{ |
|
135 |
int nh; |
|
136 |
TerraformerHeightMod *mod; |
|
137 |
int count; |
|
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
159
diff
changeset
|
138 |
|
863
6a1444534f62
(svn r1344) Use MapSize[XY]() (or MapSize()/MapMax[XY]() where appropriate) instead of TILES_[XY]
tron
parents:
856
diff
changeset
|
139 |
assert(tile < MapSize()); |
0 | 140 |
|
141 |
if (height < 0) { |
|
142 |
_error_message = STR_1003_ALREADY_AT_SEA_LEVEL; |
|
143 |
return false; |
|
144 |
} |
|
145 |
||
146 |
_error_message = STR_1004_TOO_HIGH; |
|
147 |
||
148 |
if (height > 0xF) |
|
149 |
return false; |
|
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
159
diff
changeset
|
150 |
|
0 | 151 |
nh = TerraformGetHeightOfTile(ts, tile); |
152 |
if (nh < 0 || height == nh) |
|
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
159
diff
changeset
|
153 |
return false; |
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
159
diff
changeset
|
154 |
|
0 | 155 |
if (TerraformProc(ts, tile, 0)<0) |
156 |
return false; |
|
157 |
||
158 |
if (TerraformProc(ts, tile + TILE_XY(0,-1), 1)<0) |
|
159 |
return false; |
|
160 |
||
161 |
if (TerraformProc(ts, tile + TILE_XY(-1,-1), 2)<0) |
|
162 |
return false; |
|
163 |
||
164 |
if (TerraformProc(ts, tile + TILE_XY(-1,0), 3)<0) |
|
165 |
return false; |
|
166 |
||
167 |
mod = ts->modheight; |
|
168 |
count = ts->modheight_count; |
|
169 |
||
170 |
for(;;) { |
|
171 |
if (count == 0) { |
|
172 |
if (ts->modheight_count >= 576) |
|
173 |
return false; |
|
174 |
ts->modheight_count++; |
|
175 |
break; |
|
176 |
} |
|
177 |
if (mod->tile == (TileIndex)tile) |
|
178 |
break; |
|
179 |
mod++; |
|
180 |
count--; |
|
181 |
} |
|
182 |
||
183 |
mod->tile = (TileIndex)tile; |
|
184 |
mod->height = (byte)height; |
|
185 |
||
186 |
ts->cost += _price.terraform; |
|
187 |
||
188 |
{ |
|
189 |
int direction = ts->direction, r; |
|
909
65cdb609b7a6
(svn r1396) Introduce TileIndexDiffC - the compile time version of TileIndexDiff
tron
parents:
900
diff
changeset
|
190 |
const TileIndexDiffC *ttm; |
0 | 191 |
|
909
65cdb609b7a6
(svn r1396) Introduce TileIndexDiffC - the compile time version of TileIndexDiff
tron
parents:
900
diff
changeset
|
192 |
static const TileIndexDiffC _terraform_tilepos[] = { |
65cdb609b7a6
(svn r1396) Introduce TileIndexDiffC - the compile time version of TileIndexDiff
tron
parents:
900
diff
changeset
|
193 |
{ 1, 0}, |
65cdb609b7a6
(svn r1396) Introduce TileIndexDiffC - the compile time version of TileIndexDiff
tron
parents:
900
diff
changeset
|
194 |
{-2, 0}, |
65cdb609b7a6
(svn r1396) Introduce TileIndexDiffC - the compile time version of TileIndexDiff
tron
parents:
900
diff
changeset
|
195 |
{ 1, 1}, |
65cdb609b7a6
(svn r1396) Introduce TileIndexDiffC - the compile time version of TileIndexDiff
tron
parents:
900
diff
changeset
|
196 |
{ 0, -2} |
65cdb609b7a6
(svn r1396) Introduce TileIndexDiffC - the compile time version of TileIndexDiff
tron
parents:
900
diff
changeset
|
197 |
}; |
0 | 198 |
|
909
65cdb609b7a6
(svn r1396) Introduce TileIndexDiffC - the compile time version of TileIndexDiff
tron
parents:
900
diff
changeset
|
199 |
for(ttm = _terraform_tilepos; ttm != endof(_terraform_tilepos); ttm++) { |
65cdb609b7a6
(svn r1396) Introduce TileIndexDiffC - the compile time version of TileIndexDiff
tron
parents:
900
diff
changeset
|
200 |
tile += ToTileIndexDiff(*ttm); |
0 | 201 |
|
202 |
r = TerraformGetHeightOfTile(ts, tile); |
|
203 |
if (r != height && r-direction != height && r+direction != height) { |
|
204 |
if (!TerraformTileHeight(ts, tile, r+direction)) |
|
205 |
return false; |
|
206 |
} |
|
207 |
} |
|
208 |
} |
|
209 |
||
210 |
return true; |
|
211 |
} |
|
212 |
||
213 |
/* Terraform land |
|
214 |
* p1 - corners |
|
215 |
* p2 - direction |
|
216 |
*/ |
|
217 |
||
218 |
int32 CmdTerraformLand(int x, int y, uint32 flags, uint32 p1, uint32 p2) |
|
219 |
{ |
|
220 |
TerraformerState ts; |
|
221 |
uint tile; |
|
222 |
int direction; |
|
223 |
||
224 |
TerraformerHeightMod modheight_data[576]; |
|
225 |
TileIndex tile_table_data[625]; |
|
226 |
||
227 |
SET_EXPENSES_TYPE(EXPENSES_CONSTRUCTION); |
|
228 |
||
229 |
_error_message = INVALID_STRING_ID; |
|
230 |
_terraform_err_tile = 0; |
|
231 |
||
232 |
ts.direction = direction = p2 ? 1 : -1; |
|
233 |
ts.flags = flags; |
|
234 |
ts.modheight_count = ts.tile_table_count = 0; |
|
235 |
ts.cost = 0; |
|
236 |
ts.modheight = modheight_data; |
|
237 |
ts.tile_table = tile_table_data; |
|
238 |
||
239 |
tile = TILE_FROM_XY(x,y); |
|
240 |
||
241 |
if (p1 & 1) { |
|
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
159
diff
changeset
|
242 |
if (!TerraformTileHeight(&ts, tile+TILE_XY(1,0), |
1044
63e0601a43cc
(svn r1545) Add TileHeight() which returns the height (not multiplied by 8)
tron
parents:
1035
diff
changeset
|
243 |
TileHeight(tile + TILE_XY(1, 0)) + direction)) |
0 | 244 |
return CMD_ERROR; |
245 |
} |
|
246 |
||
247 |
if (p1 & 2) { |
|
248 |
if (!TerraformTileHeight(&ts, tile+TILE_XY(1,1), |
|
1044
63e0601a43cc
(svn r1545) Add TileHeight() which returns the height (not multiplied by 8)
tron
parents:
1035
diff
changeset
|
249 |
TileHeight(tile + TILE_XY(1, 1)) + direction)) |
0 | 250 |
return CMD_ERROR; |
251 |
} |
|
252 |
||
253 |
if (p1 & 4) { |
|
254 |
if (!TerraformTileHeight(&ts, tile+TILE_XY(0,1), |
|
1044
63e0601a43cc
(svn r1545) Add TileHeight() which returns the height (not multiplied by 8)
tron
parents:
1035
diff
changeset
|
255 |
TileHeight(tile + TILE_XY(0, 1)) + direction)) |
0 | 256 |
return CMD_ERROR; |
257 |
} |
|
258 |
||
259 |
if (p1 & 8) { |
|
260 |
if (!TerraformTileHeight(&ts, tile+TILE_XY(0,0), |
|
1044
63e0601a43cc
(svn r1545) Add TileHeight() which returns the height (not multiplied by 8)
tron
parents:
1035
diff
changeset
|
261 |
TileHeight(tile + TILE_XY(0, 0)) + direction)) |
0 | 262 |
return CMD_ERROR; |
263 |
} |
|
264 |
||
265 |
if (direction == -1) { |
|
266 |
/* Check if tunnel would take damage */ |
|
267 |
int count; |
|
268 |
TileIndex *ti = ts.tile_table; |
|
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
159
diff
changeset
|
269 |
|
0 | 270 |
for(count = ts.tile_table_count; count != 0; count--, ti++) { |
271 |
uint z, t; |
|
272 |
uint tile = *ti; |
|
273 |
||
274 |
z = TerraformGetHeightOfTile(&ts, tile + TILE_XY(0,0)); |
|
275 |
t = TerraformGetHeightOfTile(&ts, tile + TILE_XY(1,0)); |
|
276 |
if (t <= z) z = t; |
|
277 |
t = TerraformGetHeightOfTile(&ts, tile + TILE_XY(1,1)); |
|
278 |
if (t <= z) z = t; |
|
279 |
t = TerraformGetHeightOfTile(&ts, tile + TILE_XY(0,1)); |
|
280 |
if (t <= z) z = t; |
|
281 |
||
282 |
if (!CheckTunnelInWay(tile, z*8)) |
|
283 |
return_cmd_error(STR_1002_EXCAVATION_WOULD_DAMAGE); |
|
284 |
} |
|
285 |
} |
|
286 |
||
287 |
if (flags & DC_EXEC) { |
|
288 |
/* Clear the landscape at the tiles */ |
|
289 |
{ |
|
290 |
int count; |
|
291 |
TileIndex *ti = ts.tile_table; |
|
292 |
for(count = ts.tile_table_count; count != 0; count--, ti++) { |
|
293 |
DoCommandByTile(*ti, 0, 0, flags, CMD_LANDSCAPE_CLEAR); |
|
294 |
} |
|
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
159
diff
changeset
|
295 |
} |
0 | 296 |
|
297 |
/* change the height */ |
|
298 |
{ |
|
299 |
int count; |
|
300 |
TerraformerHeightMod *mod; |
|
301 |
uint til; |
|
302 |
||
303 |
mod = ts.modheight; |
|
304 |
for(count = ts.modheight_count; count != 0; count--, mod++) { |
|
305 |
til = mod->tile; |
|
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
159
diff
changeset
|
306 |
|
1059
fe97d81a1b4f
(svn r1560) Introduce SetTileType() and SetTileHeight()
tron
parents:
1044
diff
changeset
|
307 |
SetTileHeight(til, mod->height); |
0 | 308 |
TerraformAddDirtyTileAround(&ts, til); |
309 |
} |
|
310 |
} |
|
311 |
||
312 |
/* finally mark the dirty tiles dirty */ |
|
313 |
{ |
|
314 |
int count; |
|
315 |
TileIndex *ti = ts.tile_table; |
|
316 |
for(count = ts.tile_table_count; count != 0; count--, ti++) { |
|
317 |
MarkTileDirtyByTile(*ti); |
|
318 |
} |
|
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
159
diff
changeset
|
319 |
} |
0 | 320 |
} |
321 |
return ts.cost; |
|
322 |
} |
|
323 |
||
324 |
||
325 |
/* |
|
326 |
* p1 - start |
|
327 |
*/ |
|
328 |
||
329 |
int32 CmdLevelLand(int ex, int ey, uint32 flags, uint32 p1, uint32 p2) |
|
330 |
{ |
|
331 |
int size_x, size_y; |
|
332 |
int sx, sy; |
|
333 |
uint h, curh; |
|
334 |
uint tile; |
|
335 |
int32 ret, cost, money; |
|
336 |
||
889
64d2f7d5f02b
(svn r1375) -Fix: [1050990] Buying trains sometimes accounted for incorrectly. Was the result of the cost getting reset in a recursive call of docommand. That is fixed. In addition all cost-commands are typed explicitely. Please do not forget to do so or your costs will be credited to construction if you are unlucky.
darkvater
parents:
863
diff
changeset
|
337 |
SET_EXPENSES_TYPE(EXPENSES_CONSTRUCTION); |
64d2f7d5f02b
(svn r1375) -Fix: [1050990] Buying trains sometimes accounted for incorrectly. Was the result of the cost getting reset in a recursive call of docommand. That is fixed. In addition all cost-commands are typed explicitely. Please do not forget to do so or your costs will be credited to construction if you are unlucky.
darkvater
parents:
863
diff
changeset
|
338 |
|
0 | 339 |
// remember level height |
1044
63e0601a43cc
(svn r1545) Add TileHeight() which returns the height (not multiplied by 8)
tron
parents:
1035
diff
changeset
|
340 |
h = TileHeight(p1); |
0 | 341 |
|
342 |
ex >>= 4; ey >>= 4; |
|
343 |
||
344 |
// make sure sx,sy are smaller than ex,ey |
|
926
a6d140a6a4de
(svn r1414) Move TileIndex, TILE_MASK and GET_TILE_[XY] to map.h and turn the latter into inline functions names Tile[XY]
tron
parents:
909
diff
changeset
|
345 |
sx = TileX(p1); |
a6d140a6a4de
(svn r1414) Move TileIndex, TILE_MASK and GET_TILE_[XY] to map.h and turn the latter into inline functions names Tile[XY]
tron
parents:
909
diff
changeset
|
346 |
sy = TileY(p1); |
0 | 347 |
if (ex < sx) intswap(ex, sx); |
348 |
if (ey < sy) intswap(ey, sy); |
|
349 |
tile = TILE_XY(sx,sy); |
|
350 |
||
351 |
size_x = ex-sx+1; |
|
352 |
size_y = ey-sy+1; |
|
353 |
||
354 |
money = GetAvailableMoneyForCommand(); |
|
355 |
cost = 0; |
|
356 |
||
357 |
BEGIN_TILE_LOOP(tile2, size_x, size_y, tile) |
|
1044
63e0601a43cc
(svn r1545) Add TileHeight() which returns the height (not multiplied by 8)
tron
parents:
1035
diff
changeset
|
358 |
curh = TileHeight(tile2); |
0 | 359 |
while (curh != h) { |
360 |
ret = DoCommandByTile(tile2, 8, (curh > h)?0:1, flags & ~DC_EXEC, CMD_TERRAFORM_LAND); |
|
361 |
if (ret == CMD_ERROR) break; |
|
362 |
cost += ret; |
|
363 |
||
364 |
if (flags & DC_EXEC) { |
|
365 |
if ((money -= ret) < 0) { |
|
366 |
_additional_cash_required = ret; |
|
367 |
return cost - ret; |
|
368 |
} |
|
369 |
DoCommandByTile(tile2, 8, (curh > h)?0:1, flags, CMD_TERRAFORM_LAND); |
|
370 |
} |
|
371 |
||
372 |
curh += (curh > h) ? -1 : 1; |
|
373 |
} |
|
374 |
END_TILE_LOOP(tile2, size_x, size_y, tile) |
|
375 |
||
376 |
if (cost == 0) return CMD_ERROR; |
|
377 |
return cost; |
|
378 |
} |
|
379 |
||
380 |
/* Purchase a land area |
|
381 |
* p1 = unused |
|
382 |
* p2 = unused |
|
383 |
*/ |
|
384 |
||
385 |
int32 CmdPurchaseLandArea(int x, int y, uint32 flags, uint32 p1, uint32 p2) |
|
386 |
{ |
|
387 |
uint tile; |
|
388 |
int32 cost; |
|
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
159
diff
changeset
|
389 |
|
0 | 390 |
SET_EXPENSES_TYPE(EXPENSES_CONSTRUCTION); |
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
159
diff
changeset
|
391 |
|
0 | 392 |
tile = TILE_FROM_XY(x,y); |
393 |
||
394 |
if (!EnsureNoVehicle(tile)) |
|
395 |
return CMD_ERROR; |
|
396 |
||
1035
812f837ee03f
(svn r1536) Move GET_TILEHEIGHT, GET_TILETYPE and IS_TILETYPE to map.h, turn them into inline functions and add some asserts
tron
parents:
926
diff
changeset
|
397 |
if (IsTileType(tile, MP_UNMOVABLE) && |
0 | 398 |
_map5[tile] == 3 && |
399 |
_map_owner[tile] == _current_player) |
|
400 |
return_cmd_error(STR_5807_YOU_ALREADY_OWN_IT); |
|
401 |
||
402 |
cost = DoCommandByTile(tile, 0, 0, flags, CMD_LANDSCAPE_CLEAR); |
|
403 |
if (cost == CMD_ERROR) |
|
404 |
return CMD_ERROR; |
|
405 |
||
406 |
if (flags & DC_EXEC) { |
|
407 |
ModifyTile(tile, |
|
408 |
MP_SETTYPE(MP_UNMOVABLE) | MP_MAPOWNER_CURRENT | MP_MAP5, |
|
409 |
3 /* map5 */ |
|
410 |
); |
|
411 |
} |
|
412 |
||
413 |
return cost + _price.purchase_land * 10; |
|
414 |
} |
|
415 |
||
416 |
||
1095 | 417 |
static int32 ClearTile_Clear(uint tile, byte flags) |
418 |
{ |
|
0 | 419 |
static const int32 * _clear_price_table[] = { |
420 |
NULL, |
|
421 |
&_price.clear_1, &_price.clear_1,&_price.clear_1, |
|
422 |
&_price.purchase_land,&_price.purchase_land,&_price.purchase_land,&_price.purchase_land, |
|
423 |
&_price.clear_2,&_price.clear_2,&_price.clear_2,&_price.clear_2, |
|
424 |
&_price.clear_3,&_price.clear_3,&_price.clear_3,&_price.clear_3, |
|
425 |
&_price.purchase_land,&_price.purchase_land,&_price.purchase_land,&_price.purchase_land, |
|
426 |
&_price.purchase_land,&_price.purchase_land,&_price.purchase_land,&_price.purchase_land, |
|
427 |
&_price.clear_2,&_price.clear_2,&_price.clear_2,&_price.clear_2, |
|
428 |
}; |
|
429 |
const int32 *price = _clear_price_table[_map5[tile] & 0x1F]; |
|
430 |
||
431 |
if (flags & DC_EXEC) |
|
432 |
DoClearSquare(tile); |
|
433 |
||
434 |
if (price == NULL) |
|
435 |
return 0; |
|
436 |
return *price; |
|
437 |
} |
|
438 |
||
439 |
int32 CmdSellLandArea(int x, int y, uint32 flags, uint32 p1, uint32 p2) |
|
440 |
{ |
|
441 |
uint tile; |
|
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
159
diff
changeset
|
442 |
|
0 | 443 |
SET_EXPENSES_TYPE(EXPENSES_CONSTRUCTION); |
444 |
||
445 |
tile = TILE_FROM_XY(x,y); |
|
446 |
||
149
5f7d4b21df01
(svn r150) -Fix: [1010833] Turning on the magic bulldozer removes oil rigs
darkvater
parents:
39
diff
changeset
|
447 |
if (!CheckTileOwnership(tile) && _current_player != OWNER_WATER) |
0 | 448 |
return CMD_ERROR; |
449 |
||
450 |
if (!EnsureNoVehicle(tile)) |
|
451 |
return CMD_ERROR; |
|
452 |
||
453 |
if (flags & DC_EXEC) |
|
454 |
DoClearSquare(tile); |
|
455 |
||
456 |
return - _price.purchase_land*2; |
|
457 |
} |
|
458 |
||
459 |
||
460 |
#include "table/clear_land.h" |
|
461 |
||
462 |
||
463 |
void DrawClearLandTile(TileInfo *ti, byte set) |
|
464 |
{ |
|
465 |
DrawGroundSprite(0xF54 + _tileh_to_sprite[ti->tileh] + set * 19); |
|
466 |
} |
|
467 |
||
468 |
void DrawHillyLandTile(TileInfo *ti) |
|
469 |
{ |
|
470 |
if (ti->tileh != 0) { |
|
471 |
DrawGroundSprite(0xFA0 + _tileh_to_sprite[ti->tileh]); |
|
472 |
} else { |
|
473 |
DrawGroundSprite(_landscape_clear_sprites[((ti->x^ti->y) >> 4) & 0x7]); |
|
474 |
} |
|
475 |
} |
|
476 |
||
477 |
void DrawClearLandFence(TileInfo *ti, byte img) |
|
478 |
{ |
|
479 |
byte z = ti->z; |
|
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
159
diff
changeset
|
480 |
|
0 | 481 |
if (ti->tileh & 2) { |
482 |
z += 8; |
|
483 |
if (ti->tileh == 0x17) |
|
484 |
z += 8; |
|
485 |
} |
|
486 |
||
487 |
if (img & 0x38) { |
|
488 |
DrawGroundSpriteAt(_clear_land_fence_sprites_1[((img >> 3) & 7) - 1] + _fence_mod_by_tileh[ti->tileh], ti->x, ti->y, z); |
|
489 |
} |
|
490 |
||
491 |
if (img & 0x7) { |
|
492 |
DrawGroundSpriteAt(_clear_land_fence_sprites_1[(img & 7) - 1] + _fence_mod_by_tileh_2[ti->tileh], ti->x, ti->y, z); |
|
493 |
} |
|
494 |
} |
|
495 |
||
496 |
static void DrawTile_Clear(TileInfo *ti) |
|
497 |
{ |
|
498 |
||
499 |
switch((ti->map5 & (7<<2)) >> 2) { |
|
500 |
case 0: |
|
501 |
DrawClearLandTile(ti, (ti->map5 & 3)); |
|
502 |
break; |
|
503 |
||
504 |
case 1: |
|
505 |
DrawHillyLandTile(ti); |
|
506 |
break; |
|
507 |
||
508 |
case 2: |
|
509 |
DrawGroundSprite(0xFB7 + _tileh_to_sprite[ti->tileh]); |
|
510 |
break; |
|
511 |
||
512 |
case 3: |
|
513 |
DrawGroundSprite( _clear_land_sprites_1[_map3_lo[ti->tile]&0xF] + _tileh_to_sprite[ti->tileh]); |
|
514 |
break; |
|
515 |
||
516 |
case 4: |
|
517 |
DrawGroundSprite( _clear_land_sprites_2[ti->map5&3] + _tileh_to_sprite[ti->tileh]); |
|
518 |
break; |
|
519 |
||
520 |
case 5: |
|
521 |
DrawGroundSprite( _clear_land_sprites_3[ti->map5&3] + _tileh_to_sprite[ti->tileh]); |
|
522 |
break; |
|
523 |
} |
|
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
159
diff
changeset
|
524 |
|
0 | 525 |
DrawClearLandFence(ti, _map3_hi[ti->tile] >> 2); |
526 |
} |
|
527 |
||
1095 | 528 |
static uint GetSlopeZ_Clear(TileInfo *ti) |
529 |
{ |
|
530 |
return GetPartialZ(ti->x & 0xF, ti->y & 0xF, ti->tileh) + ti->z; |
|
531 |
} |
|
0 | 532 |
|
1095 | 533 |
static uint GetSlopeTileh_Clear(TileInfo *ti) |
39 | 534 |
{ |
535 |
return ti->tileh; |
|
536 |
} |
|
537 |
||
473
77f0ef57e7cf
(svn r724) Remove restriction that a tile can only accept 3 cargo types.
tron
parents:
410
diff
changeset
|
538 |
static void GetAcceptedCargo_Clear(uint tile, AcceptedCargo ac) |
0 | 539 |
{ |
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
159
diff
changeset
|
540 |
/* unused */ |
0 | 541 |
} |
542 |
||
543 |
static void AnimateTile_Clear(uint tile) |
|
544 |
{ |
|
545 |
/* unused */ |
|
546 |
} |
|
547 |
||
1293 | 548 |
void TileLoopClearHelper(TileIndex tile) |
0 | 549 |
{ |
1293 | 550 |
byte img_1; |
551 |
byte img_2; |
|
552 |
static byte img_by_map5[] = { 0, 0, 0, 2, 1, 1, 0, 0 }; |
|
553 |
TileIndex dirty = INVALID_TILE; |
|
0 | 554 |
|
1293 | 555 |
switch (GetTileType(tile)) { |
556 |
case MP_CLEAR: |
|
557 |
img_1 = img_by_map5[(_map5[tile] & 0x1C) >> 2]; |
|
558 |
break; |
|
559 |
||
560 |
case MP_TREES: |
|
561 |
if ((_map2[tile] & 0x30) == 0x20) |
|
562 |
img_1 = 1; |
|
563 |
else |
|
564 |
img_1 = 0; |
|
565 |
||
566 |
default: |
|
567 |
img_1 = 0; |
|
568 |
break; |
|
0 | 569 |
} |
570 |
||
1293 | 571 |
switch (GetTileType(TILE_ADDXY(tile, 1, 0))) { |
572 |
case MP_CLEAR: |
|
573 |
img_2 = img_by_map5[(_map5[TILE_ADDXY(tile, 1, 0)] & 0x1C) >> 2]; |
|
574 |
break; |
|
575 |
||
576 |
case MP_TREES: |
|
577 |
if ((_map2[TILE_ADDXY(tile, 1, 0)] & 0x30) == 0x20) |
|
578 |
img_2 = 1; |
|
579 |
else |
|
580 |
img_2 = 0; |
|
581 |
break; |
|
582 |
||
583 |
default: |
|
584 |
img_2 = 0; |
|
585 |
break; |
|
0 | 586 |
} |
587 |
||
1293 | 588 |
if ((_map3_hi[tile] & 0xE0) == 0) { |
589 |
if ((img_1 & 2) != (img_2 & 2)) { |
|
0 | 590 |
_map3_hi[tile] |= 3 << 5; |
591 |
dirty = tile; |
|
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
159
diff
changeset
|
592 |
} |
0 | 593 |
} else { |
594 |
if (img_1 == 1 && img_2 == 1) { |
|
595 |
_map3_hi[tile] &= ~(3 << 5); |
|
596 |
dirty = tile; |
|
597 |
} |
|
598 |
} |
|
599 |
||
1293 | 600 |
switch (GetTileType(TILE_ADDXY(tile, 0, 1))) { |
601 |
case MP_CLEAR: |
|
602 |
img_2 = img_by_map5[(_map5[TILE_ADDXY(tile, 1, 0)] & 0x1C) >> 2]; |
|
603 |
break; |
|
604 |
||
605 |
case MP_TREES: |
|
606 |
if ((_map2[TILE_ADDXY(tile, 0, 1)] & 0x30) == 0x20) |
|
607 |
img_2 = 1; |
|
608 |
else |
|
609 |
img_2 = 0; |
|
610 |
break; |
|
611 |
||
612 |
default: |
|
613 |
img_2 = 0; |
|
614 |
break; |
|
0 | 615 |
} |
616 |
||
1293 | 617 |
if ((_map3_hi[tile] & 0x1C) == 0) { |
618 |
if ((img_1 & 2) != (img_2 & 2)) { |
|
0 | 619 |
_map3_hi[tile] |= 3 << 2; |
620 |
dirty = tile; |
|
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
159
diff
changeset
|
621 |
} |
0 | 622 |
} else { |
623 |
if (img_1 == 1 && img_2 == 1) { |
|
624 |
_map3_hi[tile] &= ~(3 << 2); |
|
625 |
dirty = tile; |
|
626 |
} |
|
627 |
} |
|
628 |
||
1293 | 629 |
if (dirty != INVALID_TILE) |
0 | 630 |
MarkTileDirtyByTile(dirty); |
631 |
} |
|
632 |
||
633 |
||
634 |
/* convert into snowy tiles */ |
|
635 |
static void TileLoopClearAlps(uint tile) |
|
636 |
{ |
|
637 |
int k; |
|
638 |
byte m5,tmp; |
|
639 |
||
640 |
/* distance from snow line, in steps of 8 */ |
|
641 |
k = GetTileZ(tile) - _opt.snow_line; |
|
642 |
||
643 |
m5 = _map5[tile] & 0x1C; |
|
644 |
tmp = _map5[tile] & 3; |
|
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
159
diff
changeset
|
645 |
|
0 | 646 |
if (k < -8) { |
647 |
/* snow_m2_down */ |
|
648 |
if (m5 != 0x10) |
|
649 |
return; |
|
650 |
if (tmp == 0) |
|
651 |
m5 = 3; |
|
652 |
} else if (k == -8) { |
|
653 |
/* snow_m1 */ |
|
654 |
if (m5 != 0x10) { |
|
655 |
m5 = 0x10; |
|
656 |
} else if (tmp != 0) { |
|
657 |
m5 = (tmp - 1) + 0x10; |
|
658 |
} else |
|
659 |
return; |
|
660 |
} else if (k < 8) { |
|
661 |
/* snow_0 */ |
|
662 |
if (m5 != 0x10) { |
|
663 |
m5 = 0x10; |
|
664 |
} else if (tmp != 1) { |
|
665 |
m5 = 1; |
|
666 |
if (tmp != 0) |
|
667 |
m5 = tmp - 1; |
|
668 |
m5 += 0x10; |
|
669 |
} else |
|
670 |
return; |
|
671 |
} else if (k == 8) { |
|
672 |
/* snow_p1 */ |
|
673 |
if (m5 != 0x10) { |
|
674 |
m5 = 0x10; |
|
675 |
} else if (tmp != 2) { |
|
676 |
m5 = 2; |
|
677 |
if (tmp <= 2) |
|
678 |
m5 = tmp + 1; |
|
679 |
m5 += 0x10; |
|
680 |
} else |
|
681 |
return; |
|
682 |
} else { |
|
683 |
/* snow_p2_up */ |
|
684 |
if (m5 != 0x10) { |
|
685 |
m5 = 0x10; |
|
686 |
} else if (tmp != 3) { |
|
687 |
m5 = tmp + 1 + 0x10; |
|
688 |
} else |
|
689 |
return; |
|
690 |
} |
|
691 |
||
692 |
_map5[tile] = m5; |
|
693 |
MarkTileDirtyByTile(tile); |
|
694 |
} |
|
695 |
||
696 |
static void TileLoopClearDesert(uint tile) |
|
697 |
{ |
|
698 |
if ( (_map5[tile] & 0x1C) == 0x14) |
|
699 |
return; |
|
700 |
||
701 |
if (GetMapExtraBits(tile) == 1) { |
|
702 |
_map5[tile] = 0x17; |
|
703 |
} else { |
|
704 |
if (GetMapExtraBits(tile+TILE_XY(1,0)) != 1 && |
|
705 |
GetMapExtraBits(tile+TILE_XY(-1,0)) != 1 && |
|
706 |
GetMapExtraBits(tile+TILE_XY(0,1)) != 1 && |
|
707 |
GetMapExtraBits(tile+TILE_XY(0,-1)) != 1) |
|
708 |
return; |
|
709 |
_map5[tile] = 0x15; |
|
710 |
} |
|
711 |
||
712 |
MarkTileDirtyByTile(tile); |
|
713 |
} |
|
714 |
||
715 |
static void TileLoop_Clear(uint tile) |
|
716 |
{ |
|
717 |
byte m5,m3; |
|
718 |
||
719 |
TileLoopClearHelper(tile); |
|
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
159
diff
changeset
|
720 |
|
0 | 721 |
if (_opt.landscape == LT_DESERT) { |
722 |
TileLoopClearDesert(tile); |
|
723 |
} else if (_opt.landscape == LT_HILLY) { |
|
724 |
TileLoopClearAlps(tile); |
|
725 |
} |
|
726 |
||
727 |
m5 = _map5[tile]; |
|
728 |
if ( (m5 & 0x1C) == 0x10 || (m5 & 0x1C) == 0x14) |
|
729 |
return; |
|
730 |
||
731 |
if ( (m5 & 0x1C) != 0xC) { |
|
732 |
if ( (m5 & 3) == 3) |
|
733 |
return; |
|
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
159
diff
changeset
|
734 |
|
0 | 735 |
if (_game_mode != GM_EDITOR) { |
736 |
m5 += 0x20; |
|
737 |
if (m5 >= 0x20) { |
|
738 |
// Didn't overflow |
|
739 |
_map5[tile] = m5; |
|
740 |
return; |
|
741 |
} |
|
742 |
/* did overflow, so continue */ |
|
743 |
} else { |
|
744 |
m5 = ((byte)Random() > 21) ? (2) : (6); |
|
745 |
} |
|
746 |
m5++; |
|
747 |
} else if (_game_mode != GM_EDITOR) { |
|
748 |
/* handle farm field */ |
|
749 |
m5 += 0x20; |
|
750 |
if (m5 >= 0x20) { |
|
751 |
// Didn't overflow |
|
752 |
_map5[tile] = m5; |
|
753 |
return; |
|
754 |
} |
|
755 |
/* overflowed */ |
|
756 |
m3 = _map3_lo[tile] + 1; |
|
757 |
assert( (m3 & 0xF) != 0); |
|
758 |
if ( (m3 & 0xF) >= 9) /* NOTE: will not work properly if m3&0xF == 0xF */ |
|
759 |
m3 &= ~0xF; |
|
760 |
_map3_lo[tile] = m3; |
|
761 |
} |
|
762 |
||
763 |
_map5[tile] = m5; |
|
764 |
MarkTileDirtyByTile(tile); |
|
765 |
} |
|
766 |
||
1093
4fdc46eaf423
(svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile
tron
parents:
1059
diff
changeset
|
767 |
void GenerateClearTile(void) |
0 | 768 |
{ |
769 |
int i,j; |
|
770 |
uint tile,tile_new; |
|
771 |
uint32 r; |
|
772 |
||
773 |
/* add hills */ |
|
1202
4d2a20c50760
(svn r1706) Implement ScaleByMapSize() and ScaleByMapSize1D()
tron
parents:
1130
diff
changeset
|
774 |
i = ScaleByMapSize((Random() & 0x3FF) + 0x400); |
0 | 775 |
do { |
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
159
diff
changeset
|
776 |
tile = TILE_MASK(Random()); |
1035
812f837ee03f
(svn r1536) Move GET_TILEHEIGHT, GET_TILETYPE and IS_TILETYPE to map.h, turn them into inline functions and add some asserts
tron
parents:
926
diff
changeset
|
777 |
if (IsTileType(tile, MP_CLEAR)) |
0 | 778 |
_map5[tile] = (byte)((_map5[tile] & ~(3<<2)) | (1<<2)); |
779 |
} while (--i); |
|
780 |
||
781 |
/* add grey squares */ |
|
1202
4d2a20c50760
(svn r1706) Implement ScaleByMapSize() and ScaleByMapSize1D()
tron
parents:
1130
diff
changeset
|
782 |
i = ScaleByMapSize((Random() & 0x7F) + 0x80); |
0 | 783 |
do { |
784 |
r = Random(); |
|
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
159
diff
changeset
|
785 |
tile = TILE_MASK(r); |
1035
812f837ee03f
(svn r1536) Move GET_TILEHEIGHT, GET_TILETYPE and IS_TILETYPE to map.h, turn them into inline functions and add some asserts
tron
parents:
926
diff
changeset
|
786 |
if (IsTileType(tile, MP_CLEAR)) { |
0 | 787 |
j = ((r >> 16) & 0xF) + 5; |
788 |
for(;;) { |
|
789 |
_map5[tile] = (byte)((_map5[tile] & ~(3<<2)) | (2<<2)); |
|
790 |
do { |
|
791 |
if (--j == 0) goto get_out; |
|
900 | 792 |
tile_new = tile + TileOffsByDir(Random() & 3); |
1035
812f837ee03f
(svn r1536) Move GET_TILEHEIGHT, GET_TILETYPE and IS_TILETYPE to map.h, turn them into inline functions and add some asserts
tron
parents:
926
diff
changeset
|
793 |
} while (!IsTileType(tile_new, MP_CLEAR)); |
0 | 794 |
tile = tile_new; |
795 |
} |
|
796 |
get_out:; |
|
797 |
} |
|
798 |
} while (--i); |
|
799 |
} |
|
800 |
||
801 |
static void ClickTile_Clear(uint tile) |
|
802 |
{ |
|
803 |
/* not used */ |
|
804 |
} |
|
805 |
||
410 | 806 |
static uint32 GetTileTrackStatus_Clear(uint tile, TransportType mode) |
0 | 807 |
{ |
808 |
return 0; |
|
809 |
} |
|
810 |
||
811 |
static const StringID _clear_land_str[4+8-1] = { |
|
812 |
STR_080B_ROUGH_LAND, |
|
813 |
STR_080A_ROCKS, |
|
814 |
STR_080E_FIELDS, |
|
815 |
STR_080F_SNOW_COVERED_LAND, |
|
816 |
STR_0810_DESERT, |
|
817 |
0, |
|
818 |
0, |
|
819 |
STR_080C_BARE_LAND, |
|
820 |
STR_080D_GRASS, |
|
821 |
STR_080D_GRASS, |
|
822 |
STR_080D_GRASS, |
|
823 |
}; |
|
824 |
||
825 |
static void GetTileDesc_Clear(uint tile, TileDesc *td) |
|
826 |
{ |
|
827 |
int i = (_map5[tile]>>2) & 7; |
|
828 |
if (i == 0) |
|
829 |
i = (_map5[tile] & 3) + 8; |
|
830 |
td->str = _clear_land_str[i - 1]; |
|
831 |
td->owner = _map_owner[tile]; |
|
832 |
} |
|
833 |
||
834 |
static void ChangeTileOwner_Clear(uint tile, byte old_player, byte new_player) |
|
835 |
{ |
|
836 |
return; |
|
837 |
} |
|
838 |
||
1093
4fdc46eaf423
(svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile
tron
parents:
1059
diff
changeset
|
839 |
void InitializeClearLand(void) |
4fdc46eaf423
(svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile
tron
parents:
1059
diff
changeset
|
840 |
{ |
0 | 841 |
_opt.snow_line = _patches.snow_line_height * 8; |
842 |
} |
|
843 |
||
844 |
const TileTypeProcs _tile_type_clear_procs = { |
|
845 |
DrawTile_Clear, /* draw_tile_proc */ |
|
846 |
GetSlopeZ_Clear, /* get_slope_z_proc */ |
|
847 |
ClearTile_Clear, /* clear_tile_proc */ |
|
848 |
GetAcceptedCargo_Clear, /* get_accepted_cargo_proc */ |
|
849 |
GetTileDesc_Clear, /* get_tile_desc_proc */ |
|
850 |
GetTileTrackStatus_Clear, /* get_tile_track_status_proc */ |
|
851 |
ClickTile_Clear, /* click_tile_proc */ |
|
852 |
AnimateTile_Clear, /* animate_tile_proc */ |
|
853 |
TileLoop_Clear, /* tile_loop_clear */ |
|
854 |
ChangeTileOwner_Clear, /* change_tile_owner_clear */ |
|
855 |
NULL, /* get_produced_cargo_proc */ |
|
856 |
NULL, /* vehicle_enter_tile_proc */ |
|
857 |
NULL, /* vehicle_leave_tile_proc */ |
|
39 | 858 |
GetSlopeTileh_Clear, /* get_slope_tileh_proc */ |
0 | 859 |
}; |