diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 52df212d93f..4cefa1847fd 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 c4c0b4b7fd3..7ccc3e0312c 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 570ab7f7b92..68629c6aa85 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);