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

Codechange: Rename CBID_STATION_SPRITE_LAYOUT and CBID_STATION_TILE_LAYOUT.

These callbacks both select rail station tile layouts, the difference is one happens when drawing, the other happens when building. Change the names to make this clearer.
This commit is contained in:
Peter Nelson
2024-04-21 14:25:37 +01:00
committed by Peter Nelson
parent ba46128bdd
commit 70a2ed062d
4 changed files with 12 additions and 12 deletions

View File

@@ -1473,12 +1473,12 @@ CommandCost CmdBuildRailStation(DoCommandFlag flags, TileIndex tile_org, RailTyp
uint32_t platinfo = GetPlatformInfo(AXIS_X, GetStationGfx(tile), plat_len, numtracks_orig, plat_len - w, numtracks_orig - numtracks, false);
/* As the station is not yet completely finished, the station does not yet exist. */
uint16_t callback = GetStationCallback(CBID_STATION_TILE_LAYOUT, platinfo, 0, statspec, nullptr, tile);
uint16_t callback = GetStationCallback(CBID_STATION_BUILD_TILE_LAYOUT, platinfo, 0, statspec, nullptr, tile);
if (callback != CALLBACK_FAILED) {
if (callback < 8) {
SetStationGfx(tile, (callback & ~1) + axis);
} else {
ErrorUnknownCallbackResult(statspec->grf_prop.grffile->grfid, CBID_STATION_TILE_LAYOUT, callback);
ErrorUnknownCallbackResult(statspec->grf_prop.grffile->grfid, CBID_STATION_BUILD_TILE_LAYOUT, callback);
}
}
@@ -3103,8 +3103,8 @@ static void DrawTile_Station(TileInfo *ti)
if (statspec != nullptr) {
tile_layout = GetStationGfx(ti->tile);
if (HasBit(statspec->callback_mask, CBM_STATION_SPRITE_LAYOUT)) {
uint16_t callback = GetStationCallback(CBID_STATION_SPRITE_LAYOUT, 0, 0, statspec, st, ti->tile);
if (HasBit(statspec->callback_mask, CBM_STATION_DRAW_TILE_LAYOUT)) {
uint16_t callback = GetStationCallback(CBID_STATION_DRAW_TILE_LAYOUT, 0, 0, statspec, st, ti->tile);
if (callback != CALLBACK_FAILED) tile_layout = (callback & ~1) + GetRailStationAxis(ti->tile);
}