- fixed: Translucency detection for GL textures was broken.

- fixed: Textures which are already scaled should not be upsampled.
- fixed: The transparency check in the upscaling code checked the wrong modes for exclusion when handling translucent textures.
This commit is contained in:
Christoph Oelckers 2016-01-30 02:13:47 +01:00
parent 4267e3c40b
commit 37ac6ef9a0
2 changed files with 8 additions and 5 deletions

View file

@ -263,6 +263,10 @@ unsigned char *gl_CreateUpsampledTextureBuffer ( const FTexture *inputTexture, u
if ( inputTexture->bHasCanvas ) if ( inputTexture->bHasCanvas )
return inputBuffer; return inputBuffer;
// already scaled?
if (inputTexture->xScale >= FRACUNIT*2 && inputTexture->yScale >= FRACUNIT*2)
return inputBuffer;
switch (inputTexture->UseType) switch (inputTexture->UseType)
{ {
case FTexture::TEX_Sprite: case FTexture::TEX_Sprite:
@ -281,14 +285,14 @@ unsigned char *gl_CreateUpsampledTextureBuffer ( const FTexture *inputTexture, u
if (inputBuffer) if (inputBuffer)
{ {
int type = gl_texture_hqresize;
outWidth = inWidth; outWidth = inWidth;
outHeight = inHeight; outHeight = inHeight;
int type = gl_texture_hqresize;
#ifdef HAVE_MMX #ifdef HAVE_MMX
// ASM-hqNx does not preserve the alpha channel so fall back to C-version for such textures // ASM-hqNx does not preserve the alpha channel so fall back to C-version for such textures
if (!hasAlpha && type > 3 && type <= 6) if (!hasAlpha && type > 6 && type <= 9)
{ {
type += 3; type -= 3;
} }
#endif #endif

View file

@ -510,7 +510,7 @@ void FTexture::CheckTrans(unsigned char * buffer, int size, int trans)
if (trans == -1) if (trans == -1)
{ {
DWORD * dwbuf = (DWORD*)buffer; DWORD * dwbuf = (DWORD*)buffer;
if (gl_info.mIsTransparent == -1) for(int i=0;i<size;i++) for(int i=0;i<size;i++)
{ {
DWORD alpha = dwbuf[i]>>24; DWORD alpha = dwbuf[i]>>24;
@ -521,7 +521,6 @@ void FTexture::CheckTrans(unsigned char * buffer, int size, int trans)
} }
} }
} }
gl_info.mIsTransparent = 0;
} }
} }