Re: [dx67] estetic fixes + volume fix

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Le Jeudi 03 Juillet 2003 23:14, Raphaël Junqueira a écrit :
> Hi,
>
> Changelog:
>  - some estetic fixes
>  - fix a bug on IDirect3DVolume8Impl_AddDirtyBox
>
> Regards,
> Raphael

Better way to attach patches now (stupid me)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)

iD8DBQE/BJzvp7NA3AmQTU4RAm+oAJ9XqR7fJ2i6EWPTX8X9TkSIaKcO+ACfake5
oKJTuG7Aqm2e88C9pUBRRAM=
=Ff0J
-----END PGP SIGNATURE-----
Index: surface.c
===================================================================
RCS file: /home/wine/wine/dlls/d3d8/surface.c,v
retrieving revision 1.20
diff -u -r1.20 surface.c
--- surface.c	3 Jul 2003 18:10:22 -0000	1.20
+++ surface.c	3 Jul 2003 21:10:26 -0000
@@ -1,7 +1,8 @@
 /*
  * IDirect3DSurface8 implementation
  *
- * Copyright 2002 Jason Edmeades
+ * Copyright 2002-2003 Jason Edmeades
+ *                     Raphael Junqueira
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -20,6 +21,8 @@
 
 #include "config.h"
 
+#define NONAMELESSUNION
+#define NONAMELESSSTRUCT
 #include "windef.h"
 #include "winbase.h"
 #include "winuser.h"
@@ -76,21 +79,25 @@
     IDirect3DDevice8Impl_AddRef(*ppDevice);
     return D3D_OK;
 }
+
 HRESULT WINAPI IDirect3DSurface8Impl_SetPrivateData(LPDIRECT3DSURFACE8 iface, REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags) {
     ICOM_THIS(IDirect3DSurface8Impl,iface);
     FIXME("(%p) : stub\n", This);    
     return D3D_OK;
 }
+
 HRESULT WINAPI IDirect3DSurface8Impl_GetPrivateData(LPDIRECT3DSURFACE8 iface, REFGUID refguid, void* pData, DWORD* pSizeOfData) {
     ICOM_THIS(IDirect3DSurface8Impl,iface);
     FIXME("(%p) : stub\n", This);    
     return D3D_OK;
 }
+
 HRESULT WINAPI IDirect3DSurface8Impl_FreePrivateData(LPDIRECT3DSURFACE8 iface, REFGUID refguid) {
     ICOM_THIS(IDirect3DSurface8Impl,iface);
     FIXME("(%p) : stub\n", This);    
     return D3D_OK;
 }
+
 HRESULT WINAPI IDirect3DSurface8Impl_GetContainer(LPDIRECT3DSURFACE8 iface, REFIID riid, void** ppContainer) {
     ICOM_THIS(IDirect3DSurface8Impl,iface);
     HRESULT res;
@@ -106,6 +113,7 @@
     TRACE("(%p) : returning %p\n", This, *ppContainer);
     return res;
 }
+
 HRESULT WINAPI IDirect3DSurface8Impl_GetDesc(LPDIRECT3DSURFACE8 iface, D3DSURFACE_DESC *pDesc) {
     ICOM_THIS(IDirect3DSurface8Impl,iface);
 
@@ -113,6 +121,7 @@
     memcpy(pDesc, &This->myDesc, sizeof(D3DSURFACE_DESC));
     return D3D_OK;
 }
+
 HRESULT WINAPI IDirect3DSurface8Impl_LockRect(LPDIRECT3DSURFACE8 iface, D3DLOCKED_RECT* pLockedRect, CONST RECT* pRect, DWORD Flags) {
     HRESULT hr;
     ICOM_THIS(IDirect3DSurface8Impl,iface);
@@ -254,6 +263,7 @@
     This->locked = TRUE;
     return D3D_OK;
 }
+
 HRESULT WINAPI IDirect3DSurface8Impl_UnlockRect(LPDIRECT3DSURFACE8 iface) {
     ICOM_THIS(IDirect3DSurface8Impl,iface);
     
@@ -374,6 +384,7 @@
     return D3D_OK;
 }
 
+
 ICOM_VTABLE(IDirect3DSurface8) Direct3DSurface8_Vtbl =
 {
     ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
@@ -389,6 +400,7 @@
     IDirect3DSurface8Impl_LockRect,
     IDirect3DSurface8Impl_UnlockRect,
 };
+
 
 HRESULT WINAPI IDirect3DSurface8Impl_LoadTexture(LPDIRECT3DSURFACE8 iface, GLenum gl_target, GLenum gl_level) {
   ICOM_THIS(IDirect3DSurface8Impl,iface);
Index: volume.c
===================================================================
RCS file: /home/wine/wine/dlls/d3d8/volume.c,v
retrieving revision 1.7
diff -u -r1.7 volume.c
--- volume.c	4 Jun 2003 23:05:46 -0000	1.7
+++ volume.c	3 Jul 2003 21:10:38 -0000
@@ -1,7 +1,8 @@
 /*
  * IDirect3DVolume8 implementation
  *
- * Copyright 2002 Jason Edmeades
+ * Copyright 2002-2003 Jason Edmeades
+ *                     Raphael Junqueira
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -20,6 +21,8 @@
 
 #include "config.h"
 
+#define NONAMELESSUNION
+#define NONAMELESSSTRUCT
 #include "windef.h"
 #include "winbase.h"
 #include "winuser.h"
@@ -31,8 +34,7 @@
 WINE_DEFAULT_DEBUG_CHANNEL(d3d);
 
 /* IDirect3DVolume IUnknown parts follow: */
