1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-18 12:33:17 +01:00

Close #12408: Refactor CURSOR_ID to use strong enum

This commit is contained in:
Julia Pinheiro
2020-10-11 13:01:14 -03:00
committed by GitHub
parent f56039abfd
commit cba1d48226
25 changed files with 156 additions and 150 deletions

View File

@@ -25,7 +25,7 @@ void FootpathItemObject::ReadLegacy(IReadObjectContext* context, OpenRCT2::IStre
stream->Seek(6, OpenRCT2::STREAM_SEEK_CURRENT);
_legacyType.path_bit.flags = stream->ReadValue<uint16_t>();
_legacyType.path_bit.draw_type = stream->ReadValue<uint8_t>();
_legacyType.path_bit.tool_id = stream->ReadValue<uint8_t>();
_legacyType.path_bit.tool_id = static_cast<CursorID>(stream->ReadValue<uint8_t>());
_legacyType.path_bit.price = stream->ReadValue<int16_t>();
_legacyType.path_bit.scenery_tab_id = OBJECT_ENTRY_INDEX_NULL;
stream->Seek(2, OpenRCT2::STREAM_SEEK_CURRENT);
@@ -107,7 +107,7 @@ void FootpathItemObject::ReadJson(IReadObjectContext* context, json_t& root)
if (properties.is_object())
{
_legacyType.path_bit.draw_type = ParseDrawType(Json::GetString(properties["renderAs"]));
_legacyType.path_bit.tool_id = Cursor::FromString(Json::GetString(properties["cursor"]), CURSOR_LAMPPOST_DOWN);
_legacyType.path_bit.tool_id = Cursor::FromString(Json::GetString(properties["cursor"]), CursorID::LamppostDown);
_legacyType.path_bit.price = Json::GetNumber<int16_t>(properties["price"]);
SetPrimarySceneryGroup(Json::GetString(properties["sceneryGroup"]));