[PATCH 4/5] d3dx9: Get rid of the ID3DXLineImpl typedef.

Henri Verbeet hverbeet at codeweavers.com
Tue Sep 24 02:48:47 CDT 2013


---
 dlls/d3dx9_36/line.c |  663 ++++++++++++++++++++++++--------------------------
 1 file changed, 313 insertions(+), 350 deletions(-)
 rewrite dlls/d3dx9_36/line.c (72%)

diff --git a/dlls/d3dx9_36/line.c b/dlls/d3dx9_36/line.c
dissimilarity index 72%
index 200b6e6..0b3e88f 100644
--- a/dlls/d3dx9_36/line.c
+++ b/dlls/d3dx9_36/line.c
@@ -1,350 +1,313 @@
-/*
- * Copyright 2010 Christian Costa
- *
- * 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, USA
- *
- */
-
-#include "wine/debug.h"
-#include "d3dx9_36_private.h"
-
-WINE_DEFAULT_DEBUG_CHANNEL(d3dx);
-
-typedef struct ID3DXLineImpl {
-    ID3DXLine ID3DXLine_iface;
-    LONG ref;
-
-    IDirect3DDevice9 *device;
-    IDirect3DStateBlock9 *state;
-} ID3DXLineImpl;
-
-static inline ID3DXLineImpl *impl_from_ID3DXLine(ID3DXLine *iface)
-{
-    return CONTAINING_RECORD(iface, ID3DXLineImpl, ID3DXLine_iface);
-}
-
-/*** IUnknown methods ***/
-static HRESULT WINAPI ID3DXLineImpl_QueryInterface(ID3DXLine *iface, REFIID riid, void **out)
-{
-    TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out);
-
-    if (IsEqualGUID(riid, &IID_IUnknown) ||
-        IsEqualGUID(riid, &IID_ID3DXLine))
-    {
-        ID3DXLine_AddRef(iface);
-        *out = iface;
-        return S_OK;
-    }
-
-    ERR("Interface %s not found\n", debugstr_guid(riid));
-
-    return E_NOINTERFACE;
-}
-
-static ULONG WINAPI ID3DXLineImpl_AddRef(ID3DXLine* iface)
-{
-    ID3DXLineImpl *This = impl_from_ID3DXLine(iface);
-
-    TRACE("(%p)->(): AddRef from %u\n", This, This->ref);
-
-    return InterlockedIncrement(&This->ref);
-}
-
-static ULONG WINAPI ID3DXLineImpl_Release(ID3DXLine* iface)
-{
-    ID3DXLineImpl *This = impl_from_ID3DXLine(iface);
-    ULONG ref = InterlockedDecrement(&This->ref);
-
-    TRACE("(%p)->(): Release from %u\n", This, ref + 1);
-
-    if (!ref)
-    {
-        IDirect3DDevice9_Release(This->device);
-        HeapFree(GetProcessHeap(), 0, This);
-    }
-
-    return ref;
-}
-
-/*** ID3DXLine methods ***/
-static HRESULT WINAPI ID3DXLineImpl_GetDevice(struct ID3DXLine *iface, struct IDirect3DDevice9 **device)
-{
-    ID3DXLineImpl *This = impl_from_ID3DXLine(iface);
-
-    TRACE ("(%p)->(%p)\n", This, device);
-
-    if (device == NULL) return D3DERR_INVALIDCALL;
-
-    *device = This->device;
-    IDirect3DDevice9_AddRef(This->device);
-
-    return D3D_OK;
-}
-
-static HRESULT WINAPI ID3DXLineImpl_Begin(ID3DXLine* iface)
-{
-    ID3DXLineImpl *This = impl_from_ID3DXLine(iface);
-
-    HRESULT hr;
-    D3DXMATRIX identity, projection;
-    D3DVIEWPORT9 vp;
-
-    TRACE ("(%p)->()\n", This);
-
-    if (This->state != NULL) /* We already began. Return error. */
-        return D3DERR_INVALIDCALL;
-
-    hr = IDirect3DDevice9_CreateStateBlock(This->device, D3DSBT_ALL, &This->state);
-    if (FAILED(hr)) return D3DXERR_INVALIDDATA;
-
-    hr = IDirect3DDevice9_GetViewport(This->device, &vp);
-    if (FAILED(hr)) goto failed;
-
-    D3DXMatrixIdentity(&identity);
-    D3DXMatrixOrthoOffCenterLH(&projection,
-                               0.0, vp.Width, /* Min and max x */
-                               vp.Height, 0.0, /* Min and max y. Screen y is on top so this is inverted */
-                               0.0, 1.0); /* Min and max z */
-
-    hr = IDirect3DDevice9_SetTransform(This->device, D3DTS_WORLD, &identity);
-    if (FAILED(hr)) goto failed;
-
-    hr = IDirect3DDevice9_SetTransform(This->device, D3DTS_VIEW, &identity);
-    if (FAILED(hr)) goto failed;
-
-    hr = IDirect3DDevice9_SetTransform(This->device, D3DTS_PROJECTION, &projection);
-    if (FAILED(hr)) goto failed;
-
-    /* Windows sets similar states so we do the same */
-
-    hr = IDirect3DDevice9_SetRenderState(This->device, D3DRS_LIGHTING, FALSE);
-    if (FAILED(hr)) goto failed;
-
-    hr = IDirect3DDevice9_SetRenderState(This->device, D3DRS_FOGENABLE, FALSE);
-    if (FAILED(hr)) goto failed;
-
-    hr = IDirect3DDevice9_SetRenderState(This->device, D3DRS_SHADEMODE, D3DSHADE_FLAT);
-    if (FAILED(hr)) goto failed;
-
-    hr = IDirect3DDevice9_SetRenderState(This->device, D3DRS_ALPHABLENDENABLE, TRUE);
-    if (FAILED(hr)) goto failed;
-
-    hr = IDirect3DDevice9_SetRenderState(This->device, D3DRS_SRCBLEND, D3DBLEND_SRCALPHA);
-    if (FAILED(hr)) goto failed;
-
-    hr = IDirect3DDevice9_SetRenderState(This->device, D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA);
-    if (FAILED(hr)) goto failed;
-
-    return D3D_OK;
-failed:
-    IDirect3DStateBlock9_Apply(This->state);
-    IDirect3DStateBlock9_Release(This->state);
-    This->state = NULL;
-    return D3DXERR_INVALIDDATA;
-}
-
-static HRESULT WINAPI ID3DXLineImpl_Draw(ID3DXLine *iface, const D3DXVECTOR2 *vertex_list,
-        DWORD vertex_list_count, D3DCOLOR color)
-{
-    FIXME("iface %p, vertex_list %p, vertex_list_count %u, color 0x%08x stub!\n",
-            iface, vertex_list, vertex_list_count, color);
-
-    return E_NOTIMPL;
-}
-
-static HRESULT WINAPI ID3DXLineImpl_DrawTransform(ID3DXLine *iface, const D3DXVECTOR3 *vertex_list,
-        DWORD vertex_list_count, const D3DXMATRIX *transform, D3DCOLOR color)
-{
-    FIXME("iface %p, vertex_list %p, vertex_list_count %u, transform %p, color 0x%08x stub!\n",
-            iface, vertex_list, vertex_list_count, transform, color);
-
-    return E_NOTIMPL;
-}
-
-static HRESULT WINAPI ID3DXLineImpl_SetPattern(ID3DXLine* iface, DWORD pattern)
-{
-    ID3DXLineImpl *This = impl_from_ID3DXLine(iface);
-
-    FIXME("(%p)->(%#x): stub\n", This, pattern);
-
-    return E_NOTIMPL;
-}
-
-static DWORD WINAPI ID3DXLineImpl_GetPattern(ID3DXLine* iface)
-{
-    ID3DXLineImpl *This = impl_from_ID3DXLine(iface);
-
-    FIXME("(%p)->(): stub\n", This);
-
-    return 0xFFFFFFFF;
-}
-
-static HRESULT WINAPI ID3DXLineImpl_SetPatternScale(ID3DXLine* iface, FLOAT scale)
-{
-    ID3DXLineImpl *This = impl_from_ID3DXLine(iface);
-
-    FIXME("(%p)->(%f): stub\n", This, scale);
-
-    return E_NOTIMPL;
-}
-
-static FLOAT WINAPI ID3DXLineImpl_GetPatternScale(ID3DXLine* iface)
-{
-    ID3DXLineImpl *This = impl_from_ID3DXLine(iface);
-
-    FIXME("(%p)->(): stub\n", This);
-
-    return 1.0f;
-}
-
-static HRESULT WINAPI ID3DXLineImpl_SetWidth(ID3DXLine* iface, FLOAT width)
-{
-    ID3DXLineImpl *This = impl_from_ID3DXLine(iface);
-
-    FIXME("(%p)->(%f): stub\n", This, width);
-
-    return E_NOTIMPL;
-}
-
-static FLOAT WINAPI ID3DXLineImpl_GetWidth(ID3DXLine* iface)
-{
-    ID3DXLineImpl *This = impl_from_ID3DXLine(iface);
-
-    FIXME("(%p)->(): stub\n", This);
-
-    return 1.0f;
-}
-
-static HRESULT WINAPI ID3DXLineImpl_SetAntialias(ID3DXLine* iface, BOOL antialias)
-{
-    ID3DXLineImpl *This = impl_from_ID3DXLine(iface);
-
-    FIXME("(%p)->(%u): stub\n", This, antialias);
-
-    return E_NOTIMPL;
-}
-
-static BOOL WINAPI ID3DXLineImpl_GetAntialias(ID3DXLine* iface)
-{
-    ID3DXLineImpl *This = impl_from_ID3DXLine(iface);
-
-    FIXME("(%p)->(): stub\n", This);
-
-    return FALSE;
-}
-
-static HRESULT WINAPI ID3DXLineImpl_SetGLLines(ID3DXLine* iface, BOOL gl_lines)
-{
-    ID3DXLineImpl *This = impl_from_ID3DXLine(iface);
-
-    FIXME("(%p)->(%u): stub\n", This, gl_lines);
-
-    return E_NOTIMPL;
-}
-
-static BOOL WINAPI ID3DXLineImpl_GetGLLines(ID3DXLine* iface)
-{
-    ID3DXLineImpl *This = impl_from_ID3DXLine(iface);
-
-    FIXME("(%p)->(): stub\n", This);
-
-    return FALSE;
-}
-
-static HRESULT WINAPI ID3DXLineImpl_End(ID3DXLine* iface)
-{
-    ID3DXLineImpl *This = impl_from_ID3DXLine(iface);
-
-    HRESULT hr;
-
-    TRACE ("(%p)->()\n", This);
-
-    if (This->state == NULL) /* We haven't begun yet. */
-        return D3DERR_INVALIDCALL;
-
-    hr = IDirect3DStateBlock9_Apply(This->state);
-    IDirect3DStateBlock9_Release(This->state);
-    This->state = NULL;
-
-    if (FAILED(hr)) return D3DXERR_INVALIDDATA;
-    else return D3D_OK;
-}
-
-static HRESULT WINAPI ID3DXLineImpl_OnLostDevice(ID3DXLine* iface)
-{
-    ID3DXLineImpl *This = impl_from_ID3DXLine(iface);
-
-    FIXME("(%p)->(): stub\n", This);
-
-    return E_NOTIMPL;
-}
-static HRESULT WINAPI ID3DXLineImpl_OnResetDevice(ID3DXLine* iface)
-{
-    ID3DXLineImpl *This = impl_from_ID3DXLine(iface);
-
-    FIXME("(%p)->(): stub\n", This);
-
-    return E_NOTIMPL;
-}
-
-static const struct ID3DXLineVtbl ID3DXLine_Vtbl =
-{
-    /*** IUnknown methods ***/
-    ID3DXLineImpl_QueryInterface,
-    ID3DXLineImpl_AddRef,
-    ID3DXLineImpl_Release,
-    /*** ID3DXLine methods ***/
-    ID3DXLineImpl_GetDevice,
-    ID3DXLineImpl_Begin,
-    ID3DXLineImpl_Draw,
-    ID3DXLineImpl_DrawTransform,
-    ID3DXLineImpl_SetPattern,
-    ID3DXLineImpl_GetPattern,
-    ID3DXLineImpl_SetPatternScale,
-    ID3DXLineImpl_GetPatternScale,
-    ID3DXLineImpl_SetWidth,
-    ID3DXLineImpl_GetWidth,
-    ID3DXLineImpl_SetAntialias,
-    ID3DXLineImpl_GetAntialias,
-    ID3DXLineImpl_SetGLLines,
-    ID3DXLineImpl_GetGLLines,
-    ID3DXLineImpl_End,
-    ID3DXLineImpl_OnLostDevice,
-    ID3DXLineImpl_OnResetDevice
-};
-
-HRESULT WINAPI D3DXCreateLine(struct IDirect3DDevice9 *device, struct ID3DXLine **line)
-{
-    ID3DXLineImpl* object;
-
-    TRACE("(%p, %p)\n", device, line);
-
-    if (!device || !line)
-        return D3DERR_INVALIDCALL;
-
-    object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(ID3DXLineImpl));
-    if (!object)
-        return E_OUTOFMEMORY;
-
-    object->ID3DXLine_iface.lpVtbl = &ID3DXLine_Vtbl;
-    object->ref = 1;
-    object->device = device;
-    object->state = NULL; /* We only initialize it on Begin */
-    IDirect3DDevice9_AddRef(device);
-
-    *line = &object->ID3DXLine_iface;
-
-    return D3D_OK;
-}
+/*
+ * Copyright 2010 Christian Costa
+ *
+ * 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, USA
+ *
+ */
+
+#include "wine/debug.h"
+#include "d3dx9_36_private.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(d3dx);
+
+struct d3dx9_line
+{
+    ID3DXLine ID3DXLine_iface;
+    LONG ref;
+
+    IDirect3DDevice9 *device;
+    IDirect3DStateBlock9 *state;
+};
+
+static inline struct d3dx9_line *impl_from_ID3DXLine(ID3DXLine *iface)
+{
+    return CONTAINING_RECORD(iface, struct d3dx9_line, ID3DXLine_iface);
+}
+
+static HRESULT WINAPI d3dx9_line_QueryInterface(ID3DXLine *iface, REFIID riid, void **out)
+{
+    TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out);
+
+    if (IsEqualGUID(riid, &IID_ID3DXLine)
+            || IsEqualGUID(riid, &IID_IUnknown))
+    {
+        ID3DXLine_AddRef(iface);
+        *out = iface;
+        return S_OK;
+    }
+
+    WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid));
+
+    *out = NULL;
+    return E_NOINTERFACE;
+}
+
+static ULONG WINAPI d3dx9_line_AddRef(ID3DXLine *iface)
+{
+    struct d3dx9_line *line = impl_from_ID3DXLine(iface);
+    ULONG refcount = InterlockedIncrement(&line->ref);
+
+    TRACE("%p increasing refcount to %u.\n", line, refcount);
+
+    return refcount;
+}
+
+static ULONG WINAPI d3dx9_line_Release(ID3DXLine *iface)
+{
+    struct d3dx9_line *line = impl_from_ID3DXLine(iface);
+    ULONG refcount = InterlockedDecrement(&line->ref);
+
+    TRACE("%p decreasing refcount to %u.\n", line, refcount);
+
+    if (!refcount)
+    {
+        IDirect3DDevice9_Release(line->device);
+        HeapFree(GetProcessHeap(), 0, line);
+    }
+
+    return refcount;
+}
+
+static HRESULT WINAPI d3dx9_line_GetDevice(struct ID3DXLine *iface, struct IDirect3DDevice9 **device)
+{
+    struct d3dx9_line *line = impl_from_ID3DXLine(iface);
+
+    TRACE("iface %p, device %p.\n", iface, line);
+
+    if (!device)
+        return D3DERR_INVALIDCALL;
+
+    *device = line->device;
+    IDirect3DDevice9_AddRef(line->device);
+
+    return D3D_OK;
+}
+
+static HRESULT WINAPI d3dx9_line_Begin(ID3DXLine *iface)
+{
+    struct d3dx9_line *line = impl_from_ID3DXLine(iface);
+    D3DXMATRIX identity, projection;
+    D3DVIEWPORT9 vp;
+
+    TRACE("iface %p.\n", iface);
+
+    if (line->state)
+        return D3DERR_INVALIDCALL;
+
+    if (FAILED(IDirect3DDevice9_CreateStateBlock(line->device, D3DSBT_ALL, &line->state)))
+        return D3DXERR_INVALIDDATA;
+
+    if (FAILED(IDirect3DDevice9_GetViewport(line->device, &vp)))
+        goto failed;
+
+    D3DXMatrixIdentity(&identity);
+    D3DXMatrixOrthoOffCenterLH(&projection, 0.0, vp.Width, vp.Height, 0.0, 0.0, 1.0);
+
+    if (FAILED(IDirect3DDevice9_SetTransform(line->device, D3DTS_WORLD, &identity)))
+        goto failed;
+    if (FAILED(IDirect3DDevice9_SetTransform(line->device, D3DTS_VIEW, &identity)))
+        goto failed;
+    if (FAILED(IDirect3DDevice9_SetTransform(line->device, D3DTS_PROJECTION, &projection)))
+        goto failed;
+
+    if (FAILED(IDirect3DDevice9_SetRenderState(line->device, D3DRS_LIGHTING, FALSE)))
+        goto failed;
+    if (FAILED(IDirect3DDevice9_SetRenderState(line->device, D3DRS_FOGENABLE, FALSE)))
+        goto failed;
+    if (FAILED(IDirect3DDevice9_SetRenderState(line->device, D3DRS_SHADEMODE, D3DSHADE_FLAT)))
+        goto failed;
+    if (FAILED(IDirect3DDevice9_SetRenderState(line->device, D3DRS_ALPHABLENDENABLE, TRUE)))
+        goto failed;
+    if (FAILED(IDirect3DDevice9_SetRenderState(line->device, D3DRS_SRCBLEND, D3DBLEND_SRCALPHA)))
+        goto failed;
+    if (FAILED(IDirect3DDevice9_SetRenderState(line->device, D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA)))
+        goto failed;
+
+    return D3D_OK;
+
+failed:
+    IDirect3DStateBlock9_Apply(line->state);
+    IDirect3DStateBlock9_Release(line->state);
+    line->state = NULL;
+    return D3DXERR_INVALIDDATA;
+}
+
+static HRESULT WINAPI d3dx9_line_Draw(ID3DXLine *iface, const D3DXVECTOR2 *vertex_list,
+        DWORD vertex_list_count, D3DCOLOR color)
+{
+    FIXME("iface %p, vertex_list %p, vertex_list_count %u, color 0x%08x stub!\n",
+            iface, vertex_list, vertex_list_count, color);
+
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3dx9_line_DrawTransform(ID3DXLine *iface, const D3DXVECTOR3 *vertex_list,
+        DWORD vertex_list_count, const D3DXMATRIX *transform, D3DCOLOR color)
+{
+    FIXME("iface %p, vertex_list %p, vertex_list_count %u, transform %p, color 0x%08x stub!\n",
+            iface, vertex_list, vertex_list_count, transform, color);
+
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3dx9_line_SetPattern(ID3DXLine *iface, DWORD pattern)
+{
+    FIXME("iface %p, pattern 0x%08x stub!\n", iface, pattern);
+
+    return E_NOTIMPL;
+}
+
+static DWORD WINAPI d3dx9_line_GetPattern(ID3DXLine *iface)
+{
+    FIXME("iface %p stub!\n", iface);
+
+    return 0xffffffff;
+}
+
+static HRESULT WINAPI d3dx9_line_SetPatternScale(ID3DXLine *iface, float scale)
+{
+    FIXME("iface %p, scale %.8e stub!\n", iface, scale);
+
+    return E_NOTIMPL;
+}
+
+static float WINAPI d3dx9_line_GetPatternScale(ID3DXLine *iface)
+{
+    FIXME("iface %p stub!\n", iface);
+
+    return 1.0f;
+}
+
+static HRESULT WINAPI d3dx9_line_SetWidth(ID3DXLine *iface, float width)
+{
+    FIXME("iface %p, width %.8e stub!\n", iface, width);
+
+    return E_NOTIMPL;
+}
+
+static float WINAPI d3dx9_line_GetWidth(ID3DXLine *iface)
+{
+    FIXME("iface %p stub!\n", iface);
+
+    return 1.0f;
+}
+
+static HRESULT WINAPI d3dx9_line_SetAntialias(ID3DXLine *iface, BOOL antialias)
+{
+    FIXME("iface %p, antialias %#x stub!\n", iface, antialias);
+
+    return E_NOTIMPL;
+}
+
+static BOOL WINAPI d3dx9_line_GetAntialias(ID3DXLine *iface)
+{
+    FIXME("iface %p stub!\n", iface);
+
+    return FALSE;
+}
+
+static HRESULT WINAPI d3dx9_line_SetGLLines(ID3DXLine *iface, BOOL gl_lines)
+{
+    FIXME("iface %p, gl_lines %#x stub!\n", iface, gl_lines);
+
+    return E_NOTIMPL;
+}
+
+static BOOL WINAPI d3dx9_line_GetGLLines(ID3DXLine *iface)
+{
+    FIXME("iface %p stub!\n", iface);
+
+    return FALSE;
+}
+
+static HRESULT WINAPI d3dx9_line_End(ID3DXLine *iface)
+{
+    struct d3dx9_line *line = impl_from_ID3DXLine(iface);
+
+    HRESULT hr;
+
+    TRACE("iface %p.\n", iface);
+
+    if (!line->state)
+        return D3DERR_INVALIDCALL;
+
+    hr = IDirect3DStateBlock9_Apply(line->state);
+    IDirect3DStateBlock9_Release(line->state);
+    line->state = NULL;
+
+    if (FAILED(hr))
+        return D3DXERR_INVALIDDATA;
+
+    return D3D_OK;
+}
+
+static HRESULT WINAPI d3dx9_line_OnLostDevice(ID3DXLine *iface)
+{
+    FIXME("iface %p stub!\n", iface);
+
+    return E_NOTIMPL;
+}
+static HRESULT WINAPI d3dx9_line_OnResetDevice(ID3DXLine *iface)
+{
+    FIXME("iface %p stub!\n", iface);
+
+    return E_NOTIMPL;
+}
+
+static const struct ID3DXLineVtbl d3dx9_line_vtbl =
+{
+    d3dx9_line_QueryInterface,
+    d3dx9_line_AddRef,
+    d3dx9_line_Release,
+    d3dx9_line_GetDevice,
+    d3dx9_line_Begin,
+    d3dx9_line_Draw,
+    d3dx9_line_DrawTransform,
+    d3dx9_line_SetPattern,
+    d3dx9_line_GetPattern,
+    d3dx9_line_SetPatternScale,
+    d3dx9_line_GetPatternScale,
+    d3dx9_line_SetWidth,
+    d3dx9_line_GetWidth,
+    d3dx9_line_SetAntialias,
+    d3dx9_line_GetAntialias,
+    d3dx9_line_SetGLLines,
+    d3dx9_line_GetGLLines,
+    d3dx9_line_End,
+    d3dx9_line_OnLostDevice,
+    d3dx9_line_OnResetDevice,
+};
+
+HRESULT WINAPI D3DXCreateLine(struct IDirect3DDevice9 *device, struct ID3DXLine **line)
+{
+    struct d3dx9_line *object;
+
+    TRACE("device %p, line %p.\n", device, line);
+
+    if (!device || !line)
+        return D3DERR_INVALIDCALL;
+
+    if (!(object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object))))
+        return E_OUTOFMEMORY;
+
+    object->ID3DXLine_iface.lpVtbl = &d3dx9_line_vtbl;
+    object->ref = 1;
+    object->device = device;
+    IDirect3DDevice9_AddRef(device);
+
+    *line = &object->ID3DXLine_iface;
+
+    return D3D_OK;
+}
-- 
1.7.10.4




More information about the wine-patches mailing list