Commit eafebc04 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Get rid of the WINED3DLOCKED_RECT typedef.

parent 6523ef5f
...@@ -262,7 +262,7 @@ static HRESULT WINAPI IDirect3DSurface8Impl_LockRect(IDirect3DSurface8 *iface, ...@@ -262,7 +262,7 @@ static HRESULT WINAPI IDirect3DSurface8Impl_LockRect(IDirect3DSurface8 *iface,
} }
} }
hr = wined3d_surface_map(This->wined3d_surface, (WINED3DLOCKED_RECT *)pLockedRect, pRect, Flags); hr = wined3d_surface_map(This->wined3d_surface, (struct wined3d_mapped_rect *)pLockedRect, pRect, Flags);
wined3d_mutex_unlock(); wined3d_mutex_unlock();
return hr; return hr;
......
...@@ -294,7 +294,7 @@ static HRESULT WINAPI IDirect3DSurface9Impl_LockRect(IDirect3DSurface9 *iface, ...@@ -294,7 +294,7 @@ static HRESULT WINAPI IDirect3DSurface9Impl_LockRect(IDirect3DSurface9 *iface,
TRACE("iface %p, locked_rect %p, rect %p, flags %#x.\n", iface, pLockedRect, pRect, Flags); TRACE("iface %p, locked_rect %p, rect %p, flags %#x.\n", iface, pLockedRect, pRect, Flags);
wined3d_mutex_lock(); wined3d_mutex_lock();
hr = wined3d_surface_map(This->wined3d_surface, (WINED3DLOCKED_RECT *)pLockedRect, pRect, Flags); hr = wined3d_surface_map(This->wined3d_surface, (struct wined3d_mapped_rect *)pLockedRect, pRect, Flags);
wined3d_mutex_unlock(); wined3d_mutex_unlock();
return hr; return hr;
......
...@@ -910,7 +910,7 @@ static HRESULT WINAPI ddraw_surface1_GetAttachedSurface(IDirectDrawSurface *ifac ...@@ -910,7 +910,7 @@ static HRESULT WINAPI ddraw_surface1_GetAttachedSurface(IDirectDrawSurface *ifac
static HRESULT surface_lock(IDirectDrawSurfaceImpl *This, static HRESULT surface_lock(IDirectDrawSurfaceImpl *This,
RECT *Rect, DDSURFACEDESC2 *DDSD, DWORD Flags, HANDLE h) RECT *Rect, DDSURFACEDESC2 *DDSD, DWORD Flags, HANDLE h)
{ {
WINED3DLOCKED_RECT LockedRect; struct wined3d_mapped_rect mapped_rect;
HRESULT hr = DD_OK; HRESULT hr = DD_OK;
TRACE("This %p, rect %s, surface_desc %p, flags %#x, h %p.\n", TRACE("This %p, rect %s, surface_desc %p, flags %#x, h %p.\n",
...@@ -946,7 +946,7 @@ static HRESULT surface_lock(IDirectDrawSurfaceImpl *This, ...@@ -946,7 +946,7 @@ static HRESULT surface_lock(IDirectDrawSurfaceImpl *This,
if (This->surface_desc.ddsCaps.dwCaps & DDSCAPS_FRONTBUFFER) if (This->surface_desc.ddsCaps.dwCaps & DDSCAPS_FRONTBUFFER)
hr = ddraw_surface_update_frontbuffer(This, Rect, TRUE); hr = ddraw_surface_update_frontbuffer(This, Rect, TRUE);
if (SUCCEEDED(hr)) if (SUCCEEDED(hr))
hr = wined3d_surface_map(This->wined3d_surface, &LockedRect, Rect, Flags); hr = wined3d_surface_map(This->wined3d_surface, &mapped_rect, Rect, Flags);
if (FAILED(hr)) if (FAILED(hr))
{ {
wined3d_mutex_unlock(); wined3d_mutex_unlock();
...@@ -977,7 +977,7 @@ static HRESULT surface_lock(IDirectDrawSurfaceImpl *This, ...@@ -977,7 +977,7 @@ static HRESULT surface_lock(IDirectDrawSurfaceImpl *This,
* does not set the LPSURFACE flag on locked surfaces !?!. * does not set the LPSURFACE flag on locked surfaces !?!.
* DDSD->dwFlags |= DDSD_LPSURFACE; * DDSD->dwFlags |= DDSD_LPSURFACE;
*/ */
This->surface_desc.lpSurface = LockedRect.pBits; This->surface_desc.lpSurface = mapped_rect.data;
DD_STRUCT_COPY_BYSIZE(DDSD,&(This->surface_desc)); DD_STRUCT_COPY_BYSIZE(DDSD,&(This->surface_desc));
TRACE("locked surface returning description :\n"); TRACE("locked surface returning description :\n");
...@@ -4759,7 +4759,7 @@ static HRESULT WINAPI d3d_texture2_Load(IDirect3DTexture2 *iface, IDirect3DTextu ...@@ -4759,7 +4759,7 @@ static HRESULT WINAPI d3d_texture2_Load(IDirect3DTexture2 *iface, IDirect3DTextu
} }
else else
{ {
WINED3DLOCKED_RECT src_rect, dst_rect; struct wined3d_mapped_rect src_rect, dst_rect;
/* Copy also the ColorKeying stuff */ /* Copy also the ColorKeying stuff */
if (src_desc->dwFlags & DDSD_CKSRCBLT) if (src_desc->dwFlags & DDSD_CKSRCBLT)
...@@ -4790,9 +4790,9 @@ static HRESULT WINAPI d3d_texture2_Load(IDirect3DTexture2 *iface, IDirect3DTextu ...@@ -4790,9 +4790,9 @@ static HRESULT WINAPI d3d_texture2_Load(IDirect3DTexture2 *iface, IDirect3DTextu
} }
if (dst_surface->surface_desc.u4.ddpfPixelFormat.dwFlags & DDPF_FOURCC) if (dst_surface->surface_desc.u4.ddpfPixelFormat.dwFlags & DDPF_FOURCC)
memcpy(dst_rect.pBits, src_rect.pBits, src_surface->surface_desc.u1.dwLinearSize); memcpy(dst_rect.data, src_rect.data, src_surface->surface_desc.u1.dwLinearSize);
else else
memcpy(dst_rect.pBits, src_rect.pBits, src_rect.Pitch * src_desc->dwHeight); memcpy(dst_rect.data, src_rect.data, src_rect.row_pitch * src_desc->dwHeight);
wined3d_surface_unmap(src_surface->wined3d_surface); wined3d_surface_unmap(src_surface->wined3d_surface);
wined3d_surface_unmap(dst_surface->wined3d_surface); wined3d_surface_unmap(dst_surface->wined3d_surface);
......
...@@ -4967,7 +4967,7 @@ HRESULT CDECL wined3d_device_set_depth_stencil(struct wined3d_device *device, st ...@@ -4967,7 +4967,7 @@ HRESULT CDECL wined3d_device_set_depth_stencil(struct wined3d_device *device, st
HRESULT CDECL wined3d_device_set_cursor_properties(struct wined3d_device *device, HRESULT CDECL wined3d_device_set_cursor_properties(struct wined3d_device *device,
UINT x_hotspot, UINT y_hotspot, struct wined3d_surface *cursor_image) UINT x_hotspot, UINT y_hotspot, struct wined3d_surface *cursor_image)
{ {
WINED3DLOCKED_RECT lockedRect; struct wined3d_mapped_rect mapped_rect;
TRACE("device %p, x_hotspot %u, y_hotspot %u, cursor_image %p.\n", TRACE("device %p, x_hotspot %u, y_hotspot %u, cursor_image %p.\n",
device, x_hotspot, y_hotspot, cursor_image); device, x_hotspot, y_hotspot, cursor_image);
...@@ -4985,7 +4985,7 @@ HRESULT CDECL wined3d_device_set_cursor_properties(struct wined3d_device *device ...@@ -4985,7 +4985,7 @@ HRESULT CDECL wined3d_device_set_cursor_properties(struct wined3d_device *device
if (cursor_image) if (cursor_image)
{ {
WINED3DLOCKED_RECT rect; struct wined3d_mapped_rect rect;
/* MSDN: Cursor must be A8R8G8B8 */ /* MSDN: Cursor must be A8R8G8B8 */
if (cursor_image->resource.format->id != WINED3DFMT_B8G8R8A8_UNORM) if (cursor_image->resource.format->id != WINED3DFMT_B8G8R8A8_UNORM)
...@@ -5018,7 +5018,7 @@ HRESULT CDECL wined3d_device_set_cursor_properties(struct wined3d_device *device ...@@ -5018,7 +5018,7 @@ HRESULT CDECL wined3d_device_set_cursor_properties(struct wined3d_device *device
const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; const struct wined3d_gl_info *gl_info = &device->adapter->gl_info;
const struct wined3d_format *format = wined3d_get_format(gl_info, WINED3DFMT_B8G8R8A8_UNORM); const struct wined3d_format *format = wined3d_get_format(gl_info, WINED3DFMT_B8G8R8A8_UNORM);
struct wined3d_context *context; struct wined3d_context *context;
char *mem, *bits = rect.pBits; char *mem, *bits = rect.data;
GLint intfmt = format->glInternal; GLint intfmt = format->glInternal;
GLint gl_format = format->glFormat; GLint gl_format = format->glFormat;
GLint type = format->glType; GLint type = format->glType;
...@@ -5031,7 +5031,7 @@ HRESULT CDECL wined3d_device_set_cursor_properties(struct wined3d_device *device ...@@ -5031,7 +5031,7 @@ HRESULT CDECL wined3d_device_set_cursor_properties(struct wined3d_device *device
* different) */ * different) */
mem = HeapAlloc(GetProcessHeap(), 0, width * height * bpp); mem = HeapAlloc(GetProcessHeap(), 0, width * height * bpp);
for(i = 0; i < height; i++) for(i = 0; i < height; i++)
memcpy(&mem[width * bpp * i], &bits[rect.Pitch * i], width * bpp); memcpy(&mem[width * bpp * i], &bits[rect.row_pitch * i], width * bpp);
wined3d_surface_unmap(cursor_image); wined3d_surface_unmap(cursor_image);
context = context_acquire(device, NULL); context = context_acquire(device, NULL);
...@@ -5080,7 +5080,7 @@ HRESULT CDECL wined3d_device_set_cursor_properties(struct wined3d_device *device ...@@ -5080,7 +5080,7 @@ HRESULT CDECL wined3d_device_set_cursor_properties(struct wined3d_device *device
* chunks. */ * chunks. */
DWORD *maskBits = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, DWORD *maskBits = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,
(cursor_image->resource.width * cursor_image->resource.height / 8)); (cursor_image->resource.width * cursor_image->resource.height / 8));
wined3d_surface_map(cursor_image, &lockedRect, NULL, wined3d_surface_map(cursor_image, &mapped_rect, NULL,
WINED3DLOCK_NO_DIRTY_UPDATE | WINED3DLOCK_READONLY); WINED3DLOCK_NO_DIRTY_UPDATE | WINED3DLOCK_READONLY);
TRACE("width: %u height: %u.\n", cursor_image->resource.width, cursor_image->resource.height); TRACE("width: %u height: %u.\n", cursor_image->resource.width, cursor_image->resource.height);
...@@ -5090,7 +5090,7 @@ HRESULT CDECL wined3d_device_set_cursor_properties(struct wined3d_device *device ...@@ -5090,7 +5090,7 @@ HRESULT CDECL wined3d_device_set_cursor_properties(struct wined3d_device *device
cursorInfo.hbmMask = CreateBitmap(cursor_image->resource.width, cursor_image->resource.height, cursorInfo.hbmMask = CreateBitmap(cursor_image->resource.width, cursor_image->resource.height,
1, 1, maskBits); 1, 1, maskBits);
cursorInfo.hbmColor = CreateBitmap(cursor_image->resource.width, cursor_image->resource.height, cursorInfo.hbmColor = CreateBitmap(cursor_image->resource.width, cursor_image->resource.height,
1, 32, lockedRect.pBits); 1, 32, mapped_rect.data);
wined3d_surface_unmap(cursor_image); wined3d_surface_unmap(cursor_image);
/* Create our cursor and clean up. */ /* Create our cursor and clean up. */
cursor = CreateIconIndirect(&cursorInfo); cursor = CreateIconIndirect(&cursorInfo);
......
...@@ -1702,11 +1702,11 @@ struct wined3d_raster_status ...@@ -1702,11 +1702,11 @@ struct wined3d_raster_status
UINT scan_line; UINT scan_line;
}; };
typedef struct _WINED3DLOCKED_RECT struct wined3d_mapped_rect
{ {
INT Pitch; UINT row_pitch;
void *pBits; void *data;
} WINED3DLOCKED_RECT; };
typedef struct _WINED3DLOCKED_BOX typedef struct _WINED3DLOCKED_BOX
{ {
...@@ -2360,7 +2360,7 @@ HRESULT __cdecl wined3d_surface_getdc(struct wined3d_surface *surface, HDC *dc); ...@@ -2360,7 +2360,7 @@ HRESULT __cdecl wined3d_surface_getdc(struct wined3d_surface *surface, HDC *dc);
ULONG __cdecl wined3d_surface_incref(struct wined3d_surface *surface); ULONG __cdecl wined3d_surface_incref(struct wined3d_surface *surface);
HRESULT __cdecl wined3d_surface_is_lost(const struct wined3d_surface *surface); HRESULT __cdecl wined3d_surface_is_lost(const struct wined3d_surface *surface);
HRESULT __cdecl wined3d_surface_map(struct wined3d_surface *surface, HRESULT __cdecl wined3d_surface_map(struct wined3d_surface *surface,
WINED3DLOCKED_RECT *locked_rect, const RECT *rect, DWORD flags); struct wined3d_mapped_rect *mapped_rect, const RECT *rect, DWORD flags);
void __cdecl wined3d_surface_preload(struct wined3d_surface *surface); void __cdecl wined3d_surface_preload(struct wined3d_surface *surface);
HRESULT __cdecl wined3d_surface_releasedc(struct wined3d_surface *surface, HDC dc); HRESULT __cdecl wined3d_surface_releasedc(struct wined3d_surface *surface, HDC dc);
HRESULT __cdecl wined3d_surface_restore(struct wined3d_surface *surface); HRESULT __cdecl wined3d_surface_restore(struct wined3d_surface *surface);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment