50
50
// ===========================================================================
51
51
52
52
CVAR (Bool, gl_aalines, false , CVAR_ARCHIVE)
53
+ CVAR(Bool, hw_2dmip, true , CVAR_ARCHIVE)
53
54
54
55
void Draw2D(F2DDrawer* drawer, FRenderState& state)
55
56
{
@@ -71,6 +72,8 @@ void Draw2D(F2DDrawer* drawer, FRenderState& state, int x, int y, int width, int
71
72
state.EnableMultisampling (false );
72
73
state.EnableLineSmooth (gl_aalines);
73
74
75
+ bool cache_hw_2dmip = hw_2dmip; // cache cvar lookup so it's not done in a loop
76
+
74
77
auto &vertices = drawer->mVertices ;
75
78
auto &indices = drawer->mIndices ;
76
79
auto &commands = drawer->mData ;
@@ -180,7 +183,7 @@ void Draw2D(F2DDrawer* drawer, FRenderState& state, int x, int y, int width, int
180
183
auto flags = cmd.mTexture ->GetUseType () >= ETextureType::Special? UF_None : cmd.mTexture ->GetUseType () == ETextureType::FontChar? UF_Font : UF_Texture;
181
184
182
185
auto scaleflags = cmd.mFlags & F2DDrawer::DTF_Indexed ? CTF_Indexed : 0 ;
183
- state.SetMaterial (cmd.mTexture , flags, scaleflags, cmd.mFlags & F2DDrawer::DTF_Wrap ? CLAMP_NONE : CLAMP_XY_NOMIP, cmd.mTranslationId , -1 );
186
+ state.SetMaterial (cmd.mTexture , flags, scaleflags, cmd.mFlags & F2DDrawer::DTF_Wrap ? CLAMP_NONE : (cache_hw_2dmip ? CLAMP_XY : CLAMP_XY_NOMIP) , cmd.mTranslationId , -1 );
184
187
state.EnableTexture (true );
185
188
186
189
// Canvas textures are stored upside down
0 commit comments