wined3d: Eliminate the heightscale field from IWineD3DSurfaceImpl.

Henri Verbeet hverbeet at codeweavers.com
Fri Mar 13 04:44:17 CDT 2009


---
 dlls/wined3d/device.c          |    1 -
 dlls/wined3d/surface.c         |    6 ++++--
 dlls/wined3d/wined3d_private.h |    1 -
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 52df212..4cefa18 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -802,7 +802,6 @@ static HRESULT  WINAPI IWineD3DDeviceImpl_CreateSurface(IWineD3DDevice *iface, U
     object->currentDesc.MultiSampleType    = MultiSample;
     object->currentDesc.MultiSampleQuality = MultisampleQuality;
     object->glDescription.level            = Level;
-    object->heightscale                    = glDesc->heightscale != 0.0 ? glDesc->heightscale : 1.0;
     list_init(&object->overlays);
 
     /* Flags */
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index c4c0b4b..7ccc3e0 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -287,8 +287,9 @@ static void surface_download_data(IWineD3DSurfaceImpl *This) {
 /* This call just uploads data, the caller is responsible for activating the
  * right context and binding the correct texture. */
 static void surface_upload_data(IWineD3DSurfaceImpl *This, GLenum internal, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *data) {
+    const struct GlPixelFormatDesc *format_desc = This->resource.format_desc;
 
-    if(This->heightscale != 1.0 && This->heightscale != 0.0) height *= This->heightscale;
+    if (format_desc->heightscale != 1.0 && format_desc->heightscale != 0.0) height *= format_desc->heightscale;
 
     if (This->resource.format == WINED3DFMT_DXT1 ||
             This->resource.format == WINED3DFMT_DXT2 || This->resource.format == WINED3DFMT_DXT3 ||
@@ -349,10 +350,11 @@ static void surface_upload_data(IWineD3DSurfaceImpl *This, GLenum internal, GLsi
 /* This call just allocates the texture, the caller is responsible for
  * activating the right context and binding the correct texture. */
 static void surface_allocate_surface(IWineD3DSurfaceImpl *This, GLenum internal, GLsizei width, GLsizei height, GLenum format, GLenum type) {
+    const struct GlPixelFormatDesc *format_desc = This->resource.format_desc;
     BOOL enable_client_storage = FALSE;
     const BYTE *mem = NULL;
 
-    if(This->heightscale != 1.0 && This->heightscale != 0.0) height *= This->heightscale;
+    if (format_desc->heightscale != 1.0 && format_desc->heightscale != 0.0) height *= format_desc->heightscale;
 
     TRACE("(%p) : Creating surface (target %#x)  level %d, d3d format %s, internal format %#x, width %d, height %d, gl format %#x, gl type=%#x\n", This,
             This->glDescription.target, This->glDescription.level, debug_d3dformat(This->resource.format), internal, width, height, format, type);
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 570ab7f..68629c6 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -1531,7 +1531,6 @@ struct IWineD3DSurfaceImpl
 
     UINT                      pow2Width;
     UINT                      pow2Height;
-    float                     heightscale;
 
     /* A method to retrieve the drawable size. Not in the Vtable to make it changeable */
     void (*get_drawable_size)(IWineD3DSurfaceImpl *This, UINT *width, UINT *height);
-- 
1.6.0.6



--------------080304020504060107060208--



More information about the wine-patches mailing list