Split SDL2 code from Profile.cpp and TextScr.cpp

This commit is contained in:
Clownacy 2020-03-31 16:28:28 +01:00
parent 37c5236b9b
commit 584ea57c5d
4 changed files with 15 additions and 10 deletions

View file

@ -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);

View file

@ -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);
}

View file

@ -4,10 +4,9 @@
#include <stdio.h>
#include <string.h>
#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;

View file

@ -4,10 +4,9 @@
#include <stdlib.h>
#include <string.h>
#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;