From ee3a1b6189083a814ee444ad805a7a4e576bb2ba Mon Sep 17 00:00:00 2001 From: zicodxx Date: Sun, 16 Jan 2011 02:09:45 +0100 Subject: [PATCH] When changing resolutions and Game_wind is present, send EVENT_WINDOW_ACTIVATE shortly so it's canvase will align to the new resolution seamlessly --- CHANGELOG.txt | 1 + main/menu.c | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index fda175565..c50fe9951 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -3,6 +3,7 @@ D1X-Rebirth Changelog 20110116 -------- 2d/bitblt.c, arch/ogl/gr.c, arch/ogl/ogl.c, include/ogl_init.h, main/menu.c: Added feature to enable Anisotropic filtering is supported by hardware or driver; Reworked way of handling texture filtering information so ingame switching is possible again; Little fix for ogl_get_verinfo which was taken out for ordinary OGL code but should for OGLES +main/menu.c: When changing resolutions and Game_wind is present, send EVENT_WINDOW_ACTIVATE shortly so it's canvase will align to the new resolution seamlessly 20110115 -------- diff --git a/main/menu.c b/main/menu.c index 23ef820f6..1fa964c41 100644 --- a/main/menu.c +++ b/main/menu.c @@ -998,8 +998,16 @@ void change_res() newmenu_free_background(); set_screen_mode(SCREEN_MENU); if (new_mode != Game_screen_mode) + { gr_set_mode(new_mode); - Game_screen_mode = new_mode; + Game_screen_mode = new_mode; + if (Game_wind) // shortly activate Game_wind so it's canvas will align to new resolution. really minor glitch but whatever + { + d_event event; + WINDOW_SEND_EVENT(Game_wind, EVENT_WINDOW_ACTIVATED); + WINDOW_SEND_EVENT(Game_wind, EVENT_WINDOW_DEACTIVATED); + } + } game_init_render_buffers(SM_W(Game_screen_mode), SM_H(Game_screen_mode), VR_NONE); } }