Use simular logic in ref_sw:setMode as in ref_gl

This commit is contained in:
Denis Pauk 2020-01-26 21:58:19 +02:00 committed by Yamagi
parent f508584067
commit e48a7f61c6

View file

@ -1479,6 +1479,7 @@ RE_SetMode(void)
if ((err = SWimp_SetMode(&vid.width, &vid.height, r_mode->value, fullscreen)) == rserr_ok)
{
R_InitGraphics( vid.width, vid.height );
if (r_mode->value == -1)
{
sw_state.prev_mode = 4; /* safe default for custom mode */
@ -1498,7 +1499,7 @@ RE_SetMode(void)
vid_fullscreen->modified = false;
R_Printf(PRINT_ALL, "%s() - fullscreen unavailable in this mode\n", __func__);
if ((SWimp_SetMode(&vid.width, &vid.height, r_mode->value, 0)) == rserr_ok)
if ((err = SWimp_SetMode(&vid.width, &vid.height, r_mode->value, 0)) == rserr_ok)
{
return true;
}
@ -1519,7 +1520,7 @@ RE_SetMode(void)
}
/* try setting it back to something safe */
if ((SWimp_SetMode(&vid.width, &vid.height, sw_state.prev_mode, 0)) != rserr_ok)
if ((err = SWimp_SetMode(&vid.width, &vid.height, sw_state.prev_mode, 0)) != rserr_ok)
{
R_Printf(PRINT_ALL, "%s() - could not revert to safe mode\n", __func__);
return false;