diff --git a/Source/Core/VideoBackends/Software/Rasterizer.cpp b/Source/Core/VideoBackends/Software/Rasterizer.cpp index e27d1a49b0..c302203015 100644 --- a/Source/Core/VideoBackends/Software/Rasterizer.cpp +++ b/Source/Core/VideoBackends/Software/Rasterizer.cpp @@ -140,9 +140,9 @@ static inline int iround(float x) return t; } -void SetTevReg(int reg, int comp, s16 color) +void SetTevKonstColors() { - tev.SetRegColor(reg, comp, color); + tev.SetKonstColors(); } static void Draw(s32 x, s32 y, s32 xi, s32 yi) diff --git a/Source/Core/VideoBackends/Software/Rasterizer.h b/Source/Core/VideoBackends/Software/Rasterizer.h index 5edd8f76af..d9cd4a6b11 100644 --- a/Source/Core/VideoBackends/Software/Rasterizer.h +++ b/Source/Core/VideoBackends/Software/Rasterizer.h @@ -17,7 +17,7 @@ void UpdateZSlope(const OutputVertexData* v0, const OutputVertexData* v1, void DrawTriangleFrontFace(const OutputVertexData* v0, const OutputVertexData* v1, const OutputVertexData* v2); -void SetTevReg(int reg, int comp, s16 color); +void SetTevKonstColors(); struct RasterBlockPixel { diff --git a/Source/Core/VideoBackends/Software/SWVertexLoader.cpp b/Source/Core/VideoBackends/Software/SWVertexLoader.cpp index aaf91d9891..00357b12d7 100644 --- a/Source/Core/VideoBackends/Software/SWVertexLoader.cpp +++ b/Source/Core/VideoBackends/Software/SWVertexLoader.cpp @@ -67,15 +67,7 @@ void SWVertexLoader::DrawCurrentBatch(u32 base_index, u32 num_indices, u32 base_ g_renderer->BBoxFlush(); m_setup_unit.Init(primitive_type); - - // set all states with are stored within video sw - for (int i = 0; i < 4; i++) - { - Rasterizer::SetTevReg(i, Tev::RED_C, PixelShaderManager::constants.kcolors[i][0]); - Rasterizer::SetTevReg(i, Tev::GRN_C, PixelShaderManager::constants.kcolors[i][1]); - Rasterizer::SetTevReg(i, Tev::BLU_C, PixelShaderManager::constants.kcolors[i][2]); - Rasterizer::SetTevReg(i, Tev::ALP_C, PixelShaderManager::constants.kcolors[i][3]); - } + Rasterizer::SetTevKonstColors(); for (u32 i = 0; i < m_index_generator.GetIndexLen(); i++) { diff --git a/Source/Core/VideoBackends/Software/Tev.cpp b/Source/Core/VideoBackends/Software/Tev.cpp index f1fecdab40..b85fdc0c3b 100644 --- a/Source/Core/VideoBackends/Software/Tev.cpp +++ b/Source/Core/VideoBackends/Software/Tev.cpp @@ -740,7 +740,13 @@ void Tev::Draw() EfbInterface::BlendTev(Position[0], Position[1], output); } -void Tev::SetRegColor(int reg, int comp, s16 color) +void Tev::SetKonstColors() { - KonstantColors[reg][comp] = color; + for (int i = 0; i < 4; i++) + { + KonstantColors[i].r = PixelShaderManager::constants.kcolors[i][0]; + KonstantColors[i].g = PixelShaderManager::constants.kcolors[i][1]; + KonstantColors[i].b = PixelShaderManager::constants.kcolors[i][2]; + KonstantColors[i].a = PixelShaderManager::constants.kcolors[i][3]; + } } diff --git a/Source/Core/VideoBackends/Software/Tev.h b/Source/Core/VideoBackends/Software/Tev.h index 422bbb9fff..efbeed0c69 100644 --- a/Source/Core/VideoBackends/Software/Tev.h +++ b/Source/Core/VideoBackends/Software/Tev.h @@ -226,7 +226,6 @@ public: RED_C }; + void SetKonstColors(); void Draw(); - - void SetRegColor(int reg, int comp, s16 color); };