summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2010-01-21 01:38:13 +0000
committerrubidium <rubidium@openttd.org>2010-01-21 01:38:13 +0000
commitf94c83a3874c292ae0d90a7819c971e4bc7aebad (patch)
treea952b3b5ff3a44ae3b028ee995ee32f968cc2ba0
parent02edae54542cf619cb8d0157d476be45df898119 (diff)
downloadopenttd-f94c83a3874c292ae0d90a7819c971e4bc7aebad.tar.xz
(svn r18872) -Codechange: introduce PaletteID and use it
-rw-r--r--src/aircraft_cmd.cpp2
-rw-r--r--src/aircraft_gui.cpp2
-rw-r--r--src/bridge.h2
-rw-r--r--src/company_gui.cpp2
-rw-r--r--src/engine_gui.cpp2
-rw-r--r--src/engine_gui.h10
-rw-r--r--src/gfx.cpp6
-rw-r--r--src/gfx_func.h4
-rw-r--r--src/gfx_type.h11
-rw-r--r--src/industry_cmd.cpp2
-rw-r--r--src/newgrf.cpp2
-rw-r--r--src/newgrf_gui.cpp2
-rw-r--r--src/newgrf_house.cpp4
-rw-r--r--src/newgrf_industrytiles.cpp2
-rw-r--r--src/newgrf_station.cpp4
-rw-r--r--src/rail_cmd.cpp6
-rw-r--r--src/road_cmd.cpp8
-rw-r--r--src/roadveh_cmd.cpp2
-rw-r--r--src/roadveh_gui.cpp2
-rw-r--r--src/ship_cmd.cpp2
-rw-r--r--src/sprite.cpp8
-rw-r--r--src/sprite.h18
-rw-r--r--src/station_cmd.cpp6
-rw-r--r--src/tilehighlight_func.h4
-rw-r--r--src/train_cmd.cpp2
-rw-r--r--src/train_gui.cpp4
-rw-r--r--src/tree_cmd.cpp14
-rw-r--r--src/unmovable_cmd.cpp2
-rw-r--r--src/vehicle.cpp12
-rw-r--r--src/vehicle_gui.cpp2
-rw-r--r--src/viewport.cpp30
-rw-r--r--src/viewport_func.h8
-rw-r--r--src/water_cmd.cpp2
33 files changed, 94 insertions, 95 deletions
diff --git a/src/aircraft_cmd.cpp b/src/aircraft_cmd.cpp
index 03048134c..b20d1df3e 100644
--- a/src/aircraft_cmd.cpp
+++ b/src/aircraft_cmd.cpp
@@ -200,7 +200,7 @@ static SpriteID GetAircraftIcon(EngineID engine)
return DIR_W + _aircraft_sprite[spritenum];
}
-void DrawAircraftEngine(int left, int right, int preferred_x, int y, EngineID engine, SpriteID pal)
+void DrawAircraftEngine(int left, int right, int preferred_x, int y, EngineID engine, PaletteID pal)
{
SpriteID sprite = GetAircraftIcon(engine);
const Sprite *real_sprite = GetSprite(sprite, ST_NORMAL);
diff --git a/src/aircraft_gui.cpp b/src/aircraft_gui.cpp
index d7f2cb88b..35d0b9104 100644
--- a/src/aircraft_gui.cpp
+++ b/src/aircraft_gui.cpp
@@ -87,7 +87,7 @@ void DrawAircraftImage(const Vehicle *v, int left, int right, int y, VehicleID s
int x = rtl ? right - real_sprite->width - real_sprite->x_offs : left - real_sprite->x_offs;
bool helicopter = v->subtype == AIR_HELICOPTER;
- SpriteID pal = (v->vehstatus & VS_CRASHED) ? PALETTE_CRASH : GetVehiclePalette(v);
+ PaletteID pal = (v->vehstatus & VS_CRASHED) ? PALETTE_CRASH : GetVehiclePalette(v);
DrawSprite(sprite, pal, x, y + 10);
if (helicopter) {
const Aircraft *a = Aircraft::From(v);
diff --git a/src/bridge.h b/src/bridge.h
index 8b374cd50..b65d4e829 100644
--- a/src/bridge.h
+++ b/src/bridge.h
@@ -47,7 +47,7 @@ struct BridgeSpec {
uint16 price; ///< the price multiplier
uint16 speed; ///< maximum travel speed
SpriteID sprite; ///< the sprite which is used in the GUI
- SpriteID pal; ///< the palette which is used in the GUI
+ PaletteID pal; ///< the palette which is used in the GUI
StringID material; ///< the string that contains the bridge description
StringID transport_name[2]; ///< description of the bridge, when built for road or rail
PalSpriteID **sprite_table; ///< table of sprites for drawing the bridge
diff --git a/src/company_gui.cpp b/src/company_gui.cpp
index 642bb3e6d..786c7ff4c 100644
--- a/src/company_gui.cpp
+++ b/src/company_gui.cpp
@@ -846,7 +846,7 @@ void DrawCompanyManagerFace(CompanyManagerFace cmf, int colour, int x, int y)
bool has_moustache = !HasBit(ge, GENDER_FEMALE) && GetCompanyManagerFaceBits(cmf, CMFV_HAS_MOUSTACHE, ge) != 0;
bool has_tie_earring = !HasBit(ge, GENDER_FEMALE) || GetCompanyManagerFaceBits(cmf, CMFV_HAS_TIE_EARRING, ge) != 0;
bool has_glasses = GetCompanyManagerFaceBits(cmf, CMFV_HAS_GLASSES, ge) != 0;
- SpriteID pal;
+ PaletteID pal;
/* Modify eye colour palette only if 2 or more valid values exist */
if (_cmf_info[CMFV_EYE_COLOUR].valid_values[ge] < 2) {
diff --git a/src/engine_gui.cpp b/src/engine_gui.cpp
index b142c5cc6..41790b384 100644
--- a/src/engine_gui.cpp
+++ b/src/engine_gui.cpp
@@ -248,7 +248,7 @@ StringID GetEngineInfoString(EngineID engine)
* @param engine Engine to draw.
* @param pal Palette to use for drawing.
*/
-void DrawVehicleEngine(int left, int right, int preferred_x, int y, EngineID engine, SpriteID pal)
+void DrawVehicleEngine(int left, int right, int preferred_x, int y, EngineID engine, PaletteID pal)
{
const Engine *e = Engine::Get(engine);
diff --git a/src/engine_gui.h b/src/engine_gui.h
index 4e4b51ff6..ef508cc29 100644
--- a/src/engine_gui.h
+++ b/src/engine_gui.h
@@ -25,10 +25,10 @@ void EngList_SortPartial(GUIEngineList *el, EngList_SortTypeFunction compare, ui
StringID GetEngineCategoryName(EngineID engine);
StringID GetEngineInfoString(EngineID engine);
-void DrawVehicleEngine(int left, int right, int preferred_x, int y, EngineID engine, SpriteID pal);
-void DrawTrainEngine(int left, int right, int preferred_x, int y, EngineID engine, SpriteID pal);
-void DrawRoadVehEngine(int left, int right, int preferred_x, int y, EngineID engine, SpriteID pal);
-void DrawShipEngine(int left, int right, int preferred_x, int y, EngineID engine, SpriteID pal);
-void DrawAircraftEngine(int left, int right, int preferred_x, int y, EngineID engine, SpriteID pal);
+void DrawVehicleEngine(int left, int right, int preferred_x, int y, EngineID engine, PaletteID pal);
+void DrawTrainEngine(int left, int right, int preferred_x, int y, EngineID engine, PaletteID pal);
+void DrawRoadVehEngine(int left, int right, int preferred_x, int y, EngineID engine, PaletteID pal);
+void DrawShipEngine(int left, int right, int preferred_x, int y, EngineID engine, PaletteID pal);
+void DrawAircraftEngine(int left, int right, int preferred_x, int y, EngineID engine, PaletteID pal);
#endif /* ENGINE_GUI_H */
diff --git a/src/gfx.cpp b/src/gfx.cpp
index 755097613..e798c97fa 100644
--- a/src/gfx.cpp
+++ b/src/gfx.cpp
@@ -1028,7 +1028,7 @@ Dimension GetSpriteSize(SpriteID sprid)
* @param y Top coordinate of image
* @param sub If available, draw only specified part of the sprite
*/
-void DrawSprite(SpriteID img, SpriteID pal, int x, int y, const SubSprite *sub)
+void DrawSprite(SpriteID img, PaletteID pal, int x, int y, const SubSprite *sub)
{
if (HasBit(img, PALETTE_MODIFIER_TRANSPARENT)) {
_colour_remap_ptr = GetNonSprite(GB(pal, 0, PALETTE_WIDTH), ST_RECOLOUR) + 1;
@@ -1645,7 +1645,7 @@ bool FillDrawPixelInfo(DrawPixelInfo *n, int left, int top, int width, int heigh
return true;
}
-static void SetCursorSprite(SpriteID cursor, SpriteID pal)
+static void SetCursorSprite(CursorID cursor, PaletteID pal)
{
CursorVars *cv = &_cursor;
const Sprite *p;
@@ -1682,7 +1682,7 @@ void CursorTick()
SwitchAnimatedCursor();
}
-void SetMouseCursor(SpriteID sprite, SpriteID pal)
+void SetMouseCursor(CursorID sprite, PaletteID pal)
{
/* Turn off animation */
_cursor.animate_timeout = 0;
diff --git a/src/gfx_func.h b/src/gfx_func.h
index ca583fbc9..5f7bee2fa 100644
--- a/src/gfx_func.h
+++ b/src/gfx_func.h
@@ -91,7 +91,7 @@ void RedrawScreenRect(int left, int top, int right, int bottom);
void GfxScroll(int left, int top, int width, int height, int xo, int yo);
Dimension GetSpriteSize(SpriteID sprid);
-void DrawSprite(SpriteID img, SpriteID pal, int x, int y, const SubSprite *sub = NULL);
+void DrawSprite(SpriteID img, PaletteID pal, int x, int y, const SubSprite *sub = NULL);
/** How to align the to-be drawn text. */
enum StringAlignment {
@@ -149,7 +149,7 @@ bool FillDrawPixelInfo(DrawPixelInfo *n, int left, int top, int width, int heigh
/* window.cpp */
void DrawOverlappedWindowForAll(int left, int top, int right, int bottom);
-void SetMouseCursor(SpriteID sprite, SpriteID pal);
+void SetMouseCursor(CursorID cursor, PaletteID pal);
void SetAnimatedMouseCursor(const AnimCursor *table);
void CursorTick();
bool ChangeResInGame(int w, int h);
diff --git a/src/gfx_type.h b/src/gfx_type.h
index fd3495159..968c0c993 100644
--- a/src/gfx_type.h
+++ b/src/gfx_type.h
@@ -16,14 +16,15 @@
#include "core/geometry_type.hpp"
#include "zoom_type.h"
-typedef uint32 SpriteID; ///< The number of a sprite, without mapping bits and colourtables
+typedef uint32 SpriteID; ///< The number of a sprite, without mapping bits and colourtables
+typedef uint32 PaletteID; ///< The number of the palette
+typedef uint32 CursorID; ///< The number of the cursor (sprite)
/** Combination of a palette sprite and a 'real' sprite */
struct PalSpriteID {
SpriteID sprite; ///< The 'real' sprite
- SpriteID pal; ///< The palette (use \c PAL_NONE) if not needed)
+ PaletteID pal; ///< The palette (use \c PAL_NONE) if not needed)
};
-typedef int32 CursorID;
enum WindowKeyCodes {
WKC_SHIFT = 0x8000,
@@ -113,8 +114,8 @@ struct CursorVars {
Point pos, size, offs, delta; ///< position, size, offset from top-left, and movement
Point draw_pos, draw_size; ///< position and size bounding-box for drawing
int short_vehicle_offset; ///< offset of the X for short vehicles
- SpriteID sprite; ///< current image of cursor
- SpriteID pal;
+ CursorID sprite; ///< current image of cursor
+ PaletteID pal;
int wheel; ///< mouse wheel movement
diff --git a/src/industry_cmd.cpp b/src/industry_cmd.cpp
index e30f339d8..45beb7ead 100644
--- a/src/industry_cmd.cpp
+++ b/src/industry_cmd.cpp
@@ -311,7 +311,7 @@ static void DrawTile_Industry(TileInfo *ti)
const IndustryTileSpec *indts = GetIndustryTileSpec(gfx);
const DrawBuildingsTileStruct *dits;
SpriteID image;
- SpriteID pal;
+ PaletteID pal;
/* Retrieve pointer to the draw industry tile struct */
if (gfx >= NEW_INDUSTRYTILEOFFSET) {
diff --git a/src/newgrf.cpp b/src/newgrf.cpp
index 5e4a5abdc..83e4d3f6c 100644
--- a/src/newgrf.cpp
+++ b/src/newgrf.cpp
@@ -1389,7 +1389,7 @@ static ChangeInfoResult BridgeChangeInfo(uint brid, int numinfo, int prop, byte
for (byte sprite = 0; sprite < 32; sprite++) {
SpriteID image = grf_load_word(&buf);
- SpriteID pal = grf_load_word(&buf);
+ PaletteID pal = grf_load_word(&buf);
bridge->sprite_table[tableid][sprite].sprite = image;
bridge->sprite_table[tableid][sprite].pal = pal;
diff --git a/src/newgrf_gui.cpp b/src/newgrf_gui.cpp
index 3ec7f194e..23b08a854 100644
--- a/src/newgrf_gui.cpp
+++ b/src/newgrf_gui.cpp
@@ -663,7 +663,7 @@ struct NewGRFWindow : public Window {
for (const GRFConfig *c = this->list; c != NULL; c = c->next, i++) {
if (this->vscroll.IsVisible(i)) {
const char *text = (c->name != NULL && !StrEmpty(c->name)) ? c->name : c->filename;
- SpriteID pal;
+ PaletteID pal;
/* Pick a colour */
switch (c->status) {
diff --git a/src/newgrf_house.cpp b/src/newgrf_house.cpp
index 2a2e4cd3f..3ea73c4cd 100644
--- a/src/newgrf_house.cpp
+++ b/src/newgrf_house.cpp
@@ -404,7 +404,7 @@ static void DrawTileLayout(const TileInfo *ti, const TileLayoutSpriteGroup *grou
const DrawTileSprites *dts = group->dts;
const HouseSpec *hs = HouseSpec::Get(house_id);
- SpriteID palette = hs->random_colour[TileHash2Bit(ti->x, ti->y)] + PALETTE_RECOLOUR_START;
+ PaletteID palette = hs->random_colour[TileHash2Bit(ti->x, ti->y)] + PALETTE_RECOLOUR_START;
if (HasBit(hs->callback_mask, CBM_HOUSE_COLOUR)) {
uint16 callback = GetHouseCallback(CBID_HOUSE_COLOUR, 0, 0, house_id, Town::GetByTile(ti->tile), ti->tile);
if (callback != CALLBACK_FAILED) {
@@ -414,7 +414,7 @@ static void DrawTileLayout(const TileInfo *ti, const TileLayoutSpriteGroup *grou
}
SpriteID image = dts->ground.sprite;
- SpriteID pal = dts->ground.pal;
+ PaletteID pal = dts->ground.pal;
if (HasBit(image, SPRITE_MODIFIER_CUSTOM_SPRITE)) image += stage;
diff --git a/src/newgrf_industrytiles.cpp b/src/newgrf_industrytiles.cpp
index 4afc810ee..8d1d05732 100644
--- a/src/newgrf_industrytiles.cpp
+++ b/src/newgrf_industrytiles.cpp
@@ -172,7 +172,7 @@ static void IndustryDrawTileLayout(const TileInfo *ti, const TileLayoutSpriteGro
const DrawTileSprites *dts = group->dts;
SpriteID image = dts->ground.sprite;
- SpriteID pal = dts->ground.pal;
+ PaletteID pal = dts->ground.pal;
if (HasBit(image, SPRITE_MODIFIER_CUSTOM_SPRITE)) image += stage;
diff --git a/src/newgrf_station.cpp b/src/newgrf_station.cpp
index f1301ea72..d6dcba7b0 100644
--- a/src/newgrf_station.cpp
+++ b/src/newgrf_station.cpp
@@ -879,7 +879,7 @@ bool DrawStationTile(int x, int y, RailType railtype, Axis axis, StationClassID
const StationSpec *statspec;
const DrawTileSprites *sprites;
const RailtypeInfo *rti = GetRailTypeInfo(railtype);
- SpriteID palette = COMPANY_SPRITE_COLOUR(_local_company);
+ PaletteID palette = COMPANY_SPRITE_COLOUR(_local_company);
uint tile = 2;
statspec = GetCustomStationSpec(sclass, station);
@@ -899,7 +899,7 @@ bool DrawStationTile(int x, int y, RailType railtype, Axis axis, StationClassID
}
SpriteID image = sprites->ground.sprite;
- SpriteID pal = sprites->ground.pal;
+ PaletteID pal = sprites->ground.pal;
if (HasBit(image, SPRITE_MODIFIER_CUSTOM_SPRITE)) {
image += GetCustomStationGroundRelocation(statspec, NULL, INVALID_TILE);
image += rti->custom_ground_offset;
diff --git a/src/rail_cmd.cpp b/src/rail_cmd.cpp
index 98909f38f..fa751e505 100644
--- a/src/rail_cmd.cpp
+++ b/src/rail_cmd.cpp
@@ -1757,7 +1757,7 @@ static void DrawTrackBits(TileInfo *ti, TrackBits track)
/* DrawFoundation modifies ti */
SpriteID image;
- SpriteID pal = PAL_NONE;
+ PaletteID pal = PAL_NONE;
const SubSprite *sub = NULL;
bool junction = false;
@@ -1944,7 +1944,7 @@ static void DrawTile_Track(TileInfo *ti)
} else {
/* draw depot */
const DrawTileSprites *dts;
- SpriteID pal = PAL_NONE;
+ PaletteID pal = PAL_NONE;
if (ti->tileh != SLOPE_FLAT) DrawFoundation(ti, FOUNDATION_LEVELED);
@@ -1997,7 +1997,7 @@ void DrawTrainDepotSprite(int x, int y, int dir, RailType railtype)
y += 17;
if (image != SPR_FLAT_GRASS_TILE) image += offset;
- SpriteID palette = COMPANY_SPRITE_COLOUR(_local_company);
+ PaletteID palette = COMPANY_SPRITE_COLOUR(_local_company);
DrawSprite(image, PAL_NONE, x, y);
DrawRailTileSeqInGUI(x, y, dts, offset, 0, palette);
diff --git a/src/road_cmd.cpp b/src/road_cmd.cpp
index 0df105778..5e66c6db3 100644
--- a/src/road_cmd.cpp
+++ b/src/road_cmd.cpp
@@ -1087,7 +1087,7 @@ static void DrawRoadBits(TileInfo *ti)
RoadBits tram = GetRoadBits(ti->tile, ROADTYPE_TRAM);
SpriteID image = 0;
- SpriteID pal = PAL_NONE;
+ PaletteID pal = PAL_NONE;
if (ti->tileh != SLOPE_FLAT) {
DrawFoundation(ti, GetRoadFoundation(ti->tileh, road | tram));
@@ -1176,7 +1176,7 @@ static void DrawTile_Road(TileInfo *ti)
if (ti->tileh != SLOPE_FLAT) DrawFoundation(ti, FOUNDATION_LEVELED);
SpriteID image = GetRailTypeInfo(GetRailType(ti->tile))->base_sprites.crossing;
- SpriteID pal = PAL_NONE;
+ PaletteID pal = PAL_NONE;
if (GetCrossingRoadAxis(ti->tile) == AXIS_X) image++;
if (IsCrossingBarred(ti->tile)) image += 2;
@@ -1212,7 +1212,7 @@ static void DrawTile_Road(TileInfo *ti)
case ROAD_TILE_DEPOT: {
if (ti->tileh != SLOPE_FLAT) DrawFoundation(ti, FOUNDATION_LEVELED);
- SpriteID palette = COMPANY_SPRITE_COLOUR(GetTileOwner(ti->tile));
+ PaletteID palette = COMPANY_SPRITE_COLOUR(GetTileOwner(ti->tile));
const DrawTileSprites *dts;
if (HasTileRoadType(ti->tile, ROADTYPE_TRAM)) {
@@ -1231,7 +1231,7 @@ static void DrawTile_Road(TileInfo *ti)
void DrawRoadDepotSprite(int x, int y, DiagDirection dir, RoadType rt)
{
- SpriteID palette = COMPANY_SPRITE_COLOUR(_local_company);
+ PaletteID palette = COMPANY_SPRITE_COLOUR(_local_company);
const DrawTileSprites *dts = (rt == ROADTYPE_TRAM) ? &_tram_depot[dir] : &_road_depot[dir];
x += 33;
diff --git a/src/roadveh_cmd.cpp b/src/roadveh_cmd.cpp
index 4bf84953d..5ff4816ad 100644
--- a/src/roadveh_cmd.cpp
+++ b/src/roadveh_cmd.cpp
@@ -145,7 +145,7 @@ SpriteID RoadVehicle::GetImage(Direction direction) const
return sprite;
}
-void DrawRoadVehEngine(int left, int right, int preferred_x, int y, EngineID engine, SpriteID pal)
+void DrawRoadVehEngine(int left, int right, int preferred_x, int y, EngineID engine, PaletteID pal)
{
SpriteID sprite = GetRoadVehIcon(engine);
const Sprite *real_sprite = GetSprite(sprite, ST_NORMAL);
diff --git a/src/roadveh_gui.cpp b/src/roadveh_gui.cpp
index c046c5891..abe6441e1 100644
--- a/src/roadveh_gui.cpp
+++ b/src/roadveh_gui.cpp
@@ -143,7 +143,7 @@ void DrawRoadVehImage(const Vehicle *v, int left, int right, int y, VehicleID se
Point offset;
int width = u->GetDisplayImageWidth(&offset);
- SpriteID pal = (u->vehstatus & VS_CRASHED) ? PALETTE_CRASH : GetVehiclePalette(u);
+ PaletteID pal = (u->vehstatus & VS_CRASHED) ? PALETTE_CRASH : GetVehiclePalette(u);
DrawSprite(u->GetImage(dir), pal, pos + (rtl ? -offset.x : offset.x), y + 6 + offset.y);
pos += rtl ? -width : width;
diff --git a/src/ship_cmd.cpp b/src/ship_cmd.cpp
index f060218cb..723992e50 100644
--- a/src/ship_cmd.cpp
+++ b/src/ship_cmd.cpp
@@ -65,7 +65,7 @@ static SpriteID GetShipIcon(EngineID engine)
return DIR_W + _ship_sprites[spritenum];
}
-void DrawShipEngine(int left, int right, int preferred_x, int y, EngineID engine, SpriteID pal)
+void DrawShipEngine(int left, int right, int preferred_x, int y, EngineID engine, PaletteID pal)
{
SpriteID sprite = GetShipIcon(engine);
const Sprite *real_sprite = GetSprite(sprite, ST_NORMAL);
diff --git a/src/sprite.cpp b/src/sprite.cpp
index bfb0acff5..eb2e9a162 100644
--- a/src/sprite.cpp
+++ b/src/sprite.cpp
@@ -28,7 +28,7 @@
* @param default_palette The default recolour sprite to use (typically company colour)
* @param child_offset_is_unsigned Whether child sprite offsets are interpreted signed or unsigned
*/
-void DrawCommonTileSeq(const TileInfo *ti, const DrawTileSprites *dts, TransparencyOption to, int32 orig_offset, uint32 newgrf_offset, SpriteID default_palette, bool child_offset_is_unsigned)
+void DrawCommonTileSeq(const TileInfo *ti, const DrawTileSprites *dts, TransparencyOption to, int32 orig_offset, uint32 newgrf_offset, PaletteID default_palette, bool child_offset_is_unsigned)
{
const DrawTileSeqStruct *dtss;
foreach_draw_tile_seq(dtss, dts->seq) {
@@ -42,7 +42,7 @@ void DrawCommonTileSeq(const TileInfo *ti, const DrawTileSprites *dts, Transpare
image += (HasBit(image, SPRITE_MODIFIER_CUSTOM_SPRITE) ? newgrf_offset : orig_offset);
- SpriteID pal = SpriteLayoutPaletteTransform(image, dtss->image.pal, default_palette);
+ PaletteID pal = SpriteLayoutPaletteTransform(image, dtss->image.pal, default_palette);
if ((byte)dtss->delta_z != 0x80) {
AddSortableSpriteToDraw(
@@ -70,7 +70,7 @@ void DrawCommonTileSeq(const TileInfo *ti, const DrawTileSprites *dts, Transpare
* @param default_palette The default recolour sprite to use (typically company colour)
* @param child_offset_is_unsigned Whether child sprite offsets are interpreted signed or unsigned
*/
-void DrawCommonTileSeqInGUI(int x, int y, const DrawTileSprites *dts, int32 orig_offset, uint32 newgrf_offset, SpriteID default_palette, bool child_offset_is_unsigned)
+void DrawCommonTileSeqInGUI(int x, int y, const DrawTileSprites *dts, int32 orig_offset, uint32 newgrf_offset, PaletteID default_palette, bool child_offset_is_unsigned)
{
const DrawTileSeqStruct *dtss;
Point child_offset = {0, 0};
@@ -83,7 +83,7 @@ void DrawCommonTileSeqInGUI(int x, int y, const DrawTileSprites *dts, int32 orig
image += (HasBit(image, SPRITE_MODIFIER_CUSTOM_SPRITE) ? newgrf_offset : orig_offset);
- SpriteID pal = SpriteLayoutPaletteTransform(image, dtss->image.pal, default_palette);
+ PaletteID pal = SpriteLayoutPaletteTransform(image, dtss->image.pal, default_palette);
if ((byte)dtss->delta_z != 0x80) {
Point pt = RemapCoords(dtss->delta_x, dtss->delta_y, dtss->delta_z);
diff --git a/src/sprite.h b/src/sprite.h
index d831e31c4..61a621b86 100644
--- a/src/sprite.h
+++ b/src/sprite.h
@@ -59,15 +59,15 @@ struct DrawBuildingsTileStruct {
/** Iterate through all DrawTileSeqStructs in DrawTileSprites. */
#define foreach_draw_tile_seq(idx, list) for (idx = list; ((byte) idx->delta_x) != 0x80; idx++)
-void DrawCommonTileSeq(const struct TileInfo *ti, const DrawTileSprites *dts, TransparencyOption to, int32 orig_offset, uint32 newgrf_offset, SpriteID default_palette, bool child_offset_is_unsigned);
-void DrawCommonTileSeqInGUI(int x, int y, const DrawTileSprites *dts, int32 orig_offset, uint32 newgrf_offset, SpriteID default_palette, bool child_offset_is_unsigned);
+void DrawCommonTileSeq(const struct TileInfo *ti, const DrawTileSprites *dts, TransparencyOption to, int32 orig_offset, uint32 newgrf_offset, PaletteID default_palette, bool child_offset_is_unsigned);
+void DrawCommonTileSeqInGUI(int x, int y, const DrawTileSprites *dts, int32 orig_offset, uint32 newgrf_offset, PaletteID default_palette, bool child_offset_is_unsigned);
/**
* Draw tile sprite sequence on tile with railroad specifics.
* @param total_offset Spriteoffset from normal rail to current railtype.
* @param newgrf_offset Startsprite of the Action1 to use.
*/
-static inline void DrawRailTileSeq(const struct TileInfo *ti, const DrawTileSprites *dts, TransparencyOption to, int32 total_offset, uint32 newgrf_offset, SpriteID default_palette)
+static inline void DrawRailTileSeq(const struct TileInfo *ti, const DrawTileSprites *dts, TransparencyOption to, int32 total_offset, uint32 newgrf_offset, PaletteID default_palette)
{
DrawCommonTileSeq(ti, dts, to, total_offset, newgrf_offset, default_palette, false);
}
@@ -77,7 +77,7 @@ static inline void DrawRailTileSeq(const struct TileInfo *ti, const DrawTileSpri
* @param total_offset Spriteoffset from normal rail to current railtype.
* @param newgrf_offset Startsprite of the Action1 to use.
*/
-static inline void DrawRailTileSeqInGUI(int x, int y, const DrawTileSprites *dts, int32 total_offset, uint32 newgrf_offset, SpriteID default_palette)
+static inline void DrawRailTileSeqInGUI(int x, int y, const DrawTileSprites *dts, int32 total_offset, uint32 newgrf_offset, PaletteID default_palette)
{
DrawCommonTileSeqInGUI(x, y, dts, total_offset, newgrf_offset, default_palette, false);
}
@@ -85,7 +85,7 @@ static inline void DrawRailTileSeqInGUI(int x, int y, const DrawTileSprites *dts
/**
* Draw TTD sprite sequence on tile.
*/
-static inline void DrawOrigTileSeq(const struct TileInfo *ti, const DrawTileSprites *dts, TransparencyOption to, SpriteID default_palette)
+static inline void DrawOrigTileSeq(const struct TileInfo *ti, const DrawTileSprites *dts, TransparencyOption to, PaletteID default_palette)
{
DrawCommonTileSeq(ti, dts, to, 0, 0, default_palette, false);
}
@@ -93,7 +93,7 @@ static inline void DrawOrigTileSeq(const struct TileInfo *ti, const DrawTileSpri
/**
* Draw TTD sprite sequence in GUI.
*/
-static inline void DrawOrigTileSeqInGUI(int x, int y, const DrawTileSprites *dts, SpriteID default_palette)
+static inline void DrawOrigTileSeqInGUI(int x, int y, const DrawTileSprites *dts, PaletteID default_palette)
{
DrawCommonTileSeqInGUI(x, y, dts, 0, 0, default_palette, false);
}
@@ -102,7 +102,7 @@ static inline void DrawOrigTileSeqInGUI(int x, int y, const DrawTileSprites *dts
* Draw NewGRF industrytile or house sprite layout
* @param stage Sprite inside the Action1 spritesets to use, i.e. construction stage.
*/
-static inline void DrawNewGRFTileSeq(const struct TileInfo *ti, const DrawTileSprites *dts, TransparencyOption to, uint32 stage, SpriteID default_palette)
+static inline void DrawNewGRFTileSeq(const struct TileInfo *ti, const DrawTileSprites *dts, TransparencyOption to, uint32 stage, PaletteID default_palette)
{
DrawCommonTileSeq(ti, dts, to, 0, stage, default_palette, true);
}
@@ -118,7 +118,7 @@ static inline void DrawNewGRFTileSeq(const struct TileInfo *ti, const DrawTileSp
* @param default_pal The default recolour sprite to use (typically company colour resp. random industry/house colour)
* @return The palette to use
*/
-static inline SpriteID SpriteLayoutPaletteTransform(SpriteID image, SpriteID pal, SpriteID default_pal)
+static inline PaletteID SpriteLayoutPaletteTransform(SpriteID image, PaletteID pal, PaletteID default_pal)
{
if (HasBit(image, PALETTE_MODIFIER_TRANSPARENT) || HasBit(image, PALETTE_MODIFIER_COLOUR)) {
return (pal != 0 ? pal : default_pal);
@@ -137,7 +137,7 @@ static inline SpriteID SpriteLayoutPaletteTransform(SpriteID image, SpriteID pal
* @param default_pal The default recolour sprite to use (typically company colour resp. random industry/house colour)
* @return The palette to use
*/
-static inline SpriteID GroundSpritePaletteTransform(SpriteID image, SpriteID pal, SpriteID default_pal)
+static inline PaletteID GroundSpritePaletteTransform(SpriteID image, PaletteID pal, PaletteID default_pal)
{
if (HasBit(image, PALETTE_MODIFIER_COLOUR)) {
return (pal != 0 ? pal : default_pal);
diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp
index 1a0caa1e9..37746da54 100644
--- a/src/station_cmd.cpp
+++ b/src/station_cmd.cpp
@@ -2325,7 +2325,7 @@ static void DrawTile_Station(TileInfo *ti)
const StationSpec *statspec = NULL;
Owner owner = GetTileOwner(ti->tile);
- SpriteID palette;
+ PaletteID palette;
if (Company::IsValidID(owner)) {
palette = COMPANY_SPRITE_COLOUR(owner);
} else {
@@ -2430,7 +2430,7 @@ static void DrawTile_Station(TileInfo *ti)
}
} else {
SpriteID image = t->ground.sprite;
- SpriteID pal = t->ground.pal;
+ PaletteID pal = t->ground.pal;
if (HasBit(image, SPRITE_MODIFIER_CUSTOM_SPRITE)) {
image += GetCustomStationGroundRelocation(statspec, st, ti->tile);
image += custom_ground_offset;
@@ -2465,7 +2465,7 @@ static void DrawTile_Station(TileInfo *ti)
void StationPickerDrawSprite(int x, int y, StationType st, RailType railtype, RoadType roadtype, int image)
{
int32 total_offset = 0;
- SpriteID pal = COMPANY_SPRITE_COLOUR(_local_company);
+ PaletteID pal = COMPANY_SPRITE_COLOUR(_local_company);
const DrawTileSprites *t = &_station_display_datas[st][image];
if (railtype != INVALID_RAILTYPE) {
diff --git a/src/tilehighlight_func.h b/src/tilehighlight_func.h
index 778faff61..6f37c5579 100644
--- a/src/tilehighlight_func.h
+++ b/src/tilehighlight_func.h
@@ -20,8 +20,8 @@ void PlaceProc_DemolishArea(TileIndex tile);
bool GUIPlaceProcDragXY(ViewportDragDropSelectionProcess proc, TileIndex start_tile, TileIndex end_tile);
bool HandlePlacePushButton(Window *w, int widget, CursorID cursor, HighLightStyle mode, PlaceProc *placeproc);
-void SetObjectToPlaceWnd(CursorID icon, SpriteID pal, HighLightStyle mode, Window *w);
-void SetObjectToPlace(CursorID icon, SpriteID pal, HighLightStyle mode, WindowClass window_class, WindowNumber window_num);
+void SetObjectToPlaceWnd(CursorID icon, PaletteID pal, HighLightStyle mode, Window *w);
+void SetObjectToPlace(CursorID icon, PaletteID pal, HighLightStyle mode, WindowClass window_class, WindowNumber window_num);
void ResetObjectToPlace();
void VpSelectTilesWithMethod(int x, int y, ViewportPlaceMethod method);
diff --git a/src/train_cmd.cpp b/src/train_cmd.cpp
index fe730b44b..a1c9d51d2 100644
--- a/src/train_cmd.cpp
+++ b/src/train_cmd.cpp
@@ -637,7 +637,7 @@ static SpriteID GetRailIcon(EngineID engine, bool rear_head, int &y)
return GetDefaultTrainSprite(spritenum, DIR_W);
}
-void DrawTrainEngine(int left, int right, int preferred_x, int y, EngineID engine, SpriteID pal)
+void DrawTrainEngine(int left, int right, int preferred_x, int y, EngineID engine, PaletteID pal)
{
if (RailVehInfo(engine)->railveh_type == RAILVEH_MULTIHEAD) {
int yf = y;
diff --git a/src/train_gui.cpp b/src/train_gui.cpp
index 4eb6da762..16291af14 100644
--- a/src/train_gui.cpp
+++ b/src/train_gui.cpp
@@ -80,7 +80,7 @@ void DrawTrainImage(const Train *v, int left, int right, int y, VehicleID select
int width = Train::From(v)->GetDisplayImageWidth(&offset);
if (rtl ? px + width > 0 : px - width < max_width) {
- SpriteID pal = (v->vehstatus & VS_CRASHED) ? PALETTE_CRASH : GetVehiclePalette(v);
+ PaletteID pal = (v->vehstatus & VS_CRASHED) ? PALETTE_CRASH : GetVehiclePalette(v);
DrawSprite(v->GetImage(dir), pal, px + (rtl ? -offset.x : offset.x), 7 + offset.y);
}
@@ -314,7 +314,7 @@ void DrawTrainDetails(const Train *v, int left, int right, int y, int vscroll_po
Point offset;
int width = u->GetDisplayImageWidth(&offset);
if (vscroll_pos <= 0 && vscroll_pos > -vscroll_cap) {
- SpriteID pal = (v->vehstatus & VS_CRASHED) ? PALETTE_CRASH : GetVehiclePalette(v);
+ PaletteID pal = (v->vehstatus & VS_CRASHED) ? PALETTE_CRASH : GetVehiclePalette(v);
DrawSprite(u->GetImage(dir), pal, px + (rtl ? -offset.x : offset.x), y - line_height * vscroll_pos + sprite_y_offset + offset.y);
}
px += rtl ? -width : width;
diff --git a/src/tree_cmd.cpp b/src/tree_cmd.cpp
index 94eb3f067..3c127e0ae 100644
--- a/src/tree_cmd.cpp
+++ b/src/tree_cmd.cpp
@@ -433,9 +433,7 @@ CommandCost CmdPlantTree(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32
}
}
-struct TreeListEnt {
- SpriteID image;
- SpriteID pal;
+struct TreeListEnt : PalSpriteID {
byte x, y;
};
@@ -477,11 +475,11 @@ static void DrawTile_Trees(TileInfo *ti)
uint trees = GetTreeCount(ti->tile);
for (uint i = 0; i < trees; i++) {
- SpriteID image = s[0].sprite + (i == trees - 1 ? GetTreeGrowth(ti->tile) : 3);
- SpriteID pal = s[0].pal;
+ SpriteID sprite = s[0].sprite + (i == trees - 1 ? GetTreeGrowth(ti->tile) : 3);
+ PaletteID pal = s[0].pal;
- te[i].image = image;
- te[i].pal = pal;
+ te[i].sprite = sprite;
+ te[i].pal = pal;
te[i].x = d->x;
te[i].y = d->y;
s++;
@@ -502,7 +500,7 @@ static void DrawTile_Trees(TileInfo *ti)
}
}
- AddSortableSpriteToDraw(te[mi].image, te[mi].pal, ti->x + te[mi].x, ti->y + te[mi].y, 16 - te[mi].x, 16 - te[mi].y, 0x30, z, IsTransparencySet(TO_TREES), -te[mi].x, -te[mi].y);
+ AddSortableSpriteToDraw(te[mi].sprite, te[mi].pal, ti->x + te[mi].x, ti->y + te[mi].y, 16 - te[mi].x, 16 - te[mi].y, 0x30, z, IsTransparencySet(TO_TREES), -te[mi].x, -te[mi].y);
/* replace the removed one with the last one */
te[mi] = te[trees - 1];
diff --git a/src/unmovable_cmd.cpp b/src/unmovable_cmd.cpp
index 8044354fc..c1b626517 100644
--- a/src/unmovable_cmd.cpp
+++ b/src/unmovable_cmd.cpp
@@ -232,7 +232,7 @@ static void DrawTile_Unmovable(TileInfo *ti)
assert(IsCompanyHQ(ti->tile));
if (ti->tileh != SLOPE_FLAT) DrawFoundation(ti, FOUNDATION_LEVELED);
- SpriteID palette = COMPANY_SPRITE_COLOUR(GetTileOwner(ti->tile));
+ PaletteID palette = COMPANY_SPRITE_COLOUR(GetTileOwner(ti->tile));
const DrawTileSprites *t = &_unmovable_display_datas[GetCompanyHQSize(ti->tile) << 2 | GetCompanyHQSection(ti->tile)];
DrawGroundSprite(t->ground.sprite, palette);
diff --git a/src/vehicle.cpp b/src/vehicle.cpp
index f2cecfe68..a62cac987 100644
--- a/src/vehicle.cpp
+++ b/src/vehicle.cpp
@@ -766,7 +766,7 @@ void CallVehicleTicks()
static void DoDrawVehicle(const Vehicle *v)
{
SpriteID image = v->cur_image;
- SpriteID pal = PAL_NONE;
+ PaletteID pal = PAL_NONE;
if (v->vehstatus & VS_DEFPAL) pal = (v->vehstatus & VS_CRASHED) ? PALETTE_CRASH : GetVehiclePalette(v);
@@ -1393,9 +1393,9 @@ const Livery *GetEngineLivery(EngineID engine_type, CompanyID company, EngineID
}
-static SpriteID GetEngineColourMap(EngineID engine_type, CompanyID company, EngineID parent_engine_type, const Vehicle *v)
+static PaletteID GetEngineColourMap(EngineID engine_type, CompanyID company, EngineID parent_engine_type, const Vehicle *v)
{
- SpriteID map = (v != NULL) ? v->colourmap : PAL_NONE;
+ PaletteID map = (v != NULL) ? v->colourmap : PAL_NONE;
/* Return cached value if any */
if (map != PAL_NONE) return map;
@@ -1421,7 +1421,7 @@ static SpriteID GetEngineColourMap(EngineID engine_type, CompanyID company, Engi
bool twocc = HasBit(e->info.misc_flags, EF_USES_2CC);
- if (map == PAL_NONE) map = twocc ? (SpriteID)SPR_2CCMAP_BASE : (SpriteID)PALETTE_RECOLOUR_START;
+ if (map == PAL_NONE) map = twocc ? (PaletteID)SPR_2CCMAP_BASE : (PaletteID)PALETTE_RECOLOUR_START;
/* Spectator has news shown too, but has invalid company ID - as well as dedicated server */
if (!Company::IsValidID(company)) return map;
@@ -1436,12 +1436,12 @@ static SpriteID GetEngineColourMap(EngineID engine_type, CompanyID company, Engi
return map;
}
-SpriteID GetEnginePalette(EngineID engine_type, CompanyID company)
+PaletteID GetEnginePalette(EngineID engine_type, CompanyID company)
{
return GetEngineColourMap(engine_type, company, INVALID_ENGINE, NULL);
}
-SpriteID GetVehiclePalette(const Vehicle *v)
+PaletteID GetVehiclePalette(const Vehicle *v)
{
if (v->type == VEH_TRAIN) {
return GetEngineColourMap(v->engine_type, v->owner, Train::From(v)->tcache.first_engine, v);
diff --git a/src/vehicle_gui.cpp b/src/vehicle_gui.cpp
index 4707b47bf..76079d955 100644
--- a/src/vehicle_gui.cpp
+++ b/src/vehicle_gui.cpp
@@ -142,7 +142,7 @@ void DepotSortList(VehicleList *list)
/** draw the vehicle profit button in the vehicle list window. */
static void DrawVehicleProfitButton(const Vehicle *v, int x, int y)
{
- SpriteID pal;
+ PaletteID pal;
/* draw profit-based coloured icons */
if (v->age <= DAYS_IN_YEAR * 2) {
diff --git a/src/viewport.cpp b/src/viewport.cpp
index 0248ee95c..4239a299e 100644
--- a/src/viewport.cpp
+++ b/src/viewport.cpp
@@ -63,7 +63,7 @@ struct StringSpriteToDraw {
struct TileSpriteToDraw {
SpriteID image;
- SpriteID pal;
+ PaletteID pal;
const SubSprite *sub; ///< only draw a rectangular part of the sprite
int32 x; ///< screen X coordinate of sprite
int32 y; ///< screen Y coordinate of sprite
@@ -71,7 +71,7 @@ struct TileSpriteToDraw {
struct ChildScreenSpriteToDraw {
SpriteID image;
- SpriteID pal;
+ PaletteID pal;
const SubSprite *sub; ///< only draw a rectangular part of the sprite
int32 x;
int32 y;
@@ -81,7 +81,7 @@ struct ChildScreenSpriteToDraw {
/** Parent sprite that should be drawn */
struct ParentSpriteToDraw {
SpriteID image; ///< sprite to draw
- SpriteID pal; ///< palette to use
+ PaletteID pal; ///< palette to use
const SubSprite *sub; ///< only draw a rectangular part of the sprite
int32 x; ///< screen X coordinate of sprite
@@ -476,7 +476,7 @@ void HandleZoomMessage(Window *w, const ViewPort *vp, byte widget_zoom_in, byte
* @param extra_offs_x Pixel X offset for the sprite position.
* @param extra_offs_y Pixel Y offset for the sprite position.
*/
-static void AddTileSpriteToDraw(SpriteID image, SpriteID pal, int32 x, int32 y, int z, const SubSprite *sub = NULL, int extra_offs_x = 0, int extra_offs_y = 0)
+static void AddTileSpriteToDraw(SpriteID image, PaletteID pal, int32 x, int32 y, int z, const SubSprite *sub = NULL, int extra_offs_x = 0, int extra_offs_y = 0)
{
assert((image & SPRITE_MASK) < MAX_SPRITES);
@@ -501,7 +501,7 @@ static void AddTileSpriteToDraw(SpriteID image, SpriteID pal, int32 x, int32 y,
* @param extra_offs_x Pixel X offset for the sprite position.
* @param extra_offs_y Pixel Y offset for the sprite position.
*/
-static void AddChildSpriteToFoundation(SpriteID image, SpriteID pal, const SubSprite *sub, FoundationPart foundation_part, int extra_offs_x, int extra_offs_y)
+static void AddChildSpriteToFoundation(SpriteID image, PaletteID pal, const SubSprite *sub, FoundationPart foundation_part, int extra_offs_x, int extra_offs_y)
{
assert(IsInsideMM(foundation_part, 0, FOUNDATION_PART_END));
assert(_vd.foundation[foundation_part] != -1);
@@ -530,7 +530,7 @@ static void AddChildSpriteToFoundation(SpriteID image, SpriteID pal, const SubSp
* @param extra_offs_x Pixel X offset for the sprite position.
* @param extra_offs_y Pixel Y offset for the sprite position.
*/
-void DrawGroundSpriteAt(SpriteID image, SpriteID pal, int32 x, int32 y, int z, const SubSprite *sub, int extra_offs_x, int extra_offs_y)
+void DrawGroundSpriteAt(SpriteID image, PaletteID pal, int32 x, int32 y, int z, const SubSprite *sub, int extra_offs_x, int extra_offs_y)
{
/* Switch to first foundation part, if no foundation was drawn */
if (_vd.foundation_part == FOUNDATION_PART_NONE) _vd.foundation_part = FOUNDATION_PART_NORMAL;
@@ -553,7 +553,7 @@ void DrawGroundSpriteAt(SpriteID image, SpriteID pal, int32 x, int32 y, int z, c
* @param extra_offs_x Pixel X offset for the sprite position.
* @param extra_offs_y Pixel Y offset for the sprite position.
*/
-void DrawGroundSprite(SpriteID image, SpriteID pal, const SubSprite *sub, int extra_offs_x, int extra_offs_y)
+void DrawGroundSprite(SpriteID image, PaletteID pal, const SubSprite *sub, int extra_offs_x, int extra_offs_y)
{
DrawGroundSpriteAt(image, pal, 0, 0, 0, sub, extra_offs_x, extra_offs_y);
}
@@ -597,7 +597,7 @@ void OffsetGroundSprite(int x, int y)
* @param z position z of the sprite.
* @param sub Only draw a part of the sprite.
*/
-static void AddCombinedSprite(SpriteID image, SpriteID pal, int x, int y, byte z, const SubSprite *sub)
+static void AddCombinedSprite(SpriteID image, PaletteID pal, int x, int y, byte z, const SubSprite *sub)
{
Point pt = RemapCoords(x, y, z);
const Sprite *spr = GetSprite(image & SPRITE_MASK, ST_NORMAL);
@@ -636,7 +636,7 @@ static void AddCombinedSprite(SpriteID image, SpriteID pal, int x, int y, byte z
* @param bb_offset_z bounding box extent towards negative Z (world)
* @param sub Only draw a part of the sprite.
*/
-void AddSortableSpriteToDraw(SpriteID image, SpriteID pal, int x, int y, int w, int h, int dz, int z, bool transparent, int bb_offset_x, int bb_offset_y, int bb_offset_z, const SubSprite *sub)
+void AddSortableSpriteToDraw(SpriteID image, PaletteID pal, int x, int y, int w, int h, int dz, int z, bool transparent, int bb_offset_x, int bb_offset_y, int bb_offset_z, const SubSprite *sub)
{
int32 left, right, top, bottom;
@@ -759,7 +759,7 @@ void EndSpriteCombine()
* @param transparent if true, switch the palette between the provided palette and the transparent palette,
* @param sub Only draw a part of the sprite.
*/
-void AddChildSpriteScreen(SpriteID image, SpriteID pal, int x, int y, bool transparent, const SubSprite *sub)
+void AddChildSpriteScreen(SpriteID image, PaletteID pal, int x, int y, bool transparent, const SubSprite *sub)
{
assert((image & SPRITE_MASK) < MAX_SPRITES);
@@ -815,7 +815,7 @@ static void AddStringToDraw(int x, int y, StringID string, uint64 params_1, uint
* @param z_offset Z offset relative to the groundsprite. Only used for the sprite position, not for sprite sorting.
* @param foundation_part Foundation part the sprite belongs to.
*/
-static void DrawSelectionSprite(SpriteID image, SpriteID pal, const TileInfo *ti, int z_offset, FoundationPart foundation_part)
+static void DrawSelectionSprite(SpriteID image, PaletteID pal, const TileInfo *ti, int z_offset, FoundationPart foundation_part)
{
/* FIXME: This is not totally valid for some autorail highlights, that extent over the edges of the tile. */
if (_vd.foundation[foundation_part] == -1) {
@@ -833,7 +833,7 @@ static void DrawSelectionSprite(SpriteID image, SpriteID pal, const TileInfo *ti
* @param ti TileInfo Tile that is being drawn
* @param pal Palette to apply.
*/
-static void DrawTileSelectionRect(const TileInfo *ti, SpriteID pal)
+static void DrawTileSelectionRect(const TileInfo *ti, PaletteID pal)
{
if (!IsValidTile(ti->tile)) return;
@@ -896,7 +896,7 @@ static const HighLightStyle _autorail_type[6][2] = {
static void DrawAutorailSelection(const TileInfo *ti, uint autorail_type)
{
SpriteID image;
- SpriteID pal;
+ PaletteID pal;
int offset;
FoundationPart foundation_part = FOUNDATION_PART_NORMAL;
@@ -2656,14 +2656,14 @@ bool VpHandlePlaceSizingDrag()
return false;
}
-void SetObjectToPlaceWnd(CursorID icon, SpriteID pal, HighLightStyle mode, Window *w)
+void SetObjectToPlaceWnd(CursorID icon, PaletteID pal, HighLightStyle mode, Window *w)
{
SetObjectToPlace(icon, pal, mode, w->window_class, w->window_number);
}
#include "table/animcursors.h"
-void SetObjectToPlace(CursorID icon, SpriteID pal, HighLightStyle mode, WindowClass window_class, WindowNumber window_num)
+void SetObjectToPlace(CursorID icon, PaletteID pal, HighLightStyle mode, WindowClass window_class, WindowNumber window_num)
{
/* undo clicking on button and drag & drop */
if (_thd.place_mode != HT_NONE || _special_mouse_mode == WSM_DRAGDROP) {
diff --git a/src/viewport_func.h b/src/viewport_func.h
index e025f1c8a..027f9c165 100644
--- a/src/viewport_func.h
+++ b/src/viewport_func.h
@@ -45,10 +45,10 @@ static inline void MaxZoomInOut(int how, Window *w)
void OffsetGroundSprite(int x, int y);
-void DrawGroundSprite(SpriteID image, SpriteID pal, const SubSprite *sub = NULL, int extra_offs_x = 0, int extra_offs_y = 0);
-void DrawGroundSpriteAt(SpriteID image, SpriteID pal, int32 x, int32 y, int z, const SubSprite *sub = NULL, int extra_offs_x = 0, int extra_offs_y = 0);
-void AddSortableSpriteToDraw(SpriteID image, SpriteID pal, int x, int y, int w, int h, int dz, int z, bool transparent = false, int bb_offset_x = 0, int bb_offset_y = 0, int bb_offset_z = 0, const SubSprite *sub = NULL);
-void AddChildSpriteScreen(SpriteID image, SpriteID pal, int x, int y, bool transparent = false, const SubSprite *sub = NULL);
+void DrawGroundSprite(SpriteID image, PaletteID pal, const SubSprite *sub = NULL, int extra_offs_x = 0, int extra_offs_y = 0);
+void DrawGroundSpriteAt(SpriteID image, PaletteID pal, int32 x, int32 y, int z, const SubSprite *sub = NULL, int extra_offs_x = 0, int extra_offs_y = 0);
+void AddSortableSpriteToDraw(SpriteID image, PaletteID pal, int x, int y, int w, int h, int dz, int z, bool transparent = false, int bb_offset_x = 0, int bb_offset_y = 0, int bb_offset_z = 0, const SubSprite *sub = NULL);
+void AddChildSpriteScreen(SpriteID image, PaletteID pal, int x, int y, bool transparent = false, const SubSprite *sub = NULL);
void ViewportAddString(const DrawPixelInfo *dpi, ZoomLevel small_from, const ViewportSign *sign, StringID string_normal, StringID string_small, StringID string_small_shadow, uint64 params_1, uint64 params_2 = 0, Colours colour = INVALID_COLOUR);
diff --git a/src/water_cmd.cpp b/src/water_cmd.cpp
index 2f7d8b82b..25d876792 100644
--- a/src/water_cmd.cpp
+++ b/src/water_cmd.cpp
@@ -535,7 +535,7 @@ struct LocksDrawTileStruct {
#include "table/water_land.h"
static void DrawWaterStuff(const TileInfo *ti, const WaterDrawTileStruct *wdts,
- SpriteID palette, uint base, bool draw_ground)
+ PaletteID palette, uint base, bool draw_ground)
{
SpriteID image;
SpriteID water_base = GetCanalSprite(CF_WATERSLOPE, ti->tile);