Commit 468af083 authored by Richard Gobeille's avatar Richard Gobeille
Browse files

engine: early exit from osdfunc_setrendermode() if the requested rendmode is already set

parent e6058568
......@@ -629,6 +629,15 @@ int32_t (*baselayer_osdcmd_vidmode_func)(osdcmdptr_t parm);
static int osdfunc_setrendermode(osdcmdptr_t parm)
{
static const char *const modes[] = {
#ifdef NOASM
"software (C)",
#else
"software (x86 ASM)",
#endif
nullptr, nullptr, "Polymost", "Polymer (for great justice)"
};
if (parm->numparms != 1)
return OSDCMD_SHOWHELP;
......@@ -637,6 +646,9 @@ static int osdfunc_setrendermode(osdcmdptr_t parm)
if (m != REND_CLASSIC && m != REND_POLYMOST && m != REND_POLYMER)
return OSDCMD_SHOWHELP;
if (videoGetRenderMode() == m)
return OSDCMD_OK;
if ((m==REND_CLASSIC) != (bpp==8) && baselayer_osdcmd_vidmode_func)
{
// Mismatch between video mode and requested renderer, do auto switch.
......@@ -662,29 +674,7 @@ static int osdfunc_setrendermode(osdcmdptr_t parm)
}
videoSetRenderMode(m);
char const *renderer = "other";
switch (videoGetRenderMode())
{
case REND_CLASSIC:
#ifdef NOASM
renderer = "classic software (C)";
#else
renderer = "classic software (ASM)";
#endif
break;
case REND_POLYMOST:
renderer = "polygonal OpenGL";
break;
#ifdef POLYMER
case REND_POLYMER:
renderer = "great justice (Polymer)";
break;
#endif
}
VLOG_F(LOG_GFX, "Rendering method changed to %s.", renderer);
VLOG_F(LOG_GFX, "Rendering method changed to %s.", modes[videoGetRenderMode()]);
return OSDCMD_OK;
}
......
Supports Markdown
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