Henri Verbeet : wined3d: Get rid of the WINED3DLOCKED_BOX typedef.

Alexandre Julliard julliard at winehq.org
Tue Dec 6 15:46:17 CST 2011


Module: wine
Branch: master
Commit: 2fa5a22100731277d06cdc74d383b22ec8d6834d
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=2fa5a22100731277d06cdc74d383b22ec8d6834d

Author: Henri Verbeet <hverbeet at codeweavers.com>
Date:   Mon Dec  5 22:06:57 2011 +0100

wined3d: Get rid of the WINED3DLOCKED_BOX typedef.

---

 dlls/d3d10core/texture.c |    8 ++++----
 dlls/d3d8/volume.c       |    2 +-
 dlls/d3d9/volume.c       |    2 +-
 dlls/wined3d/device.c    |    6 +++---
 dlls/wined3d/volume.c    |   20 ++++++++++----------
 include/wine/wined3d.h   |   12 ++++++------
 6 files changed, 25 insertions(+), 25 deletions(-)

diff --git a/dlls/d3d10core/texture.c b/dlls/d3d10core/texture.c
index bd9b63a..f6e6d3b 100644
--- a/dlls/d3d10core/texture.c
+++ b/dlls/d3d10core/texture.c
@@ -363,8 +363,8 @@ static HRESULT STDMETHODCALLTYPE d3d10_texture3d_Map(ID3D10Texture3D *iface, UIN
         D3D10_MAP map_type, UINT map_flags, D3D10_MAPPED_TEXTURE3D *mapped_texture)
 {
     struct d3d10_texture3d *texture = impl_from_ID3D10Texture3D(iface);
+    struct wined3d_mapped_box wined3d_map_desc;
     struct wined3d_resource *sub_resource;
-    WINED3DLOCKED_BOX wined3d_map_desc;
     HRESULT hr;
 
     TRACE("iface %p, sub_resource_idx %u, map_type %u, map_flags %#x, mapped_texture %p.\n",
@@ -380,9 +380,9 @@ static HRESULT STDMETHODCALLTYPE d3d10_texture3d_Map(ID3D10Texture3D *iface, UIN
     else if (SUCCEEDED(hr = wined3d_volume_map(wined3d_volume_from_resource(sub_resource),
             &wined3d_map_desc, NULL, 0)))
     {
-        mapped_texture->pData = wined3d_map_desc.pBits;
-        mapped_texture->RowPitch = wined3d_map_desc.RowPitch;
-        mapped_texture->DepthPitch = wined3d_map_desc.SlicePitch;
+        mapped_texture->pData = wined3d_map_desc.data;
+        mapped_texture->RowPitch = wined3d_map_desc.row_pitch;
+        mapped_texture->DepthPitch = wined3d_map_desc.slice_pitch;
     }
 
     return hr;
diff --git a/dlls/d3d8/volume.c b/dlls/d3d8/volume.c
index f3d1132..069b64f 100644
--- a/dlls/d3d8/volume.c
+++ b/dlls/d3d8/volume.c
@@ -227,7 +227,7 @@ static HRESULT WINAPI IDirect3DVolume8Impl_LockBox(IDirect3DVolume8 *iface,
             iface, pLockedVolume, pBox, Flags);
 
     wined3d_mutex_lock();
-    hr = wined3d_volume_map(This->wined3d_volume, (WINED3DLOCKED_BOX *)pLockedVolume,
+    hr = wined3d_volume_map(This->wined3d_volume, (struct wined3d_mapped_box *)pLockedVolume,
             (const WINED3DBOX *)pBox, Flags);
     wined3d_mutex_unlock();
 
diff --git a/dlls/d3d9/volume.c b/dlls/d3d9/volume.c
index 5e430b9..dfd27fe 100644
--- a/dlls/d3d9/volume.c
+++ b/dlls/d3d9/volume.c
@@ -225,7 +225,7 @@ static HRESULT WINAPI IDirect3DVolume9Impl_LockBox(IDirect3DVolume9 *iface,
             iface, pLockedVolume, pBox, Flags);
 
     wined3d_mutex_lock();
-    hr = wined3d_volume_map(This->wined3d_volume, (WINED3DLOCKED_BOX *)pLockedVolume,
+    hr = wined3d_volume_map(This->wined3d_volume, (struct wined3d_mapped_box *)pLockedVolume,
             (const WINED3DBOX *)pBox, Flags);
     wined3d_mutex_unlock();
 
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 987d540..068fb7f 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -4301,8 +4301,8 @@ HRESULT CDECL wined3d_device_draw_indexed_primitive_strided(struct wined3d_devic
 static HRESULT device_update_volume(struct wined3d_device *device,
         struct wined3d_volume *src_volume, struct wined3d_volume *dst_volume)
 {
-    WINED3DLOCKED_BOX src;
-    WINED3DLOCKED_BOX dst;
+    struct wined3d_mapped_box src;
+    struct wined3d_mapped_box dst;
     HRESULT hr;
 
     TRACE("device %p, src_volume %p, dst_volume %p.\n",
@@ -4319,7 +4319,7 @@ static HRESULT device_update_volume(struct wined3d_device *device,
         return hr;
     }
 
-    memcpy(dst.pBits, src.pBits, dst_volume->resource.size);
+    memcpy(dst.data, src.data, dst_volume->resource.size);
 
     hr = wined3d_volume_unmap(dst_volume);
     if (FAILED(hr))
diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c
index d36d6c3..d00cc4d 100644
--- a/dlls/wined3d/volume.c
+++ b/dlls/wined3d/volume.c
@@ -185,23 +185,23 @@ struct wined3d_resource * CDECL wined3d_volume_get_resource(struct wined3d_volum
 }
 
 HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume,
-        WINED3DLOCKED_BOX *locked_box, const WINED3DBOX *box, DWORD flags)
+        struct wined3d_mapped_box *mapped_box, const WINED3DBOX *box, DWORD flags)
 {
-    TRACE("volume %p, locked_box %p, box %p, flags %#x.\n",
-            volume, locked_box, box, flags);
+    TRACE("volume %p, mapped_box %p, box %p, flags %#x.\n",
+            volume, mapped_box, box, flags);
 
     if (!volume->resource.allocatedMemory)
         volume->resource.allocatedMemory = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, volume->resource.size);
 
     TRACE("allocatedMemory %p.\n", volume->resource.allocatedMemory);
 
-    locked_box->RowPitch = volume->resource.format->byte_count * volume->resource.width; /* Bytes / row */
-    locked_box->SlicePitch = volume->resource.format->byte_count
+    mapped_box->row_pitch = volume->resource.format->byte_count * volume->resource.width; /* Bytes / row */
+    mapped_box->slice_pitch = volume->resource.format->byte_count
             * volume->resource.width * volume->resource.height; /* Bytes / slice */
     if (!box)
     {
         TRACE("No box supplied - all is ok\n");
-        locked_box->pBits = volume->resource.allocatedMemory;
+        mapped_box->data = volume->resource.allocatedMemory;
         volume->lockedBox.Left   = 0;
         volume->lockedBox.Top    = 0;
         volume->lockedBox.Front  = 0;
@@ -213,9 +213,9 @@ HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume,
     {
         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);
-        locked_box->pBits = volume->resource.allocatedMemory
-                + (locked_box->SlicePitch * box->Front)     /* FIXME: is front < back or vica versa? */
-                + (locked_box->RowPitch * box->Top)
+        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;
@@ -234,7 +234,7 @@ HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume,
     volume->locked = TRUE;
 
     TRACE("Returning memory %p, row pitch %d, slice pitch %d.\n",
-            locked_box->pBits, locked_box->RowPitch, locked_box->SlicePitch);
+            mapped_box->data, mapped_box->row_pitch, mapped_box->slice_pitch);
 
     return WINED3D_OK;
 }
diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h
index 91d73b6..a0356a2 100644
--- a/include/wine/wined3d.h
+++ b/include/wine/wined3d.h
@@ -1708,12 +1708,12 @@ struct wined3d_mapped_rect
     void *data;
 };
 
-typedef struct _WINED3DLOCKED_BOX
+struct wined3d_mapped_box
 {
-    INT RowPitch;
-    INT SlicePitch;
-    void *pBits;
-} WINED3DLOCKED_BOX;
+    UINT row_pitch;
+    UINT slice_pitch;
+    void *data;
+};
 
 typedef struct _WINED3DBOX
 {
@@ -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,
-        WINED3DLOCKED_BOX *locked_box, const WINED3DBOX *box, DWORD flags);
+        struct wined3d_mapped_box *mapped_box, const WINED3DBOX *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);




More information about the wine-cvs mailing list