diff --git a/GPU/Directx9/TransformPipelineDX9.cpp b/GPU/Directx9/TransformPipelineDX9.cpp index fee72ff0e8..8b93501c9c 100644 --- a/GPU/Directx9/TransformPipelineDX9.cpp +++ b/GPU/Directx9/TransformPipelineDX9.cpp @@ -299,12 +299,12 @@ static void SetupDecFmtForDraw(LinkedShaderDX9 *program, const DecVtxFormat &dec // COLOR if (decFmt.c0fmt != 0) { - VertexAttribSetup(VertexElement, decFmt.c0fmt, decFmt.c0off, D3DDECLUSAGE_COLOR, 0); + VertexAttribSetup(VertexElement, decFmt.c0fmt, decFmt.c0off, D3DDECLTYPE_UBYTE4N, 0); VertexElement++; } // Never used ? if (decFmt.c1fmt != 0) { - VertexAttribSetup(VertexElement, decFmt.c1fmt, decFmt.c1off, D3DDECLUSAGE_COLOR, 1); + VertexAttribSetup(VertexElement, decFmt.c1fmt, decFmt.c1off, D3DDECLTYPE_UBYTE4N, 1); VertexElement++; } @@ -477,10 +477,10 @@ void TransformDrawEngineDX9::SoftwareTransformAndDraw( c1[j] = 0.0f; } } else { - c0[0] = gstate.getMaterialAmbientA() / 255.f; - c0[1] = gstate.getMaterialAmbientR() / 255.f; - c0[2] = gstate.getMaterialAmbientG() / 255.f; - c0[3] = gstate.getMaterialAmbientB() / 255.f; + c0[0] = gstate.getMaterialAmbientR() / 255.f; + c0[1] = gstate.getMaterialAmbientG() / 255.f; + c0[2] = gstate.getMaterialAmbientB() / 255.f; + c0[3] = gstate.getMaterialAmbientA() / 255.f; } if (reader.hasUV()) { @@ -538,10 +538,10 @@ void TransformDrawEngineDX9::SoftwareTransformAndDraw( if (reader.hasColor0()) { reader.ReadColor0(unlitColor); } else { - unlitColor[0] = gstate.getMaterialAmbientA() / 255.f; - unlitColor[1] = gstate.getMaterialAmbientR() / 255.f; - unlitColor[2] = gstate.getMaterialAmbientG() / 255.f; - unlitColor[3] = gstate.getMaterialAmbientB() / 255.f; + unlitColor[0] = gstate.getMaterialAmbientR() / 255.f; + unlitColor[1] = gstate.getMaterialAmbientG() / 255.f; + unlitColor[2] = gstate.getMaterialAmbientB() / 255.f; + unlitColor[3] = gstate.getMaterialAmbientA() / 255.f; } float litColor0[4]; float litColor1[4]; @@ -569,10 +569,10 @@ void TransformDrawEngineDX9::SoftwareTransformAndDraw( c0[j] = unlitColor[j]; } } else { - c0[0] = gstate.getMaterialAmbientA() / 255.f; - c0[1] = gstate.getMaterialAmbientR() / 255.f; - c0[2] = gstate.getMaterialAmbientG() / 255.f; - c0[3] = gstate.getMaterialAmbientB() / 255.f; + c0[0] = gstate.getMaterialAmbientR() / 255.f; + c0[1] = gstate.getMaterialAmbientG() / 255.f; + c0[2] = gstate.getMaterialAmbientB() / 255.f; + c0[3] = gstate.getMaterialAmbientA() / 255.f; } if (lmode) { for (int j = 0; j < 4; j++) { diff --git a/GPU/Directx9/helper/global.cpp b/GPU/Directx9/helper/global.cpp index 45f046d27e..09589635aa 100644 --- a/GPU/Directx9/helper/global.cpp +++ b/GPU/Directx9/helper/global.cpp @@ -57,8 +57,8 @@ static const D3DVERTEXELEMENT9 SoftTransVertexElements[] = { { 0, 0, D3DDECLTYPE_FLOAT4, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITION, 0 }, { 0, 16, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_TEXCOORD, 0 }, - { 0, 28, D3DDECLTYPE_D3DCOLOR, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_COLOR, 0 }, - { 0, 32, D3DDECLTYPE_D3DCOLOR, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_COLOR, 1 }, + { 0, 28, D3DDECLTYPE_UBYTE4N, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_COLOR, 0 }, + { 0, 32, D3DDECLTYPE_UBYTE4N, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_COLOR, 1 }, D3DDECL_END() };