mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2025-12-23 15:52:55 +01:00
Rename local variable spr to entity
This commit is contained in:
@@ -59,11 +59,11 @@ void EntityPaintSetup(PaintSession& session, const CoordsXY& pos)
|
|||||||
|
|
||||||
const bool highlightPathIssues = (session.ViewFlags & VIEWPORT_FLAG_HIGHLIGHT_PATH_ISSUES);
|
const bool highlightPathIssues = (session.ViewFlags & VIEWPORT_FLAG_HIGHLIGHT_PATH_ISSUES);
|
||||||
|
|
||||||
for (auto* spr : EntityTileList(pos))
|
for (auto* entity : EntityTileList(pos))
|
||||||
{
|
{
|
||||||
if (highlightPathIssues)
|
if (highlightPathIssues)
|
||||||
{
|
{
|
||||||
const auto staff = spr->As<Staff>();
|
const auto staff = entity->As<Staff>();
|
||||||
if (staff != nullptr)
|
if (staff != nullptr)
|
||||||
{
|
{
|
||||||
if (staff->AssignedStaffType != StaffType::Handyman)
|
if (staff->AssignedStaffType != StaffType::Handyman)
|
||||||
@@ -71,13 +71,13 @@ void EntityPaintSetup(PaintSession& session, const CoordsXY& pos)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (spr->Type != EntityType::Litter)
|
else if (entity->Type != EntityType::Litter)
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto entityPos = spr->GetLocation();
|
const auto entityPos = entity->GetLocation();
|
||||||
|
|
||||||
// Only paint sprites that are below the clip height and inside the clip selection.
|
// Only paint sprites that are below the clip height and inside the clip selection.
|
||||||
// Here converting from land/path/etc height scale to pixel height scale.
|
// Here converting from land/path/etc height scale to pixel height scale.
|
||||||
@@ -104,10 +104,10 @@ void EntityPaintSetup(PaintSession& session, const CoordsXY& pos)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
auto screenCoords = Translate3DTo2DWithZ(session.CurrentRotation, spr->GetLocation());
|
auto screenCoords = Translate3DTo2DWithZ(session.CurrentRotation, entity->GetLocation());
|
||||||
auto spriteRect = ScreenRect(
|
auto spriteRect = ScreenRect(
|
||||||
screenCoords - ScreenCoordsXY{ spr->SpriteData.Width, spr->SpriteData.HeightMin },
|
screenCoords - ScreenCoordsXY{ entity->SpriteData.Width, entity->SpriteData.HeightMin },
|
||||||
screenCoords + ScreenCoordsXY{ spr->SpriteData.Width, spr->SpriteData.HeightMax });
|
screenCoords + ScreenCoordsXY{ entity->SpriteData.Width, entity->SpriteData.HeightMax });
|
||||||
|
|
||||||
const ZoomLevel zoom = session.DPI.zoom_level;
|
const ZoomLevel zoom = session.DPI.zoom_level;
|
||||||
if (session.DPI.y + session.DPI.height <= zoom.ApplyInversedTo(spriteRect.GetTop())
|
if (session.DPI.y + session.DPI.height <= zoom.ApplyInversedTo(spriteRect.GetTop())
|
||||||
@@ -120,56 +120,56 @@ void EntityPaintSetup(PaintSession& session, const CoordsXY& pos)
|
|||||||
|
|
||||||
int32_t image_direction = session.CurrentRotation;
|
int32_t image_direction = session.CurrentRotation;
|
||||||
image_direction <<= 3;
|
image_direction <<= 3;
|
||||||
image_direction += spr->Orientation;
|
image_direction += entity->Orientation;
|
||||||
image_direction &= 0x1F;
|
image_direction &= 0x1F;
|
||||||
|
|
||||||
session.CurrentlyDrawnEntity = spr;
|
session.CurrentlyDrawnEntity = entity;
|
||||||
session.SpritePosition.x = entityPos.x;
|
session.SpritePosition.x = entityPos.x;
|
||||||
session.SpritePosition.y = entityPos.y;
|
session.SpritePosition.y = entityPos.y;
|
||||||
session.InteractionType = ViewportInteractionItem::Entity;
|
session.InteractionType = ViewportInteractionItem::Entity;
|
||||||
|
|
||||||
switch (spr->Type)
|
switch (entity->Type)
|
||||||
{
|
{
|
||||||
case EntityType::Vehicle:
|
case EntityType::Vehicle:
|
||||||
spr->As<Vehicle>()->Paint(session, image_direction);
|
entity->As<Vehicle>()->Paint(session, image_direction);
|
||||||
if (LightFx::ForVehiclesIsAvailable())
|
if (LightFx::ForVehiclesIsAvailable())
|
||||||
{
|
{
|
||||||
LightFx::AddLightsMagicVehicle(spr->As<Vehicle>());
|
LightFx::AddLightsMagicVehicle(entity->As<Vehicle>());
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case EntityType::Guest:
|
case EntityType::Guest:
|
||||||
case EntityType::Staff:
|
case EntityType::Staff:
|
||||||
spr->As<Peep>()->Paint(session, image_direction);
|
entity->As<Peep>()->Paint(session, image_direction);
|
||||||
break;
|
break;
|
||||||
case EntityType::SteamParticle:
|
case EntityType::SteamParticle:
|
||||||
spr->As<SteamParticle>()->Paint(session, image_direction);
|
entity->As<SteamParticle>()->Paint(session, image_direction);
|
||||||
break;
|
break;
|
||||||
case EntityType::MoneyEffect:
|
case EntityType::MoneyEffect:
|
||||||
spr->As<MoneyEffect>()->Paint(session, image_direction);
|
entity->As<MoneyEffect>()->Paint(session, image_direction);
|
||||||
break;
|
break;
|
||||||
case EntityType::CrashedVehicleParticle:
|
case EntityType::CrashedVehicleParticle:
|
||||||
spr->As<VehicleCrashParticle>()->Paint(session, image_direction);
|
entity->As<VehicleCrashParticle>()->Paint(session, image_direction);
|
||||||
break;
|
break;
|
||||||
case EntityType::ExplosionCloud:
|
case EntityType::ExplosionCloud:
|
||||||
spr->As<ExplosionCloud>()->Paint(session, image_direction);
|
entity->As<ExplosionCloud>()->Paint(session, image_direction);
|
||||||
break;
|
break;
|
||||||
case EntityType::CrashSplash:
|
case EntityType::CrashSplash:
|
||||||
spr->As<CrashSplashParticle>()->Paint(session, image_direction);
|
entity->As<CrashSplashParticle>()->Paint(session, image_direction);
|
||||||
break;
|
break;
|
||||||
case EntityType::ExplosionFlare:
|
case EntityType::ExplosionFlare:
|
||||||
spr->As<ExplosionFlare>()->Paint(session, image_direction);
|
entity->As<ExplosionFlare>()->Paint(session, image_direction);
|
||||||
break;
|
break;
|
||||||
case EntityType::JumpingFountain:
|
case EntityType::JumpingFountain:
|
||||||
spr->As<JumpingFountain>()->Paint(session, image_direction);
|
entity->As<JumpingFountain>()->Paint(session, image_direction);
|
||||||
break;
|
break;
|
||||||
case EntityType::Balloon:
|
case EntityType::Balloon:
|
||||||
spr->As<Balloon>()->Paint(session, image_direction);
|
entity->As<Balloon>()->Paint(session, image_direction);
|
||||||
break;
|
break;
|
||||||
case EntityType::Duck:
|
case EntityType::Duck:
|
||||||
spr->As<Duck>()->Paint(session, image_direction);
|
entity->As<Duck>()->Paint(session, image_direction);
|
||||||
break;
|
break;
|
||||||
case EntityType::Litter:
|
case EntityType::Litter:
|
||||||
spr->As<Litter>()->Paint(session, image_direction);
|
entity->As<Litter>()->Paint(session, image_direction);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
assert(false);
|
assert(false);
|
||||||
|
|||||||
Reference in New Issue
Block a user