mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-20 13:33:02 +01:00
Move function for NSF use
This commit is contained in:
@@ -66,6 +66,25 @@ void SceneryGroupObject::DrawPreview(rct_drawpixelinfo* dpi, int32_t width, int3
|
||||
gfx_draw_sprite(dpi, imageId, screenCoords - ScreenCoordsXY{ 15, 14 }, 0);
|
||||
}
|
||||
|
||||
static std::optional<uint8_t> GetSceneryType(const ObjectType type)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case ObjectType::SmallScenery:
|
||||
return SCENERY_TYPE_SMALL;
|
||||
case ObjectType::LargeScenery:
|
||||
return SCENERY_TYPE_LARGE;
|
||||
case ObjectType::Walls:
|
||||
return SCENERY_TYPE_WALL;
|
||||
case ObjectType::Banners:
|
||||
return SCENERY_TYPE_BANNER;
|
||||
case ObjectType::PathBits:
|
||||
return SCENERY_TYPE_PATH_ITEM;
|
||||
default:
|
||||
return std::nullopt;
|
||||
}
|
||||
}
|
||||
|
||||
void SceneryGroupObject::UpdateEntryIndexes()
|
||||
{
|
||||
auto context = GetContext();
|
||||
@@ -84,7 +103,7 @@ void SceneryGroupObject::UpdateEntryIndexes()
|
||||
auto entryIndex = objectManager.GetLoadedObjectEntryIndex(ori->LoadedObject.get());
|
||||
Guard::Assert(entryIndex != OBJECT_ENTRY_INDEX_NULL, GUARD_LINE);
|
||||
|
||||
auto sceneryType = ori->ObjectEntry.GetSceneryType();
|
||||
auto sceneryType = GetSceneryType(ori->Type);
|
||||
if (sceneryType.has_value())
|
||||
{
|
||||
_legacyType.scenery_entries[_legacyType.entry_count] = { sceneryType.value(), entryIndex };
|
||||
|
||||
Reference in New Issue
Block a user