diff --git a/src/gl/system/gl_framebuffer.cpp b/src/gl/system/gl_framebuffer.cpp index dec0861daa..d98bab181d 100644 --- a/src/gl/system/gl_framebuffer.cpp +++ b/src/gl/system/gl_framebuffer.cpp @@ -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(); mDebug->Update(); - gl_SetupMenu(); DoSetGamma(); } diff --git a/src/gl/system/gl_menu.cpp b/src/gl/system/gl_menu.cpp index 1d6a64cd08..681154e7a5 100644 --- a/src/gl/system/gl_menu.cpp +++ b/src/gl/system/gl_menu.cpp @@ -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); diff --git a/src/menu/menudef.cpp b/src/menu/menudef.cpp index ac8d68fc6f..5cbc885499 100644 --- a/src/menu/menudef.cpp +++ b/src/menu/menudef.cpp @@ -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(")"); diff --git a/wadsrc/static/menudef.txt b/wadsrc/static/menudef.txt index d769af6e10..a2d1a3230e 100644 --- a/wadsrc/static/menudef.txt +++ b/wadsrc/static/menudef.txt @@ -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"