diff options
author | rubidium <rubidium@openttd.org> | 2010-08-26 14:45:45 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2010-08-26 14:45:45 +0000 |
commit | 4efa2efdbba6f08b2ee4ca3aacb2aeb792429af4 (patch) | |
tree | 60ad5b19a5b1e1131aee081bdeea8f4d6a83af1e /src/tile_map.h | |
parent | 7f86dcca90b20241a210dd5f088e249a902f725c (diff) | |
download | openttd-4efa2efdbba6f08b2ee4ca3aacb2aeb792429af4.tar.xz |
(svn r20622) -Codechange: unify [GS]et[Statation|Object|Industry|House]AnimationFrame
Diffstat (limited to 'src/tile_map.h')
-rw-r--r-- | src/tile_map.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/tile_map.h b/src/tile_map.h index 7310fc599..420421e40 100644 --- a/src/tile_map.h +++ b/src/tile_map.h @@ -202,6 +202,30 @@ static inline TropicZone GetTropicZone(TileIndex tile) return (TropicZone)GB(_m[tile].m6, 0, 2); } +/** + * Get the current animation frame + * @param t the tile + * @pre IsTileType(t, MP_HOUSE) || IsTileType(t, MP_OBJECT) || IsTileType(t, MP_INDUSTRY) ||IsTileType(t, MP_STATION) + * @return frame number + */ +static inline byte GetAnimationFrame(TileIndex t) +{ + assert(IsTileType(t, MP_HOUSE) || IsTileType(t, MP_OBJECT) || IsTileType(t, MP_INDUSTRY) ||IsTileType(t, MP_STATION)); + return _me[t].m7; +} + +/** + * Set a new animation frame + * @param t the tile + * @param frame the new frame number + * @pre IsTileType(t, MP_HOUSE) || IsTileType(t, MP_OBJECT) || IsTileType(t, MP_INDUSTRY) ||IsTileType(t, MP_STATION) + */ +static inline void SetAnimationFrame(TileIndex t, byte frame) +{ + assert(IsTileType(t, MP_HOUSE) || IsTileType(t, MP_OBJECT) || IsTileType(t, MP_INDUSTRY) ||IsTileType(t, MP_STATION)); + _me[t].m7 = frame; +} + Slope GetTileSlope(TileIndex tile, uint *h); uint GetTileZ(TileIndex tile); uint GetTileMaxZ(TileIndex tile); |