Ivan Gyurdiev : wined3d: Merge VIEWPORT types into one type in WINED3D namespace.

Alexandre Julliard julliard at wine.codeweavers.com
Wed Oct 11 05:52:44 CDT 2006


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

Author: Ivan Gyurdiev <ivg231 at gmail.com>
Date:   Tue Oct 10 21:57:25 2006 -0400

wined3d: Merge VIEWPORT types into one type in WINED3D namespace.

---

 dlls/d3d8/device.c               |    2 ++
 dlls/d3d9/device.c               |    4 ++++
 dlls/ddraw/device.c              |    7 +++++--
 dlls/wined3d/device.c            |    4 ++--
 dlls/wined3d/stateblock.c        |    4 ++--
 include/wine/wined3d_interface.h |    3 ---
 include/wine/wined3d_types.h     |    9 +++++++++
 7 files changed, 24 insertions(+), 9 deletions(-)

diff --git a/dlls/d3d8/device.c b/dlls/d3d8/device.c
index 2a7d730..92e32b3 100644
--- a/dlls/d3d8/device.c
+++ b/dlls/d3d8/device.c
@@ -697,6 +697,7 @@ static HRESULT WINAPI IDirect3DDevice8Im
     IDirect3DDevice8Impl *This = (IDirect3DDevice8Impl *)iface;
     TRACE("(%p) Relay\n" , This);
 
+    /* Note: D3DVIEWPORT8 is compatible with WINED3DVIEWPORT */
     return IWineD3DDevice_SetViewport(This->WineD3DDevice, (const WINED3DVIEWPORT *)pViewport);
 }
 
@@ -704,6 +705,7 @@ static HRESULT WINAPI IDirect3DDevice8Im
     IDirect3DDevice8Impl *This = (IDirect3DDevice8Impl *)iface;
     TRACE("(%p) Relay\n" , This);
 
+    /* Note: D3DVIEWPORT8 is compatible with WINED3DVIEWPORT */
     return IWineD3DDevice_GetViewport(This->WineD3DDevice, (WINED3DVIEWPORT *)pViewport);
 }
 
diff --git a/dlls/d3d9/device.c b/dlls/d3d9/device.c
index 815ea6d..2e6c3c3 100644
--- a/dlls/d3d9/device.c
+++ b/dlls/d3d9/device.c
@@ -480,12 +480,16 @@ static HRESULT  WINAPI  IDirect3DDevice9
 static HRESULT  WINAPI  IDirect3DDevice9Impl_SetViewport(LPDIRECT3DDEVICE9 iface, CONST D3DVIEWPORT9* pViewport) {
     IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
     TRACE("(%p) Relay\n" , This);
+
+    /* Note: D3DVIEWPORT9 is compatible with WINED3DVIEWPORT */
     return IWineD3DDevice_SetViewport(This->WineD3DDevice, (const WINED3DVIEWPORT *)pViewport);
 }
 
 static HRESULT  WINAPI  IDirect3DDevice9Impl_GetViewport(LPDIRECT3DDEVICE9 iface, D3DVIEWPORT9* pViewport) {
     IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
     TRACE("(%p) Relay\n" , This);
+
+    /* Note: D3DVIEWPORT9 is compatible with WINED3DVIEWPORT */
     return IWineD3DDevice_GetViewport(This->WineD3DDevice, (WINED3DVIEWPORT *)pViewport);
 }
 
