From 76b5e7ef600ff2d913140a1d222daf1b4f631386 Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Fri, 9 Mar 2012 00:12:04 +0000 Subject: [PATCH] - Fixed: D3DFB::DrawTextureV() did not disable the scissor test if it was needed but SetStyle() decided there was nothing to draw. In practical terms, this means that if your weapon is completely invisible, the game would not draw anything outside of the main play area because the scissor test would be left on for the entire frame and not just the weapon's quad. Making the call to SetStyle() before the scissor check is enough to fix this. SVN r3412 (trunk) --- src/win32/fb_d3d9.cpp | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/src/win32/fb_d3d9.cpp b/src/win32/fb_d3d9.cpp index 0c22f4512..c7515bb26 100644 --- a/src/win32/fb_d3d9.cpp +++ b/src/win32/fb_d3d9.cpp @@ -2981,6 +2981,16 @@ void STACK_ARGS D3DFB::DrawTextureV (FTexture *img, double x, double y, uint32 t x1 -= (parms.texwidth - parms.windowright) * xscale; u1 = float(u1 - (parms.texwidth - parms.windowright) * uscale); } + parms.bilinear = false; + + D3DCOLOR color0, color1; + BufferedTris *quad = &QuadExtra[QuadBatchPos]; + + if (!SetStyle(tex, parms, color0, color1, *quad)) + { + return; + } + #if 0 float vscale = 1.f / tex->Box->Owner->Height / yscale; if (y0 < parms.uclip) @@ -3023,16 +3033,6 @@ void STACK_ARGS D3DFB::DrawTextureV (FTexture *img, double x, double y, uint32 t D3DDevice->SetRenderState(D3DRS_SCISSORTESTENABLE, TRUE); } #endif - parms.bilinear = false; - - D3DCOLOR color0, color1; - BufferedTris *quad = &QuadExtra[QuadBatchPos]; - - if (!SetStyle(tex, parms, color0, color1, *quad)) - { - return; - } - quad->Texture = tex->Box->Owner->Tex; if (parms.bilinear) { @@ -3548,6 +3548,7 @@ void D3DFB::EndQuadBatch() } else if ((quad->Flags & BQF_Paletted) == BQF_CustomPalette) { + assert(quad->Palette != NULL); SetPaletteTexture(quad->Palette->Tex, quad->Palette->RoundedPaletteSize, quad->Palette->BorderColor); } #if 0