From 162ad601ba64723ded7396f48e8f31985937d6b3 Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Mon, 12 Mar 2012 01:22:19 +0000 Subject: [PATCH] - Fixed bug introduced in r3412: The SetStyle() call needs to come after the scissoring check, because the latter can flush the quads, including the one SetStyle() just set a style for. SVN r3429 (trunk) --- src/sound/music_midistream.cpp | 2 +- src/win32/fb_d3d9.cpp | 21 +++++++++++---------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/src/sound/music_midistream.cpp b/src/sound/music_midistream.cpp index 8c312f4c1..7fb46160f 100644 --- a/src/sound/music_midistream.cpp +++ b/src/sound/music_midistream.cpp @@ -962,7 +962,7 @@ int MIDIStreamer::FillBuffer(int buffer_num, int max_events, DWORD max_time) int MIDIStreamer::FillStopBuffer(int buffer_num) { - DWORD *events = Events[buffer_num], *max_event_p; + DWORD *events = Events[buffer_num]; int i; events = WriteStopNotes(events); diff --git a/src/win32/fb_d3d9.cpp b/src/win32/fb_d3d9.cpp index c7515bb26..25716a0f0 100644 --- a/src/win32/fb_d3d9.cpp +++ b/src/win32/fb_d3d9.cpp @@ -2981,15 +2981,6 @@ 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; @@ -3033,6 +3024,16 @@ 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)) + { + goto done; + } + quad->Texture = tex->Box->Owner->Tex; if (parms.bilinear) { @@ -3109,7 +3110,7 @@ void STACK_ARGS D3DFB::DrawTextureV (FTexture *img, double x, double y, uint32 t QuadBatchPos++; VertexPos += 4; IndexPos += 6; - +done: if (scissoring) { EndQuadBatch();