wined3d: Get rid of the WINED3DMATERIAL typedef.
This commit is contained in:
parent
f597359727
commit
02bb70fc3b
@ -1311,9 +1311,9 @@ static HRESULT WINAPI IDirect3DDevice8Impl_SetMaterial(IDirect3DDevice8 *iface,
|
|||||||
|
|
||||||
TRACE("iface %p, material %p.\n", iface, pMaterial);
|
TRACE("iface %p, material %p.\n", iface, pMaterial);
|
||||||
|
|
||||||
/* Note: D3DMATERIAL8 is compatible with WINED3DMATERIAL */
|
/* Note: D3DMATERIAL8 is compatible with struct wined3d_material. */
|
||||||
wined3d_mutex_lock();
|
wined3d_mutex_lock();
|
||||||
hr = wined3d_device_set_material(This->wined3d_device, (const WINED3DMATERIAL *)pMaterial);
|
hr = wined3d_device_set_material(This->wined3d_device, (const struct wined3d_material *)pMaterial);
|
||||||
wined3d_mutex_unlock();
|
wined3d_mutex_unlock();
|
||||||
|
|
||||||
return hr;
|
return hr;
|
||||||
@ -1327,9 +1327,9 @@ static HRESULT WINAPI IDirect3DDevice8Impl_GetMaterial(IDirect3DDevice8 *iface,
|
|||||||
|
|
||||||
TRACE("iface %p, material %p.\n", iface, pMaterial);
|
TRACE("iface %p, material %p.\n", iface, pMaterial);
|
||||||
|
|
||||||
/* Note: D3DMATERIAL8 is compatible with WINED3DMATERIAL */
|
/* Note: D3DMATERIAL8 is compatible with struct wined3d_material. */
|
||||||
wined3d_mutex_lock();
|
wined3d_mutex_lock();
|
||||||
hr = wined3d_device_get_material(This->wined3d_device, (WINED3DMATERIAL *)pMaterial);
|
hr = wined3d_device_get_material(This->wined3d_device, (struct wined3d_material *)pMaterial);
|
||||||
wined3d_mutex_unlock();
|
wined3d_mutex_unlock();
|
||||||
|
|
||||||
return hr;
|
return hr;
|
||||||
|
@ -1329,9 +1329,9 @@ static HRESULT WINAPI IDirect3DDevice9Impl_SetMaterial(IDirect3DDevice9Ex *iface
|
|||||||
|
|
||||||
TRACE("iface %p, material %p.\n", iface, pMaterial);
|
TRACE("iface %p, material %p.\n", iface, pMaterial);
|
||||||
|
|
||||||
/* Note: D3DMATERIAL9 is compatible with WINED3DMATERIAL */
|
/* Note: D3DMATERIAL9 is compatible with struct wined3d_material. */
|
||||||
wined3d_mutex_lock();
|
wined3d_mutex_lock();
|
||||||
hr = wined3d_device_set_material(This->wined3d_device, (const WINED3DMATERIAL *)pMaterial);
|
hr = wined3d_device_set_material(This->wined3d_device, (const struct wined3d_material *)pMaterial);
|
||||||
wined3d_mutex_unlock();
|
wined3d_mutex_unlock();
|
||||||
|
|
||||||
return hr;
|
return hr;
|
||||||
@ -1345,9 +1345,9 @@ static HRESULT WINAPI IDirect3DDevice9Impl_GetMaterial(IDirect3DDevice9Ex *iface
|
|||||||
|
|
||||||
TRACE("iface %p, material %p.\n", iface, pMaterial);
|
TRACE("iface %p, material %p.\n", iface, pMaterial);
|
||||||
|
|
||||||
/* Note: D3DMATERIAL9 is compatible with WINED3DMATERIAL */
|
/* Note: D3DMATERIAL9 is compatible with struct wined3d_material. */
|
||||||
wined3d_mutex_lock();
|
wined3d_mutex_lock();
|
||||||
hr = wined3d_device_get_material(This->wined3d_device, (WINED3DMATERIAL *)pMaterial);
|
hr = wined3d_device_get_material(This->wined3d_device, (struct wined3d_material *)pMaterial);
|
||||||
wined3d_mutex_unlock();
|
wined3d_mutex_unlock();
|
||||||
|
|
||||||
return hr;
|
return hr;
|
||||||
|
@ -5265,8 +5265,8 @@ IDirect3DDeviceImpl_7_SetMaterial(IDirect3DDevice7 *iface,
|
|||||||
if (!Mat) return DDERR_INVALIDPARAMS;
|
if (!Mat) return DDERR_INVALIDPARAMS;
|
||||||
|
|
||||||
wined3d_mutex_lock();
|
wined3d_mutex_lock();
|
||||||
/* Note: D3DMATERIAL7 is compatible with WINED3DMATERIAL */
|
/* Note: D3DMATERIAL7 is compatible with struct wined3d_material. */
|
||||||
hr = wined3d_device_set_material(This->wined3d_device, (WINED3DMATERIAL *)Mat);
|
hr = wined3d_device_set_material(This->wined3d_device, (struct wined3d_material *)Mat);
|
||||||
wined3d_mutex_unlock();
|
wined3d_mutex_unlock();
|
||||||
|
|
||||||
return hr_ddraw_from_wined3d(hr);
|
return hr_ddraw_from_wined3d(hr);
|
||||||
@ -5319,8 +5319,8 @@ IDirect3DDeviceImpl_7_GetMaterial(IDirect3DDevice7 *iface,
|
|||||||
TRACE("iface %p, material %p.\n", iface, Mat);
|
TRACE("iface %p, material %p.\n", iface, Mat);
|
||||||
|
|
||||||
wined3d_mutex_lock();
|
wined3d_mutex_lock();
|
||||||
/* Note: D3DMATERIAL7 is compatible with WINED3DMATERIAL */
|
/* Note: D3DMATERIAL7 is compatible with struct wined3d_material. */
|
||||||
hr = wined3d_device_get_material(This->wined3d_device, (WINED3DMATERIAL *)Mat);
|
hr = wined3d_device_get_material(This->wined3d_device, (struct wined3d_material *)Mat);
|
||||||
wined3d_mutex_unlock();
|
wined3d_mutex_unlock();
|
||||||
|
|
||||||
return hr_ddraw_from_wined3d(hr);
|
return hr_ddraw_from_wined3d(hr);
|
||||||
|
@ -2280,7 +2280,7 @@ HRESULT CDECL wined3d_device_get_clip_status(const struct wined3d_device *device
|
|||||||
return WINED3D_OK;
|
return WINED3D_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT CDECL wined3d_device_set_material(struct wined3d_device *device, const WINED3DMATERIAL *material)
|
HRESULT CDECL wined3d_device_set_material(struct wined3d_device *device, const struct wined3d_material *material)
|
||||||
{
|
{
|
||||||
TRACE("device %p, material %p.\n", device, material);
|
TRACE("device %p, material %p.\n", device, material);
|
||||||
|
|
||||||
@ -2299,25 +2299,25 @@ HRESULT CDECL wined3d_device_set_material(struct wined3d_device *device, const W
|
|||||||
return WINED3D_OK;
|
return WINED3D_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT CDECL wined3d_device_get_material(const struct wined3d_device *device, WINED3DMATERIAL *material)
|
HRESULT CDECL wined3d_device_get_material(const struct wined3d_device *device, struct wined3d_material *material)
|
||||||
{
|
{
|
||||||
TRACE("device %p, material %p.\n", device, material);
|
TRACE("device %p, material %p.\n", device, material);
|
||||||
|
|
||||||
*material = device->updateStateBlock->state.material;
|
*material = device->updateStateBlock->state.material;
|
||||||
|
|
||||||
TRACE("Diffuse {%.8e, %.8e, %.8e, %.8e}\n",
|
TRACE("diffuse {%.8e, %.8e, %.8e, %.8e}\n",
|
||||||
material->Diffuse.r, material->Diffuse.g,
|
material->diffuse.r, material->diffuse.g,
|
||||||
material->Diffuse.b, material->Diffuse.a);
|
material->diffuse.b, material->diffuse.a);
|
||||||
TRACE("Ambient {%.8e, %.8e, %.8e, %.8e}\n",
|
TRACE("ambient {%.8e, %.8e, %.8e, %.8e}\n",
|
||||||
material->Ambient.r, material->Ambient.g,
|
material->ambient.r, material->ambient.g,
|
||||||
material->Ambient.b, material->Ambient.a);
|
material->ambient.b, material->ambient.a);
|
||||||
TRACE("Specular {%.8e, %.8e, %.8e, %.8e}\n",
|
TRACE("specular {%.8e, %.8e, %.8e, %.8e}\n",
|
||||||
material->Specular.r, material->Specular.g,
|
material->specular.r, material->specular.g,
|
||||||
material->Specular.b, material->Specular.a);
|
material->specular.b, material->specular.a);
|
||||||
TRACE("Emissive {%.8e, %.8e, %.8e, %.8e}\n",
|
TRACE("emissive {%.8e, %.8e, %.8e, %.8e}\n",
|
||||||
material->Emissive.r, material->Emissive.g,
|
material->emissive.r, material->emissive.g,
|
||||||
material->Emissive.b, material->Emissive.a);
|
material->emissive.b, material->emissive.a);
|
||||||
TRACE("Power %.8e.\n", material->Power);
|
TRACE("power %.8e.\n", material->power);
|
||||||
|
|
||||||
return WINED3D_OK;
|
return WINED3D_OK;
|
||||||
}
|
}
|
||||||
|
@ -656,10 +656,10 @@ static void state_specularenable(struct wined3d_context *context, const struct w
|
|||||||
TRACE("Setting specular enable state and materials\n");
|
TRACE("Setting specular enable state and materials\n");
|
||||||
if (state->render_states[WINED3DRS_SPECULARENABLE])
|
if (state->render_states[WINED3DRS_SPECULARENABLE])
|
||||||
{
|
{
|
||||||
glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, (float *)&state->material.Specular);
|
glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, (float *)&state->material.specular);
|
||||||
checkGLcall("glMaterialfv");
|
checkGLcall("glMaterialfv");
|
||||||
|
|
||||||
if (state->material.Power > gl_info->limits.shininess)
|
if (state->material.power > gl_info->limits.shininess)
|
||||||
{
|
{
|
||||||
/* glMaterialf man page says that the material says that GL_SHININESS must be between 0.0
|
/* glMaterialf man page says that the material says that GL_SHININESS must be between 0.0
|
||||||
* and 128.0, although in d3d neither -1 nor 129 produce an error. GL_NV_max_light_exponent
|
* and 128.0, although in d3d neither -1 nor 129 produce an error. GL_NV_max_light_exponent
|
||||||
@ -667,12 +667,12 @@ static void state_specularenable(struct wined3d_context *context, const struct w
|
|||||||
* value reported by the extension, otherwise 128. For values > gl_info->limits.shininess clamp
|
* value reported by the extension, otherwise 128. For values > gl_info->limits.shininess clamp
|
||||||
* them, it should be safe to do so without major visual distortions.
|
* them, it should be safe to do so without major visual distortions.
|
||||||
*/
|
*/
|
||||||
WARN("Material power = %.8e, limit %.8e\n", state->material.Power, gl_info->limits.shininess);
|
WARN("Material power = %.8e, limit %.8e\n", state->material.power, gl_info->limits.shininess);
|
||||||
glMaterialf(GL_FRONT_AND_BACK, GL_SHININESS, gl_info->limits.shininess);
|
glMaterialf(GL_FRONT_AND_BACK, GL_SHININESS, gl_info->limits.shininess);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
glMaterialf(GL_FRONT_AND_BACK, GL_SHININESS, state->material.Power);
|
glMaterialf(GL_FRONT_AND_BACK, GL_SHININESS, state->material.power);
|
||||||
}
|
}
|
||||||
checkGLcall("glMaterialf(GL_SHININESS)");
|
checkGLcall("glMaterialf(GL_SHININESS)");
|
||||||
|
|
||||||
@ -716,24 +716,24 @@ static void state_specularenable(struct wined3d_context *context, const struct w
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
TRACE("Diffuse {%.8e, %.8e, %.8e, %.8e}\n",
|
TRACE("diffuse {%.8e, %.8e, %.8e, %.8e}\n",
|
||||||
state->material.Diffuse.r, state->material.Diffuse.g,
|
state->material.diffuse.r, state->material.diffuse.g,
|
||||||
state->material.Diffuse.b, state->material.Diffuse.a);
|
state->material.diffuse.b, state->material.diffuse.a);
|
||||||
TRACE("Ambient {%.8e, %.8e, %.8e, %.8e}\n",
|
TRACE("ambient {%.8e, %.8e, %.8e, %.8e}\n",
|
||||||
state->material.Ambient.r, state->material.Ambient.g,
|
state->material.ambient.r, state->material.ambient.g,
|
||||||
state->material.Ambient.b, state->material.Ambient.a);
|
state->material.ambient.b, state->material.ambient.a);
|
||||||
TRACE("Specular {%.8e, %.8e, %.8e, %.8e}\n",
|
TRACE("specular {%.8e, %.8e, %.8e, %.8e}\n",
|
||||||
state->material.Specular.r, state->material.Specular.g,
|
state->material.specular.r, state->material.specular.g,
|
||||||
state->material.Specular.b, state->material.Specular.a);
|
state->material.specular.b, state->material.specular.a);
|
||||||
TRACE("Emissive {%.8e, %.8e, %.8e, %.8e}\n",
|
TRACE("emissive {%.8e, %.8e, %.8e, %.8e}\n",
|
||||||
state->material.Emissive.r, state->material.Emissive.g,
|
state->material.emissive.r, state->material.emissive.g,
|
||||||
state->material.Emissive.b, state->material.Emissive.a);
|
state->material.emissive.b, state->material.emissive.a);
|
||||||
|
|
||||||
glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT, (float *)&state->material.Ambient);
|
glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT, (float *)&state->material.ambient);
|
||||||
checkGLcall("glMaterialfv(GL_AMBIENT)");
|
checkGLcall("glMaterialfv(GL_AMBIENT)");
|
||||||
glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, (float *)&state->material.Diffuse);
|
glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, (float *)&state->material.diffuse);
|
||||||
checkGLcall("glMaterialfv(GL_DIFFUSE)");
|
checkGLcall("glMaterialfv(GL_DIFFUSE)");
|
||||||
glMaterialfv(GL_FRONT_AND_BACK, GL_EMISSION, (float *)&state->material.Emissive);
|
glMaterialfv(GL_FRONT_AND_BACK, GL_EMISSION, (float *)&state->material.emissive);
|
||||||
checkGLcall("glMaterialfv(GL_EMISSION)");
|
checkGLcall("glMaterialfv(GL_EMISSION)");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1272,23 +1272,23 @@ static void state_colormat(struct wined3d_context *context, const struct wined3d
|
|||||||
* tracking with glColorMaterial, so apply those here. */
|
* tracking with glColorMaterial, so apply those here. */
|
||||||
switch (context->tracking_parm) {
|
switch (context->tracking_parm) {
|
||||||
case GL_AMBIENT_AND_DIFFUSE:
|
case GL_AMBIENT_AND_DIFFUSE:
|
||||||
glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT, (float *)&state->material.Ambient);
|
glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT, (float *)&state->material.ambient);
|
||||||
glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, (float *)&state->material.Diffuse);
|
glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, (float *)&state->material.diffuse);
|
||||||
checkGLcall("glMaterialfv");
|
checkGLcall("glMaterialfv");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GL_DIFFUSE:
|
case GL_DIFFUSE:
|
||||||
glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, (float *)&state->material.Diffuse);
|
glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, (float *)&state->material.diffuse);
|
||||||
checkGLcall("glMaterialfv");
|
checkGLcall("glMaterialfv");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GL_AMBIENT:
|
case GL_AMBIENT:
|
||||||
glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT, (float *)&state->material.Ambient);
|
glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT, (float *)&state->material.ambient);
|
||||||
checkGLcall("glMaterialfv");
|
checkGLcall("glMaterialfv");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GL_EMISSION:
|
case GL_EMISSION:
|
||||||
glMaterialfv(GL_FRONT_AND_BACK, GL_EMISSION, (float *)&state->material.Emissive);
|
glMaterialfv(GL_FRONT_AND_BACK, GL_EMISSION, (float *)&state->material.emissive);
|
||||||
checkGLcall("glMaterialfv");
|
checkGLcall("glMaterialfv");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -1296,9 +1296,11 @@ static void state_colormat(struct wined3d_context *context, const struct wined3d
|
|||||||
/* Only change material color if specular is enabled, otherwise it is set to black */
|
/* Only change material color if specular is enabled, otherwise it is set to black */
|
||||||
if (state->render_states[WINED3DRS_SPECULARENABLE])
|
if (state->render_states[WINED3DRS_SPECULARENABLE])
|
||||||
{
|
{
|
||||||
glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, (float *)&state->material.Specular);
|
glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, (float *)&state->material.specular);
|
||||||
checkGLcall("glMaterialfv");
|
checkGLcall("glMaterialfv");
|
||||||
} else {
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
static const GLfloat black[] = {0.0f, 0.0f, 0.0f, 0.0f};
|
static const GLfloat black[] = {0.0f, 0.0f, 0.0f, 0.0f};
|
||||||
glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, &black[0]);
|
glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, &black[0]);
|
||||||
checkGLcall("glMaterialfv");
|
checkGLcall("glMaterialfv");
|
||||||
|
@ -2279,7 +2279,7 @@ struct wined3d_state
|
|||||||
|
|
||||||
struct wined3d_matrix transforms[HIGHEST_TRANSFORMSTATE + 1];
|
struct wined3d_matrix transforms[HIGHEST_TRANSFORMSTATE + 1];
|
||||||
double clip_planes[MAX_CLIPPLANES][4];
|
double clip_planes[MAX_CLIPPLANES][4];
|
||||||
WINED3DMATERIAL material;
|
struct wined3d_material material;
|
||||||
WINED3DVIEWPORT viewport;
|
WINED3DVIEWPORT viewport;
|
||||||
RECT scissor_rect;
|
RECT scissor_rect;
|
||||||
|
|
||||||
|
@ -1564,14 +1564,14 @@ struct wined3d_light
|
|||||||
float phi;
|
float phi;
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef struct _WINED3DMATERIAL
|
struct wined3d_material
|
||||||
{
|
{
|
||||||
struct wined3d_color Diffuse;
|
struct wined3d_color diffuse;
|
||||||
struct wined3d_color Ambient;
|
struct wined3d_color ambient;
|
||||||
struct wined3d_color Specular;
|
struct wined3d_color specular;
|
||||||
struct wined3d_color Emissive;
|
struct wined3d_color emissive;
|
||||||
float Power;
|
float power;
|
||||||
} WINED3DMATERIAL;
|
};
|
||||||
|
|
||||||
typedef struct _WINED3DVIEWPORT
|
typedef struct _WINED3DVIEWPORT
|
||||||
{
|
{
|
||||||
@ -2217,7 +2217,7 @@ HRESULT __cdecl wined3d_device_get_index_buffer(const struct wined3d_device *dev
|
|||||||
HRESULT __cdecl wined3d_device_get_light(const struct wined3d_device *device,
|
HRESULT __cdecl wined3d_device_get_light(const struct wined3d_device *device,
|
||||||
UINT light_idx, struct wined3d_light *light);
|
UINT light_idx, struct wined3d_light *light);
|
||||||
HRESULT __cdecl wined3d_device_get_light_enable(const struct wined3d_device *device, UINT light_idx, BOOL *enable);
|
HRESULT __cdecl wined3d_device_get_light_enable(const struct wined3d_device *device, UINT light_idx, BOOL *enable);
|
||||||
HRESULT __cdecl wined3d_device_get_material(const struct wined3d_device *device, WINED3DMATERIAL *material);
|
HRESULT __cdecl wined3d_device_get_material(const struct wined3d_device *device, struct wined3d_material *material);
|
||||||
float __cdecl wined3d_device_get_npatch_mode(const struct wined3d_device *device);
|
float __cdecl wined3d_device_get_npatch_mode(const struct wined3d_device *device);
|
||||||
struct wined3d_shader * __cdecl wined3d_device_get_pixel_shader(const struct wined3d_device *device);
|
struct wined3d_shader * __cdecl wined3d_device_get_pixel_shader(const struct wined3d_device *device);
|
||||||
void __cdecl wined3d_device_get_primitive_type(const struct wined3d_device *device,
|
void __cdecl wined3d_device_get_primitive_type(const struct wined3d_device *device,
|
||||||
@ -2296,7 +2296,7 @@ HRESULT __cdecl wined3d_device_set_index_buffer(struct wined3d_device *device,
|
|||||||
HRESULT __cdecl wined3d_device_set_light(struct wined3d_device *device,
|
HRESULT __cdecl wined3d_device_set_light(struct wined3d_device *device,
|
||||||
UINT light_idx, const struct wined3d_light *light);
|
UINT light_idx, const struct wined3d_light *light);
|
||||||
HRESULT __cdecl wined3d_device_set_light_enable(struct wined3d_device *device, UINT light_idx, BOOL enable);
|
HRESULT __cdecl wined3d_device_set_light_enable(struct wined3d_device *device, UINT light_idx, BOOL enable);
|
||||||
HRESULT __cdecl wined3d_device_set_material(struct wined3d_device *device, const WINED3DMATERIAL *material);
|
HRESULT __cdecl wined3d_device_set_material(struct wined3d_device *device, const struct wined3d_material *material);
|
||||||
void __cdecl wined3d_device_set_multithreaded(struct wined3d_device *device);
|
void __cdecl wined3d_device_set_multithreaded(struct wined3d_device *device);
|
||||||
HRESULT __cdecl wined3d_device_set_npatch_mode(struct wined3d_device *device, float segments);
|
HRESULT __cdecl wined3d_device_set_npatch_mode(struct wined3d_device *device, float segments);
|
||||||
HRESULT __cdecl wined3d_device_set_pixel_shader(struct wined3d_device *device, struct wined3d_shader *shader);
|
HRESULT __cdecl wined3d_device_set_pixel_shader(struct wined3d_device *device, struct wined3d_shader *shader);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user