summaryrefslogtreecommitdiff
path: root/road_cmd.c
diff options
context:
space:
mode:
authortron <tron@openttd.org>2006-06-10 08:37:41 +0000
committertron <tron@openttd.org>2006-06-10 08:37:41 +0000
commit0a72639c2d7254c37cd6f8ab0a9fa0f4d63fd2ea (patch)
treeddcc7798b94be03152e4b31cee4bf48bc73774e4 /road_cmd.c
parent15c945c9263ffd64f01fd3da92fcb4efb17fe691 (diff)
downloadopenttd-0a72639c2d7254c37cd6f8ab0a9fa0f4d63fd2ea.tar.xz
(svn r5210) Many small changes which piled up: const, unsigned, variable scope, CSE for readability, DeMorgan, if cascades -> switch, whitespace, parentheses, bracing, misc.
Diffstat (limited to 'road_cmd.c')
-rw-r--r--road_cmd.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/road_cmd.c b/road_cmd.c
index 832ca7a24..cd8263c31 100644
--- a/road_cmd.c
+++ b/road_cmd.c
@@ -741,20 +741,19 @@ static void DrawRoadBits(TileInfo* ti, RoadBits road)
static void DrawTile_Road(TileInfo *ti)
{
- PalSpriteID image;
-
switch (GetRoadTileType(ti->tile)) {
case ROAD_TILE_NORMAL:
DrawRoadBits(ti, GetRoadBits(ti->tile));
break;
case ROAD_TILE_CROSSING: {
+ PalSpriteID image;
+
if (ti->tileh != SLOPE_FLAT) DrawFoundation(ti, ti->tileh);
image = GetRailTypeInfo(GetRailTypeCrossing(ti->tile))->base_sprites.crossing;
if (GetCrossingRoadAxis(ti->tile) == AXIS_X) image++;
-
if (IsCrossingBarred(ti->tile)) image += 2;
if (IsOnSnow(ti->tile)) {
@@ -802,12 +801,8 @@ static void DrawTile_Road(TileInfo *ti)
void DrawRoadDepotSprite(int x, int y, int image)
{
- uint32 ormod;
- const DrawRoadSeqStruct *dtss;
-
- ormod = PLAYER_SPRITE_COLOR(_local_player);
-
- dtss = _road_display_datas[image];
+ const DrawRoadSeqStruct* dtss = _road_display_datas[image];
+ uint32 ormod = PLAYER_SPRITE_COLOR(_local_player);
x += 33;
y += 17;
@@ -1064,7 +1059,7 @@ static void ChangeTileOwner_Road(TileIndex tile, PlayerID old_player, PlayerID n
if (new_player != OWNER_SPECTATOR) {
SetTileOwner(tile, new_player);
- } else {
+ } else {
switch (GetRoadTileType(tile)) {
case ROAD_TILE_NORMAL:
SetTileOwner(tile, OWNER_NONE);