-HRESULT WINAPI IDirect3DVolume8Impl_QueryInterface(LPDIRECT3DVOLUME8 iface,REFIID riid,LPVOID *ppobj)
-{
+HRESULT WINAPI IDirect3DVolume8Impl_QueryInterface(LPDIRECT3DVOLUME8 iface, REFIID riid, LPVOID* ppobj) {
     ICOM_THIS(IDirect3DVolume8Impl,iface);
 
     if (IsEqualGUID(riid, &IID_IUnknown)
@@ -42,7 +44,7 @@
         return D3D_OK;
     }
 
-    WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj);
+    WARN("(%p)->(%s,%p) not found\n", This, debugstr_guid(riid), ppobj);
     return E_NOINTERFACE;
 }
 
@@ -75,16 +77,19 @@
 
     return D3D_OK;
 }
+
 HRESULT WINAPI IDirect3DVolume8Impl_SetPrivateData(LPDIRECT3DVOLUME8 iface, REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags) {
     ICOM_THIS(IDirect3DVolume8Impl,iface);
     FIXME("(%p) : stub\n", This);    
     return D3D_OK;
 }
+
 HRESULT WINAPI IDirect3DVolume8Impl_GetPrivateData(LPDIRECT3DVOLUME8 iface, REFGUID  refguid, void* pData, DWORD* pSizeOfData) {
     ICOM_THIS(IDirect3DVolume8Impl,iface);
     FIXME("(%p) : stub\n", This);    
     return D3D_OK;
 }
+
 HRESULT WINAPI IDirect3DVolume8Impl_FreePrivateData(LPDIRECT3DVOLUME8 iface, REFGUID refguid) {
     ICOM_THIS(IDirect3DVolume8Impl,iface);
     FIXME("(%p) : stub\n", This);    
@@ -98,12 +103,14 @@
     IUnknown_AddRef(This->Container);
     return D3D_OK;
 }
+
 HRESULT WINAPI IDirect3DVolume8Impl_GetDesc(LPDIRECT3DVOLUME8 iface, D3DVOLUME_DESC* pDesc) {
     ICOM_THIS(IDirect3DVolume8Impl,iface);
     TRACE("(%p) : copying into %p\n", This, pDesc);
     memcpy(pDesc, &This->myDesc, sizeof(D3DVOLUME_DESC));
     return D3D_OK;
 }
+
 HRESULT WINAPI IDirect3DVolume8Impl_LockBox(LPDIRECT3DVOLUME8 iface, D3DLOCKED_BOX* pLockedVolume, CONST D3DBOX* pBox, DWORD Flags) {
     ICOM_THIS(IDirect3DVolume8Impl,iface);
     FIXME("(%p) : pBox=%p stub\n", This, pBox);    
@@ -162,6 +169,7 @@
     TRACE("returning memory@%p rpitch(%d) spitch(%d)\n", pLockedVolume->pBits, pLockedVolume->RowPitch, pLockedVolume->SlicePitch);
     return D3D_OK;
 }
+
 HRESULT WINAPI IDirect3DVolume8Impl_UnlockBox(LPDIRECT3DVOLUME8 iface) {
     ICOM_THIS(IDirect3DVolume8Impl,iface);
     if (FALSE == This->locked) {
@@ -191,6 +199,7 @@
     IDirect3DVolume8Impl_UnlockBox
 };
 
+
 HRESULT WINAPI IDirect3DVolume8Impl_CleanDirtyBox(LPDIRECT3DVOLUME8 iface) {
   ICOM_THIS(IDirect3DVolume8Impl,iface);
   This->Dirty = FALSE;
@@ -210,11 +219,20 @@
 HRESULT WINAPI IDirect3DVolume8Impl_AddDirtyBox(LPDIRECT3DVOLUME8 iface, CONST D3DBOX* pDirtyBox) {
   ICOM_THIS(IDirect3DVolume8Impl,iface);
   This->Dirty = TRUE;
-  This->lockedBox.Left   = min(This->lockedBox.Left,   pDirtyBox->Left);
-  This->lockedBox.Top    = min(This->lockedBox.Top,    pDirtyBox->Top);
-  This->lockedBox.Front  = min(This->lockedBox.Front,  pDirtyBox->Front);
-  This->lockedBox.Right  = max(This->lockedBox.Right,  pDirtyBox->Right);
-  This->lockedBox.Bottom = max(This->lockedBox.Bottom, pDirtyBox->Bottom);
-  This->lockedBox.Back   = max(This->lockedBox.Back,   pDirtyBox->Back);
+   if (NULL != pDirtyBox) {
+    This->lockedBox.Left   = min(This->lockedBox.Left,   pDirtyBox->Left);
+    This->lockedBox.Top    = min(This->lockedBox.Top,    pDirtyBox->Top);
+    This->lockedBox.Front  = min(This->lockedBox.Front,  pDirtyBox->Front);
+    This->lockedBox.Right  = max(This->lockedBox.Right,  pDirtyBox->Right);
+    This->lockedBox.Bottom = max(This->lockedBox.Bottom, pDirtyBox->Bottom);
+    This->lockedBox.Back   = max(This->lockedBox.Back,   pDirtyBox->Back);
+  } else {
+    This->lockedBox.Left   = 0;
+    This->lockedBox.Top    = 0;
+    This->lockedBox.Front  = 0;
+    This->lockedBox.Right  = This->myDesc.Width;
+    This->lockedBox.Bottom = This->myDesc.Height;
+    This->lockedBox.Back   = This->myDesc.Depth;
+  }
   return D3D_OK;
 }

[Index of Archives]     [Gimp for Windows]     [Red Hat]     [Samba]     [Yosemite Camping]     [Graphics Cards]     [Wine Home]

  Powered by Linux