diff --git a/UnleashedRecomp/app.h b/UnleashedRecomp/app.h index 2b7bc9a..e5ea434 100644 --- a/UnleashedRecomp/app.h +++ b/UnleashedRecomp/app.h @@ -5,12 +5,12 @@ class App { public: - inline static bool s_isInit; - inline static bool s_isMissingDLC; + static inline bool s_isInit; + static inline bool s_isMissingDLC; - inline static ELanguage s_language; + static inline ELanguage s_language; - inline static double s_deltaTime; + static inline double s_deltaTime; static void Restart(std::vector restartArgs = {}); static void Exit(); diff --git a/UnleashedRecomp/decompressor.h b/UnleashedRecomp/decompressor.h index 4809f7e..6bcdf2b 100644 --- a/UnleashedRecomp/decompressor.h +++ b/UnleashedRecomp/decompressor.h @@ -1,7 +1,7 @@ #pragma once template -static std::unique_ptr decompressZstd(const uint8_t(&data)[N], size_t decompressedSize) +inline std::unique_ptr decompressZstd(const uint8_t(&data)[N], size_t decompressedSize) { auto decompressedData = std::make_unique(decompressedSize); ZSTD_decompress(decompressedData.get(), decompressedSize, data, N); diff --git a/UnleashedRecomp/framework.h b/UnleashedRecomp/framework.h index 92818da..8bff546 100644 --- a/UnleashedRecomp/framework.h +++ b/UnleashedRecomp/framework.h @@ -22,19 +22,19 @@ _##procName* procName = (_##procName*)PROC_ADDRESS(libraryName, #procName); template -void ByteSwap(T& value) +inline void ByteSwap(T& value) { value = std::byteswap(value); } template -T RoundUp(const T& in_rValue, uint32_t in_round) +inline T RoundUp(const T& in_rValue, uint32_t in_round) { return (in_rValue + in_round - 1) & ~(in_round - 1); } template -T RoundDown(const T& in_rValue, uint32_t in_round) +inline T RoundDown(const T& in_rValue, uint32_t in_round) { return in_rValue & ~(in_round - 1); } @@ -75,7 +75,7 @@ constexpr size_t FirstBitLow(TValue value) return 0; } -inline static std::unique_ptr ReadAllBytes(const char* filePath, size_t& fileSize) +inline std::unique_ptr ReadAllBytes(const char* filePath, size_t& fileSize) { FILE* file = fopen(filePath, "rb"); diff --git a/UnleashedRecomp/kernel/xdbf.h b/UnleashedRecomp/kernel/xdbf.h index d1c2de3..040bac1 100644 --- a/UnleashedRecomp/kernel/xdbf.h +++ b/UnleashedRecomp/kernel/xdbf.h @@ -8,7 +8,7 @@ extern std::unordered_map g_xdbfTextureCache; namespace xdbf { - inline static std::string& FixInvalidSequences(std::string& str) + inline std::string& FixInvalidSequences(std::string& str) { static std::vector invalidSequences = { diff --git a/UnleashedRecomp/locale/config_locale.h b/UnleashedRecomp/locale/config_locale.h index 3db4bea..a06d2ab 100644 --- a/UnleashedRecomp/locale/config_locale.h +++ b/UnleashedRecomp/locale/config_locale.h @@ -3,10 +3,10 @@ #include #define CONFIG_DEFINE_LOCALE(name) \ - inline static std::unordered_map> g_##name##_locale = + inline std::unordered_map> g_##name##_locale = #define CONFIG_DEFINE_ENUM_LOCALE(type) \ - inline static std::unordered_map>> g_##type##_locale = + inline std::unordered_map>> g_##type##_locale = CONFIG_DEFINE_ENUM_LOCALE(bool) { diff --git a/UnleashedRecomp/locale/locale.h b/UnleashedRecomp/locale/locale.h index 0513000..aeceb6f 100644 --- a/UnleashedRecomp/locale/locale.h +++ b/UnleashedRecomp/locale/locale.h @@ -2,9 +2,9 @@ #include -inline static std::string g_localeMissing = ""; +inline std::string g_localeMissing = ""; -inline static std::unordered_map> g_locale +inline std::unordered_map> g_locale { { "Options_Category_System", @@ -294,7 +294,7 @@ inline static std::unordered_map s_queue{}; + static inline std::queue s_queue{}; static void Init(); static void Draw(); diff --git a/UnleashedRecomp/ui/button_guide.h b/UnleashedRecomp/ui/button_guide.h index 7d8e6e9..d6c375c 100644 --- a/UnleashedRecomp/ui/button_guide.h +++ b/UnleashedRecomp/ui/button_guide.h @@ -55,7 +55,7 @@ public: class ButtonGuide { public: - inline static bool s_isVisible = false; + static inline bool s_isVisible = false; static void Init(); static void Draw(); diff --git a/UnleashedRecomp/ui/fader.h b/UnleashedRecomp/ui/fader.h index d513e6a..be2e72f 100644 --- a/UnleashedRecomp/ui/fader.h +++ b/UnleashedRecomp/ui/fader.h @@ -3,7 +3,7 @@ class Fader { public: - inline static bool s_isVisible = false; + static inline bool s_isVisible = false; static void Draw(); static void SetFadeColour(ImU32 colour); diff --git a/UnleashedRecomp/ui/imgui_utils.h b/UnleashedRecomp/ui/imgui_utils.h index 624ff16..4aa0be7 100644 --- a/UnleashedRecomp/ui/imgui_utils.h +++ b/UnleashedRecomp/ui/imgui_utils.h @@ -13,7 +13,7 @@ #define CENTRE_TEXT_HORZ(min, max, textSize) min.x + ((max.x - min.x) - textSize.x) / 2 #define CENTRE_TEXT_VERT(min, max, textSize) min.y + ((max.y - min.y) - textSize.y) / 2 -static void SetGradient(const ImVec2& min, const ImVec2& max, ImU32 top, ImU32 bottom) +inline void SetGradient(const ImVec2& min, const ImVec2& max, ImU32 top, ImU32 bottom) { auto callbackData = AddImGuiCallback(ImGuiCallback::SetGradient); callbackData->setGradient.boundsMin[0] = min.x; @@ -24,47 +24,47 @@ static void SetGradient(const ImVec2& min, const ImVec2& max, ImU32 top, ImU32 b callbackData->setGradient.gradientBottom = bottom; } -static void ResetGradient() +inline void ResetGradient() { auto callbackData = AddImGuiCallback(ImGuiCallback::SetGradient); memset(&callbackData->setGradient, 0, sizeof(callbackData->setGradient)); } -static void SetShaderModifier(uint32_t shaderModifier) +inline void SetShaderModifier(uint32_t shaderModifier) { auto callbackData = AddImGuiCallback(ImGuiCallback::SetShaderModifier); callbackData->setShaderModifier.shaderModifier = shaderModifier; } -static void SetOrigin(ImVec2 origin) +inline void SetOrigin(ImVec2 origin) { auto callbackData = AddImGuiCallback(ImGuiCallback::SetOrigin); callbackData->setOrigin.origin[0] = origin.x; callbackData->setOrigin.origin[1] = origin.y; } -static void SetScale(ImVec2 scale) +inline void SetScale(ImVec2 scale) { auto callbackData = AddImGuiCallback(ImGuiCallback::SetScale); callbackData->setScale.scale[0] = scale.x; callbackData->setScale.scale[1] = scale.y; } -static void SetTextSkew(float yCenter, float skewScale) +inline void SetTextSkew(float yCenter, float skewScale) { SetShaderModifier(IMGUI_SHADER_MODIFIER_TEXT_SKEW); SetOrigin({ 0.0f, yCenter }); SetScale({ skewScale, 1.0f }); } -static void ResetTextSkew() +inline void ResetTextSkew() { SetShaderModifier(IMGUI_SHADER_MODIFIER_NONE); SetOrigin({ 0.0f, 0.0f }); SetScale({ 1.0f, 1.0f }); } -static void SetMarqueeFade(ImVec2 min, ImVec2 max, float fadeScale) +inline void SetMarqueeFade(ImVec2 min, ImVec2 max, float fadeScale) { auto callbackData = AddImGuiCallback(ImGuiCallback::SetMarqueeFade); callbackData->setMarqueeFade.boundsMin[0] = min.x; @@ -76,26 +76,26 @@ static void SetMarqueeFade(ImVec2 min, ImVec2 max, float fadeScale) SetScale({ fadeScale, 1.0f }); } -static void ResetMarqueeFade() +inline void ResetMarqueeFade() { ResetGradient(); SetShaderModifier(IMGUI_SHADER_MODIFIER_NONE); SetScale({ 1.0f, 1.0f }); } -static void SetOutline(float outline) +inline void SetOutline(float outline) { auto callbackData = AddImGuiCallback(ImGuiCallback::SetOutline); callbackData->setOutline.outline = outline; } -static void ResetOutline() +inline void ResetOutline() { SetOutline(0.0f); } // Aspect ratio aware. -static float Scale(float size) +inline float Scale(float size) { auto& io = ImGui::GetIO(); @@ -106,25 +106,25 @@ static float Scale(float size) } // Not aspect ratio aware. Will stretch. -static float ScaleX(float x) +inline float ScaleX(float x) { auto& io = ImGui::GetIO(); return x * io.DisplaySize.x / 1280.0f; } // Not aspect ratio aware. Will stretch. -static float ScaleY(float y) +inline float ScaleY(float y) { auto& io = ImGui::GetIO(); return y * io.DisplaySize.y / 720.0f; } -static double ComputeMotion(double duration, double offset, double total) +inline double ComputeMotion(double duration, double offset, double total) { return sqrt(std::clamp((ImGui::GetTime() - duration - offset / 60.0) / total * 60.0, 0.0, 1.0)); } -static void DrawPauseContainer(GuestTexture* texture, ImVec2 min, ImVec2 max, float alpha = 1) +inline void DrawPauseContainer(GuestTexture* texture, ImVec2 min, ImVec2 max, float alpha = 1) { auto drawList = ImGui::GetForegroundDrawList(); @@ -155,7 +155,7 @@ static void DrawPauseContainer(GuestTexture* texture, ImVec2 min, ImVec2 max, fl drawList->AddImage(texture, { max.x - commonWidth, max.y - commonHeight }, { max.x, max.y + bottomHeight }, GET_UV_COORDS(br), colour); } -static void DrawPauseHeaderContainer(GuestTexture* texture, ImVec2 min, ImVec2 max, float alpha = 1) +inline void DrawPauseHeaderContainer(GuestTexture* texture, ImVec2 min, ImVec2 max, float alpha = 1) { auto drawList = ImGui::GetForegroundDrawList(); @@ -172,7 +172,7 @@ static void DrawPauseHeaderContainer(GuestTexture* texture, ImVec2 min, ImVec2 m drawList->AddImage(texture, { max.x - commonWidth, min.y }, max, GET_UV_COORDS(right), colour); } -static void DrawTextWithMarquee(const ImFont* font, float fontSize, const ImVec2& pos, const ImVec2& min, const ImVec2& max, ImU32 color, const char* text, double time, double delay, double speed) +inline void DrawTextWithMarquee(const ImFont* font, float fontSize, const ImVec2& pos, const ImVec2& min, const ImVec2& max, ImU32 color, const char* text, double time, double delay, double speed) { auto drawList = ImGui::GetForegroundDrawList(); auto rectWidth = max.x - min.x; @@ -190,7 +190,7 @@ static void DrawTextWithMarquee(const ImFont* font, float fontSize, const ImVec2 drawList->PopClipRect(); } -static void DrawTextWithOutline(const ImFont* font, float fontSize, const ImVec2& pos, ImU32 color, const char* text, float outlineSize, ImU32 outlineColor, uint32_t shaderModifier = IMGUI_SHADER_MODIFIER_NONE) +inline void DrawTextWithOutline(const ImFont* font, float fontSize, const ImVec2& pos, ImU32 color, const char* text, float outlineSize, ImU32 outlineColor, uint32_t shaderModifier = IMGUI_SHADER_MODIFIER_NONE) { auto drawList = ImGui::GetForegroundDrawList(); @@ -207,7 +207,7 @@ static void DrawTextWithOutline(const ImFont* font, float fontSize, const ImVec2 SetShaderModifier(IMGUI_SHADER_MODIFIER_NONE); } -static void DrawTextWithShadow(const ImFont* font, float fontSize, const ImVec2& pos, ImU32 colour, const char* text, float offset = 2.0f, float radius = 1.0f, ImU32 shadowColour = IM_COL32(0, 0, 0, 255)) +inline void DrawTextWithShadow(const ImFont* font, float fontSize, const ImVec2& pos, ImU32 colour, const char* text, float offset = 2.0f, float radius = 1.0f, ImU32 shadowColour = IM_COL32(0, 0, 0, 255)) { auto drawList = ImGui::GetForegroundDrawList(); @@ -220,7 +220,7 @@ static void DrawTextWithShadow(const ImFont* font, float fontSize, const ImVec2& drawList->AddText(font, fontSize, pos, colour, text, nullptr); } -static float CalcWidestTextSize(const ImFont* font, float fontSize, std::span strs) +inline float CalcWidestTextSize(const ImFont* font, float fontSize, std::span strs) { auto result = 0.0f; @@ -230,7 +230,7 @@ static float CalcWidestTextSize(const ImFont* font, float fontSize, std::span Split(const char* str, char delimiter) +inline std::vector Split(const char* str, char delimiter) { std::vector result; @@ -282,7 +282,7 @@ static std::vector Split(const char* str, char delimiter) return result; } -static ImVec2 MeasureCentredParagraph(const ImFont* font, float fontSize, float lineMargin, std::vector lines) +inline ImVec2 MeasureCentredParagraph(const ImFont* font, float fontSize, float lineMargin, std::vector lines) { auto x = 0.0f; auto y = 0.0f; @@ -298,12 +298,12 @@ static ImVec2 MeasureCentredParagraph(const ImFont* font, float fontSize, float return { x, y }; } -static ImVec2 MeasureCentredParagraph(const ImFont* font, float fontSize, float lineMargin, const char* text) +inline ImVec2 MeasureCentredParagraph(const ImFont* font, float fontSize, float lineMargin, const char* text) { return MeasureCentredParagraph(font, fontSize, lineMargin, Split(text, '\n')); } -static void DrawCentredParagraph(const ImFont* font, float fontSize, const ImVec2& centre, float lineMargin, const char* text, std::function drawMethod) +inline void DrawCentredParagraph(const ImFont* font, float fontSize, const ImVec2& centre, float lineMargin, const char* text, std::function drawMethod) { auto lines = Split(text, '\n'); auto paragraphSize = MeasureCentredParagraph(font, fontSize, lineMargin, lines); @@ -337,7 +337,7 @@ static void DrawCentredParagraph(const ImFont* font, float fontSize, const ImVec } } -static void DrawTextWithMarqueeShadow(const ImFont* font, float fontSize, const ImVec2& pos, const ImVec2& min, const ImVec2& max, ImU32 colour, const char* text, double time, double delay, double speed, float offset = 2.0f, float radius = 1.0f, ImU32 shadowColour = IM_COL32(0, 0, 0, 255)) +inline void DrawTextWithMarqueeShadow(const ImFont* font, float fontSize, const ImVec2& pos, const ImVec2& min, const ImVec2& max, ImU32 colour, const char* text, double time, double delay, double speed, float offset = 2.0f, float radius = 1.0f, ImU32 shadowColour = IM_COL32(0, 0, 0, 255)) { auto drawList = ImGui::GetForegroundDrawList(); auto rectWidth = max.x - min.x; @@ -355,27 +355,27 @@ static void DrawTextWithMarqueeShadow(const ImFont* font, float fontSize, const drawList->PopClipRect(); } -static float Lerp(float a, float b, float t) +inline float Lerp(float a, float b, float t) { return a + (b - a) * t; } -static float Cubic(float a, float b, float t) +inline float Cubic(float a, float b, float t) { return a + (b - a) * (t * t * t); } -static float Hermite(float a, float b, float t) +inline float Hermite(float a, float b, float t) { return a + (b - a) * (t * t * (3 - 2 * t)); } -static ImVec2 Lerp(const ImVec2& a, const ImVec2& b, float t) +inline ImVec2 Lerp(const ImVec2& a, const ImVec2& b, float t) { return { a.x + (b.x - a.x) * t, a.y + (b.y - a.y) * t }; } -static ImU32 ColourLerp(ImU32 c0, ImU32 c1, float t) +inline ImU32 ColourLerp(ImU32 c0, ImU32 c1, float t) { auto a = ImGui::ColorConvertU32ToFloat4(c0); auto b = ImGui::ColorConvertU32ToFloat4(c1); diff --git a/UnleashedRecomp/ui/installer_wizard.h b/UnleashedRecomp/ui/installer_wizard.h index 0b8e6cf..1b7545b 100644 --- a/UnleashedRecomp/ui/installer_wizard.h +++ b/UnleashedRecomp/ui/installer_wizard.h @@ -4,7 +4,7 @@ struct InstallerWizard { - inline static bool s_isVisible = false; + static inline bool s_isVisible = false; static void Init(); static void Draw(); diff --git a/UnleashedRecomp/ui/message_window.h b/UnleashedRecomp/ui/message_window.h index 5e46648..0e2ca6b 100644 --- a/UnleashedRecomp/ui/message_window.h +++ b/UnleashedRecomp/ui/message_window.h @@ -6,7 +6,7 @@ class MessageWindow { public: - inline static bool s_isVisible = false; + static inline bool s_isVisible = false; static void Init(); static void Draw(); diff --git a/UnleashedRecomp/ui/options_menu.h b/UnleashedRecomp/ui/options_menu.h index f0a32e5..aecfc24 100644 --- a/UnleashedRecomp/ui/options_menu.h +++ b/UnleashedRecomp/ui/options_menu.h @@ -5,11 +5,11 @@ class OptionsMenu { public: - inline static bool s_isVisible = false; - inline static bool s_isPause = false; - inline static bool s_isRestartRequired = false; + static inline bool s_isVisible = false; + static inline bool s_isPause = false; + static inline bool s_isRestartRequired = false; - inline static SWA::EMenuType s_pauseMenuType; + static inline SWA::EMenuType s_pauseMenuType; static void Init(); static void Draw(); diff --git a/UnleashedRecomp/ui/options_menu_thumbnails.h b/UnleashedRecomp/ui/options_menu_thumbnails.h index 26266ed..43e26c1 100644 --- a/UnleashedRecomp/ui/options_menu_thumbnails.h +++ b/UnleashedRecomp/ui/options_menu_thumbnails.h @@ -36,9 +36,9 @@ #include #include -inline static std::unordered_map> g_thumbnails; +inline std::unordered_map> g_thumbnails; -static void LoadThumbnails() +inline void LoadThumbnails() { g_thumbnails[Config::Language.Name] = LOAD_ZSTD_TEXTURE(g_language); g_thumbnails[Config::Hints.Name] = LOAD_ZSTD_TEXTURE(g_hints); @@ -73,7 +73,7 @@ static void LoadThumbnails() g_thumbnails[Config::UIScaleMode.Name] = LOAD_ZSTD_TEXTURE(g_ui_scale_mode); } -static GuestTexture* GetThumbnail(const std::string_view name) +inline GuestTexture* GetThumbnail(const std::string_view name) { if (!g_thumbnails.count(name)) return nullptr; diff --git a/UnleashedRecomp/ui/sdl_listener.h b/UnleashedRecomp/ui/sdl_listener.h index 8ca2cad..27eed82 100644 --- a/UnleashedRecomp/ui/sdl_listener.h +++ b/UnleashedRecomp/ui/sdl_listener.h @@ -7,7 +7,7 @@ public: virtual void OnSDLEvent(SDL_Event* event) = 0; }; -std::vector& GetEventListeners(); +extern std::vector& GetEventListeners(); class SDLEventListener : public ISDLEventListener { diff --git a/UnleashedRecomp/ui/window.h b/UnleashedRecomp/ui/window.h index 96ec75c..8b036a8 100644 --- a/UnleashedRecomp/ui/window.h +++ b/UnleashedRecomp/ui/window.h @@ -18,17 +18,17 @@ class Window { public: - inline static SDL_Window* s_pWindow; - inline static HWND s_handle; + static inline SDL_Window* s_pWindow; + static inline HWND s_handle; - inline static int s_x; - inline static int s_y; - inline static int s_width = DEFAULT_WIDTH; - inline static int s_height = DEFAULT_HEIGHT; + static inline int s_x; + static inline int s_y; + static inline int s_width = DEFAULT_WIDTH; + static inline int s_height = DEFAULT_HEIGHT; - inline static bool s_isFocused; - inline static bool s_isIconNight; - inline static bool s_isFullscreenCursorVisible; + static inline bool s_isFocused; + static inline bool s_isIconNight; + static inline bool s_isFullscreenCursorVisible; static SDL_Surface* GetIconSurface(void* pIconBmp, size_t iconSize) { diff --git a/UnleashedRecomp/ui/window_events.h b/UnleashedRecomp/ui/window_events.h index e8a932f..6e94e3a 100644 --- a/UnleashedRecomp/ui/window_events.h +++ b/UnleashedRecomp/ui/window_events.h @@ -5,7 +5,7 @@ #define SDL_USER_EVILSONIC (SDL_USEREVENT + 1) -inline static void SDL_ResizeEvent(SDL_Window* pWindow, int width, int height) +inline void SDL_ResizeEvent(SDL_Window* pWindow, int width, int height) { SDL_Event event{}; event.type = SDL_WINDOWEVENT; @@ -17,7 +17,7 @@ inline static void SDL_ResizeEvent(SDL_Window* pWindow, int width, int height) SDL_PushEvent(&event); } -inline static void SDL_MoveEvent(SDL_Window* pWindow, int x, int y) +inline void SDL_MoveEvent(SDL_Window* pWindow, int x, int y) { SDL_Event event{}; event.type = SDL_WINDOWEVENT; @@ -29,7 +29,7 @@ inline static void SDL_MoveEvent(SDL_Window* pWindow, int x, int y) SDL_PushEvent(&event); } -inline static void SDL_User_EvilSonic(SDL_Window* pWindow, bool isCtor) +inline void SDL_User_EvilSonic(SDL_Window* pWindow, bool isCtor) { SDL_Event event{}; event.type = SDL_USER_EVILSONIC; diff --git a/UnleashedRecomp/user/achievement_data.h b/UnleashedRecomp/user/achievement_data.h index 6c6edb3..2a23c28 100644 --- a/UnleashedRecomp/user/achievement_data.h +++ b/UnleashedRecomp/user/achievement_data.h @@ -43,7 +43,7 @@ public: Record Records[ACH_RECORDS]; }; - inline static Data Data{ ACH_SIGNATURE, ACH_VERSION }; + static inline Data Data{ ACH_SIGNATURE, ACH_VERSION }; static std::filesystem::path GetDataPath() { diff --git a/UnleashedRecomp/user/config.h b/UnleashedRecomp/user/config.h index 491d483..502d854 100644 --- a/UnleashedRecomp/user/config.h +++ b/UnleashedRecomp/user/config.h @@ -8,7 +8,7 @@ class Config { public: - inline static std::vector Definitions{}; + static inline std::vector Definitions{}; CONFIG_DEFINE_ENUM_LOCALISED("System", ELanguage, Language, ELanguage::English); CONFIG_DEFINE_LOCALISED("System", bool, Hints, true); diff --git a/UnleashedRecomp/user/config_detail.h b/UnleashedRecomp/user/config_detail.h index 86b1514..e2a6d25 100644 --- a/UnleashedRecomp/user/config_detail.h +++ b/UnleashedRecomp/user/config_detail.h @@ -1,22 +1,22 @@ #pragma once #define CONFIG_DEFINE(section, type, name, defaultValue) \ - inline static ConfigDef name{section, #name, defaultValue}; + static inline ConfigDef name{section, #name, defaultValue}; #define CONFIG_DEFINE_LOCALISED(section, type, name, defaultValue) \ - inline static ConfigDef name{section, #name, &g_##name##_locale, defaultValue}; + static inline ConfigDef name{section, #name, &g_##name##_locale, defaultValue}; #define CONFIG_DEFINE_ENUM(section, type, name, defaultValue) \ - inline static ConfigDef name{section, #name, defaultValue, &g_##type##_template}; + static inline ConfigDef name{section, #name, defaultValue, &g_##type##_template}; #define CONFIG_DEFINE_ENUM_LOCALISED(section, type, name, defaultValue) \ - inline static ConfigDef name{section, #name, &g_##name##_locale, defaultValue, &g_##type##_template, &g_##type##_locale}; + static inline ConfigDef name{section, #name, &g_##name##_locale, defaultValue, &g_##type##_template, &g_##type##_locale}; #define CONFIG_DEFINE_CALLBACK(section, type, name, defaultValue, readCallback) \ - inline static ConfigDef name{section, #name, defaultValue, [](ConfigDef* def) readCallback}; + static inline ConfigDef name{section, #name, defaultValue, [](ConfigDef* def) readCallback}; #define CONFIG_DEFINE_ENUM_TEMPLATE(type) \ - inline static std::unordered_map g_##type##_template = + inline std::unordered_map g_##type##_template = #define CONFIG_LOCALE std::unordered_map> #define CONFIG_ENUM_LOCALE(type) std::unordered_map>> @@ -275,7 +275,7 @@ public: }; template -class ConfigDef : public IConfigDef +class ConfigDef final : public IConfigDef { public: std::string Section{}; diff --git a/UnleashedRecomp/user/paths.h b/UnleashedRecomp/user/paths.h index c1a4bf4..5af9d4b 100644 --- a/UnleashedRecomp/user/paths.h +++ b/UnleashedRecomp/user/paths.h @@ -2,12 +2,12 @@ #define USER_DIRECTORY "SWA" -static std::filesystem::path GetGamePath() +inline std::filesystem::path GetGamePath() { return std::filesystem::current_path(); } -static std::filesystem::path GetUserPath() +inline std::filesystem::path GetUserPath() { if (std::filesystem::exists("portable.txt")) return std::filesystem::current_path(); @@ -24,7 +24,7 @@ static std::filesystem::path GetUserPath() return userPath; } -static std::filesystem::path GetSavePath() +inline std::filesystem::path GetSavePath() { return GetUserPath() / "save"; }