mirror of https://github.com/OpenTTD/OpenTTD
(svn r4739) - Newstations: remove cargo type parameter of GetCustomStationRelocation() as we can determine it internally
parent
a55ac6efac
commit
4963eb80b7
|
@ -323,11 +323,11 @@ static void NewStationResolver(ResolverObject *res, const StationSpec *statspec,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
SpriteID GetCustomStationRelocation(const StationSpec *statspec, const Station *st, TileIndex tile, CargoID ctype)
|
SpriteID GetCustomStationRelocation(const StationSpec *statspec, const Station *st, TileIndex tile)
|
||||||
{
|
{
|
||||||
const SpriteGroup *group;
|
const SpriteGroup *group;
|
||||||
ResolverObject object;
|
ResolverObject object;
|
||||||
ctype = (st == NULL) ? GC_PURCHASE : GC_DEFAULT_NA;
|
CargoID ctype = (st == NULL) ? GC_PURCHASE : GC_DEFAULT_NA;
|
||||||
|
|
||||||
NewStationResolver(&object, statspec, st, tile);
|
NewStationResolver(&object, statspec, st, tile);
|
||||||
|
|
||||||
|
|
|
@ -96,9 +96,9 @@ void SetCustomStationSpec(StationSpec *statspec);
|
||||||
const StationSpec *GetCustomStationSpec(StationClassID sclass, uint station);
|
const StationSpec *GetCustomStationSpec(StationClassID sclass, uint station);
|
||||||
|
|
||||||
/* Get sprite offset for a given custom station and station structure (may be
|
/* Get sprite offset for a given custom station and station structure (may be
|
||||||
* NULL if ctype is set - that means we are in a build dialog). The station
|
* NULL - that means we are in a build dialog). The station structure is used
|
||||||
* structure is used for variational sprite groups. */
|
* for variational sprite groups. */
|
||||||
SpriteID GetCustomStationRelocation(const StationSpec *statspec, const Station *st, TileIndex tile, CargoID ctype);
|
SpriteID GetCustomStationRelocation(const StationSpec *statspec, const Station *st, TileIndex tile);
|
||||||
|
|
||||||
/* Allocate a StationSpec to a Station. This is called once per build operation. */
|
/* Allocate a StationSpec to a Station. This is called once per build operation. */
|
||||||
int AllocateSpecToStation(const StationSpec *statspec, Station *st, bool exec);
|
int AllocateSpecToStation(const StationSpec *statspec, Station *st, bool exec);
|
||||||
|
|
|
@ -1324,7 +1324,7 @@ static void DrawTile_Track(TileInfo *ti)
|
||||||
DrawTileSeqStruct const *seq;
|
DrawTileSeqStruct const *seq;
|
||||||
// emulate station tile - open with building
|
// emulate station tile - open with building
|
||||||
const DrawTileSprites *cust = &statspec->renderdata[2 + GetWaypointAxis(ti->tile)];
|
const DrawTileSprites *cust = &statspec->renderdata[2 + GetWaypointAxis(ti->tile)];
|
||||||
uint32 relocation = GetCustomStationRelocation(statspec, ComposeWaypointStation(ti->tile), ti->tile, 0);
|
uint32 relocation = GetCustomStationRelocation(statspec, ComposeWaypointStation(ti->tile), ti->tile);
|
||||||
|
|
||||||
/* We don't touch the 0x8000 bit. In all this
|
/* We don't touch the 0x8000 bit. In all this
|
||||||
* waypoint code, it is used to indicate that
|
* waypoint code, it is used to indicate that
|
||||||
|
|
|
@ -1990,7 +1990,7 @@ static void DrawTile_Station(TileInfo *ti)
|
||||||
if (statspec != NULL) {
|
if (statspec != NULL) {
|
||||||
uint tile = GetStationGfx(ti->tile);
|
uint tile = GetStationGfx(ti->tile);
|
||||||
|
|
||||||
relocation = GetCustomStationRelocation(statspec, st, ti->tile, 0);
|
relocation = GetCustomStationRelocation(statspec, st, ti->tile);
|
||||||
|
|
||||||
/* Ensure the chosen tile layout is valid for this custom station */
|
/* Ensure the chosen tile layout is valid for this custom station */
|
||||||
t = &statspec->renderdata[tile < statspec->tiles ? tile : GetRailStationAxis(ti->tile)];
|
t = &statspec->renderdata[tile < statspec->tiles ? tile : GetRailStationAxis(ti->tile)];
|
||||||
|
|
|
@ -405,7 +405,7 @@ void DrawWaypointSprite(int x, int y, int stat_id, RailType railtype)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
relocation = GetCustomStationRelocation(statspec, NULL, INVALID_TILE, 1);
|
relocation = GetCustomStationRelocation(statspec, NULL, INVALID_TILE);
|
||||||
// emulate station tile - open with building
|
// emulate station tile - open with building
|
||||||
// add 1 to get the other direction
|
// add 1 to get the other direction
|
||||||
cust = &statspec->renderdata[2];
|
cust = &statspec->renderdata[2];
|
||||||
|
|
Loading…
Reference in New Issue