Small fix for the last commit, and a little fix for disable fog to really disable it :)

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4662 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Rodolfo Osvaldo Bogado
2009-12-09 13:51:28 +00:00
parent a1d612e946
commit 0bc7fa7bf5
6 changed files with 38 additions and 42 deletions

View File

@ -22,6 +22,7 @@
#include "Statistics.h"
#include "PixelShaderManager.h"
#include "VideoCommon.h"
#include "VideoConfig.h"
static int s_nColorsChanged[2]; // 0 - regular colors, 1 - k colors
static int s_nIndTexMtxChanged;
@ -203,9 +204,16 @@ void PixelShaderManager::SetConstants()
if (s_bFogParamChanged)
{
float a = bpmem.fog.a.GetA() * ((float)(1 << bpmem.fog.b_shift));
float b = ((float)bpmem.fog.b_magnitude / 8388638) * ((float)(1 << (bpmem.fog.b_shift - 1)));
SetPSConstant4f(C_FOG + 1, a, b, bpmem.fog.c_proj_fsel.GetC(), 0);
if(!g_ActiveConfig.bDisableFog)
{
float a = bpmem.fog.a.GetA() * ((float)(1 << bpmem.fog.b_shift));
float b = ((float)bpmem.fog.b_magnitude / 8388638) * ((float)(1 << (bpmem.fog.b_shift - 1)));
SetPSConstant4f(C_FOG + 1, a, b, bpmem.fog.c_proj_fsel.GetC(), 0);
}
else
{
SetPSConstant4f(C_FOG + 1, 0.0, 1.0, 1.0, 0);
}
s_bFogParamChanged = false;
}