SDL2: fix size of letterbox sequences

andrew-strong reported that using SDL2, with the window set to full
screen, but a windowed size less than full screen, caused letterbox
sequences, such as the player ship destroyed sequence, to render in a
subwindow sized to the dimensions game would have when unmaximized, even
if the game window is maximized at the time of the sequence.

tycho suggested a change that resolves this issue, and basic testing
showed no unwanted side effects.

Reported-by: andrew-strong <https://github.com/dxx-rebirth/dxx-rebirth/issues/399>
Suggested-by: tycho <https://github.com/dxx-rebirth/dxx-rebirth/issues/399#issuecomment-583688998>
This commit is contained in:
Kp 2020-03-28 17:32:34 +00:00
parent 2e682e140d
commit 0fb82b47f6

View file

@ -239,8 +239,8 @@ void init_cockpit()
break;
case CM_LETTERBOX: {
const unsigned gsm_height = SM_H(Game_screen_mode);
const unsigned w = SM_W(Game_screen_mode);
const unsigned gsm_height = grd_curscreen->get_screen_height();
const unsigned w = grd_curscreen->get_screen_width();
const unsigned h = (gsm_height * 3) / 4; // true letterbox size (16:9)
const unsigned x = 0;
const unsigned y = (gsm_height - h) / 2;