diff --git a/wadsrc/static/language.enu b/wadsrc/static/language.enu index a700c6db15..7880ea1255 100644 --- a/wadsrc/static/language.enu +++ b/wadsrc/static/language.enu @@ -2771,6 +2771,7 @@ GLTEXMNU_ANISOTROPIC = "Anisotropic filter"; GLTEXMNU_TEXFORMAT = "Texture Format"; GLTEXMNU_ENABLEHIRES = "Enable hires textures"; GLTEXMNU_HQRESIZE = "High Quality Resize mode"; +GLTEXMNU_HQRESIZEWARN = "This mode requires %d times more video memory"; GLTEXMNU_RESIZETEX = "Resize textures"; GLTEXMNU_RESIZESPR = "Resize sprites"; GLTEXMNU_RESIZEFNT = "Resize fonts"; diff --git a/wadsrc/static/menudef.txt b/wadsrc/static/menudef.txt index 6c3571adce..9b527e2eb4 100644 --- a/wadsrc/static/menudef.txt +++ b/wadsrc/static/menudef.txt @@ -2256,12 +2256,15 @@ OptionMenu "GLTextureGLOptions" protected { Option "$GLTEXMNU_HQRESIZE", gl_texture_hqresize, "HqResizeModesNoMMX" } + StaticText "!HQRESIZE_WARNING!" + Option "$GLTEXMNU_RESIZETEX", gl_texture_hqresize_textures, "OnOff" Option "$GLTEXMNU_RESIZESPR", gl_texture_hqresize_sprites, "OnOff" Option "$GLTEXMNU_RESIZEFNT", gl_texture_hqresize_fonts, "OnOff" Option "$GLTEXMNU_PRECACHETEX", gl_precache, "YesNo" Option "$GLTEXMNU_TRIMSPREDGE", gl_trimsprites, "OnOff" Option "$GLTEXMNU_SORTDRAWLIST", gl_sort_textures, "YesNo" + Class "GLTextureGLOptions" } OptionMenu "GLLightOptions" protected diff --git a/wadsrc/static/zscript/menu/optionmenu.txt b/wadsrc/static/zscript/menu/optionmenu.txt index ad8aa14187..a06a31b6a6 100644 --- a/wadsrc/static/zscript/menu/optionmenu.txt +++ b/wadsrc/static/zscript/menu/optionmenu.txt @@ -536,3 +536,75 @@ class CompatibilityMenu : OptionMenu DTA_CleanNoMove_1, true); } } + +class GLTextureGLOptions : OptionMenu +{ + private int mWarningIndex; + + override void Init(Menu parent, OptionMenuDescriptor desc) + { + super.Init(parent, desc); + + for (int i=0; i < mDesc.mItems.Size(); ++i) + { + if (mDesc.mItems[i].mLabel == "!HQRESIZE_WARNING!") + { + mWarningIndex = i; + break; + } + } + } + + override void Ticker() + { + Super.Ticker(); + + if (mWarningIndex > 0) + { + string message; + + if (gl_texture_hqresize > 0) + { + int multiplier; + + switch (gl_texture_hqresize) + { + case 1: + case 4: + case 7: + case 10: + case 13: + multiplier = 4; + break; + case 2: + case 5: + case 8: + case 11: + case 14: + multiplier = 9; + break; + case 3: + case 6: + case 9: + case 12: + case 15: + multiplier = 16; + break; + case 16: + case 18: + multiplier = 25; + break; + case 17: + case 19: + multiplier = 36; + break; + } + + string localized = StringTable.Localize("$GLTEXMNU_HQRESIZEWARN"); + message = String.Format(localized, multiplier); + } + + mDesc.mItems[mWarningIndex].mLabel = message; + } + } +}