(Tiny) Collapsing

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2372 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
XTra.KrazzY 2009-02-22 18:13:50 +00:00
parent 3dfac4fcc8
commit 0a3f193cbc
1 changed files with 8 additions and 32 deletions

View File

@ -442,36 +442,12 @@ void VertexShaderManager::SetProjection(float* _pProjection, int constantIndex)
void VertexShaderManager::SetMaterialColor(int index, u32 data) void VertexShaderManager::SetMaterialColor(int index, u32 data)
{ {
// TODO: collapse int ind = index * 4;
switch (index)
{ nMaterialsChanged |= (1 << index);
case 0:
nMaterialsChanged |= 1; s_fMaterials[ind++] = ((data>>24)&0xFF)/255.0f;
s_fMaterials[0] = ((data>>24)&0xFF)/255.0f; s_fMaterials[ind++] = ((data>>16)&0xFF)/255.0f;
s_fMaterials[1] = ((data>>16)&0xFF)/255.0f; s_fMaterials[ind++] = ((data>>8)&0xFF)/255.0f;
s_fMaterials[2] = ((data>>8)&0xFF)/255.0f; s_fMaterials[ind] = ((data)&0xFF)/255.0f;
s_fMaterials[3] = ((data)&0xFF)/255.0f;
break;
case 1:
nMaterialsChanged |= 2;
s_fMaterials[4] = ((data>>24)&0xFF)/255.0f;
s_fMaterials[5] = ((data>>16)&0xFF)/255.0f;
s_fMaterials[6] = ((data>>8)&0xFF)/255.0f;
s_fMaterials[7] = ((data)&0xFF)/255.0f;
break;
case 2:
nMaterialsChanged |= 4;
s_fMaterials[8] = ((data>>24)&0xFF)/255.0f;
s_fMaterials[9] = ((data>>16)&0xFF)/255.0f;
s_fMaterials[10] = ((data>>8)&0xFF)/255.0f;
s_fMaterials[11] = ((data)&0xFF)/255.0f;
break;
case 3:
nMaterialsChanged |= 8;
s_fMaterials[12] = ((data>>24)&0xFF)/255.0f;
s_fMaterials[13] = ((data>>16)&0xFF)/255.0f;
s_fMaterials[14] = ((data>>8)&0xFF)/255.0f;
s_fMaterials[15] = ((data)&0xFF)/255.0f;
break;
}
} }