From 5f32febcf319dac44d3d170d2c644ce025cf41d7 Mon Sep 17 00:00:00 2001 From: NeoBrainX Date: Sun, 7 Apr 2013 16:50:58 +0200 Subject: [PATCH] Apply re07a91930df0 to the software renderer. --- Source/Plugins/Plugin_VideoSoftware/Src/Tev.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Source/Plugins/Plugin_VideoSoftware/Src/Tev.cpp b/Source/Plugins/Plugin_VideoSoftware/Src/Tev.cpp index 418b85f8f1..e741d79a1c 100644 --- a/Source/Plugins/Plugin_VideoSoftware/Src/Tev.cpp +++ b/Source/Plugins/Plugin_VideoSoftware/Src/Tev.cpp @@ -698,9 +698,13 @@ void Tev::Draw() } #endif } - - // convert to 8 bits per component - u8 output[4] = {(u8)Reg[0][ALP_C], (u8)Reg[0][BLU_C], (u8)Reg[0][GRN_C], (u8)Reg[0][RED_C]}; + + // convert to 8 bits per component + // the results of the last tev stage are put onto the screen, + // regardless of the used destination register - TODO: Verify! + u32 color_index = bpmem.combiners[bpmem.genMode.numtevstages].colorC.dest; + u32 alpha_index = bpmem.combiners[bpmem.genMode.numtevstages].alphaC.dest; + u8 output[4] = {(u8)Reg[alpha_index][ALP_C], (u8)Reg[color_index][BLU_C], (u8)Reg[color_index][GRN_C], (u8)Reg[color_index][RED_C]}; if (!TevAlphaTest(output[ALP_C])) return;