Commit 05eef50e authored by Rico Schüller's avatar Rico Schüller Committed by Alexandre Julliard

d3dx9: Handle ST_FXLC in d3dx9_parse_resource().

parent db36599a
......@@ -88,6 +88,7 @@ enum SHADER_CONSTANT_TYPE
enum STATE_TYPE
{
ST_CONSTANT,
ST_FXLC,
};
struct d3dx_parameter
......@@ -4021,6 +4022,28 @@ static HRESULT d3dx9_parse_name(char **name, const char *ptr)
return D3D_OK;
}
static HRESULT d3dx9_copy_data(char **str, const char **ptr)
{
DWORD size;
read_dword(ptr, &size);
TRACE("Data size: %#x\n", size);
*str = HeapAlloc(GetProcessHeap(), 0, size);
if (!*str)
{
ERR("Failed to allocate name memory.\n");
return E_OUTOFMEMORY;
}
TRACE("Data: %s.\n", debugstr_an(*ptr, size));
memcpy(*str, *ptr, size);
*ptr += ((size + 3) & ~3);
return D3D_OK;
}
static HRESULT d3dx9_parse_data(struct d3dx_parameter *param, const char **ptr, LPDIRECT3DDEVICE9 device)
{
DWORD size;
......@@ -4795,6 +4818,14 @@ static HRESULT d3dx9_parse_resource(struct ID3DXBaseEffectImpl *base, const char
hr = d3dx9_parse_data(param, ptr, base->effect->device);
break;
case D3DXPT_BOOL:
case D3DXPT_INT:
case D3DXPT_FLOAT:
case D3DXPT_STRING:
state->type = ST_FXLC;
hr = d3dx9_copy_data(param->data, ptr);
break;
default:
FIXME("Unhandled type %s\n", debug_d3dxparameter_type(param->type));
hr=E_FAIL;
......
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