Codechange: Use EnumBitSet for RoadStopDrawModes.

This commit is contained in:
Peter Nelson
2025-02-04 02:07:06 +00:00
committed by Peter Nelson
parent 17f6da413d
commit c31494a413
3 changed files with 14 additions and 15 deletions
+4 -4
View File
@@ -3335,7 +3335,7 @@ draw_default_foundation:
StationType type = GetStationType(ti->tile);
const RoadStopSpec *stopspec = GetRoadStopSpec(ti->tile);
RoadStopDrawMode stop_draw_mode{};
RoadStopDrawModes stop_draw_mode{};
if (stopspec != nullptr) {
stop_draw_mode = stopspec->draw_mode;
st = BaseStation::GetByTile(ti->tile);
@@ -3345,7 +3345,7 @@ draw_default_foundation:
if (stopspec->flags.Test(RoadStopSpecFlag::DrawModeRegister)) {
stop_draw_mode = static_cast<RoadStopDrawMode>(GetRegister(0x100));
}
if (type == StationType::RoadWaypoint && (stop_draw_mode & ROADSTOP_DRAW_MODE_WAYP_GROUND)) {
if (type == StationType::RoadWaypoint && stop_draw_mode.Test(RoadStopDrawMode::WaypGround)) {
draw_ground = true;
}
t = ((const TileLayoutSpriteGroup *)group)->ProcessRegisters(nullptr);
@@ -3364,7 +3364,7 @@ draw_default_foundation:
}
if (IsDriveThroughStopTile(ti->tile)) {
if (type != StationType::RoadWaypoint && (stopspec == nullptr || (stop_draw_mode & ROADSTOP_DRAW_MODE_OVERLAY) != 0)) {
if (type != StationType::RoadWaypoint && (stopspec == nullptr || stop_draw_mode.Test(RoadStopDrawMode::Overlay))) {
uint sprite_offset = GetDriveThroughStopAxis(ti->tile) == AXIS_X ? 1 : 0;
DrawRoadOverlays(ti, PAL_NONE, road_rti, tram_rti, sprite_offset, sprite_offset);
}
@@ -3372,7 +3372,7 @@ draw_default_foundation:
/* Non-drivethrough road stops are only valid for roads. */
assert(road_rt != INVALID_ROADTYPE && tram_rt == INVALID_ROADTYPE);
if ((stopspec == nullptr || (stop_draw_mode & ROADSTOP_DRAW_MODE_ROAD) != 0) && road_rti->UsesOverlay()) {
if ((stopspec == nullptr || stop_draw_mode.Test(RoadStopDrawMode::Road)) && road_rti->UsesOverlay()) {
SpriteID ground = GetCustomRoadSprite(road_rti, ti->tile, ROTSG_ROADSTOP);
DrawGroundSprite(ground + view, PAL_NONE);
}