1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-26 21:54:22 +01:00

Codefix: Sprite offsets and counts are not SpriteIDs. (#13336)

This commit is contained in:
Peter Nelson
2025-01-19 15:58:13 +00:00
committed by GitHub
parent 0aa9faf187
commit d22fd78b1c
4 changed files with 24 additions and 24 deletions

View File

@@ -202,13 +202,13 @@ static const SpriteID SPR_TRACKS_FOR_SLOPES_MAGLEV_BASE = SPR_TRACKS_FOR_SLOPES_
static const uint16_t TRACKS_FOR_SLOPES_SPRITE_COUNT = 12;
static const SpriteID SPR_SLOPES_BASE = SPR_TRACKS_FOR_SLOPES_BASE + TRACKS_FOR_SLOPES_SPRITE_COUNT;
static const SpriteID SPR_SLOPES_INCLINED_OFFSET = 15;
static const SpriteID SPR_SLOPES_VIRTUAL_BASE = SPR_SLOPES_BASE - SPR_SLOPES_INCLINED_OFFSET; // The original foundations (see SPR_FOUNDATION_BASE below) are mapped before the additional foundations.
static const SpriteID SPR_TRKFOUND_BLOCK_SIZE = 22; // The normal track foundation sprites are organized in blocks of 22.
static const uint16_t SLOPES_INCLINED_OFFSET = 15;
static const SpriteID SPR_SLOPES_VIRTUAL_BASE = SPR_SLOPES_BASE - SLOPES_INCLINED_OFFSET; // The original foundations (see SPR_FOUNDATION_BASE below) are mapped before the additional foundations.
static const uint16_t TRKFOUND_BLOCK_SIZE = 22; // The normal track foundation sprites are organized in blocks of 22.
static const uint16_t NORMAL_FOUNDATION_SPRITE_COUNT = 74;
/** Halftile foundations */
static const SpriteID SPR_HALFTILE_FOUNDATION_BASE = SPR_SLOPES_BASE + NORMAL_FOUNDATION_SPRITE_COUNT;
static const SpriteID SPR_HALFTILE_BLOCK_SIZE = 4; // The half tile foundation sprites are organized in blocks of 4.
static const uint16_t HALFTILE_BLOCK_SIZE = 4; // The half tile foundation sprites are organized in blocks of 4.
static const uint16_t NORMAL_AND_HALFTILE_FOUNDATION_SPRITE_COUNT = 90;
static const SpriteID SPR_AUTORAIL_BASE = SPR_HALFTILE_FOUNDATION_BASE + NORMAL_AND_HALFTILE_FOUNDATION_SPRITE_COUNT;
@@ -222,11 +222,11 @@ static const uint16_t TWOCCMAP_SPRITE_COUNT = 256;
/** shore tiles - action 05-0D */
static const SpriteID SPR_SHORE_BASE = SPR_2CCMAP_BASE + TWOCCMAP_SPRITE_COUNT;
static const SpriteID SPR_SHORE_SPRITE_COUNT = 18;
static const uint16_t SHORE_SPRITE_COUNT = 18;
static const SpriteID SPR_ORIGINALSHORE_START = 4062;
static const SpriteID SPR_ORIGINALSHORE_END = 4069;
static const SpriteID SPR_AIRPORTX_BASE = SPR_SHORE_BASE + SPR_SHORE_SPRITE_COUNT; // The sprites used for other airport angles
static const SpriteID SPR_AIRPORTX_BASE = SPR_SHORE_BASE + SHORE_SPRITE_COUNT; // The sprites used for other airport angles
static const SpriteID SPR_NEWAIRPORT_TARMAC = SPR_AIRPORTX_BASE;
static const SpriteID SPR_NSRUNWAY1 = SPR_AIRPORTX_BASE + 1;
static const SpriteID SPR_NSRUNWAY2 = SPR_AIRPORTX_BASE + 2;
@@ -255,9 +255,9 @@ static const SpriteID SPR_AIRPORT_PREVIEW_COMMUTER = SPR_AIRPORT_PREVIEW
static const SpriteID SPR_AIRPORT_PREVIEW_HELIDEPOT = SPR_AIRPORT_PREVIEW_BASE + 6;
static const SpriteID SPR_AIRPORT_PREVIEW_INTERCONTINENTAL = SPR_AIRPORT_PREVIEW_BASE + 7;
static const SpriteID SPR_AIRPORT_PREVIEW_HELISTATION = SPR_AIRPORT_PREVIEW_BASE + 8;
static const SpriteID SPR_AIRPORT_PREVIEW_COUNT = 9;
static const uint16_t AIRPORT_PREVIEW_SPRITE_COUNT = 9;
static const SpriteID SPR_ROADSTOP_BASE = SPR_AIRPORT_PREVIEW_BASE + SPR_AIRPORT_PREVIEW_COUNT; // The sprites used for drive-through road stops
static const SpriteID SPR_ROADSTOP_BASE = SPR_AIRPORT_PREVIEW_BASE + AIRPORT_PREVIEW_SPRITE_COUNT; // The sprites used for drive-through road stops
static const SpriteID SPR_BUS_STOP_DT_Y_W = SPR_ROADSTOP_BASE;
static const SpriteID SPR_BUS_STOP_DT_Y_E = SPR_ROADSTOP_BASE + 1;
static const SpriteID SPR_BUS_STOP_DT_X_W = SPR_ROADSTOP_BASE + 2;
@@ -272,7 +272,7 @@ static const uint16_t ROADSTOP_SPRITE_COUNT = 8;
static const SpriteID SPR_TRAMWAY_BASE = SPR_ROADSTOP_BASE + ROADSTOP_SPRITE_COUNT;
static const SpriteID SPR_TRAMWAY_OVERLAY = SPR_TRAMWAY_BASE + 4;
static const SpriteID SPR_TRAMWAY_TRAM = SPR_TRAMWAY_BASE + 27;
static const SpriteID SPR_TRAMWAY_SLOPED_OFFSET = 11;
static const uint16_t TRAMWAY_SLOPED_OFFSET = 11;
static const SpriteID SPR_TRAMWAY_BUS_STOP_DT_Y_W = SPR_TRAMWAY_BASE + 25;
static const SpriteID SPR_TRAMWAY_BUS_STOP_DT_Y_E = SPR_TRAMWAY_BASE + 23;
static const SpriteID SPR_TRAMWAY_BUS_STOP_DT_X_W = SPR_TRAMWAY_BASE + 24;
@@ -291,8 +291,8 @@ static const uint16_t TRAMWAY_SPRITE_COUNT = 119;
/** One way road sprites */
static const SpriteID SPR_ONEWAY_BASE = SPR_TRAMWAY_BASE + TRAMWAY_SPRITE_COUNT;
static const SpriteID SPR_ONEWAY_SLOPE_N_OFFSET = 6;
static const SpriteID SPR_ONEWAY_SLOPE_S_OFFSET = 12;
static const uint16_t ONEWAY_SLOPE_N_OFFSET = 6;
static const uint16_t ONEWAY_SLOPE_S_OFFSET = 12;
static const uint16_t ONEWAY_SPRITE_COUNT = 18;
/** Tunnel sprites with grass only for custom railtype tunnel. */
@@ -367,9 +367,9 @@ static const SpriteID SPR_STATUE_COMPANY = 2632;
static const SpriteID SPR_BOUGHT_LAND = 4790;
/* sprites for rail and rail stations*/
static const SpriteID SPR_RAIL_SNOW_OFFSET = 26;
static const SpriteID SPR_MONO_SNOW_OFFSET = 26;
static const SpriteID SPR_MGLV_SNOW_OFFSET = 26;
static const uint16_t SPR_RAIL_SNOW_OFFSET = 26;
static const uint16_t SPR_MONO_SNOW_OFFSET = 26;
static const uint16_t SPR_MGLV_SNOW_OFFSET = 26;
static const SpriteID SPR_ORIGINAL_SIGNALS_BASE = 1275;