equal
deleted
inserted
replaced
1 /* $Id$ */ |
1 /* $Id$ */ |
2 |
2 |
3 #include "stdafx.h" |
3 #include "stdafx.h" |
4 #include "openttd.h" |
4 #include "openttd.h" |
|
5 #include "clear.h" |
5 #include "functions.h" |
6 #include "functions.h" |
6 #include "map.h" |
7 #include "map.h" |
7 #include "player.h" |
8 #include "player.h" |
8 #include "spritecache.h" |
9 #include "spritecache.h" |
9 #include "table/sprites.h" |
10 #include "table/sprites.h" |
235 } |
236 } |
236 } |
237 } |
237 |
238 |
238 void DoClearSquare(TileIndex tile) |
239 void DoClearSquare(TileIndex tile) |
239 { |
240 { |
240 ModifyTile(tile, |
241 SetTileType(tile, MP_CLEAR); |
241 MP_SETTYPE(MP_CLEAR) | |
242 SetTileOwner(tile, OWNER_NONE); |
242 MP_MAP2_CLEAR | MP_MAP3LO_CLEAR | MP_MAP3HI_CLEAR | MP_MAPOWNER | MP_MAP5, |
243 _m[tile].m2 = 0; |
243 OWNER_NONE, /* map_owner */ |
244 _m[tile].m3 = 0; |
244 _generating_world ? 3 : 0 /* map5 */ |
245 _m[tile].m4 = 0; |
245 ); |
246 SetClearGroundDensity(tile, CL_GRASS, _generating_world ? 3 : 0); |
|
247 MarkTileDirtyByTile(tile); |
246 } |
248 } |
247 |
249 |
248 uint32 GetTileTrackStatus(TileIndex tile, TransportType mode) |
250 uint32 GetTileTrackStatus(TileIndex tile, TransportType mode) |
249 { |
251 { |
250 return _tile_type_procs[GetTileType(tile)]->get_tile_track_status_proc(tile, mode); |
252 return _tile_type_procs[GetTileType(tile)]->get_tile_track_status_proc(tile, mode); |
613 |
615 |
614 for (tile = 0; tile != MapSize(); ++tile) { |
616 for (tile = 0; tile != MapSize(); ++tile) { |
615 for (data = _make_desert_or_rainforest_data; |
617 for (data = _make_desert_or_rainforest_data; |
616 data != endof(_make_desert_or_rainforest_data); ++data) { |
618 data != endof(_make_desert_or_rainforest_data); ++data) { |
617 TileIndex t = TILE_MASK(tile + ToTileIndexDiff(*data)); |
619 TileIndex t = TILE_MASK(tile + ToTileIndexDiff(*data)); |
618 if (IsTileType(t, MP_CLEAR) && (_m[t].m5 & 0x1c) == 0x14) break; |
620 if (IsTileType(t, MP_CLEAR) && IsClearGround(t, CL_DESERT)) break; |
619 } |
621 } |
620 if (data == endof(_make_desert_or_rainforest_data)) |
622 if (data == endof(_make_desert_or_rainforest_data)) |
621 SetMapExtraBits(tile, 2); |
623 SetMapExtraBits(tile, 2); |
622 } |
624 } |
623 } |
625 } |