[PATCH 2/5] wined3d: Get rid of the SFLAG_INTEXTURE / SFLAG_INSRGBTEX check in surface_set_texture_name().

Henri Verbeet hverbeet at codeweavers.com
Fri Sep 6 02:57:40 CDT 2013


---
 dlls/wined3d/surface.c | 31 +++++--------------------------
 1 file changed, 5 insertions(+), 26 deletions(-)

diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index e36f61d..011be7a 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -1709,36 +1709,15 @@ static const struct wined3d_surface_ops gdi_surface_ops =
     gdi_surface_unmap,
 };
 
-void surface_set_texture_name(struct wined3d_surface *surface, GLuint new_name, BOOL srgb)
+void surface_set_texture_name(struct wined3d_surface *surface, GLuint name, BOOL srgb)
 {
-    GLuint *name;
-    DWORD flag;
+    TRACE("surface %p, name %u, srgb %#x.\n", surface, name, srgb);
 
-    TRACE("surface %p, new_name %u, srgb %#x.\n", surface, new_name, srgb);
-
-    if(srgb)
-    {
-        name = &surface->texture_name_srgb;
-        flag = SFLAG_INSRGBTEX;
-    }
+    if (srgb)
+        surface->texture_name_srgb = name;
     else
-    {
-        name = &surface->texture_name;
-        flag = SFLAG_INTEXTURE;
-    }
-
-    if (!*name && new_name)
-    {
-        /* FIXME: We shouldn't need to remove SFLAG_INTEXTURE if the
-         * surface has no texture name yet. See if we can get rid of this. */
-        if (surface->flags & flag)
-        {
-            ERR("Surface has %s set, but no texture name.\n", debug_surflocation(flag));
-            surface_modify_location(surface, flag, FALSE);
-        }
-    }
+        surface->texture_name = name;
 
-    *name = new_name;
     surface_force_reload(surface);
 }
 
-- 
1.8.1.5




More information about the wine-patches mailing list