Stefan Dösinger : wined3d: Do not reset the material.
Alexandre Julliard
julliard at wine.codeweavers.com
Wed Jan 10 15:47:07 CST 2007
Module: wine
Branch: master
Commit: 329670c7f129343ef0086f76b08a40d0fd5e3242
URL: http://source.winehq.org/git/wine.git/?a=commit;h=329670c7f129343ef0086f76b08a40d0fd5e3242
Author: Stefan Dösinger <stefan at codeweavers.com>
Date: Wed Jan 10 11:23:04 2007 +0100
wined3d: Do not reset the material.
---
dlls/wined3d/drawprim.c | 28 ----------------------------
1 files changed, 0 insertions(+), 28 deletions(-)
diff --git a/dlls/wined3d/drawprim.c b/dlls/wined3d/drawprim.c
index cf47106..d210b85 100644
--- a/dlls/wined3d/drawprim.c
+++ b/dlls/wined3d/drawprim.c
@@ -93,8 +93,6 @@ static DWORD primitiveToGl(WINED3DPRIMIT
/* Ensure the appropriate material states are set up - only change
state if really required */
static void init_materials(IWineD3DDevice *iface, BOOL isDiffuseSupplied) {
-
- BOOL requires_material_reset = FALSE;
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
if (This->tracking_color == NEEDS_TRACKING && isDiffuseSupplied) {
@@ -107,45 +105,19 @@ static void init_materials(IWineD3DDevic
glEnable(GL_COLOR_MATERIAL);
checkGLcall("glEnable GL_COLOR_MATERIAL");
This->tracking_color = IS_TRACKING;
- requires_material_reset = TRUE; /* Restore material settings as will be used */
-
} else if ((This->tracking_color == IS_TRACKING && !isDiffuseSupplied) ||
(This->tracking_color == NEEDS_TRACKING && !isDiffuseSupplied)) {
/* If we are tracking the current color but one isn't supplied, don't! */
glDisable(GL_COLOR_MATERIAL);
checkGLcall("glDisable GL_COLOR_MATERIAL");
This->tracking_color = NEEDS_TRACKING;
- requires_material_reset = TRUE; /* Restore material settings as will be used */
-
} else if (This->tracking_color == IS_TRACKING && isDiffuseSupplied) {
/* No need to reset material colors since no change to gl_color_material */
- requires_material_reset = FALSE;
-
} else if (This->tracking_color == NEEDS_DISABLE) {
glDisable(GL_COLOR_MATERIAL);
checkGLcall("glDisable GL_COLOR_MATERIAL");
This->tracking_color = DISABLED_TRACKING;
- requires_material_reset = TRUE; /* Restore material settings as will be used */
}
-
- /* Reset the material colors which may have been tracking the color*/
- if (requires_material_reset) {
- glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT, (float*) &This->stateBlock->material.Ambient);
- checkGLcall("glMaterialfv");
- glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, (float*) &This->stateBlock->material.Diffuse);
- checkGLcall("glMaterialfv");
- if (This->stateBlock->renderState[WINED3DRS_SPECULARENABLE]) {
- glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, (float*) &This->stateBlock->material.Specular);
- checkGLcall("glMaterialfv");
- } else {
- float black[4] = {0.0f, 0.0f, 0.0f, 0.0f};
- glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, &black[0]);
- checkGLcall("glMaterialfv");
- }
- glMaterialfv(GL_FRONT_AND_BACK, GL_EMISSION, (float*) &This->stateBlock->material.Emissive);
- checkGLcall("glMaterialfv");
- }
-
}
static const GLfloat invymat[16] = {
More information about the wine-cvs
mailing list