From 4c26fb09b38b801f692147080a98d9ea6a36bc94 Mon Sep 17 00:00:00 2001 From: Mike Jones Date: Sat, 3 Oct 2020 02:43:06 +0100 Subject: [PATCH] Close #12435: Refactor FILEDIALOG_TYPE to use strong enum (#13072) * Close #12435: Refactor FILEDIALOG_TYPE to use strong enum --- src/openrct2-ui/windows/LoadSave.cpp | 2 +- src/openrct2/platform/platform.h | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/openrct2-ui/windows/LoadSave.cpp b/src/openrct2-ui/windows/LoadSave.cpp index 6851448288..7a0234fe3f 100644 --- a/src/openrct2-ui/windows/LoadSave.cpp +++ b/src/openrct2-ui/windows/LoadSave.cpp @@ -403,7 +403,7 @@ static bool browse(bool isSave, char* path, size_t pathSize) } desc.initial_directory = _directory; - desc.type = isSave ? FD_SAVE : FD_OPEN; + desc.type = isSave ? FileDialogType::Save : FileDialogType::Open; desc.default_filename = isSave ? path : nullptr; // Add 'all files' filter. If the number of filters is increased, this code will need to be adjusted. diff --git a/src/openrct2/platform/platform.h b/src/openrct2/platform/platform.h index 3466e3a10f..3b41dec0e4 100644 --- a/src/openrct2/platform/platform.h +++ b/src/openrct2/platform/platform.h @@ -64,15 +64,15 @@ struct rct2_time uint8_t second; }; -enum FILEDIALOG_TYPE +enum class FileDialogType : uint8_t { - FD_OPEN, - FD_SAVE + Open, + Save }; struct file_dialog_desc { - uint8_t type; + FileDialogType type; const utf8* title; const utf8* initial_directory; const utf8* default_filename;