Codechange: make VehicleType a scoped enum

This commit is contained in:
Peter Nelson
2026-04-26 07:00:13 +01:00
committed by Peter Nelson
parent b90aefbf49
commit 77403627a8
100 changed files with 1093 additions and 1054 deletions
+2 -2
View File
@@ -609,7 +609,7 @@ uint32_t GetSmallMapOwnerPixels(TileIndex tile, TileType t, IncludeHeightmap inc
}
/** Vehicle colours in #SMT_VEHICLES mode. Indexed by #VehicleType. */
static const PixelColour _vehicle_type_colours[6] = {
static constexpr VehicleTypeIndexArray<PixelColour, VehicleType::End> _vehicle_type_colours = {
PC_RED, PC_YELLOW, PC_LIGHT_BLUE, PC_WHITE, PC_BLACK, PC_RED
};
@@ -953,7 +953,7 @@ protected:
void DrawVehicles(const DrawPixelInfo *dpi, Blitter *blitter) const
{
for (const Vehicle *v : Vehicle::Iterate()) {
if (v->type == VEH_EFFECT) continue;
if (v->type == VehicleType::Effect) continue;
if (v->vehstatus.Any({VehState::Hidden, VehState::Unclickable})) continue;
/* Remap into flat coordinates. */