Making CColor use floats instead of u8s

This commit is contained in:
parax0
2015-12-16 03:28:40 -07:00
parent f11a8b938b
commit 6b8966f0b9
24 changed files with 267 additions and 269 deletions

View File

@@ -182,27 +182,28 @@ void CSceneNode::BuildLightList(CGameArea *pArea)
void CSceneNode::LoadLights(const SViewInfo& ViewInfo)
{
CGraphics::sNumLights = 0;
CGraphics::ELightingMode Mode = (ViewInfo.GameMode ? CGraphics::eWorldLighting : CGraphics::sLightMode);
if (CGraphics::sLightMode == CGraphics::eWorldLighting || ViewInfo.GameMode)
switch (Mode)
{
case CGraphics::eNoLighting:
// No lighting: default ambient color, no dynamic lights
CGraphics::sVertexBlock.COLOR0_Amb = CGraphics::skDefaultAmbientColor;
break;
case CGraphics::eBasicLighting:
// Basic lighting: default ambient color, default dynamic lights
CGraphics::SetDefaultLighting();
CGraphics::sVertexBlock.COLOR0_Amb = CGraphics::skDefaultAmbientColor;
break;
case CGraphics::eWorldLighting:
// World lighting: world ambient color, node dynamic lights
CGraphics::sVertexBlock.COLOR0_Amb = mAmbientColor.ToVector4f();
CGraphics::sVertexBlock.COLOR0_Amb = mAmbientColor;
for (u32 iLight = 0; iLight < mLightCount; iLight++)
mLights[iLight]->Load();
}
else if (CGraphics::sLightMode == CGraphics::eBasicLighting)
{
// Basic lighting: default ambient color, default dynamic lights
CGraphics::SetDefaultLighting();
CGraphics::sVertexBlock.COLOR0_Amb = CGraphics::skDefaultAmbientColor.ToVector4f();
}
else if (CGraphics::sLightMode == CGraphics::eNoLighting)
{
// No lighting: default ambient color, no dynamic lights
CGraphics::sVertexBlock.COLOR0_Amb = CGraphics::skDefaultAmbientColor.ToVector4f();
break;
}
CGraphics::UpdateLightBlock();