From a2f0c27651c9a1a7d60458b51d1b7dc0c9101836 Mon Sep 17 00:00:00 2001 From: Rachael Alexanderson Date: Thu, 8 Oct 2020 00:30:12 -0400 Subject: [PATCH] - add option to texture hqresize resize model skins. --- src/common/textures/gametexture.h | 3 ++- src/common/textures/hires/hqresize.cpp | 3 ++- src/gameconfigfile.cpp | 6 ++++++ src/rendering/hwrenderer/hw_models.cpp | 2 +- wadsrc/static/menudef.txt | 1 + 5 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/common/textures/gametexture.h b/src/common/textures/gametexture.h index c07753eac..0720267c3 100644 --- a/src/common/textures/gametexture.h +++ b/src/common/textures/gametexture.h @@ -366,7 +366,8 @@ enum EUpscaleFlags UF_None = 0, UF_Texture = 1, UF_Sprite = 2, - UF_Font = 4 + UF_Font = 4, + UF_Skin = 8 }; extern int upscalemask; diff --git a/src/common/textures/hires/hqresize.cpp b/src/common/textures/hires/hqresize.cpp index e8b457ee1..16b2b4b13 100644 --- a/src/common/textures/hires/hqresize.cpp +++ b/src/common/textures/hires/hqresize.cpp @@ -75,7 +75,7 @@ CUSTOM_CVAR(Int, gl_texture_hqresize_maxinputsize, 512, CVAR_ARCHIVE | CVAR_GLOB TexMan.FlushAll(); } -CUSTOM_CVAR(Int, gl_texture_hqresize_targets, 7, CVAR_ARCHIVE | CVAR_GLOBALCONFIG | CVAR_NOINITCALL) +CUSTOM_CVAR(Int, gl_texture_hqresize_targets, 15, CVAR_ARCHIVE | CVAR_GLOBALCONFIG | CVAR_NOINITCALL) { TexMan.FlushAll(); UpdateUpscaleMask(); @@ -84,6 +84,7 @@ CUSTOM_CVAR(Int, gl_texture_hqresize_targets, 7, CVAR_ARCHIVE | CVAR_GLOBALCONFI CVAR (Flag, gl_texture_hqresize_textures, gl_texture_hqresize_targets, 1); CVAR (Flag, gl_texture_hqresize_sprites, gl_texture_hqresize_targets, 2); CVAR (Flag, gl_texture_hqresize_fonts, gl_texture_hqresize_targets, 4); +CVAR (Flag, gl_texture_hqresize_skins, gl_texture_hqresize_targets, 8); CVAR(Bool, gl_texture_hqresize_multithread, true, CVAR_ARCHIVE | CVAR_GLOBALCONFIG); diff --git a/src/gameconfigfile.cpp b/src/gameconfigfile.cpp index 3fdec5f0b..625fca77b 100644 --- a/src/gameconfigfile.cpp +++ b/src/gameconfigfile.cpp @@ -71,6 +71,7 @@ EXTERN_CVAR (Bool, vid_scale_linear) EXTERN_CVAR(Float, m_sensitivity_x) EXTERN_CVAR(Float, m_sensitivity_y) EXTERN_CVAR(Int, adl_volume_model) +EXTERN_CVAR (Int, gl_texture_hqresize_targets) #ifdef _WIN32 EXTERN_CVAR(Int, in_mouse) @@ -592,6 +593,11 @@ void FGameConfigFile::DoGlobalSetup () m_sensitivity_y = (float)yfact; adl_volume_model = 0; + + // if user originally wanted the in-game textures resized, set model skins to resize too + int old_targets = gl_texture_hqresize_targets; + old_targets |= (old_targets & 1) ? 8 : 0; + gl_texture_hqresize_targets = old_targets; } } } diff --git a/src/rendering/hwrenderer/hw_models.cpp b/src/rendering/hwrenderer/hw_models.cpp index 6a4bff601..ff99702f0 100644 --- a/src/rendering/hwrenderer/hw_models.cpp +++ b/src/rendering/hwrenderer/hw_models.cpp @@ -114,7 +114,7 @@ void FHWModelRenderer::SetInterpolation(double inter) void FHWModelRenderer::SetMaterial(FGameTexture *skin, bool clampNoFilter, int translation) { - state.SetMaterial(skin, UF_None, 0, clampNoFilter ? CLAMP_NOFILTER : CLAMP_NONE, translation, -1); + state.SetMaterial(skin, UF_Skin, 0, clampNoFilter ? CLAMP_NOFILTER : CLAMP_NONE, translation, -1); state.SetLightIndex(modellightindex); } diff --git a/wadsrc/static/menudef.txt b/wadsrc/static/menudef.txt index 533026994..f94f7a261 100644 --- a/wadsrc/static/menudef.txt +++ b/wadsrc/static/menudef.txt @@ -2585,6 +2585,7 @@ OptionMenu "GLTextureGLOptions" protected 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_RESIZESKN", gl_texture_hqresize_skins, "OnOff" Option "$GLTEXMNU_PRECACHETEX", gl_precache, "YesNo" Option "$GLTEXMNU_SORTDRAWLIST", gl_sort_textures, "YesNo" Class "GLTextureGLOptions"