diff options
| author | nakeee <nakeee@gmail.com> | 2009-04-10 10:25:53 +0000 |
|---|---|---|
| committer | nakeee <nakeee@gmail.com> | 2009-04-10 10:25:53 +0000 |
| commit | e84ec7855ad003a66d8654dccfd99a817536789d (patch) | |
| tree | c74047db74817c59dc7792be2312a812b990597c /Source/Core | |
| parent | 65fa1cb7291b93e80c99a4b63a45682bbba77f53 (diff) | |
smg projection hack, taken from http://forums.dolphin-emu.com/thread-165-page-3.html
maybe we should just make configurable linear trasnformation hack;)
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2949 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core')
| -rw-r--r-- | Source/Core/VideoCommon/Src/VertexShaderManager.cpp | 11 | ||||
| -rw-r--r-- | Source/Core/VideoCommon/Src/VertexShaderManager.h | 2 |
2 files changed, 10 insertions, 3 deletions
diff --git a/Source/Core/VideoCommon/Src/VertexShaderManager.cpp b/Source/Core/VideoCommon/Src/VertexShaderManager.cpp index 3d1ee6ba6e..2c8ededb4c 100644 --- a/Source/Core/VideoCommon/Src/VertexShaderManager.cpp +++ b/Source/Core/VideoCommon/Src/VertexShaderManager.cpp @@ -69,7 +69,7 @@ void VertexShaderManager::Shutdown() // ======================================================================================= // Syncs the shader constant buffers with xfmem // ---------------- -void VertexShaderManager::SetConstants(bool proj_hax_1) +void VertexShaderManager::SetConstants(bool proj_hax_1,bool SMG_hack) { //nTransformMatricesChanged[0] = 0; nTransformMatricesChanged[1] = 256; //nNormalMatricesChanged[0] = 0; nNormalMatricesChanged[1] = 96; @@ -213,6 +213,7 @@ void VertexShaderManager::SetConstants(bool proj_hax_1) g_fProjectionMatrix[8] = 0.0f; g_fProjectionMatrix[9] = 0.0f; g_fProjectionMatrix[10] = xfregs.rawProjection[4]; + g_fProjectionMatrix[11] = xfregs.rawProjection[5]; g_fProjectionMatrix[12] = 0.0f; @@ -253,7 +254,13 @@ void VertexShaderManager::SetConstants(bool proj_hax_1) g_fProjectionMatrix[8] = 0.0f; g_fProjectionMatrix[9] = 0.0f; g_fProjectionMatrix[10] = xfregs.rawProjection[4]; - g_fProjectionMatrix[11] = xfregs.rawProjection[5] + (proj_hax_1 ? 0.1f : 0.0f); + + if (SMG_hack) { + g_fProjectionMatrix[11] = -(0.512505 + xfregs.rawProjection[5]) + (proj_hax_1 ? 0.1f : 0.0f); + } + else { + g_fProjectionMatrix[11] = xfregs.rawProjection[5] + (proj_hax_1 ? 0.1f : 0.0f); + } g_fProjectionMatrix[12] = 0.0f; g_fProjectionMatrix[13] = 0.0f; diff --git a/Source/Core/VideoCommon/Src/VertexShaderManager.h b/Source/Core/VideoCommon/Src/VertexShaderManager.h index a0b1c31994..dc7ecd2706 100644 --- a/Source/Core/VideoCommon/Src/VertexShaderManager.h +++ b/Source/Core/VideoCommon/Src/VertexShaderManager.h @@ -28,7 +28,7 @@ public: static void Shutdown(); // constant management - static void SetConstants(bool proj_hax_1); + static void SetConstants(bool proj_hax_1, bool SMG_hack); static void SetViewport(float* _Viewport); static void SetViewportChanged(); |
