summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/elrail.cpp12
-rw-r--r--src/newgrf_commons.cpp4
-rw-r--r--src/newgrf_commons.h8
-rw-r--r--src/newgrf_railtype.cpp2
-rw-r--r--src/newgrf_railtype.h2
-rw-r--r--src/rail_cmd.cpp6
-rw-r--r--src/tunnelbridge_cmd.cpp2
7 files changed, 18 insertions, 18 deletions
diff --git a/src/elrail.cpp b/src/elrail.cpp
index cbfa487ab..9137efc63 100644
--- a/src/elrail.cpp
+++ b/src/elrail.cpp
@@ -166,7 +166,7 @@ static TrackBits MaskWireBits(TileIndex t, TrackBits tracks)
/**
* Get the base wire sprite to use.
*/
-static inline SpriteID GetWireBase(TileIndex tile, TileContext context = TC_NORMAL)
+static inline SpriteID GetWireBase(TileIndex tile, TileContext context = TCX_NORMAL)
{
const RailtypeInfo *rti = GetRailTypeInfo(GetRailType(tile));
SpriteID wires = GetCustomRailSprite(rti, tile, RTSG_WIRES, context);
@@ -176,7 +176,7 @@ static inline SpriteID GetWireBase(TileIndex tile, TileContext context = TC_NORM
/**
* Get the base pylon sprite to use.
*/
-static inline SpriteID GetPylonBase(TileIndex tile, TileContext context = TC_NORMAL)
+static inline SpriteID GetPylonBase(TileIndex tile, TileContext context = TCX_NORMAL)
{
const RailtypeInfo *rti = GetRailTypeInfo(GetRailType(tile));
SpriteID pylons = GetCustomRailSprite(rti, tile, RTSG_PYLONS, context);
@@ -303,7 +303,7 @@ static void DrawCatenaryRailway(const TileInfo *ti)
AdjustTileh(ti->tile, &tileh[TS_HOME]);
SpriteID pylon_normal = GetPylonBase(ti->tile);
- SpriteID pylon_halftile = (halftile_corner != CORNER_INVALID) ? GetPylonBase(ti->tile, TC_UPPER_HALFTILE) : pylon_normal;
+ SpriteID pylon_halftile = (halftile_corner != CORNER_INVALID) ? GetPylonBase(ti->tile, TCX_UPPER_HALFTILE) : pylon_normal;
for (DiagDirection i = DIAGDIR_BEGIN; i < DIAGDIR_END; i++) {
static const uint edge_corners[] = {
@@ -442,7 +442,7 @@ static void DrawCatenaryRailway(const TileInfo *ti)
}
SpriteID wire_normal = GetWireBase(ti->tile);
- SpriteID wire_halftile = (halftile_corner != CORNER_INVALID) ? GetWireBase(ti->tile, TC_UPPER_HALFTILE) : wire_normal;
+ SpriteID wire_halftile = (halftile_corner != CORNER_INVALID) ? GetWireBase(ti->tile, TCX_UPPER_HALFTILE) : wire_normal;
Track halftile_track;
switch (halftile_corner) {
case CORNER_W: halftile_track = TRACK_LEFT; break;
@@ -503,14 +503,14 @@ void DrawCatenaryOnBridge(const TileInfo *ti)
height = GetBridgeHeight(end);
- SpriteID wire_base = GetWireBase(end, TC_ON_BRIDGE);
+ SpriteID wire_base = GetWireBase(end, TCX_ON_BRIDGE);
AddSortableSpriteToDraw(wire_base + sss->image_offset, PAL_NONE, ti->x + sss->x_offset, ti->y + sss->y_offset,
sss->x_size, sss->y_size, sss->z_size, height + sss->z_offset,
IsTransparencySet(TO_CATENARY)
);
- SpriteID pylon_base = GetPylonBase(end, TC_ON_BRIDGE);
+ SpriteID pylon_base = GetPylonBase(end, TCX_ON_BRIDGE);
/* Finished with wires, draw pylons
* every other tile needs a pylon on the northern end */
diff --git a/src/newgrf_commons.cpp b/src/newgrf_commons.cpp
index 7306f28cc..a169b17e4 100644
--- a/src/newgrf_commons.cpp
+++ b/src/newgrf_commons.cpp
@@ -314,7 +314,7 @@ uint32 GetTerrainType(TileIndex tile, TileContext context)
/* During map generation the snowstate may not be valid yet, as the tileloop may not have run yet. */
if (_generating_world) goto genworld; // we do not care about foundations here
RailGroundType ground = GetRailGroundType(tile);
- has_snow = (ground == RAIL_GROUND_ICE_DESERT || (context == TC_UPPER_HALFTILE && ground == RAIL_GROUND_HALF_SNOW));
+ has_snow = (ground == RAIL_GROUND_ICE_DESERT || (context == TCX_UPPER_HALFTILE && ground == RAIL_GROUND_HALF_SNOW));
break;
}
@@ -333,7 +333,7 @@ uint32 GetTerrainType(TileIndex tile, TileContext context)
}
case MP_TUNNELBRIDGE:
- if (context == TC_ON_BRIDGE) {
+ if (context == TCX_ON_BRIDGE) {
has_snow = (GetBridgeHeight(tile) > GetSnowLine());
} else {
/* During map generation the snowstate may not be valid yet, as the tileloop may not have run yet. */
diff --git a/src/newgrf_commons.h b/src/newgrf_commons.h
index a260eb0d5..5d575973f 100644
--- a/src/newgrf_commons.h
+++ b/src/newgrf_commons.h
@@ -19,9 +19,9 @@
/** Contextx for tile accesses */
enum TileContext {
- TC_NORMAL, ///< Nothing special.
- TC_UPPER_HALFTILE, ///< Querying information about the upper part of a tile with halftile foundation.
- TC_ON_BRIDGE, ///< Querying information about stuff on the bridge (via some bridgehead).
+ TCX_NORMAL, ///< Nothing special.
+ TCX_UPPER_HALFTILE, ///< Querying information about the upper part of a tile with halftile foundation.
+ TCX_ON_BRIDGE, ///< Querying information about stuff on the bridge (via some bridgehead).
};
/**
@@ -131,7 +131,7 @@ extern IndustryTileOverrideManager _industile_mngr;
extern AirportOverrideManager _airport_mngr;
extern AirportTileOverrideManager _airporttile_mngr;
-uint32 GetTerrainType(TileIndex tile, TileContext context = TC_NORMAL);
+uint32 GetTerrainType(TileIndex tile, TileContext context = TCX_NORMAL);
TileIndex GetNearbyTile(byte parameter, TileIndex tile);
uint32 GetNearbyTileInformation(TileIndex tile);
diff --git a/src/newgrf_railtype.cpp b/src/newgrf_railtype.cpp
index 9f32efeb1..79d83b2d5 100644
--- a/src/newgrf_railtype.cpp
+++ b/src/newgrf_railtype.cpp
@@ -135,5 +135,5 @@ uint8 GetReverseRailTypeTranslation(RailType railtype, const GRFFile *grffile)
*/
void GetRailTypeResolver(ResolverObject *ro, uint index)
{
- NewRailTypeResolver(ro, index, TC_NORMAL);
+ NewRailTypeResolver(ro, index, TCX_NORMAL);
}
diff --git a/src/newgrf_railtype.h b/src/newgrf_railtype.h
index 770bc1b71..0c57f7e49 100644
--- a/src/newgrf_railtype.h
+++ b/src/newgrf_railtype.h
@@ -15,7 +15,7 @@
#include "rail.h"
#include "newgrf_commons.h"
-SpriteID GetCustomRailSprite(const RailtypeInfo *rti, TileIndex tile, RailTypeSpriteGroup rtsg, TileContext context = TC_NORMAL);
+SpriteID GetCustomRailSprite(const RailtypeInfo *rti, TileIndex tile, RailTypeSpriteGroup rtsg, TileContext context = TCX_NORMAL);
uint8 GetReverseRailTypeTranslation(RailType railtype, const GRFFile *grffile);
diff --git a/src/rail_cmd.cpp b/src/rail_cmd.cpp
index 779700c3d..1a417ab97 100644
--- a/src/rail_cmd.cpp
+++ b/src/rail_cmd.cpp
@@ -1809,7 +1809,7 @@ static void DrawTrackDetails(const TileInfo *ti, const RailtypeInfo *rti)
{
/* Base sprite for track fences.
* Note: Halftile slopes only have fences on the upper part. */
- SpriteID base_image = GetCustomRailSprite(rti, ti->tile, RTSG_FENCES, IsHalftileSlope(ti->tileh) ? TC_UPPER_HALFTILE : TC_NORMAL);
+ SpriteID base_image = GetCustomRailSprite(rti, ti->tile, RTSG_FENCES, IsHalftileSlope(ti->tileh) ? TCX_UPPER_HALFTILE : TCX_NORMAL);
if (base_image == 0) base_image = SPR_TRACK_FENCE_FLAT_X;
switch (GetRailGroundType(ti->tile)) {
@@ -1968,8 +1968,8 @@ static void DrawTrackBitsOverlay(TileInfo *ti, TrackBits track, const RailtypeIn
if (IsValidCorner(halftile_corner)) {
DrawFoundation(ti, HalftileFoundation(halftile_corner));
- overlay = GetCustomRailSprite(rti, ti->tile, RTSG_OVERLAY, TC_UPPER_HALFTILE);
- ground = GetCustomRailSprite(rti, ti->tile, RTSG_GROUND, TC_UPPER_HALFTILE);
+ overlay = GetCustomRailSprite(rti, ti->tile, RTSG_OVERLAY, TCX_UPPER_HALFTILE);
+ ground = GetCustomRailSprite(rti, ti->tile, RTSG_GROUND, TCX_UPPER_HALFTILE);
/* Draw higher halftile-overlay: Use the sloped sprites with three corners raised. They probably best fit the lightning. */
Slope fake_slope = SlopeWithThreeCornersRaised(OppositeCorner(halftile_corner));
diff --git a/src/tunnelbridge_cmd.cpp b/src/tunnelbridge_cmd.cpp
index 7cfa11c5c..1fa3e770c 100644
--- a/src/tunnelbridge_cmd.cpp
+++ b/src/tunnelbridge_cmd.cpp
@@ -1253,7 +1253,7 @@ void DrawBridgeMiddle(const TileInfo *ti)
} else if (transport_type == TRANSPORT_RAIL) {
const RailtypeInfo *rti = GetRailTypeInfo(GetRailType(rampsouth));
if (rti->UsesOverlay()) {
- SpriteID surface = GetCustomRailSprite(rti, rampsouth, RTSG_BRIDGE, TC_ON_BRIDGE);
+ SpriteID surface = GetCustomRailSprite(rti, rampsouth, RTSG_BRIDGE, TCX_ON_BRIDGE);
if (surface != 0) {
AddSortableSpriteToDraw(surface + axis, PAL_NONE, x, y, 16, 16, 0, bridge_z, IsTransparencySet(TO_BRIDGES));
}