From fe2d09576d0e90eb1dac52bf54c0b8fef0697bcc Mon Sep 17 00:00:00 2001 From: NeoBrainX Date: Sat, 30 Apr 2011 17:34:08 +0000 Subject: [PATCH] Fix "Disable Lighting" in D3D9 and D3D11. Fixes issue 3185. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7498 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Core/VideoCommon/Src/VertexManagerBase.cpp | 11 +++++++++++ .../Plugin_VideoOGL/Src/NativeVertexFormat.cpp | 11 ----------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Source/Core/VideoCommon/Src/VertexManagerBase.cpp b/Source/Core/VideoCommon/Src/VertexManagerBase.cpp index a9b50bc6e2..004b0f3cca 100644 --- a/Source/Core/VideoCommon/Src/VertexManagerBase.cpp +++ b/Source/Core/VideoCommon/Src/VertexManagerBase.cpp @@ -11,6 +11,7 @@ #include "RenderBase.h" #include "VertexManagerBase.h" +#include "VideoConfig.h" VertexManager *g_vertex_manager; @@ -158,6 +159,16 @@ void VertexManager::AddVertices(int primitive, int numVertices) void VertexManager::Flush() { + // Disable Lighting + // TODO - Is this a good spot for this code? + if (g_ActiveConfig.bDisableLighting) + { + for (u32 i = 0; i < xfregs.numChan.numColorChans; i++) + { + xfregs.alpha[i].enablelighting = false; + xfregs.color[i].enablelighting = false; + } + } g_vertex_manager->vFlush(); } diff --git a/Source/Plugins/Plugin_VideoOGL/Src/NativeVertexFormat.cpp b/Source/Plugins/Plugin_VideoOGL/Src/NativeVertexFormat.cpp index 3ee3836ae5..9fa3281b19 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/NativeVertexFormat.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/NativeVertexFormat.cpp @@ -289,17 +289,6 @@ void GLVertexFormat::EnableComponents(u32 components) } } - // Disable Lighting - // TODO - Is this a good spot for this code? - if (g_ActiveConfig.bDisableLighting) - { - for (u32 i = 0; i < xfregs.numChan.numColorChans; i++) - { - xfregs.alpha[i].enablelighting = false; - xfregs.color[i].enablelighting = false; - } - } - s_prevcomponents = components; } }