mirror of
https://github.com/Ryujinx/SDL.git
synced 2025-01-03 13:25:46 +00:00
fixes after ShowMessageBox changes:
- SDL_video.c (SDL_ShowMessageBox): remove C99'ism. - SDL_os2video.c (OS2DIVE_bootstrap): add OS2_ShowMessageBox - SDL_os2video.c (OS2VMAN_bootstrap): add OS2_ShowMessageBox - SDL_DirectFB_video.c (DirectFB_bootstrap): NULL ShowMessageBox - SDL_naclvideo.c (NACL_bootstrap): NULL ShowMessageBox (cherry picked from commit 9e352e61db6836e85e24e9f2497dee5a62d8e212)
This commit is contained in:
parent
10cbe04fc5
commit
52181848da
|
@ -4445,13 +4445,14 @@ int SDL_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid)
|
|||
} else {
|
||||
/* It's completely fine to call this function before video is initialized */
|
||||
const char *driver_name = SDL_GetHint(SDL_HINT_VIDEODRIVER);
|
||||
int i;
|
||||
if (driver_name && *driver_name != 0) {
|
||||
const char *driver_attempt = driver_name;
|
||||
while (driver_attempt && (*driver_attempt != 0) && (retval == -1)) {
|
||||
const char *driver_attempt_end = SDL_strchr(driver_attempt, ',');
|
||||
size_t driver_attempt_len = (driver_attempt_end) ? (driver_attempt_end - driver_attempt)
|
||||
: SDL_strlen(driver_attempt);
|
||||
for (int i = 0; bootstrap[i]; ++i) {
|
||||
for (i = 0; bootstrap[i]; ++i) {
|
||||
if (bootstrap[i]->ShowMessageBox && (driver_attempt_len == SDL_strlen(bootstrap[i]->name)) &&
|
||||
(SDL_strncasecmp(bootstrap[i]->name, driver_attempt, driver_attempt_len) == 0)) {
|
||||
if (bootstrap[i]->ShowMessageBox(messageboxdata, buttonid) == 0) {
|
||||
|
@ -4464,7 +4465,7 @@ int SDL_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid)
|
|||
driver_attempt = (driver_attempt_end) ? (driver_attempt_end + 1) : NULL;
|
||||
}
|
||||
} else {
|
||||
for (int i = 0; bootstrap[i]; ++i) {
|
||||
for (i = 0; bootstrap[i]; ++i) {
|
||||
if (bootstrap[i]->ShowMessageBox && bootstrap[i]->ShowMessageBox(messageboxdata, buttonid) == 0) {
|
||||
retval = 0;
|
||||
break;
|
||||
|
|
|
@ -65,7 +65,8 @@ static SDL_VideoDevice *DirectFB_CreateDevice(void);
|
|||
|
||||
VideoBootStrap DirectFB_bootstrap = {
|
||||
"directfb", "DirectFB",
|
||||
DirectFB_CreateDevice
|
||||
DirectFB_CreateDevice,
|
||||
NULL /* no ShowMessageBox implementation */
|
||||
};
|
||||
|
||||
static const DirectFBSurfaceDrawingFlagsNames(drawing_flags);
|
||||
|
|
|
@ -134,7 +134,8 @@ static SDL_VideoDevice *NACL_CreateDevice(void) {
|
|||
|
||||
VideoBootStrap NACL_bootstrap = {
|
||||
NACLVID_DRIVER_NAME, "SDL Native Client Video Driver",
|
||||
NACL_CreateDevice
|
||||
NACL_CreateDevice,
|
||||
NULL /* no ShowMessageBox implementation */
|
||||
};
|
||||
|
||||
int NACL_VideoInit(_THIS) {
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
#include "SDL_os2video.h"
|
||||
#include "SDL_syswm.h"
|
||||
#include "SDL_os2util.h"
|
||||
#include "SDL_os2messagebox.h"
|
||||
|
||||
#define __MEERROR_H__
|
||||
#define _MEERROR_H_
|
||||
|
@ -1683,12 +1684,14 @@ static SDL_VideoDevice *OS2VMAN_CreateDevice(void)
|
|||
VideoBootStrap OS2DIVE_bootstrap =
|
||||
{
|
||||
OS2DRIVER_NAME_DIVE, "OS/2 video driver",
|
||||
OS2DIVE_CreateDevice
|
||||
OS2DIVE_CreateDevice,
|
||||
OS2_ShowMessageBox
|
||||
};
|
||||
VideoBootStrap OS2VMAN_bootstrap =
|
||||
{
|
||||
OS2DRIVER_NAME_VMAN, "OS/2 video driver",
|
||||
OS2VMAN_CreateDevice
|
||||
OS2VMAN_CreateDevice,
|
||||
OS2_ShowMessageBox
|
||||
};
|
||||
|
||||
#endif /* SDL_VIDEO_DRIVER_OS2 */
|
||||
|
|
Loading…
Reference in a new issue