Road stops: Add flag to read draw mode from register 0x100

This commit is contained in:
Jonathan G Rennison
2023-04-02 13:05:48 +01:00
parent 177a00ac12
commit 62053779b5
6 changed files with 23 additions and 7 deletions

View File

@@ -3551,7 +3551,9 @@ draw_default_foundation:
StationType type = GetStationType(ti->tile);
const RoadStopSpec *stopspec = GetRoadStopSpec(ti->tile);
RoadStopDrawMode stop_draw_mode = (RoadStopDrawMode)0;
if (stopspec != nullptr) {
stop_draw_mode = stopspec->draw_mode;
int view = dir;
if (IsDriveThroughStopTile(ti->tile)) view += 4;
st = BaseStation::GetByTile(ti->tile);
@@ -3559,6 +3561,9 @@ draw_default_foundation:
const SpriteGroup *group = object.Resolve();
if (group != nullptr && group->type == SGT_TILELAYOUT) {
const DrawTileSprites *dts = ((const TileLayoutSpriteGroup *)group)->ProcessRegisters(nullptr);
if (HasBit(stopspec->flags, RSF_DRAW_MODE_REGISTER)) {
stop_draw_mode = (RoadStopDrawMode)GetRegister(0x100);
}
t = dts;
if (type == STATION_ROADWAYPOINT && (stopspec->draw_mode & ROADSTOP_DRAW_MODE_WAYP_GROUND)) {
draw_ground = true;
@@ -3576,7 +3581,7 @@ draw_default_foundation:
}
if (IsDriveThroughStopTile(ti->tile)) {
if (type != STATION_ROADWAYPOINT && (stopspec == nullptr || (stopspec->draw_mode & ROADSTOP_DRAW_MODE_OVERLAY) != 0)) {
if (type != STATION_ROADWAYPOINT && (stopspec == nullptr || (stop_draw_mode & ROADSTOP_DRAW_MODE_OVERLAY) != 0)) {
uint sprite_offset = axis == AXIS_X ? 1 : 0;
DrawRoadOverlays(ti, PAL_NONE, road_rti, tram_rti, sprite_offset, sprite_offset);
}
@@ -3589,7 +3594,7 @@ draw_default_foundation:
/* Non-drivethrough road stops are only valid for roads. */
assert_tile(road_rt != INVALID_ROADTYPE && tram_rt == INVALID_ROADTYPE, ti->tile);
if ((stopspec == nullptr || (stopspec->draw_mode & ROADSTOP_DRAW_MODE_ROAD) != 0) && road_rti->UsesOverlay()) {
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);
}