diff --git a/src/Backends/Platform.h b/src/Backends/Platform.h index 718bef24..541e414b 100644 --- a/src/Backends/Platform.h +++ b/src/Backends/Platform.h @@ -9,3 +9,5 @@ void PlatformBackend_Init(void); void PlatformBackend_GetBasePath(char *string_buffer); BOOL PlatformBackend_SystemTask(void); + +void PlatformBackend_ShowMessageBox(const char *title, const char *message); diff --git a/src/Backends/Platform/SDL2.cpp b/src/Backends/Platform/SDL2.cpp index 2be3a3af..711cb1f3 100644 --- a/src/Backends/Platform/SDL2.cpp +++ b/src/Backends/Platform/SDL2.cpp @@ -252,3 +252,8 @@ BOOL PlatformBackend_SystemTask(void) return TRUE; } + +void PlatformBackend_ShowMessageBox(const char *title, const char *message) +{ + SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, title, message, NULL); +} diff --git a/src/Profile.cpp b/src/Profile.cpp index 150e802f..988b1b65 100644 --- a/src/Profile.cpp +++ b/src/Profile.cpp @@ -4,10 +4,9 @@ #include #include -#include "SDL.h" - #include "WindowsWrapper.h" +#include "Backends/Platform.h" #include "ArmsItem.h" #include "BossLife.h" #include "Fade.h" @@ -248,9 +247,9 @@ BOOL InitializeGame(void) if (!TransferStage(13, 200, 10, 8)) { #ifdef JAPANESE - SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "エラー", "ステージの読み込みに失敗", NULL); + PlatformBackend_ShowMessageBox("エラー", "ステージの読み込みに失敗"); #else - SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Error", "Failed to load stage", NULL); + PlatformBackend_ShowMessageBox("Error", "Failed to load stage"); #endif return FALSE; diff --git a/src/TextScr.cpp b/src/TextScr.cpp index 77ad7d5c..a5dae883 100644 --- a/src/TextScr.cpp +++ b/src/TextScr.cpp @@ -4,10 +4,9 @@ #include #include -#include "SDL.h" - #include "WindowsWrapper.h" +#include "Backends/Platform.h" #include "ArmsItem.h" #include "Boss.h" #include "BossLife.h" @@ -727,9 +726,9 @@ int TextScriptProc(void) if (!TransferStage(z, w, x, y)) { #ifdef JAPANESE - SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "エラー", "ステージの読み込みに失敗", NULL); + PlatformBackend_ShowMessageBox("エラー", "ステージの読み込みに失敗"); #else - SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Error", "Failed to load stage", NULL); + PlatformBackend_ShowMessageBox("Error", "Failed to load stage"); #endif return enum_ESCRETURN_exit; @@ -1284,10 +1283,10 @@ int TextScriptProc(void) char str_0[0x40]; #ifdef JAPANESE sprintf(str_0, "不明のコード:<%c%c%c", gTS.data[gTS.p_read + 1], gTS.data[gTS.p_read + 2], gTS.data[gTS.p_read + 3]); - SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "エラー", str_0, NULL); + PlatformBackend_ShowMessageBox("エラー", str_0); #else sprintf(str_0, "Unknown code:<%c%c%c", gTS.data[gTS.p_read + 1], gTS.data[gTS.p_read + 2], gTS.data[gTS.p_read + 3]); - SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Error", str_0, NULL); + PlatformBackend_ShowMessageBox("Error", str_0); #endif return enum_ESCRETURN_exit;