From fcd7fa997b15aa116e3af7c7572e8c247064a7fc Mon Sep 17 00:00:00 2001 From: donkopunchstania Date: Sat, 13 Jun 2009 17:44:14 +0000 Subject: [PATCH] Possible fix for projection hacks git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@3427 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Core/VideoCommon/Src/VertexLoader_Position.cpp | 10 +++++----- Source/Core/VideoCommon/Src/VertexShaderManager.cpp | 6 ++++-- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/Source/Core/VideoCommon/Src/VertexLoader_Position.cpp b/Source/Core/VideoCommon/Src/VertexLoader_Position.cpp index 278b32f92f..07601ada61 100644 --- a/Source/Core/VideoCommon/Src/VertexLoader_Position.cpp +++ b/Source/Core/VideoCommon/Src/VertexLoader_Position.cpp @@ -85,7 +85,7 @@ void Pos_ReadDirect() if (three) ((float*)VertexManager::s_pCurBufferPointer)[2] = (float)(T)DataRead() * posScale; else - ((float*)VertexManager::s_pCurBufferPointer)[2] = 1.0f; + ((float*)VertexManager::s_pCurBufferPointer)[2] = 0.0f; LOG_VTX(); VertexManager::s_pCurBufferPointer += 12; } @@ -115,7 +115,7 @@ void LOADERDECL Pos_ReadDirect_Float2() // No need to use floating point here. ((u32 *)VertexManager::s_pCurBufferPointer)[0] = DataReadU32(); ((u32 *)VertexManager::s_pCurBufferPointer)[1] = DataReadU32(); - ((u32 *)VertexManager::s_pCurBufferPointer)[2] = 0x3f800000; // 1.0f + ((u32 *)VertexManager::s_pCurBufferPointer)[2] = 0; LOG_VTX(); VertexManager::s_pCurBufferPointer += 12; } @@ -130,7 +130,7 @@ inline void Pos_ReadIndex_Byte(int Index) if (three) ((float*)VertexManager::s_pCurBufferPointer)[2] = ((float)(T)(pData[2])) * posScale; else - ((float*)VertexManager::s_pCurBufferPointer)[2] = 1.0f; + ((float*)VertexManager::s_pCurBufferPointer)[2] = 0.0f; LOG_VTX(); VertexManager::s_pCurBufferPointer += 12; } @@ -144,7 +144,7 @@ inline void Pos_ReadIndex_Short(int Index) if (three) ((float*)VertexManager::s_pCurBufferPointer)[2] = ((float)(T)Common::swap16(pData[2])) * posScale; else - ((float*)VertexManager::s_pCurBufferPointer)[2] = 1.0f; + ((float*)VertexManager::s_pCurBufferPointer)[2] = 0.0f; LOG_VTX(); VertexManager::s_pCurBufferPointer += 12; } @@ -158,7 +158,7 @@ inline void Pos_ReadIndex_Float(int Index) if (three) ((u32*)VertexManager::s_pCurBufferPointer)[2] = Common::swap32(pData[2]); else - ((float*)VertexManager::s_pCurBufferPointer)[2] = 1.0f; + ((float*)VertexManager::s_pCurBufferPointer)[2] = 0.0f; LOG_VTX(); VertexManager::s_pCurBufferPointer += 12; } diff --git a/Source/Core/VideoCommon/Src/VertexShaderManager.cpp b/Source/Core/VideoCommon/Src/VertexShaderManager.cpp index 73927c7265..2ac81bddeb 100644 --- a/Source/Core/VideoCommon/Src/VertexShaderManager.cpp +++ b/Source/Core/VideoCommon/Src/VertexShaderManager.cpp @@ -261,8 +261,10 @@ void VertexShaderManager::SetConstants(bool proj_hax_1,bool Hack_hack1 ,float Ha g_fProjectionMatrix[8] = 0.0f; g_fProjectionMatrix[9] = 0.0f; - g_fProjectionMatrix[10] = (Hack_hack1 ? -(Hack_value1 + xfregs.rawProjection[4]) : xfregs.rawProjection[4]); - g_fProjectionMatrix[11] = (Hack_hack2 ? -(Hack_value2 + xfregs.rawProjection[5]) : xfregs.rawProjection[5]) + (proj_hax_1 ? 0.1f : 0.0f); + //g_fProjectionMatrix[10] = (Hack_hack1 ? -(Hack_value1 + xfregs.rawProjection[4]) : xfregs.rawProjection[4]); + //g_fProjectionMatrix[11] = (Hack_hack2 ? -(Hack_value2 + xfregs.rawProjection[5]) : xfregs.rawProjection[5]) + (proj_hax_1 ? 0.1f : 0.0f); + g_fProjectionMatrix[10] = xfregs.rawProjection[4]; + g_fProjectionMatrix[11] = xfregs.rawProjection[5]; g_fProjectionMatrix[12] = 0.0f; g_fProjectionMatrix[13] = 0.0f;