mirror of https://github.com/OpenTTD/OpenTTD
(svn r20741) -Cleanup: Use IsTileOnWater() in more places.
parent
435c8d33b0
commit
e9cd81953a
|
@ -270,7 +270,7 @@ static void AirportDrawTileLayout(const TileInfo *ti, const TileLayoutSpriteGrou
|
|||
SpriteID pal = dts->ground.pal;
|
||||
|
||||
if (GB(image, 0, SPRITE_WIDTH) != 0) {
|
||||
if (image == SPR_FLAT_WATER_TILE && GetWaterClass(ti->tile) != WATER_CLASS_INVALID) {
|
||||
if (image == SPR_FLAT_WATER_TILE && IsTileOnWater(ti->tile)) {
|
||||
DrawWaterClassGround(ti);
|
||||
} else {
|
||||
DrawGroundSprite(image, GroundSpritePaletteTransform(image, pal, GENERAL_SPRITE_COLOUR(colour)));
|
||||
|
|
|
@ -401,7 +401,7 @@ static inline uint32 GetSmallMapIndustriesPixels(TileIndex tile, TileType t)
|
|||
return GetIndustrySpec(Industry::GetByTile(tile)->type)->map_colour * 0x01010101;
|
||||
} else {
|
||||
/* Otherwise, return the colour which will make it disappear */
|
||||
t = (GetWaterClass(tile) == WATER_CLASS_INVALID) ? MP_CLEAR : MP_WATER;
|
||||
t = (IsTileOnWater(tile) ? MP_WATER : MP_CLEAR);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -2663,7 +2663,7 @@ static void DrawTile_Station(TileInfo *ti)
|
|||
}
|
||||
}
|
||||
|
||||
if (IsBuoy(ti->tile) || IsDock(ti->tile) || (IsOilRig(ti->tile) && GetWaterClass(ti->tile) != WATER_CLASS_INVALID)) {
|
||||
if (IsBuoy(ti->tile) || IsDock(ti->tile) || (IsOilRig(ti->tile) && IsTileOnWater(ti->tile))) {
|
||||
if (ti->tileh == SLOPE_FLAT) {
|
||||
DrawWaterClassGround(ti);
|
||||
} else {
|
||||
|
|
|
@ -485,7 +485,7 @@ static bool IsWateredTile(TileIndex tile, Direction from)
|
|||
if ((IsTileType(src_tile, MP_STATION) && IsOilRig(src_tile)) ||
|
||||
(IsTileType(src_tile, MP_INDUSTRY))) return true;
|
||||
|
||||
return GetWaterClass(tile) != WATER_CLASS_INVALID;
|
||||
return IsTileOnWater(tile);
|
||||
}
|
||||
return (IsDock(tile) && GetTileSlope(tile, NULL) == SLOPE_FLAT) || IsBuoy(tile);
|
||||
|
||||
|
|
Loading…
Reference in New Issue