From 0ff21c3af7678c44c9947d8714a85d4980f8d90b Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Fri, 20 Sep 2013 10:28:12 +0200 Subject: [PATCH] - fixed: Sprites may never be used as a base of a texture redirect Due to autoexpansion to remove filtering artifacts their dimensions are not the same as for patches. But if the sprite hadn't been used yet this information won't have been set yet. --- src/gl/textures/gl_material.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gl/textures/gl_material.cpp b/src/gl/textures/gl_material.cpp index b77920d57..ebfcbc002 100644 --- a/src/gl/textures/gl_material.cpp +++ b/src/gl/textures/gl_material.cpp @@ -671,12 +671,14 @@ FMaterial::FMaterial(FTexture * tx, bool forceexpand) tx->gl_info.mExpanded = expanded; FTexture *basetex = tx->GetRedirect(gl.shadermodel < 4); - if (!expanded && !basetex->gl_info.mExpanded) + if (!expanded && !basetex->gl_info.mExpanded && basetex->UseType != FTexture::TEX_Sprite) { // check if the texture is just a simple redirect to a patch // If so we should use the patch for texture creation to // avoid eventual redundancies. // This may only be done if both textures use the same expansion mode + // Redirects to sprites are not permitted because sprites get expanded, however, this won't have been set + // if the sprite hadn't been used yet. mBaseLayer = ValidateSysTexture(basetex, false); } else if (!expanded)