Skip to content

Commit d6e1097

Browse files
- enable mipmapping in 2D
1 parent a4e5279 commit d6e1097

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/common/rendering/hwrenderer/hw_draw2d.cpp

+4-1
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
//===========================================================================
5151

5252
CVAR(Bool, gl_aalines, false, CVAR_ARCHIVE)
53+
CVAR(Bool, hw_2dmip, true, CVAR_ARCHIVE)
5354

5455
void Draw2D(F2DDrawer* drawer, FRenderState& state)
5556
{
@@ -71,6 +72,8 @@ void Draw2D(F2DDrawer* drawer, FRenderState& state, int x, int y, int width, int
7172
state.EnableMultisampling(false);
7273
state.EnableLineSmooth(gl_aalines);
7374

75+
bool cache_hw_2dmip = hw_2dmip; // cache cvar lookup so it's not done in a loop
76+
7477
auto &vertices = drawer->mVertices;
7578
auto &indices = drawer->mIndices;
7679
auto &commands = drawer->mData;
@@ -180,7 +183,7 @@ void Draw2D(F2DDrawer* drawer, FRenderState& state, int x, int y, int width, int
180183
auto flags = cmd.mTexture->GetUseType() >= ETextureType::Special? UF_None : cmd.mTexture->GetUseType() == ETextureType::FontChar? UF_Font : UF_Texture;
181184

182185
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);
184187
state.EnableTexture(true);
185188

186189
// Canvas textures are stored upside down

0 commit comments

Comments
 (0)