ddraw: Get rid of copy_to_surfacedesc2().

This commit is contained in:
Henri Verbeet 2013-11-28 09:55:43 +01:00 committed by Alexandre Julliard
parent 69ebf9de54
commit 82d5f36c8b
2 changed files with 1 additions and 13 deletions

View File

@ -608,18 +608,6 @@ struct member_info
#define DD_STRUCT_COPY_BYSIZE(to,from) DD_STRUCT_COPY_BYSIZE_(to,from,(from)->dwSize)
#define SIZEOF_END_PADDING(type, last_field) \
(sizeof(type) - offsetof(type, last_field) - sizeof(((type *)0)->last_field))
static inline void copy_to_surfacedesc2(DDSURFACEDESC2 *to, const DDSURFACEDESC2 *from)
{
DWORD from_size = from->dwSize;
if (from_size == sizeof(DDSURFACEDESC))
from_size -= SIZEOF_END_PADDING(DDSURFACEDESC, ddsCaps);
to->dwSize = sizeof(DDSURFACEDESC2); /* for struct copy */
DD_STRUCT_COPY_BYSIZE_(to, from, from_size);
}
HRESULT hr_ddraw_from_wined3d(HRESULT hr) DECLSPEC_HIDDEN;
#endif

View File

@ -5620,7 +5620,7 @@ HRESULT ddraw_surface_create(struct ddraw *ddraw, const DDSURFACEDESC2 *surface_
return E_OUTOFMEMORY;
texture->version = version;
copy_to_surfacedesc2(&texture->surface_desc, surface_desc);
texture->surface_desc = *surface_desc;
desc = &texture->surface_desc;
/* Ensure DDSD_CAPS is always set. */