diff --git a/dlls/d3d8/cubetexture.c b/dlls/d3d8/cubetexture.c index 0f40a0da131..6b5f223bfab 100644 --- a/dlls/d3d8/cubetexture.c +++ b/dlls/d3d8/cubetexture.c @@ -363,14 +363,14 @@ static HRESULT WINAPI IDirect3DCubeTexture8Impl_AddDirtyRect(IDirect3DCubeTextur hr = wined3d_texture_add_dirty_region(texture->wined3d_texture, face, NULL); else { - WINED3DBOX dirty_region; + struct wined3d_box dirty_region; - dirty_region.Left = dirty_rect->left; - dirty_region.Top = dirty_rect->top; - dirty_region.Right = dirty_rect->right; - dirty_region.Bottom = dirty_rect->bottom; - dirty_region.Front = 0; - dirty_region.Back = 1; + dirty_region.left = dirty_rect->left; + dirty_region.top = dirty_rect->top; + dirty_region.right = dirty_rect->right; + dirty_region.bottom = dirty_rect->bottom; + dirty_region.front = 0; + dirty_region.back = 1; hr = wined3d_texture_add_dirty_region(texture->wined3d_texture, face, &dirty_region); } wined3d_mutex_unlock(); diff --git a/dlls/d3d8/texture.c b/dlls/d3d8/texture.c index 2f62017135b..9e25f8fd921 100644 --- a/dlls/d3d8/texture.c +++ b/dlls/d3d8/texture.c @@ -351,14 +351,14 @@ static HRESULT WINAPI IDirect3DTexture8Impl_AddDirtyRect(IDirect3DTexture8 *ifac hr = wined3d_texture_add_dirty_region(texture->wined3d_texture, 0, NULL); else { - WINED3DBOX dirty_region; + struct wined3d_box dirty_region; - dirty_region.Left = dirty_rect->left; - dirty_region.Top = dirty_rect->top; - dirty_region.Right = dirty_rect->right; - dirty_region.Bottom = dirty_rect->bottom; - dirty_region.Front = 0; - dirty_region.Back = 1; + dirty_region.left = dirty_rect->left; + dirty_region.top = dirty_rect->top; + dirty_region.right = dirty_rect->right; + dirty_region.bottom = dirty_rect->bottom; + dirty_region.front = 0; + dirty_region.back = 1; hr = wined3d_texture_add_dirty_region(texture->wined3d_texture, 0, &dirty_region); } wined3d_mutex_unlock(); diff --git a/dlls/d3d8/volume.c b/dlls/d3d8/volume.c index 069b64f801c..505e17b119a 100644 --- a/dlls/d3d8/volume.c +++ b/dlls/d3d8/volume.c @@ -228,7 +228,7 @@ static HRESULT WINAPI IDirect3DVolume8Impl_LockBox(IDirect3DVolume8 *iface, wined3d_mutex_lock(); hr = wined3d_volume_map(This->wined3d_volume, (struct wined3d_mapped_box *)pLockedVolume, - (const WINED3DBOX *)pBox, Flags); + (const struct wined3d_box *)pBox, Flags); wined3d_mutex_unlock(); return hr; diff --git a/dlls/d3d8/volumetexture.c b/dlls/d3d8/volumetexture.c index 2ab5be27bae..f223462f2a9 100644 --- a/dlls/d3d8/volumetexture.c +++ b/dlls/d3d8/volumetexture.c @@ -348,7 +348,7 @@ static HRESULT WINAPI IDirect3DVolumeTexture8Impl_AddDirtyBox(IDirect3DVolumeTex TRACE("iface %p, dirty_box %p.\n", iface, dirty_box); wined3d_mutex_lock(); - hr = wined3d_texture_add_dirty_region(texture->wined3d_texture, 0, (const WINED3DBOX *)dirty_box); + hr = wined3d_texture_add_dirty_region(texture->wined3d_texture, 0, (const struct wined3d_box *)dirty_box); wined3d_mutex_unlock(); return hr; diff --git a/dlls/d3d9/cubetexture.c b/dlls/d3d9/cubetexture.c index bc290355aaf..2fdf065759d 100644 --- a/dlls/d3d9/cubetexture.c +++ b/dlls/d3d9/cubetexture.c @@ -406,14 +406,14 @@ static HRESULT WINAPI IDirect3DCubeTexture9Impl_AddDirtyRect(IDirect3DCubeTextu hr = wined3d_texture_add_dirty_region(texture->wined3d_texture, face, NULL); else { - WINED3DBOX dirty_region; + struct wined3d_box dirty_region; - dirty_region.Left = dirty_rect->left; - dirty_region.Top = dirty_rect->top; - dirty_region.Right = dirty_rect->right; - dirty_region.Bottom = dirty_rect->bottom; - dirty_region.Front = 0; - dirty_region.Back = 1; + dirty_region.left = dirty_rect->left; + dirty_region.top = dirty_rect->top; + dirty_region.right = dirty_rect->right; + dirty_region.bottom = dirty_rect->bottom; + dirty_region.front = 0; + dirty_region.back = 1; hr = wined3d_texture_add_dirty_region(texture->wined3d_texture, face, &dirty_region); } wined3d_mutex_unlock(); diff --git a/dlls/d3d9/texture.c b/dlls/d3d9/texture.c index b0ccd6f5e77..6801058006d 100644 --- a/dlls/d3d9/texture.c +++ b/dlls/d3d9/texture.c @@ -392,14 +392,14 @@ static HRESULT WINAPI IDirect3DTexture9Impl_AddDirtyRect(IDirect3DTexture9 *ifac hr = wined3d_texture_add_dirty_region(texture->wined3d_texture, 0, NULL); else { - WINED3DBOX dirty_region; + struct wined3d_box dirty_region; - dirty_region.Left = dirty_rect->left; - dirty_region.Top = dirty_rect->top; - dirty_region.Right = dirty_rect->right; - dirty_region.Bottom = dirty_rect->bottom; - dirty_region.Front = 0; - dirty_region.Back = 1; + dirty_region.left = dirty_rect->left; + dirty_region.top = dirty_rect->top; + dirty_region.right = dirty_rect->right; + dirty_region.bottom = dirty_rect->bottom; + dirty_region.front = 0; + dirty_region.back = 1; hr = wined3d_texture_add_dirty_region(texture->wined3d_texture, 0, &dirty_region); } wined3d_mutex_unlock(); diff --git a/dlls/d3d9/volume.c b/dlls/d3d9/volume.c index dfd27fe48ad..60d8e12b7a9 100644 --- a/dlls/d3d9/volume.c +++ b/dlls/d3d9/volume.c @@ -226,7 +226,7 @@ static HRESULT WINAPI IDirect3DVolume9Impl_LockBox(IDirect3DVolume9 *iface, wined3d_mutex_lock(); hr = wined3d_volume_map(This->wined3d_volume, (struct wined3d_mapped_box *)pLockedVolume, - (const WINED3DBOX *)pBox, Flags); + (const struct wined3d_box *)pBox, Flags); wined3d_mutex_unlock(); return hr; diff --git a/dlls/d3d9/volumetexture.c b/dlls/d3d9/volumetexture.c index ac79c915860..0cf0ed06f62 100644 --- a/dlls/d3d9/volumetexture.c +++ b/dlls/d3d9/volumetexture.c @@ -386,7 +386,7 @@ static HRESULT WINAPI IDirect3DVolumeTexture9Impl_AddDirtyBox(IDirect3DVolumeTex TRACE("iface %p, dirty_box %p.\n", iface, dirty_box); wined3d_mutex_lock(); - hr = wined3d_texture_add_dirty_region(texture->wined3d_texture, 0, (const WINED3DBOX *)dirty_box); + hr = wined3d_texture_add_dirty_region(texture->wined3d_texture, 0, (const struct wined3d_box *)dirty_box); wined3d_mutex_unlock(); return hr; diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c index f10cbff5c23..c49c0fb08c9 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -904,14 +904,14 @@ static void surface_map(struct wined3d_surface *surface, const RECT *rect, DWORD surface_add_dirty_rect(surface, NULL); else { - WINED3DBOX b; + struct wined3d_box b; - b.Left = rect->left; - b.Top = rect->top; - b.Right = rect->right; - b.Bottom = rect->bottom; - b.Front = 0; - b.Back = 1; + b.left = rect->left; + b.top = rect->top; + b.right = rect->right; + b.bottom = rect->bottom; + b.front = 0; + b.back = 1; surface_add_dirty_rect(surface, &b); } } @@ -2679,7 +2679,7 @@ GLenum surface_get_gl_buffer(const struct wined3d_surface *surface) } /* Slightly inefficient way to handle multiple dirty rects but it works :) */ -void surface_add_dirty_rect(struct wined3d_surface *surface, const WINED3DBOX *dirty_rect) +void surface_add_dirty_rect(struct wined3d_surface *surface, const struct wined3d_box *dirty_rect) { TRACE("surface %p, dirty_rect %p.\n", surface, dirty_rect); @@ -2690,10 +2690,10 @@ void surface_add_dirty_rect(struct wined3d_surface *surface, const WINED3DBOX *d surface_modify_location(surface, SFLAG_INSYSMEM, TRUE); if (dirty_rect) { - surface->dirtyRect.left = min(surface->dirtyRect.left, dirty_rect->Left); - surface->dirtyRect.top = min(surface->dirtyRect.top, dirty_rect->Top); - surface->dirtyRect.right = max(surface->dirtyRect.right, dirty_rect->Right); - surface->dirtyRect.bottom = max(surface->dirtyRect.bottom, dirty_rect->Bottom); + surface->dirtyRect.left = min(surface->dirtyRect.left, dirty_rect->left); + surface->dirtyRect.top = min(surface->dirtyRect.top, dirty_rect->top); + surface->dirtyRect.right = max(surface->dirtyRect.right, dirty_rect->right); + surface->dirtyRect.bottom = max(surface->dirtyRect.bottom, dirty_rect->bottom); } else { diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c index 739bfe5e2cc..49e698c189a 100644 --- a/dlls/wined3d/texture.c +++ b/dlls/wined3d/texture.c @@ -569,7 +569,7 @@ struct wined3d_resource * CDECL wined3d_texture_get_sub_resource(struct wined3d_ } HRESULT CDECL wined3d_texture_add_dirty_region(struct wined3d_texture *texture, - UINT layer, const WINED3DBOX *dirty_region) + UINT layer, const struct wined3d_box *dirty_region) { struct wined3d_resource *sub_resource; @@ -704,7 +704,7 @@ static void texture2d_preload(struct wined3d_texture *texture, enum WINED3DSRGB } static void texture2d_sub_resource_add_dirty_region(struct wined3d_resource *sub_resource, - const WINED3DBOX *dirty_region) + const struct wined3d_box *dirty_region) { surface_add_dirty_rect(surface_from_resource(sub_resource), dirty_region); } @@ -1102,7 +1102,7 @@ static void texture3d_preload(struct wined3d_texture *texture, enum WINED3DSRGB } static void texture3d_sub_resource_add_dirty_region(struct wined3d_resource *sub_resource, - const WINED3DBOX *dirty_region) + const struct wined3d_box *dirty_region) { volume_add_dirty_box(volume_from_resource(sub_resource), dirty_region); } diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c index d00cc4da71b..39e4544fa24 100644 --- a/dlls/wined3d/volume.c +++ b/dlls/wined3d/volume.c @@ -46,26 +46,26 @@ static void volume_bind_and_dirtify(const struct wined3d_volume *volume, struct container->texture_ops->texture_bind(container, context, FALSE); } -void volume_add_dirty_box(struct wined3d_volume *volume, const WINED3DBOX *dirty_box) +void volume_add_dirty_box(struct wined3d_volume *volume, const struct wined3d_box *dirty_box) { volume->dirty = TRUE; if (dirty_box) { - volume->lockedBox.Left = min(volume->lockedBox.Left, dirty_box->Left); - volume->lockedBox.Top = min(volume->lockedBox.Top, dirty_box->Top); - volume->lockedBox.Front = min(volume->lockedBox.Front, dirty_box->Front); - volume->lockedBox.Right = max(volume->lockedBox.Right, dirty_box->Right); - volume->lockedBox.Bottom = max(volume->lockedBox.Bottom, dirty_box->Bottom); - volume->lockedBox.Back = max(volume->lockedBox.Back, dirty_box->Back); + volume->lockedBox.left = min(volume->lockedBox.left, dirty_box->left); + volume->lockedBox.top = min(volume->lockedBox.top, dirty_box->top); + volume->lockedBox.front = min(volume->lockedBox.front, dirty_box->front); + volume->lockedBox.right = max(volume->lockedBox.right, dirty_box->right); + volume->lockedBox.bottom = max(volume->lockedBox.bottom, dirty_box->bottom); + volume->lockedBox.back = max(volume->lockedBox.back, dirty_box->back); } else { - volume->lockedBox.Left = 0; - volume->lockedBox.Top = 0; - volume->lockedBox.Front = 0; - volume->lockedBox.Right = volume->resource.width; - volume->lockedBox.Bottom = volume->resource.height; - volume->lockedBox.Back = volume->resource.depth; + volume->lockedBox.left = 0; + volume->lockedBox.top = 0; + volume->lockedBox.front = 0; + volume->lockedBox.right = volume->resource.width; + volume->lockedBox.bottom = volume->resource.height; + volume->lockedBox.back = volume->resource.depth; } } @@ -185,7 +185,7 @@ struct wined3d_resource * CDECL wined3d_volume_get_resource(struct wined3d_volum } HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume, - struct wined3d_mapped_box *mapped_box, const WINED3DBOX *box, DWORD flags) + struct wined3d_mapped_box *mapped_box, const struct wined3d_box *box, DWORD flags) { TRACE("volume %p, mapped_box %p, box %p, flags %#x.\n", volume, mapped_box, box, flags); @@ -202,27 +202,27 @@ HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume, { TRACE("No box supplied - all is ok\n"); mapped_box->data = volume->resource.allocatedMemory; - volume->lockedBox.Left = 0; - volume->lockedBox.Top = 0; - volume->lockedBox.Front = 0; - volume->lockedBox.Right = volume->resource.width; - volume->lockedBox.Bottom = volume->resource.height; - volume->lockedBox.Back = volume->resource.depth; + volume->lockedBox.left = 0; + volume->lockedBox.top = 0; + volume->lockedBox.front = 0; + volume->lockedBox.right = volume->resource.width; + volume->lockedBox.bottom = volume->resource.height; + volume->lockedBox.back = volume->resource.depth; } else { - TRACE("Lock Box (%p) = l %d, t %d, r %d, b %d, fr %d, ba %d\n", - box, box->Left, box->Top, box->Right, box->Bottom, box->Front, box->Back); + TRACE("Lock Box (%p) = l %u, t %u, r %u, b %u, fr %u, ba %u\n", + box, box->left, box->top, box->right, box->bottom, box->front, box->back); mapped_box->data = volume->resource.allocatedMemory - + (mapped_box->slice_pitch * box->Front) /* FIXME: is front < back or vica versa? */ - + (mapped_box->row_pitch * box->Top) - + (box->Left * volume->resource.format->byte_count); - volume->lockedBox.Left = box->Left; - volume->lockedBox.Top = box->Top; - volume->lockedBox.Front = box->Front; - volume->lockedBox.Right = box->Right; - volume->lockedBox.Bottom = box->Bottom; - volume->lockedBox.Back = box->Back; + + (mapped_box->slice_pitch * box->front) /* FIXME: is front < back or vica versa? */ + + (mapped_box->row_pitch * box->top) + + (box->left * volume->resource.format->byte_count); + volume->lockedBox.left = box->left; + volume->lockedBox.top = box->top; + volume->lockedBox.front = box->front; + volume->lockedBox.right = box->right; + volume->lockedBox.bottom = box->bottom; + volume->lockedBox.back = box->back; } if (!(flags & (WINED3DLOCK_NO_DIRTY_UPDATE | WINED3DLOCK_READONLY))) diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index fece53a3ec0..0f87f526247 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -1882,7 +1882,7 @@ struct wined3d_texture_ops struct wined3d_context *context, BOOL srgb); void (*texture_preload)(struct wined3d_texture *texture, enum WINED3DSRGB srgb); void (*texture_sub_resource_add_dirty_region)(struct wined3d_resource *sub_resource, - const WINED3DBOX *dirty_region); + const struct wined3d_box *dirty_region); void (*texture_sub_resource_cleanup)(struct wined3d_resource *sub_resource); }; @@ -1932,8 +1932,8 @@ struct wined3d_volume struct wined3d_texture *container; BOOL lockable; BOOL locked; - WINED3DBOX lockedBox; - WINED3DBOX dirtyBox; + struct wined3d_box lockedBox; + struct wined3d_box dirtyBox; BOOL dirty; }; @@ -1942,7 +1942,7 @@ static inline struct wined3d_volume *volume_from_resource(struct wined3d_resourc return CONTAINING_RECORD(resource, struct wined3d_volume, resource); } -void volume_add_dirty_box(struct wined3d_volume *volume, const WINED3DBOX *dirty_box) DECLSPEC_HIDDEN; +void volume_add_dirty_box(struct wined3d_volume *volume, const struct wined3d_box *dirty_box) DECLSPEC_HIDDEN; void volume_load(const struct wined3d_volume *volume, struct wined3d_context *context, UINT level, BOOL srgb_mode) DECLSPEC_HIDDEN; void volume_set_container(struct wined3d_volume *volume, struct wined3d_texture *container) DECLSPEC_HIDDEN; @@ -2076,7 +2076,7 @@ static inline GLuint surface_get_texture_name(const struct wined3d_surface *surf ? surface->texture_name_srgb : surface->texture_name; } -void surface_add_dirty_rect(struct wined3d_surface *surface, const WINED3DBOX *dirty_rect) DECLSPEC_HIDDEN; +void surface_add_dirty_rect(struct wined3d_surface *surface, const struct wined3d_box *dirty_rect) DECLSPEC_HIDDEN; void surface_bind(struct wined3d_surface *surface, struct wined3d_context *context, BOOL srgb) DECLSPEC_HIDDEN; HRESULT surface_color_fill(struct wined3d_surface *s, const RECT *rect, const struct wined3d_color *color) DECLSPEC_HIDDEN; diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h index a0356a293b7..2af7485df1e 100644 --- a/include/wine/wined3d.h +++ b/include/wine/wined3d.h @@ -1715,15 +1715,15 @@ struct wined3d_mapped_box void *data; }; -typedef struct _WINED3DBOX +struct wined3d_box { - UINT Left; - UINT Top; - UINT Right; - UINT Bottom; - UINT Front; - UINT Back; -} WINED3DBOX; + UINT left; + UINT top; + UINT right; + UINT bottom; + UINT front; + UINT back; +}; typedef struct WineDirect3DStridedData { @@ -2405,7 +2405,7 @@ HRESULT __cdecl wined3d_swapchain_set_gamma_ramp(const struct wined3d_swapchain HRESULT __cdecl wined3d_swapchain_set_window(struct wined3d_swapchain *swapchain, HWND window); HRESULT __cdecl wined3d_texture_add_dirty_region(struct wined3d_texture *texture, - UINT layer, const WINED3DBOX *dirty_region); + UINT layer, const struct wined3d_box *dirty_region); HRESULT __cdecl wined3d_texture_create_2d(struct wined3d_device *device, UINT width, UINT height, UINT level_count, DWORD usage, enum wined3d_format_id format_id, WINED3DPOOL pool, void *parent, const struct wined3d_parent_ops *parent_ops, struct wined3d_texture **texture); @@ -2452,7 +2452,7 @@ DWORD __cdecl wined3d_volume_get_priority(const struct wined3d_volume *volume); struct wined3d_resource * __cdecl wined3d_volume_get_resource(struct wined3d_volume *volume); ULONG __cdecl wined3d_volume_incref(struct wined3d_volume *volume); HRESULT __cdecl wined3d_volume_map(struct wined3d_volume *volume, - struct wined3d_mapped_box *mapped_box, const WINED3DBOX *box, DWORD flags); + struct wined3d_mapped_box *mapped_box, const struct wined3d_box *box, DWORD flags); void __cdecl wined3d_volume_preload(struct wined3d_volume *volume); DWORD __cdecl wined3d_volume_set_priority(struct wined3d_volume *volume, DWORD new_priority); HRESULT __cdecl wined3d_volume_unmap(struct wined3d_volume *volume);