[PATCH] d3dx9: Add stubs for the ID3DXSprite functions

Tony Wasserka tony.wasserka at freenet.de
Sat Feb 23 12:53:12 CST 2008


---
 dlls/d3dx9_36/Makefile.in   |    3 +-
 dlls/d3dx9_36/d3dx9_36.spec |    2 +-
 dlls/d3dx9_36/sprite.c      |  170 +++++++++++++++++++++++++++++++++++++++=
++++
 3 files changed, 173 insertions(+), 2 deletions(-)
 create mode 100755 dlls/d3dx9_36/sprite.c

diff --git a/dlls/d3dx9_36/Makefile.in b/dlls/d3dx9_36/Makefile.in
index 47631a2..11d9815 100644
--- a/dlls/d3dx9_36/Makefile.in
+++ b/dlls/d3dx9_36/Makefile.in
@@ -12,7 +12,8 @@ C_SRCS =3D=20
 =09font.c=20
 =09line.c=20
 =09rtem.c=20
-=09rts.c
+=09rts.c=20
+=09sprite.c
=20
 @MAKE_DLL_RULES@
=20
diff --git a/dlls/d3dx9_36/d3dx9_36.spec b/dlls/d3dx9_36/d3dx9_36.spec
index e91d973..5408f7c 100644
--- a/dlls/d3dx9_36/d3dx9_36.spec
+++ b/dlls/d3dx9_36/d3dx9_36.spec
@@ -88,7 +88,7 @@
 @ stub D3DXCreateSkinInfoFromBlendedMesh
 @ stub D3DXCreateSkinInfoFVF
 @ stub D3DXCreateSphere
-@ stub D3DXCreateSprite
+@ stdcall D3DXCreateSprite(ptr ptr)
 @ stub D3DXCreateTeapot
 @ stub D3DXCreateTextA
 @ stub D3DXCreateTextW
