mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-09-05 19:08:12 +00:00
3DS: Support simple message boxes
This commit is contained in:

committed by
Sam Lantinga

parent
d7bb56f163
commit
23d456e146
@@ -292,7 +292,7 @@ static SDL_assert_state SDLCALL SDL_PromptAssertion(const SDL_assert_data *data,
|
||||
break;
|
||||
}
|
||||
}
|
||||
#elif defined(HAVE_STDIO_H)
|
||||
#elif defined(HAVE_STDIO_H) && !defined(__3DS__)
|
||||
/* this is a little hacky. */
|
||||
for (;;) {
|
||||
char buf[32];
|
||||
@@ -319,6 +319,8 @@ static SDL_assert_state SDLCALL SDL_PromptAssertion(const SDL_assert_data *data,
|
||||
break;
|
||||
}
|
||||
}
|
||||
#else
|
||||
SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_WARNING, "Assertion Failed", message, window);
|
||||
#endif /* HAVE_STDIO_H */
|
||||
}
|
||||
|
||||
|
@@ -59,6 +59,10 @@
|
||||
#include <emscripten.h>
|
||||
#endif
|
||||
|
||||
#ifdef __3DS__
|
||||
#include <3ds.h>
|
||||
#endif
|
||||
|
||||
#ifdef __LINUX__
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
@@ -4556,6 +4560,23 @@ int SDL_ShowSimpleMessageBox(Uint32 flags, const char *title, const char *messag
|
||||
},
|
||||
title, message);
|
||||
return 0;
|
||||
#elif defined(__3DS__)
|
||||
errorConf errCnf;
|
||||
bool hasGpuRight;
|
||||
|
||||
/* If the video subsystem has not been initialised, set up graphics temporarily */
|
||||
hasGpuRight = gspHasGpuRight();
|
||||
if (!hasGpuRight)
|
||||
gfxInitDefault();
|
||||
|
||||
errorInit(&errCnf, ERROR_TEXT_WORD_WRAP, CFG_LANGUAGE_EN);
|
||||
errorText(&errCnf, message);
|
||||
errorDisp(&errCnf);
|
||||
|
||||
if (!hasGpuRight)
|
||||
gfxExit();
|
||||
|
||||
return 0;
|
||||
#else
|
||||
SDL_MessageBoxData data;
|
||||
SDL_MessageBoxButtonData button;
|
||||
|
Reference in New Issue
Block a user