Signed-off-by: Nick Renieris velocityra@gmail.com --- dlls/d3d10/d3d10_private.h | 11 +++++++ dlls/d3d10/effect.c | 71 ++++++++++++++++++++++++++++++++++++++-------- 2 files changed, 70 insertions(+), 12 deletions(-)
diff --git a/dlls/d3d10/d3d10_private.h b/dlls/d3d10/d3d10_private.h index e785b8b..4f51bf7 100644 --- a/dlls/d3d10/d3d10_private.h +++ b/dlls/d3d10/d3d10_private.h @@ -100,6 +100,16 @@ struct d3d10_effect_shader_variable } shader; };
+struct d3d10_effect_scalar_variable +{ + union + { + int i; + float f; + BOOL b; + }; +}; + struct d3d10_effect_state_object_variable { union @@ -173,6 +183,7 @@ struct d3d10_effect_variable { struct d3d10_effect_state_object_variable state; struct d3d10_effect_shader_variable shader; + struct d3d10_effect_scalar_variable scalar; } u; };
diff --git a/dlls/d3d10/effect.c b/dlls/d3d10/effect.c index cd6f4a3..f576983 100644 --- a/dlls/d3d10/effect.c +++ b/dlls/d3d10/effect.c @@ -4125,17 +4125,33 @@ static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetRawValue(ID3D10 static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_SetFloat(ID3D10EffectScalarVariable *iface, float value) { - FIXME("iface %p, value %.8e stub!\n", iface, value); + struct d3d10_effect_variable *This;
- return E_NOTIMPL; + TRACE("iface %p, value %.8e\n", iface, value); + + if (!iface) + return D3DERR_INVALIDCALL; + + This = impl_from_ID3D10EffectVariable((ID3D10EffectVariable *)iface); + This->u.scalar.i = value; + + return S_OK; }
static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetFloat(ID3D10EffectScalarVariable *iface, float *value) { - FIXME("iface %p, value %p stub!\n", iface, value); + struct d3d10_effect_variable *This;
- return E_NOTIMPL; + TRACE("iface %p, value %p\n", iface, value); + + if (!iface || !value) + return D3DERR_INVALIDCALL; + + This = impl_from_ID3D10EffectVariable((ID3D10EffectVariable *)iface); + *value = This->u.scalar.f; + + return S_OK; }
static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_SetFloatArray(ID3D10EffectScalarVariable *iface, @@ -4157,17 +4173,32 @@ static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetFloatArray(ID3D static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_SetInt(ID3D10EffectScalarVariable *iface, int value) { - FIXME("iface %p, value %d stub!\n", iface, value); + struct d3d10_effect_variable *This;
- return E_NOTIMPL; + TRACE("iface %p, value %d\n", iface, value); + + if (!iface) + return D3DERR_INVALIDCALL; + + This = impl_from_ID3D10EffectVariable((ID3D10EffectVariable *)iface); + This->u.scalar.i = value; + + return S_OK; }
static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetInt(ID3D10EffectScalarVariable *iface, int *value) { - FIXME("iface %p, value %p stub!\n", iface, value); + struct d3d10_effect_variable *This;
- return E_NOTIMPL; + TRACE("iface %p, value %p\n", iface, value); + if (!iface || !value) + return D3DERR_INVALIDCALL; + + This = impl_from_ID3D10EffectVariable((ID3D10EffectVariable *)iface); + *value = This->u.scalar.i; + + return S_OK; }
static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_SetIntArray(ID3D10EffectScalarVariable *iface, @@ -4189,17 +4220,33 @@ static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetIntArray(ID3D10 static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_SetBool(ID3D10EffectScalarVariable *iface, BOOL value) { - FIXME("iface %p, value %d stub!\n", iface, value); + struct d3d10_effect_variable *This;
- return E_NOTIMPL; + TRACE("iface %p, value %d\n", iface, value); + + if (!iface) + return D3DERR_INVALIDCALL; + + This = impl_from_ID3D10EffectVariable((ID3D10EffectVariable *)iface); + This->u.scalar.b = value; + + return S_OK; }
static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetBool(ID3D10EffectScalarVariable *iface, BOOL *value) { - FIXME("iface %p, value %p stub!\n", iface, value); + struct d3d10_effect_variable *This;
- return E_NOTIMPL; + TRACE("iface %p, value %p\n", iface, value); + + if (!iface || !value) + return D3DERR_INVALIDCALL; + + This = impl_from_ID3D10EffectVariable((ID3D10EffectVariable *)iface); + *value = This->u.scalar.b; + + return S_OK; }
static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_SetBoolArray(ID3D10EffectScalarVariable *iface,