diff --git a/dlls/d3dx9_36/sprite.c b/dlls/d3dx9_36/sprite.c
new file mode 100755
index 0000000..c17ed00
--- /dev/null
+++ b/dlls/d3dx9_36/sprite.c
@@ -0,0 +1,170 @@
+/*
+ * Copyright (C) 2008 Tony Wasserka
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, U=
SA
+ *
+ */
+
+#include "config.h"
+#include "wine/port.h"
+#include "d3dx9_36_private.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(d3dx);
+
+HRESULT WINAPI D3DXCreateSprite(LPDIRECT3DDEVICE9 device, LPD3DXSPRITE *sp=
rite)
+{
+    ID3DXSpriteImpl *object=3DNULL;
+
+    TRACE("stubn");
+    object=3DHeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(ID3DXSpr=
iteImpl));
+    if(object=3D=3DNULL) {
+        *sprite=3D(LPD3DXSPRITE)NULL;
+        return E_OUTOFMEMORY;
+    }
+    object->lpVtbl=3D&D3DXSprite_Vtbl;
+    object->ref=3D1;
+
+    *sprite=3D(LPD3DXSPRITE)object;
+    return S_OK;
+}
+
+static HRESULT WINAPI ID3DXSpriteImpl_QueryInterface(LPD3DXSPRITE iface, R=
EFIID riid, LPVOID *object)
+{
+    ID3DXSpriteImpl *This=3D(ID3DXSpriteImpl*)iface;
+
+    if(IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_ID3DXSpr=
ite)) {
+        TRACE("(%p): QueryInterface from %sn", This, debugstr_guid(riid));
+        IUnknown_AddRef(iface);
+        *object=3DThis;
+        return S_OK;
+    }
+    WARN("(%p)->(%s, %p): not foundn", iface, debugstr_guid(riid), object)=
;
+    object=3DNULL;
+    return E_NOINTERFACE;
+}
+
+static ULONG WINAPI ID3DXSpriteImpl_AddRef(LPD3DXSPRITE iface)
+{
+    ID3DXSpriteImpl *This=3D(ID3DXSpriteImpl*)iface;
+    ULONG ref=3DInterlockedIncrement(&This->ref);
+    TRACE("(%p): AddRef from %dn", This, ref-1);
+    return ref;
+}
+
+static ULONG WINAPI ID3DXSpriteImpl_Release(LPD3DXSPRITE iface)
+{
+    ID3DXSpriteImpl *This=3D(ID3DXSpriteImpl*)iface;
+    ULONG ref=3DInterlockedDecrement(&This->ref);
+    TRACE("(%p): ReleaseRef to %dn", This, ref);
+    return ref;
+}
+
+static HRESULT WINAPI ID3DXSpriteImpl_GetDevice(LPD3DXSPRITE iface, LPDIRE=
CT3DDEVICE9 *device)
+{
+    ID3DXSpriteImpl *This=3D(ID3DXSpriteImpl*)iface;
+    TRACE("(%p): stubn", This);
+    device=3DNULL;
+    return S_OK;
+}
+
+static HRESULT WINAPI ID3DXSpriteImpl_GetTransform(LPD3DXSPRITE iface, D3D=
XMATRIX *transform)
+{
+    ID3DXSpriteImpl *This=3D(ID3DXSpriteImpl*)iface;
+    TRACE("(%p): stubn", This);
+    return S_OK;
+}
+
+static HRESULT WINAPI ID3DXSpriteImpl_SetTransform(LPD3DXSPRITE iface, CON=
ST D3DXMATRIX *transform)
+{
+    ID3DXSpriteImpl *This=3D(ID3DXSpriteImpl*)iface;
+    TRACE("(%p): stubn", This);
+    return S_OK;
+}
+
+static HRESULT WINAPI ID3DXSpriteImpl_SetWorldViewRH(LPD3DXSPRITE iface, C=
ONST D3DXMATRIX *world, CONST D3DXMATRIX *view)
+{
+    ID3DXSpriteImpl *This=3D(ID3DXSpriteImpl*)iface;
+    TRACE("(%p): stubn", This);
+    return S_OK;
+}
+
+static HRESULT WINAPI ID3DXSpriteImpl_SetWorldViewLH(LPD3DXSPRITE iface, C=
ONST D3DXMATRIX *world, CONST D3DXMATRIX *view)
+{
+    ID3DXSpriteImpl *This=3D(ID3DXSpriteImpl*)iface;
+    TRACE("(%p): stubn", This);
+    return S_OK;
+}
+
+static HRESULT WINAPI ID3DXSpriteImpl_Begin(LPD3DXSPRITE iface, DWORD flag=
s)
+{
+    ID3DXSpriteImpl *This=3D(ID3DXSpriteImpl*)iface;
+    TRACE("(%p): stubn", This);
+    return S_OK;
+}
+
+static HRESULT WINAPI ID3DXSpriteImpl_Draw(LPD3DXSPRITE iface, LPDIRECT3DT=
EXTURE9 texture, CONST RECT *rect, CONST D3DXVECTOR3 *center, CONST D3DXVEC=
TOR3 *position, D3DCOLOR color)
+{
+    ID3DXSpriteImpl *This=3D(ID3DXSpriteImpl*)iface;
+    TRACE("(%p): stubn", This);
+    return S_OK;
+}
+
+static HRESULT WINAPI ID3DXSpriteImpl_Flush(LPD3DXSPRITE iface)
+{
+    ID3DXSpriteImpl *This=3D(ID3DXSpriteImpl*)iface;
+    TRACE("(%p): stubn", This);
+    return S_OK;
+}
+
+static HRESULT WINAPI ID3DXSpriteImpl_End(LPD3DXSPRITE iface)
+{
+    ID3DXSpriteImpl *This=3D(ID3DXSpriteImpl*)iface;
+    TRACE("(%p): stubn", This);
+    return S_OK;
+}
+
+static HRESULT WINAPI ID3DXSpriteImpl_OnLostDevice(LPD3DXSPRITE iface)
+{
+    ID3DXSpriteImpl *This=3D(ID3DXSpriteImpl*)iface;
+    TRACE("(%p): stubn", This);
+    return S_OK;
+}
+
+static HRESULT WINAPI ID3DXSpriteImpl_OnResetDevice(LPD3DXSPRITE iface)
+{
+    ID3DXSpriteImpl *This=3D(ID3DXSpriteImpl*)iface;
+    TRACE("(%p): stubn", This);
+    return S_OK;
+}
+
+const ID3DXSpriteVtbl D3DXSprite_Vtbl =3D
+{
+    /*** IUnknown methods ***/
+    ID3DXSpriteImpl_QueryInterface,
+    ID3DXSpriteImpl_AddRef,
+    ID3DXSpriteImpl_Release,
+    /*** ID3DXSprite methods ***/
+    ID3DXSpriteImpl_GetDevice,
+    ID3DXSpriteImpl_GetTransform,
+    ID3DXSpriteImpl_SetTransform,
+    ID3DXSpriteImpl_SetWorldViewRH,
+    ID3DXSpriteImpl_SetWorldViewLH,
+    ID3DXSpriteImpl_Begin,
+    ID3DXSpriteImpl_Draw,
+    ID3DXSpriteImpl_Flush,
+    ID3DXSpriteImpl_End,
+    ID3DXSpriteImpl_OnLostDevice,
+    ID3DXSpriteImpl_OnResetDevice
+};
--=20
1.5.3.7

=0A=0A=0A=0AUnbegrenzter Speicher, Top-Spamschutz, 120 SMS und eigene E-Mai=
lDomain inkl.=0Ahttp://office.freenet.de/dienste/emailoffice/produktuebersi=
cht/power/mail/index.html=0A



More information about the wine-patches mailing list