1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-20 21:43:06 +01:00

Add path surface object type

This commit is contained in:
Ted John
2021-04-19 22:44:20 +01:00
parent 28fb2611cb
commit 24a29a8a4c
31 changed files with 199 additions and 154 deletions

View File

@@ -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(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);
Guard::Assert(entryIndex != OBJECT_ENTRY_INDEX_NULL, GUARD_LINE);
auto sceneryType = ori->ObjectEntry.GetSceneryType();
auto sceneryType = GetSceneryType(ori->Type);
if (sceneryType != std::nullopt)
{
_legacyType.scenery_entries[_legacyType.entry_count] = { *sceneryType, entryIndex };