mirror of https://github.com/OpenTTD/OpenTTD
(svn r1715) Move [GS]etMapExtraBits to tile.[ch]
parent
a2de96abc0
commit
f08d102ac2
1
Makefile
1
Makefile
|
@ -624,6 +624,7 @@ C_SOURCES += strings.c
|
||||||
C_SOURCES += subsidy_gui.c
|
C_SOURCES += subsidy_gui.c
|
||||||
C_SOURCES += terraform_gui.c
|
C_SOURCES += terraform_gui.c
|
||||||
C_SOURCES += texteff.c
|
C_SOURCES += texteff.c
|
||||||
|
C_SOURCES += tile.c
|
||||||
C_SOURCES += town_cmd.c
|
C_SOURCES += town_cmd.c
|
||||||
C_SOURCES += town_gui.c
|
C_SOURCES += town_gui.c
|
||||||
C_SOURCES += train_cmd.c
|
C_SOURCES += train_cmd.c
|
||||||
|
|
|
@ -14,8 +14,6 @@ int GetTileZ(uint tile);
|
||||||
|
|
||||||
void DoClearSquare(uint tile);
|
void DoClearSquare(uint tile);
|
||||||
void CDECL ModifyTile(uint tile, uint flags, ...);
|
void CDECL ModifyTile(uint tile, uint flags, ...);
|
||||||
void SetMapExtraBits(uint tile, byte flags);
|
|
||||||
uint GetMapExtraBits(uint tile);
|
|
||||||
void RunTileLoop(void);
|
void RunTileLoop(void);
|
||||||
|
|
||||||
uint GetPartialZ(int x, int y, int corners);
|
uint GetPartialZ(int x, int y, int corners);
|
||||||
|
|
11
landscape.c
11
landscape.c
|
@ -430,17 +430,6 @@ void CDECL ModifyTile(uint tile, uint flags, ...)
|
||||||
MarkTileDirtyByTile(tile);
|
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_BITS 4
|
||||||
#define TILELOOP_SIZE (1 << TILELOOP_BITS)
|
#define TILELOOP_SIZE (1 << TILELOOP_BITS)
|
||||||
|
|
|
@ -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;
|
||||||
|
}
|
3
tile.h
3
tile.h
|
@ -3,6 +3,9 @@
|
||||||
|
|
||||||
#include "map.h"
|
#include "map.h"
|
||||||
|
|
||||||
|
void SetMapExtraBits(TileIndex tile, byte flags);
|
||||||
|
uint GetMapExtraBits(TileIndex tile);
|
||||||
|
|
||||||
static inline uint TileHeight(TileIndex tile)
|
static inline uint TileHeight(TileIndex tile)
|
||||||
{
|
{
|
||||||
assert(tile < MapSize());
|
assert(tile < MapSize());
|
||||||
|
|
Loading…
Reference in New Issue