- replaced gl_PatchMenu with an MMX 'ifoption' check.

This commit is contained in:
Christoph Oelckers 2018-04-25 19:36:48 +02:00
parent cf8ee3130b
commit 85300993af
4 changed files with 33 additions and 35 deletions

View file

@ -52,7 +52,6 @@ FGLRenderer *GLRenderer;
void gl_LoadExtensions();
void gl_PrintStartupLog();
void gl_SetupMenu();
CUSTOM_CVAR(Int, vid_hwgamma, 2, CVAR_ARCHIVE | CVAR_GLOBALCONFIG | CVAR_NOINITCALL)
{
@ -86,7 +85,6 @@ OpenGLFrameBuffer::OpenGLFrameBuffer(void *hMonitor, int width, int height, int
InitializeState();
mDebug = std::make_shared<FGLDebug>();
mDebug->Update();
gl_SetupMenu();
DoSetGamma();
}

View file

@ -21,7 +21,6 @@
//
#include "gl/system/gl_system.h"
#include "c_cvars.h"
#include "v_video.h"
#include "gl/system/gl_cvars.h"
@ -77,34 +76,4 @@ CUSTOM_CVAR (Float, vid_saturation, 1.f, CVAR_ARCHIVE|CVAR_GLOBALCONFIG)
}
}
CUSTOM_CVAR(Int, gl_satformula, 1, CVAR_ARCHIVE|CVAR_GLOBALCONFIG)
{
if (screen != NULL)
{
screen->SetGamma(Gamma);
}
}
// Do some tinkering with the menus so that certain options only appear
// when they are actually valid.
void gl_SetupMenu()
{
#ifndef HAVE_MMX
FOptionValues **opt = OptionValues.CheckKey("HqResizeModes");
if (opt != NULL)
{
for(int i = (*opt)->mValues.Size()-1; i>=0; i--)
{
// Delete hqNx MMX resize modes for targets
// without support of this instruction set
const auto index = llround((*opt)->mValues[i].Value);
if (index > 6 && index < 10)
{
(*opt)->mValues.Delete(i);
}
}
}
#endif
}
CVAR(Int, gl_satformula, 1, CVAR_ARCHIVE|CVAR_GLOBALCONFIG);

View file

@ -240,6 +240,12 @@ static bool CheckSkipOptionBlock(FScanner &sc)
{
filter |= IsOpenALPresent();
}
else if (sc.Compare("MMX"))
{
#ifdef HAVE_MMX
filter = true;
#endif
}
}
while (sc.CheckString(","));
sc.MustGetStringName(")");

View file

@ -2125,6 +2125,23 @@ OptionValue "HqResizeModes"
15, "xBRZ_old 4x"
}
OptionValue "HqResizeModesNoMMX"
{
0, "$OPTVAL_OFF"
1, "$OPTVAL_SCALE2X"
2, "$OPTVAL_SCALE3X"
3, "$OPTVAL_SCALE4X"
4, "$OPTVAL_HQ2X"
5, "$OPTVAL_HQ3X"
6, "$OPTVAL_HQ4X"
10, "xBRZ 2x"
11, "xBRZ 3x"
12, "xBRZ 4x"
13, "xBRZ_old 2x"
14, "xBRZ_old 3x"
15, "xBRZ_old 4x"
}
OptionValue "FogMode"
{
0, "$OPTVAL_OFF"
@ -2178,7 +2195,15 @@ OptionMenu "GLTextureGLOptions" protected
Option "$GLTEXMNU_ANISOTROPIC", gl_texture_filter_anisotropic, "Anisotropy"
Option "$GLTEXMNU_TEXFORMAT", gl_texture_format, "TextureFormats"
Option "$GLTEXMNU_ENABLEHIRES", gl_texture_usehires, "YesNo"
Option "$GLTEXMNU_HQRESIZE", gl_texture_hqresize, "HqResizeModes"
ifOption(MMX)
{
Option "$GLTEXMNU_HQRESIZE", gl_texture_hqresize, "HqResizeModes"
}
else
{
Option "$GLTEXMNU_HQRESIZE", gl_texture_hqresize, "HqResizeModesNoMMX"
}
Option "$GLTEXMNU_RESIZETEX", gl_texture_hqresize_textures, "OnOff"
Option "$GLTEXMNU_RESIZESPR", gl_texture_hqresize_sprites, "OnOff"
Option "$GLTEXMNU_RESIZEFNT", gl_texture_hqresize_fonts, "OnOff"