From ddc7a803e96897b8e95e9ce6ca54021cbb68e87d Mon Sep 17 00:00:00 2001 From: Henri Verbeet Date: Wed, 2 Mar 2011 08:55:48 +0100 Subject: [PATCH] wined3d: Standalone surfaces should never be sRGB. --- dlls/wined3d/surface.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c index b0f9dc694ec..0897467d3be 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -707,24 +707,25 @@ void surface_bind(IWineD3DSurfaceImpl *surface, BOOL srgb) } else { - GLuint *name = srgb ? &surface->texture_name_srgb : &surface->texture_name; - if (surface->texture_level) { ERR("Standalone surface %p is non-zero texture level %u.\n", surface, surface->texture_level); } + if (srgb) + ERR("Trying to bind standalone surface %p as sRGB.\n", surface); + ENTER_GL(); - if (!*name) + if (!surface->texture_name) { - glGenTextures(1, name); + glGenTextures(1, &surface->texture_name); checkGLcall("glGenTextures"); - TRACE("Surface %p given name %u.\n", surface, *name); + TRACE("Surface %p given name %u.\n", surface, surface->texture_name); - glBindTexture(surface->texture_target, *name); + glBindTexture(surface->texture_target, surface->texture_name); checkGLcall("glBindTexture"); glTexParameteri(surface->texture_target, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); glTexParameteri(surface->texture_target, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); @@ -735,7 +736,7 @@ void surface_bind(IWineD3DSurfaceImpl *surface, BOOL srgb) } else { - glBindTexture(surface->texture_target, *name); + glBindTexture(surface->texture_target, surface->texture_name); checkGLcall("glBindTexture"); } -- 2.11.4.GIT