mirror of
https://github.com/The-Powder-Toy/The-Powder-Toy.git
synced 2025-09-02 20:42:36 +02:00
Added a GUI error box for window resizing failure.
This commit is contained in:
@@ -3881,6 +3881,7 @@ void render_cursor(pixel *vid, int x, int y, int t, int rx, int ry)
|
|||||||
int sdl_opened = 0;
|
int sdl_opened = 0;
|
||||||
int sdl_open(void)
|
int sdl_open(void)
|
||||||
{
|
{
|
||||||
|
char screen_err = 0;
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
SDL_SysWMinfo SysInfo;
|
SDL_SysWMinfo SysInfo;
|
||||||
HWND WindowHandle;
|
HWND WindowHandle;
|
||||||
@@ -4098,6 +4099,7 @@ int sdl_open(void)
|
|||||||
if (info->current_w<((XRES+BARSIZE)*sdl_scale) || info->current_h<((YRES+MENUSIZE)*sdl_scale))
|
if (info->current_w<((XRES+BARSIZE)*sdl_scale) || info->current_h<((YRES+MENUSIZE)*sdl_scale))
|
||||||
{
|
{
|
||||||
sdl_scale = 1;
|
sdl_scale = 1;
|
||||||
|
screen_err = 1;
|
||||||
fprintf(stderr, "Can't change scale factor, because screen resolution is too small");
|
fprintf(stderr, "Can't change scale factor, because screen resolution is too small");
|
||||||
}
|
}
|
||||||
#ifdef PIX16
|
#ifdef PIX16
|
||||||
@@ -4128,6 +4130,9 @@ int sdl_open(void)
|
|||||||
XA_TARGETS = XInternAtom(sdl_wminfo.info.x11.display, "TARGETS", 1);
|
XA_TARGETS = XInternAtom(sdl_wminfo.info.x11.display, "TARGETS", 1);
|
||||||
sdl_wminfo.info.x11.unlock_func();
|
sdl_wminfo.info.x11.unlock_func();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
if (screen_err)
|
||||||
|
error_ui(vid_buf, 0, "Can't change scale factor, because screen resolution is too small");
|
||||||
sdl_opened = 1;
|
sdl_opened = 1;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user