summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/Src/PixelShaderManager.cpp
diff options
context:
space:
mode:
authorMatthew Parlane <parlane@gmail.com>2013-01-01 23:28:46 +1300
committerMatthew Parlane <parlane@gmail.com>2013-01-01 23:28:46 +1300
commite0c9a1fd09b9be953bf0ae41b9014485e750b07e (patch)
tree059744e17a2a35ca58dd9b817cab620faee38611 /Source/Core/VideoCommon/Src/PixelShaderManager.cpp
parentfe1fdc5e7b957312c906324134e42ca3484fa2d5 (diff)
parentc728ef2cd30ef803210d5db0a1ecab6b198a2c65 (diff)
Merge branch 'master' into wii-network
Conflicts: Source/Core/Common/Src/CommonPaths.h Source/Core/Core/CMakeLists.txt Source/Core/Core/Src/Boot/Boot_BS2Emu.cpp Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_es.cpp Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_net.cpp
Diffstat (limited to 'Source/Core/VideoCommon/Src/PixelShaderManager.cpp')
-rw-r--r--Source/Core/VideoCommon/Src/PixelShaderManager.cpp30
1 files changed, 29 insertions, 1 deletions
diff --git a/Source/Core/VideoCommon/Src/PixelShaderManager.cpp b/Source/Core/VideoCommon/Src/PixelShaderManager.cpp
index 2521f80500..258ec04413 100644
--- a/Source/Core/VideoCommon/Src/PixelShaderManager.cpp
+++ b/Source/Core/VideoCommon/Src/PixelShaderManager.cpp
@@ -302,7 +302,7 @@ void PixelShaderManager::SetConstants()
float GC_ALIGNED16(material[4]);
float NormalizationCoef = 1 / 255.0f;
- for (int i = 0; i < 4; ++i)
+ for (int i = 0; i < 2; ++i)
{
if (nMaterialsChanged & (1 << i))
{
@@ -316,6 +316,21 @@ void PixelShaderManager::SetConstants()
SetPSConstant4fv(C_PMATERIALS + i, material);
}
}
+
+ for (int i = 0; i < 2; ++i)
+ {
+ if (nMaterialsChanged & (1 << (i + 2)))
+ {
+ u32 data = *(xfregs.matColor + i);
+
+ material[0] = ((data >> 24) & 0xFF) * NormalizationCoef;
+ material[1] = ((data >> 16) & 0xFF) * NormalizationCoef;
+ material[2] = ((data >> 8) & 0xFF) * NormalizationCoef;
+ material[3] = ( data & 0xFF) * NormalizationCoef;
+
+ SetPSConstant4fv(C_PMATERIALS + i + 2, material);
+ }
+ }
nMaterialsChanged = 0;
}
@@ -465,3 +480,16 @@ void PixelShaderManager::SetMaterialColorChanged(int index)
{
nMaterialsChanged |= (1 << index);
}
+
+void PixelShaderManager::DoState(PointerWrap &p)
+{
+ p.Do(lastRGBAfull);
+ p.Do(lastAlpha);
+ p.Do(lastTexDims);
+ p.Do(lastZBias);
+
+ if (p.GetMode() == PointerWrap::MODE_READ)
+ {
+ Dirty();
+ }
+}