Commit a8497a55 authored by Stefan Dösinger's avatar Stefan Dösinger Committed by Alexandre Julliard

wined3d: Fix the num blend values -> type match.

parent 123a3f44
......@@ -106,8 +106,16 @@ HRESULT vdecl_convert_fvf(
if (has_blend && (num_blends > 0)) {
if (((fvf & D3DFVF_XYZB5) == D3DFVF_XYZB2) && (fvf & D3DFVF_LASTBETA_D3DCOLOR))
elements[idx].Type = D3DDECLTYPE_D3DCOLOR;
else
elements[idx].Type = D3DDECLTYPE_FLOAT1 + num_blends - 1;
else {
switch(num_blends) {
case 1: elements[idx].Type = D3DDECLTYPE_FLOAT1; break;
case 2: elements[idx].Type = D3DDECLTYPE_FLOAT2; break;
case 3: elements[idx].Type = D3DDECLTYPE_FLOAT3; break;
case 4: elements[idx].Type = D3DDECLTYPE_FLOAT4; break;
default:
ERR("Unexpected amount of blend values: %u\n", num_blends);
}
}
elements[idx].Usage = D3DDECLUSAGE_BLENDWEIGHT;
elements[idx].UsageIndex = 0;
idx++;
......
......@@ -1792,8 +1792,16 @@ static unsigned int ConvertFvfToDeclaration(IWineD3DDeviceImpl *This, /* For the
if (has_blend && (num_blends > 0)) {
if (((fvf & WINED3DFVF_XYZB5) == WINED3DFVF_XYZB2) && (fvf & WINED3DFVF_LASTBETA_D3DCOLOR))
elements[idx].Type = WINED3DDECLTYPE_D3DCOLOR;
else
elements[idx].Type = WINED3DDECLTYPE_FLOAT1 + num_blends - 1;
else {
switch(num_blends) {
case 1: elements[idx].Type = WINED3DDECLTYPE_FLOAT1; break;
case 2: elements[idx].Type = WINED3DDECLTYPE_FLOAT2; break;
case 3: elements[idx].Type = WINED3DDECLTYPE_FLOAT3; break;
case 4: elements[idx].Type = WINED3DDECLTYPE_FLOAT4; break;
default:
ERR("Unexpected amount of blend values: %u\n", num_blends);
}
}
elements[idx].Usage = WINED3DDECLUSAGE_BLENDWEIGHT;
elements[idx].UsageIndex = 0;
idx++;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment