From e5fc130b821024da6d394b4803c5a23942846abb Mon Sep 17 00:00:00 2001 From: zicodxx Date: Sun, 16 Jan 2011 02:09:47 +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 b0f1f396b..d5194b18a 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -3,6 +3,7 @@ D2X-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 +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 48e1067b3..0bede8ea9 100644 --- a/main/menu.c +++ b/main/menu.c @@ -1039,8 +1039,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); } }