d3dx9: Improve ID3DXConstantTable::GetConstantDesc().
This commit is contained in:
parent
ea4f402164
commit
fa7422bc4e
|
@ -923,27 +923,18 @@ static HRESULT WINAPI ID3DXConstantTableImpl_GetConstantDesc(ID3DXConstantTable
|
||||||
D3DXCONSTANT_DESC *desc, UINT *count)
|
D3DXCONSTANT_DESC *desc, UINT *count)
|
||||||
{
|
{
|
||||||
struct ID3DXConstantTableImpl *This = impl_from_ID3DXConstantTable(iface);
|
struct ID3DXConstantTableImpl *This = impl_from_ID3DXConstantTable(iface);
|
||||||
struct ctab_constant *constant_info;
|
struct ctab_constant *c = get_valid_constant(This, constant);
|
||||||
|
|
||||||
TRACE("(%p)->(%p, %p, %p)\n", This, constant, desc, count);
|
TRACE("(%p)->(%p, %p, %p)\n", This, constant, desc, count);
|
||||||
|
|
||||||
if (!constant)
|
if (!c)
|
||||||
return D3DERR_INVALIDCALL;
|
|
||||||
|
|
||||||
/* Applications can pass the name of the constant in place of the handle */
|
|
||||||
if (!is_valid_constant(This, constant))
|
|
||||||
{
|
{
|
||||||
constant = ID3DXConstantTable_GetConstantByName(iface, NULL, constant);
|
WARN("Invalid argument specified\n");
|
||||||
if (!constant)
|
|
||||||
return D3DERR_INVALIDCALL;
|
return D3DERR_INVALIDCALL;
|
||||||
}
|
}
|
||||||
|
|
||||||
constant_info = constant_from_handle(constant);
|
if (desc) *desc = c->desc;
|
||||||
|
if (count) *count = 1;
|
||||||
if (desc)
|
|
||||||
*desc = constant_info->desc;
|
|
||||||
if (count)
|
|
||||||
*count = 1;
|
|
||||||
|
|
||||||
return D3D_OK;
|
return D3D_OK;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue