1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-20 05:23:04 +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

@@ -11,9 +11,9 @@
#include <openrct2/interface/Cursors.h>
// clang-format off
namespace OpenRCT2::Ui
{
// clang-format off
static constexpr const CursorData BlankCursorData =
{
{ 0, 0 }, { 0 }, { 0 }
@@ -650,14 +650,14 @@ namespace OpenRCT2::Ui
&HandClosedDownCursorData, // CURSOR_HAND_CLOSED
};
const CursorData * CursorRepository::GetCursorData(CURSOR_ID cursorId)
// clang-format on
const CursorData* CursorRepository::GetCursorData(CursorID cursorId)
{
const CursorData * result = nullptr;
if (cursorId >= 0 && cursorId < CURSOR_COUNT)
const CursorData* result = nullptr;
if (cursorId != CursorID::Undefined && cursorId != CursorID::Count)
{
result = RawCursorData[cursorId];
result = RawCursorData[EnumValue(cursorId)];
}
return result;
}
}
// clang-format on
} // namespace OpenRCT2::Ui