diff --git a/dlls/ddraw/device.c b/dlls/ddraw/device.c
index 42e4697..26c6897 100644
--- a/dlls/ddraw/device.c
+++ b/dlls/ddraw/device.c
@@ -4035,8 +4035,9 @@ IDirect3DDeviceImpl_7_SetViewport(IDirec
     if(!Data)
         return DDERR_INVALIDPARAMS;
 
+    /* Note: D3DVIEWPORT7 is compatible with WINED3DVIEWPORT */
     return IWineD3DDevice_SetViewport(This->wineD3DDevice,
-                                      Data);
+                                      (WINED3DVIEWPORT*) Data);
 }
 
 /*****************************************************************************
@@ -4066,8 +4067,10 @@ IDirect3DDeviceImpl_7_GetViewport(IDirec
     if(!Data)
         return DDERR_INVALIDPARAMS;
 
+    /* Note: D3DVIEWPORT7 is compatible with WINED3DVIEWPORT */
     hr = IWineD3DDevice_GetViewport(This->wineD3DDevice,
-                                    Data);
+                                    (WINED3DVIEWPORT*) Data);
+
     return hr_ddraw_from_wined3d(hr);
 }
 
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index f0da0cc..44a55d8 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -2114,7 +2114,7 @@ #endif
     list_init(&This->glsl_shader_progs);
 
     { /* Set a default viewport */
-        D3DVIEWPORT9 vp;
+        WINED3DVIEWPORT vp;
         vp.X      = 0;
         vp.Y      = 0;
         vp.Width  = *(pPresentationParameters->BackBufferWidth);
@@ -5083,7 +5083,7 @@ process_vertices_strided(IWineD3DDeviceI
     char *dest_ptr, *dest_conv = NULL;
     unsigned int i;
     DWORD DestFVF = dest->fvf;
-    D3DVIEWPORT9 vp;
+    WINED3DVIEWPORT vp;
     D3DMATRIX mat, proj_mat, view_mat, world_mat;
     BOOL doClip;
     int numTextures;
diff --git a/dlls/wined3d/stateblock.c b/dlls/wined3d/stateblock.c
index 841f03c..cd6c58b 100644
--- a/dlls/wined3d/stateblock.c
+++ b/dlls/wined3d/stateblock.c
@@ -527,9 +527,9 @@ static HRESULT  WINAPI IWineD3DStateBloc
 
         if (This->set.viewport && memcmp(&targetStateBlock->viewport,
                                                     &This->viewport,
-                                                    sizeof(D3DVIEWPORT9)) != 0) {
+                                                    sizeof(WINED3DVIEWPORT)) != 0) {
             TRACE("Updating viewport\n");
-            memcpy(&This->viewport, &targetStateBlock->viewport, sizeof(D3DVIEWPORT9));
+            memcpy(&This->viewport, &targetStateBlock->viewport, sizeof(WINED3DVIEWPORT));
         }
 
         for (i = 0; i < MAX_STREAMS; i++) {
diff --git a/include/wine/wined3d_interface.h b/include/wine/wined3d_interface.h
index 7bd64c7..4c3c9a8 100644
--- a/include/wine/wined3d_interface.h
+++ b/include/wine/wined3d_interface.h
@@ -191,17 +191,14 @@ DEFINE_GUID(IID_IWineD3DQuery, 
 /* TODO: remove the d3d8/d3d9 dependencies by making a all inclusive WINED3D version */
 #if defined( __WINE_D3D9_H )
  /* Identical: */ 
-# define WINED3DVIEWPORT        D3DVIEWPORT9
 # define WINED3DGAMMARAMP       D3DGAMMARAMP
 
 #elif defined( __WINE_D3D8_H )
  /* Identical: */ 
-# define WINED3DVIEWPORT        D3DVIEWPORT8
 # define WINED3DGAMMARAMP       D3DGAMMARAMP
 
 #else /* defined (__WINE_D3D_H ) */
  /* Identical: */
-# define WINED3DVIEWPORT        D3DVIEWPORT7
 # define WINED3DGAMMARAMP       DDGAMMARAMP
 
 #endif
diff --git a/include/wine/wined3d_types.h b/include/wine/wined3d_types.h
index b1c3ae1..9bc2698 100644
--- a/include/wine/wined3d_types.h
+++ b/include/wine/wined3d_types.h
@@ -76,6 +76,15 @@ typedef struct _WINED3DMATERIAL {
     float           Power;
 } WINED3DMATERIAL;
 
+typedef struct _WINED3DVIEWPORT {
+    DWORD       X;
+    DWORD       Y;
+    DWORD       Width;
+    DWORD       Height;
+    float       MinZ;
+    float       MaxZ;
+} WINED3DVIEWPORT;
+
 #define WINED3D_VSHADER_MAX_CONSTANTS 96
 #define WINED3D_PSHADER_MAX_CONSTANTS 32
 




More information about the wine-cvs mailing list