Author: gbrunmar
Date: Tue Sep 23 12:01:40 2008
New Revision: 36429
URL:
http://svn.reactos.org/svn/reactos?rev=36429&view=rev
Log:
D3D9:
* More init values when creating a texture
Added:
trunk/reactos/dll/directx/d3d9/d3d9_basetexture.h (with props)
trunk/reactos/dll/directx/d3d9/d3d9_resource.c (with props)
trunk/reactos/dll/directx/d3d9/d3d9_texture.c (with props)
Modified:
trunk/reactos/dll/directx/d3d9/d3d9.rbuild
trunk/reactos/dll/directx/d3d9/d3d9_device.c
trunk/reactos/dll/directx/d3d9/d3d9_mipmap.c
trunk/reactos/dll/directx/d3d9/d3d9_mipmap.h
trunk/reactos/dll/directx/d3d9/d3d9_resource.h
trunk/reactos/dll/directx/d3d9/d3d9_texture.h
Modified: trunk/reactos/dll/directx/d3d9/d3d9.rbuild
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/d3d9/d3d9.rbui…
==============================================================================
--- trunk/reactos/dll/directx/d3d9/d3d9.rbuild [iso-8859-1] (original)
+++ trunk/reactos/dll/directx/d3d9/d3d9.rbuild [iso-8859-1] Tue Sep 23 12:01:40 2008
@@ -23,7 +23,9 @@
<file>d3d9_impl.c</file>
<file>d3d9_mipmap.c</file>
<file>d3d9_puredevice.c</file>
+ <file>d3d9_resource.c</file>
<file>d3d9_swapchain.c</file>
+ <file>d3d9_texture.c</file>
<file>adapter.c</file>
<file>device.c</file>
<file>format.c</file>
Added: trunk/reactos/dll/directx/d3d9/d3d9_basetexture.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/d3d9/d3d9_base…
==============================================================================
--- trunk/reactos/dll/directx/d3d9/d3d9_basetexture.h (added)
+++ trunk/reactos/dll/directx/d3d9/d3d9_basetexture.h [iso-8859-1] Tue Sep 23 12:01:40
2008
@@ -1,0 +1,43 @@
+/*
+ * COPYRIGHT: See COPYING in the top level directory
+ * PROJECT: ReactOS ReactX
+ * FILE: dll/directx/d3d9/d3d9_basetexture.h
+ * PURPOSE: Work-around for gcc warning, DO NOT USE FOR ANYTHING ELSE!!!
+ * PROGRAMERS: Gregor Gullwi <gbrunmar (dot) ros (at) gmail (dot) com>
+ */
+#ifndef _D3D9_BASETEXTURE_H_
+#define _D3D9_BASETEXTURE_H_
+
+// Work-around for:
+// "warning: 'FilterType' is narrower than values of its type"
+#if __GNUC__ >=3
+ #pragma GCC system_header
+#endif
+
+struct IDirect3DBaseTexture9Vtbl;
+
+#pragma pack(push)
+#pragma pack(1)
+typedef struct _Direct3DBaseTexture9_INT
+{
+/* 0x0000 */ IDirect3DBaseTexture9Vtbl* lpVtbl;
+/* 0x0004 */ DWORD dwUnknown04;
+/* 0x0008 */ Direct3DResource9_INT BaseResource;
+/* 0x004c */ DWORD dwUnknown4c;
+/* 0x0050 */ D3DFORMAT Format;
+/* 0x0054 */ DWORD Usage;
+/* 0x0058 */ WORD MipMapLevels;
+ union {
+/* 0x005a */ D3DTEXTUREFILTERTYPE FilterType : 8;
+ struct
+ {
+/* 0x005a */ DWORD dwFilterType : 8;
+/* 0x005b */ BOOL bIsAutoGenMipMap : 8;
+/* 0x005c */ DWORD MipMapLevels2 : 16;
+ };
+ };
+/* 0x005e */ WORD wPaletteIndex;
+} Direct3DBaseTexture9_INT;
+#pragma pack(pop)
+
+#endif
Propchange: trunk/reactos/dll/directx/d3d9/d3d9_basetexture.h
------------------------------------------------------------------------------
svn:eol-style = native
Modified: trunk/reactos/dll/directx/d3d9/d3d9_device.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/d3d9/d3d9_devi…
==============================================================================
--- trunk/reactos/dll/directx/d3d9/d3d9_device.c [iso-8859-1] (original)
+++ trunk/reactos/dll/directx/d3d9/d3d9_device.c [iso-8859-1] Tue Sep 23 12:01:40 2008
@@ -510,7 +510,7 @@
if (D3DFMT_UNKNOWN == Format)
return InvalidCall(This, "Invalid Format parameter specified, D3DFMT_UNKNOWN
is not a valid Format");
- if (NULL == pSharedHandle)
+ if (NULL != pSharedHandle)
{
UNIMPLEMENTED;
return InvalidCall(This, "Invalid pSharedHandle parameter specified, only
NULL is supported at the moment");
Modified: trunk/reactos/dll/directx/d3d9/d3d9_mipmap.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/d3d9/d3d9_mipm…
==============================================================================
--- trunk/reactos/dll/directx/d3d9/d3d9_mipmap.c [iso-8859-1] (original)
+++ trunk/reactos/dll/directx/d3d9/d3d9_mipmap.c [iso-8859-1] Tue Sep 23 12:01:40 2008
@@ -246,13 +246,16 @@
return E_OUTOFMEMORY;
}
+ InitDirect3DBaseTexture9(&pThisTexture->BaseTexture,
(IDirect3DBaseTexture9Vtbl*)&D3D9MipMap_Vtbl, Usage, Levels, Format, Pool, pDevice,
RT_EXTERNAL);
+
pThisTexture->lpVtbl = &D3D9MipMap_Vtbl;
+ pThisTexture->Usage = Usage;
pThisTexture->dwWidth = Width;
pThisTexture->dwHeight = Height;
pThisTexture->Format = Format;
- *ppTexture = (IDirect3DTexture9*)pThisTexture->lpVtbl;
+ *ppTexture = (IDirect3DTexture9*)&pThisTexture->lpVtbl;
UNIMPLEMENTED;
return D3D_OK;
Modified: trunk/reactos/dll/directx/d3d9/d3d9_mipmap.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/d3d9/d3d9_mipm…
==============================================================================
--- trunk/reactos/dll/directx/d3d9/d3d9_mipmap.h [iso-8859-1] (original)
+++ trunk/reactos/dll/directx/d3d9/d3d9_mipmap.h [iso-8859-1] Tue Sep 23 12:01:40 2008
@@ -19,7 +19,7 @@
/* 0x0064 */ LPDWORD dwUnknown64;
/* 0x0068 */ D3DFORMAT Format;
/* 0x006c */ DWORD dwUnknown6c;
-/* 0x0070 */ DWORD dwUnknown70;
+/* 0x0070 */ DWORD Usage;
/* 0x0074 */ DWORD dwUnknown74;
/* 0x0078 */ DWORD dwUnknown78;
/* 0x007c */ DWORD dwUnknown7c;
Added: trunk/reactos/dll/directx/d3d9/d3d9_resource.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/d3d9/d3d9_reso…
==============================================================================
--- trunk/reactos/dll/directx/d3d9/d3d9_resource.c (added)
+++ trunk/reactos/dll/directx/d3d9/d3d9_resource.c [iso-8859-1] Tue Sep 23 12:01:40 2008
@@ -1,0 +1,16 @@
+/*
+ * COPYRIGHT: See COPYING in the top level directory
+ * PROJECT: ReactOS ReactX
+ * FILE: dll/directx/d3d9/d3d9_resource.c
+ * PURPOSE: d3d9.dll internal resource functions
+ * PROGRAMERS: Gregor Gullwi <gbrunmar (dot) ros (at) gmail (dot) com>
+ */
+#include "d3d9_resource.h"
+#include "d3d9_device.h"
+
+void InitDirect3DResource9(Direct3DResource9_INT* pResource, D3DPOOL Pool,
LPDIRECT3DDEVICE9_INT pBaseDevice, enum REF_TYPE RefType)
+{
+ InitD3D9BaseObject(&pResource->BaseObject, RefType,
(IUnknown*)&pBaseDevice->lpVtbl);
+
+ pResource->Pool = Pool;
+}
Propchange: trunk/reactos/dll/directx/d3d9/d3d9_resource.c
------------------------------------------------------------------------------
svn:eol-style = native
Modified: trunk/reactos/dll/directx/d3d9/d3d9_resource.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/d3d9/d3d9_reso…
==============================================================================
--- trunk/reactos/dll/directx/d3d9/d3d9_resource.h [iso-8859-1] (original)
+++ trunk/reactos/dll/directx/d3d9/d3d9_resource.h [iso-8859-1] Tue Sep 23 12:01:40 2008
@@ -1,7 +1,7 @@
/*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS ReactX
- * FILE: dll/directx/d3d9/d3d9_mipmap.h
+ * FILE: dll/directx/d3d9/d3d9_resource.h
* PURPOSE: d3d9.dll internal resource structures
* PROGRAMERS: Gregor Gullwi <gbrunmar (dot) ros (at) gmail (dot) com>
*/
@@ -20,10 +20,10 @@
/* 0x0030 */ DWORD dwUnknown30;
/* 0x0034 */ DWORD dwUnknown34;
/* 0x0038 */ D3DPOOL Pool;
-/* 0x003c */ DWORD dwUnknown3c;
+/* 0x003c */ LPDWORD dwUnknown3c;
/* 0x0040 */ LPDWORD dwUnknown40;
} Direct3DResource9_INT;
-
+void InitDirect3DResource9(Direct3DResource9_INT* pResource, D3DPOOL Pool, struct
_Direct3DDevice9_INT* pDevice, enum REF_TYPE RefType);
#endif // _D3D9_RESOURCE_H_
Added: trunk/reactos/dll/directx/d3d9/d3d9_texture.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/d3d9/d3d9_text…
==============================================================================
--- trunk/reactos/dll/directx/d3d9/d3d9_texture.c (added)
+++ trunk/reactos/dll/directx/d3d9/d3d9_texture.c [iso-8859-1] Tue Sep 23 12:01:40 2008
@@ -1,0 +1,30 @@
+/*
+ * COPYRIGHT: See COPYING in the top level directory
+ * PROJECT: ReactOS ReactX
+ * FILE: dll/directx/d3d9/d3d9_texture.c
+ * PURPOSE: d3d9.dll internal texture surface functions
+ * PROGRAMERS: Gregor Gullwi <gbrunmar (dot) ros (at) gmail (dot) com>
+ */
+#include "d3d9_texture.h"
+
+void InitDirect3DBaseTexture9(Direct3DBaseTexture9_INT* pBaseTexture,
+ IDirect3DBaseTexture9Vtbl* pVtbl,
+ DWORD Usage,
+ UINT Levels,
+ D3DFORMAT Format,
+ D3DPOOL Pool,
+ struct _Direct3DDevice9_INT* pDevice,
+ enum REF_TYPE RefType)
+{
+ InitDirect3DResource9(&pBaseTexture->BaseResource, Pool, pDevice, RefType);
+
+ pBaseTexture->lpVtbl = pVtbl;
+ pBaseTexture->Format = Format;
+ pBaseTexture->wPaletteIndex = 0xFFFF;
+ pBaseTexture->Usage = Usage;
+ pBaseTexture->MipMapLevels =
+ pBaseTexture->MipMapLevels2 = (WORD)Levels;
+
+ pBaseTexture->FilterType = D3DTEXF_LINEAR;
+ pBaseTexture->bIsAutoGenMipMap = (Usage & D3DUSAGE_AUTOGENMIPMAP) != 0;
+}
Propchange: trunk/reactos/dll/directx/d3d9/d3d9_texture.c
------------------------------------------------------------------------------
svn:eol-style = native
Modified: trunk/reactos/dll/directx/d3d9/d3d9_texture.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/d3d9/d3d9_text…
==============================================================================
--- trunk/reactos/dll/directx/d3d9/d3d9_texture.h [iso-8859-1] (original)
+++ trunk/reactos/dll/directx/d3d9/d3d9_texture.h [iso-8859-1] Tue Sep 23 12:01:40 2008
@@ -9,19 +9,17 @@
#define _D3D9_TEXTURE_H_
#include "d3d9_resource.h"
+#include "d3d9_basetexture.h"
-typedef struct _Direct3DBaseTexture9_INT
-{
-/* 0x0000 */ struct IDirect3DBaseTexture9Vtbl* lpVtbl;
-/* 0x0004 */ DWORD dwUnknown04;
-/* 0x0008 */ Direct3DResource9_INT BaseResource;
-/* 0x004c */ DWORD dwUnknown4c;
-/* 0x0050 */ DWORD dwUnknown50;
-/* 0x0054 */ DWORD Usage;
-/* 0x0058 */ WORD MipMapLevels;
-/* 0x005a */ WORD dUnknown5a;
-/* 0x005c */ WORD MipMapLevels2;
-/* 0x005e */ WORD dUnknown5e;
-} Direct3DBaseTexture9_INT;
+struct IDirect3DBaseTexture9Vtbl;
+
+void InitDirect3DBaseTexture9(Direct3DBaseTexture9_INT* pBaseTexture,
+ IDirect3DBaseTexture9Vtbl* pVtbl,
+ DWORD Usage,
+ UINT Levels,
+ D3DFORMAT Format,
+ D3DPOOL Pool,
+ struct _Direct3DDevice9_INT* pDevice,
+ enum REF_TYPE RefType);
#endif // _D3D9_TEXTURE_H_