Commit abe35fd0 by Jaime Ita Passos

Some interface fixes

parent 152c540c
......@@ -652,6 +652,8 @@ void D_SRB2Loop(void)
SCR_SetMode(); // change video mode
SCR_Recalc();
chosenrendermode = render_none;
// Check and print which version is executed.
// Use this as the border between setup and the main game loop being entered.
CONS_Printf(
......@@ -1296,19 +1298,6 @@ void D_SRB2Main(void)
// set user default mode or mode set at cmdline
SCR_CheckDefaultMode();
// Lactozilla: Check if the render mode needs to change.
if (setrenderneeded)
{
CONS_Printf(M_GetText("Switching the renderer...\n"));
// Switch the renderer in the interface
if (VID_CheckRenderer())
con_refresh = true; // Allow explicit screen refresh again
// Set cv_renderer to the new render mode
CV_StealthSetValue(&cv_renderer, rendermode);
}
wipegamestate = gamestate;
savedata.lives = 0; // flag this as not-used
......
......@@ -305,16 +305,16 @@ static int patch_get(lua_State *L)
lua_pushboolean(L, patch != NULL);
break;
case patch_width:
lua_pushinteger(L, SHORT(patch->width));
lua_pushinteger(L, patch->width);
break;
case patch_height:
lua_pushinteger(L, SHORT(patch->height));
lua_pushinteger(L, patch->height);
break;
case patch_leftoffset:
lua_pushinteger(L, SHORT(patch->leftoffset));
lua_pushinteger(L, patch->leftoffset);
break;
case patch_topoffset:
lua_pushinteger(L, SHORT(patch->topoffset));
lua_pushinteger(L, patch->topoffset);
break;
}
return 1;
......
......@@ -72,7 +72,7 @@ CV_PossibleValue_t cv_renderer_t[] = {
{0, NULL}
};
consvar_t cv_renderer = CVAR_INIT ("renderer", "Software", CV_SAVE|CV_NOLUA|CV_CALL, cv_renderer_t, SCR_SetTargetRenderer);
consvar_t cv_renderer = CVAR_INIT ("renderer", "Software", CV_SAVE|CV_NOLUA|CV_CALL, cv_renderer_t, SCR_ChangeRenderer);
static void SCR_ChangeFullscreen(void);
......@@ -207,7 +207,11 @@ void SCR_SetMode(void)
if (setrenderneeded && (moviemode == MM_APNG))
M_StopMovie();
VID_CheckRenderer();
// VID_SetMode will call VID_CheckRenderer itself,
// so no need to do this in here.
if (!setmodeneeded)
VID_CheckRenderer();
vid.recalc = 1;
}
......@@ -402,15 +406,10 @@ void SCR_ChangeFullscreen(void)
#endif
}
void SCR_SetTargetRenderer(void)
{
if (!con_refresh)
SCR_ChangeRenderer();
}
void SCR_ChangeRenderer(void)
{
if ((signed)rendermode == cv_renderer.value)
if (chosenrendermode != render_none
|| (signed)rendermode == cv_renderer.value)
return;
#ifdef HWRENDER
......@@ -428,7 +427,6 @@ void SCR_ChangeRenderer(void)
// Set the new render mode
setrenderneeded = cv_renderer.value;
con_refresh = false;
}
boolean SCR_IsAspectCorrect(INT32 width, INT32 height)
......
......@@ -183,7 +183,6 @@ extern INT32 setmodeneeded; // mode number to set if needed, or 0
extern UINT8 setrenderneeded;
void SCR_ChangeRenderer(void);
void SCR_SetTargetRenderer(void);
extern CV_PossibleValue_t cv_renderer_t[];
......
......@@ -1557,7 +1557,7 @@ boolean VID_CheckRenderer(void)
setrenderneeded = 0;
}
SDLSetMode(vid.width, vid.height, USE_FULLSCREEN, (rendererchanged ? SDL_FALSE : SDL_TRUE));
SDLSetMode(vid.width, vid.height, USE_FULLSCREEN, (setmodeneeded ? SDL_TRUE : SDL_FALSE));
Impl_VideoSetupBuffer();
if (rendermode == render_soft)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment