mirror of https://github.com/OpenTTD/OpenTTD
Codechange: use StationGfx over RoadStopDir + optional offset for drive through stop
parent
38c9eb76a0
commit
ce641af6a9
|
@ -3340,15 +3340,13 @@ draw_default_foundation:
|
|||
const RoadTypeInfo *tram_rti = tram_rt == INVALID_ROADTYPE ? nullptr : GetRoadTypeInfo(tram_rt);
|
||||
|
||||
Axis axis = GetRoadStopDir(ti->tile) == DIAGDIR_NE ? AXIS_X : AXIS_Y;
|
||||
DiagDirection dir = GetRoadStopDir(ti->tile);
|
||||
StationGfx view = GetStationGfx(ti->tile);
|
||||
StationType type = GetStationType(ti->tile);
|
||||
|
||||
const RoadStopSpec *stopspec = GetRoadStopSpec(ti->tile);
|
||||
RoadStopDrawMode stop_draw_mode{};
|
||||
if (stopspec != nullptr) {
|
||||
stop_draw_mode = stopspec->draw_mode;
|
||||
int view = dir;
|
||||
if (IsDriveThroughStopTile(ti->tile)) view += 4;
|
||||
st = BaseStation::GetByTile(ti->tile);
|
||||
RoadStopResolverObject object(stopspec, st, ti->tile, INVALID_ROADTYPE, type, view);
|
||||
const SpriteGroup *group = object.Resolve();
|
||||
|
@ -3385,7 +3383,7 @@ draw_default_foundation:
|
|||
|
||||
if ((stopspec == nullptr || (stop_draw_mode & ROADSTOP_DRAW_MODE_ROAD) != 0) && road_rti->UsesOverlay()) {
|
||||
SpriteID ground = GetCustomRoadSprite(road_rti, ti->tile, ROTSG_ROADSTOP);
|
||||
DrawGroundSprite(ground + dir, PAL_NONE);
|
||||
DrawGroundSprite(ground + view, PAL_NONE);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -704,8 +704,7 @@ class NIHRoadStop : public NIHelper {
|
|||
|
||||
uint Resolve(uint index, uint var, uint32_t param, bool &avail) const override
|
||||
{
|
||||
int view = GetRoadStopDir(index);
|
||||
if (IsDriveThroughStopTile(index)) view += 4;
|
||||
StationGfx view = GetStationGfx(index);
|
||||
RoadStopResolverObject ro(GetRoadStopSpec(index), BaseStation::GetByTile(index), index, INVALID_ROADTYPE, GetStationType(index), view);
|
||||
return ro.GetScope(VSG_SCOPE_SELF)->GetVariable(var, param, avail);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue