Commit 90f5be2b authored by Ivan Gyurdiev's avatar Ivan Gyurdiev Committed by Alexandre Julliard

wined3d: Merge MATERIAL types into one type in WINED3D namespace.

parent 70bbf734
......@@ -710,14 +710,16 @@ static HRESULT WINAPI IDirect3DDevice8Impl_GetViewport(LPDIRECT3DDEVICE8 iface,
static HRESULT WINAPI IDirect3DDevice8Impl_SetMaterial(LPDIRECT3DDEVICE8 iface, CONST D3DMATERIAL8* pMaterial) {
IDirect3DDevice8Impl *This = (IDirect3DDevice8Impl *)iface;
TRACE("(%p) Relay\n" , This);
/* FIXME: Verify that D3DMATERIAL8 ~= WINED3DMATERIAL */
/* Note: D3DMATERIAL8 is compatible with WINED3DMATERIAL */
return IWineD3DDevice_SetMaterial(This->WineD3DDevice, (const WINED3DMATERIAL *)pMaterial);
}
static HRESULT WINAPI IDirect3DDevice8Impl_GetMaterial(LPDIRECT3DDEVICE8 iface, D3DMATERIAL8* pMaterial) {
IDirect3DDevice8Impl *This = (IDirect3DDevice8Impl *)iface;
TRACE("(%p) Relay\n" , This);
/* FIXME: Verify that D3DMATERIAL8 ~= WINED3DMATERIAL */
/* Note: D3DMATERIAL8 is compatible with WINED3DMATERIAL */
return IWineD3DDevice_GetMaterial(This->WineD3DDevice, (WINED3DMATERIAL *)pMaterial);
}
......
......@@ -492,12 +492,16 @@ static HRESULT WINAPI IDirect3DDevice9Impl_GetViewport(LPDIRECT3DDEVICE9 iface
static HRESULT WINAPI IDirect3DDevice9Impl_SetMaterial(LPDIRECT3DDEVICE9 iface, CONST D3DMATERIAL9* pMaterial) {
IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
TRACE("(%p) Relay\n" , This);
/* Note: D3DMATERIAL9 is compatible with WINED3DMATERIAL */
return IWineD3DDevice_SetMaterial(This->WineD3DDevice, (const WINED3DMATERIAL *)pMaterial);
}
static HRESULT WINAPI IDirect3DDevice9Impl_GetMaterial(LPDIRECT3DDEVICE9 iface, D3DMATERIAL9* pMaterial) {
IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
TRACE("(%p) Relay\n" , This);
/* Note: D3DMATERIAL9 is compatible with WINED3DMATERIAL */
return IWineD3DDevice_GetMaterial(This->WineD3DDevice, (WINED3DMATERIAL *)pMaterial);
}
......
......@@ -4095,8 +4095,10 @@ IDirect3DDeviceImpl_7_SetMaterial(IDirect3DDevice7 *iface,
HRESULT hr;
TRACE("(%p)->(%p): Relay!\n", This, Mat);
/* Note: D3DMATERIAL7 is compatible with WINED3DMATERIAL */
hr = IWineD3DDevice_SetMaterial(This->wineD3DDevice,
Mat);
(WINED3DMATERIAL*) Mat);
return hr_ddraw_from_wined3d(hr);
}
......@@ -4124,8 +4126,10 @@ IDirect3DDeviceImpl_7_GetMaterial(IDirect3DDevice7 *iface,
HRESULT hr;
TRACE("(%p)->(%p): Relay!\n", This, Mat);
/* Note: D3DMATERIAL7 is compatible with WINED3DMATERIAL */
hr = IWineD3DDevice_GetMaterial(This->wineD3DDevice,
Mat);
(WINED3DMATERIAL*) Mat);
return hr_ddraw_from_wined3d(hr);
}
......
......@@ -3139,7 +3139,6 @@ static HRESULT WINAPI IWineD3DDeviceImpl_GetClipStatus(IWineD3DDevice *iface,
/*****
* Get / Set Material
* WARNING: This code relies on the fact that D3DMATERIAL8 == D3DMATERIAL9
*****/
static HRESULT WINAPI IWineD3DDeviceImpl_SetMaterial(IWineD3DDevice *iface, CONST WINED3DMATERIAL* pMaterial) {
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
......
......@@ -520,9 +520,9 @@ static HRESULT WINAPI IWineD3DStateBlockImpl_Capture(IWineD3DStateBlock *iface)
if (This->set.material && memcmp(&targetStateBlock->material,
&This->material,
sizeof(D3DMATERIAL9)) != 0) {
sizeof(WINED3DMATERIAL)) != 0) {
TRACE("Updating material\n");
memcpy(&This->material, &targetStateBlock->material, sizeof(D3DMATERIAL9));
memcpy(&This->material, &targetStateBlock->material, sizeof(WINED3DMATERIAL));
}
if (This->set.viewport && memcmp(&targetStateBlock->viewport,
......
......@@ -191,19 +191,16 @@ DEFINE_GUID(IID_IWineD3DQuery,
/* TODO: remove the d3d8/d3d9 dependencies by making a all inclusive WINED3D version */
#if defined( __WINE_D3D9_H )
/* Identical: */
# define WINED3DMATERIAL D3DMATERIAL9
# define WINED3DVIEWPORT D3DVIEWPORT9
# define WINED3DGAMMARAMP D3DGAMMARAMP
#elif defined( __WINE_D3D8_H )
/* Identical: */
# define WINED3DMATERIAL D3DMATERIAL8
# define WINED3DVIEWPORT D3DVIEWPORT8
# define WINED3DGAMMARAMP D3DGAMMARAMP
#else /* defined (__WINE_D3D_H ) */
/* Identical: */
# define WINED3DMATERIAL D3DMATERIAL7
# define WINED3DVIEWPORT D3DVIEWPORT7
# define WINED3DGAMMARAMP DDGAMMARAMP
......
......@@ -68,6 +68,14 @@ typedef struct _WINED3DLIGHT {
float Phi;
} WINED3DLIGHT;
typedef struct _WINED3DMATERIAL {
WINED3DCOLORVALUE Diffuse;
WINED3DCOLORVALUE Ambient;
WINED3DCOLORVALUE Specular;
WINED3DCOLORVALUE Emissive;
float Power;
} WINED3DMATERIAL;
#define WINED3D_VSHADER_MAX_CONSTANTS 96
#define WINED3D_PSHADER_MAX_CONSTANTS 32
......
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