# HG changeset patch # User tron # Date 1107005628 0 # Node ID 6f2f723e5c369bab8c0b8f99a916d740f800d025 # Parent 05975e9167c45257654a8acdafc847b4a2435855 (svn r1715) Move [GS]etMapExtraBits to tile.[ch] diff -r 05975e9167c4 -r 6f2f723e5c36 Makefile --- a/Makefile Sat Jan 29 13:33:14 2005 +0000 +++ b/Makefile Sat Jan 29 13:33:48 2005 +0000 @@ -624,6 +624,7 @@ C_SOURCES += subsidy_gui.c C_SOURCES += terraform_gui.c C_SOURCES += texteff.c +C_SOURCES += tile.c C_SOURCES += town_cmd.c C_SOURCES += town_gui.c C_SOURCES += train_cmd.c diff -r 05975e9167c4 -r 6f2f723e5c36 functions.h --- a/functions.h Sat Jan 29 13:33:14 2005 +0000 +++ b/functions.h Sat Jan 29 13:33:48 2005 +0000 @@ -14,8 +14,6 @@ void DoClearSquare(uint tile); void CDECL ModifyTile(uint tile, uint flags, ...); -void SetMapExtraBits(uint tile, byte flags); -uint GetMapExtraBits(uint tile); void RunTileLoop(void); uint GetPartialZ(int x, int y, int corners); diff -r 05975e9167c4 -r 6f2f723e5c36 landscape.c --- a/landscape.c Sat Jan 29 13:33:14 2005 +0000 +++ b/landscape.c Sat Jan 29 13:33:48 2005 +0000 @@ -430,17 +430,6 @@ MarkTileDirtyByTile(tile); } -void SetMapExtraBits(uint tile, byte bits) -{ - _map_extra_bits[tile >> 2] &= ~(3 << ((tile&3)*2)); - _map_extra_bits[tile >> 2] |= (bits&3) << ((tile&3)*2); -} - -uint GetMapExtraBits(uint tile) -{ - assert(tile < MapSize()); - return (_map_extra_bits[tile >> 2] >> (tile & 3) * 2) & 3; -} #define TILELOOP_BITS 4 #define TILELOOP_SIZE (1 << TILELOOP_BITS) diff -r 05975e9167c4 -r 6f2f723e5c36 tile.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tile.c Sat Jan 29 13:33:48 2005 +0000 @@ -0,0 +1,14 @@ +#include "tile.h" + +void SetMapExtraBits(TileIndex tile, byte bits) +{ + assert(tile < MapSize()); + _map_extra_bits[tile >> 2] &= ~(3 << ((tile & 3) * 2)); + _map_extra_bits[tile >> 2] |= (bits&3) << ((tile & 3) * 2); +} + +uint GetMapExtraBits(TileIndex tile) +{ + assert(tile < MapSize()); + return (_map_extra_bits[tile >> 2] >> (tile & 3) * 2) & 3; +} diff -r 05975e9167c4 -r 6f2f723e5c36 tile.h --- a/tile.h Sat Jan 29 13:33:14 2005 +0000 +++ b/tile.h Sat Jan 29 13:33:48 2005 +0000 @@ -3,6 +3,9 @@ #include "map.h" +void SetMapExtraBits(TileIndex tile, byte flags); +uint GetMapExtraBits(TileIndex tile); + static inline uint TileHeight(TileIndex tile) { assert(tile < MapSize());