From b584f1fe3519ff59c4d59e92509f0d76a7bb194b Mon Sep 17 00:00:00 2001 From: Jan Date: Tue, 20 Dec 2022 23:36:18 +0100 Subject: [PATCH] Simplify SDL message boxes (#1249) It has what we needs and needs less abstraction, overall simplifying the code --- src/api/system.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/src/api/system.c b/src/api/system.c index 59b29b2..b51e577 100644 --- a/src/api/system.c +++ b/src/api/system.c @@ -500,19 +500,8 @@ static int f_show_fatal_error(lua_State *L) { #ifdef _WIN32 MessageBox(0, msg, title, MB_OK | MB_ICONERROR); - #else - SDL_MessageBoxButtonData buttons[] = { - { SDL_MESSAGEBOX_BUTTON_RETURNKEY_DEFAULT, 0, "Ok" }, - }; - SDL_MessageBoxData data = { - .title = title, - .message = msg, - .numbuttons = 1, - .buttons = buttons, - }; - int buttonid; - SDL_ShowMessageBox(&data, &buttonid); + SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, title, msg, NULL); #endif return 0; }