summaryrefslogtreecommitdiff
path: root/clear_cmd.c
diff options
context:
space:
mode:
Diffstat (limited to 'clear_cmd.c')
-rw-r--r--clear_cmd.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/clear_cmd.c b/clear_cmd.c
index 773d05867..38f1ccd68 100644
--- a/clear_cmd.c
+++ b/clear_cmd.c
@@ -470,7 +470,7 @@ void DrawHillyLandTile(TileInfo *ti)
if (ti->tileh != 0) {
DrawGroundSprite(0xFA0 + _tileh_to_sprite[ti->tileh]);
} else {
- DrawGroundSprite(_landscape_clear_sprites[((ti->x^ti->y) >> 4) & 0x7]);
+ DrawGroundSprite(_landscape_clear_sprites[GB(ti->x ^ ti->y, 4, 3)]);
}
}
@@ -485,11 +485,11 @@ void DrawClearLandFence(TileInfo *ti, byte img)
}
if (img & 0x38) {
- DrawGroundSpriteAt(_clear_land_fence_sprites_1[((img >> 3) & 7) - 1] + _fence_mod_by_tileh[ti->tileh], ti->x, ti->y, z);
+ DrawGroundSpriteAt(_clear_land_fence_sprites_1[GB(img, 3, 3) - 1] + _fence_mod_by_tileh[ti->tileh], ti->x, ti->y, z);
}
if (img & 0x7) {
- DrawGroundSpriteAt(_clear_land_fence_sprites_1[(img & 7) - 1] + _fence_mod_by_tileh_2[ti->tileh], ti->x, ti->y, z);
+ DrawGroundSpriteAt(_clear_land_fence_sprites_1[GB(img, 0, 3) - 1] + _fence_mod_by_tileh_2[ti->tileh], ti->x, ti->y, z);
}
}
@@ -785,7 +785,7 @@ void GenerateClearTile(void)
r = Random();
tile = RandomTileSeed(r);
if (IsTileType(tile, MP_CLEAR)) {
- j = ((r >> 16) & 0xF) + 5;
+ j = GB(r, 16, 4) + 5;
for(;;) {
TileIndex tile_new;