- added a warning for texture upscaling modes

This commit is contained in:
alexey.lysiuk 2018-08-04 13:30:04 +03:00 committed by Rachael Alexanderson
parent 778a7c370d
commit c589f1bba7
3 changed files with 76 additions and 0 deletions

View file

@ -2771,6 +2771,7 @@ GLTEXMNU_ANISOTROPIC = "Anisotropic filter";
GLTEXMNU_TEXFORMAT = "Texture Format"; GLTEXMNU_TEXFORMAT = "Texture Format";
GLTEXMNU_ENABLEHIRES = "Enable hires textures"; GLTEXMNU_ENABLEHIRES = "Enable hires textures";
GLTEXMNU_HQRESIZE = "High Quality Resize mode"; GLTEXMNU_HQRESIZE = "High Quality Resize mode";
GLTEXMNU_HQRESIZEWARN = "This mode requires %d times more video memory";
GLTEXMNU_RESIZETEX = "Resize textures"; GLTEXMNU_RESIZETEX = "Resize textures";
GLTEXMNU_RESIZESPR = "Resize sprites"; GLTEXMNU_RESIZESPR = "Resize sprites";
GLTEXMNU_RESIZEFNT = "Resize fonts"; GLTEXMNU_RESIZEFNT = "Resize fonts";

View file

@ -2256,12 +2256,15 @@ OptionMenu "GLTextureGLOptions" protected
{ {
Option "$GLTEXMNU_HQRESIZE", gl_texture_hqresize, "HqResizeModesNoMMX" Option "$GLTEXMNU_HQRESIZE", gl_texture_hqresize, "HqResizeModesNoMMX"
} }
StaticText "!HQRESIZE_WARNING!"
Option "$GLTEXMNU_RESIZETEX", gl_texture_hqresize_textures, "OnOff" Option "$GLTEXMNU_RESIZETEX", gl_texture_hqresize_textures, "OnOff"
Option "$GLTEXMNU_RESIZESPR", gl_texture_hqresize_sprites, "OnOff" Option "$GLTEXMNU_RESIZESPR", gl_texture_hqresize_sprites, "OnOff"
Option "$GLTEXMNU_RESIZEFNT", gl_texture_hqresize_fonts, "OnOff" Option "$GLTEXMNU_RESIZEFNT", gl_texture_hqresize_fonts, "OnOff"
Option "$GLTEXMNU_PRECACHETEX", gl_precache, "YesNo" Option "$GLTEXMNU_PRECACHETEX", gl_precache, "YesNo"
Option "$GLTEXMNU_TRIMSPREDGE", gl_trimsprites, "OnOff" Option "$GLTEXMNU_TRIMSPREDGE", gl_trimsprites, "OnOff"
Option "$GLTEXMNU_SORTDRAWLIST", gl_sort_textures, "YesNo" Option "$GLTEXMNU_SORTDRAWLIST", gl_sort_textures, "YesNo"
Class "GLTextureGLOptions"
} }
OptionMenu "GLLightOptions" protected OptionMenu "GLLightOptions" protected

View file

@ -536,3 +536,75 @@ class CompatibilityMenu : OptionMenu
DTA_CleanNoMove_1, true); 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;
}
}
}