[v2 1/3] dx8vb: Add stubs for D3DX8 interface

Fabian Maurer dark.shadow4 at web.de
Sat Nov 4 15:42:12 CDT 2017


v2:
-Whitespace fix
-Improved QueryInterface
-don't typedef struct
-properly format FIXME messages
-use lowercase variable names
-use better parameter names

Signed-off-by: Fabian Maurer <dark.shadow4 at web.de>
---
 dlls/dx8vb/Makefile.in     |   1 +
 dlls/dx8vb/d3dx8.c         | 852 +++++++++++++++++++++++++++++++++++++++++++++
 dlls/dx8vb/dx8vb_private.h |  41 +++
 dlls/dx8vb/main.c          |  13 +-
 4 files changed, 897 insertions(+), 10 deletions(-)
 create mode 100644 dlls/dx8vb/d3dx8.c
 create mode 100644 dlls/dx8vb/dx8vb_private.h

diff --git a/dlls/dx8vb/Makefile.in b/dlls/dx8vb/Makefile.in
index e0a083aa3d..acf672f586 100644
--- a/dlls/dx8vb/Makefile.in
+++ b/dlls/dx8vb/Makefile.in
@@ -2,6 +2,7 @@ MODULE    = dx8vb.dll
 IMPORTS   = uuid ole32
 
 C_SRCS = \
+	d3dx8.c \
 	main.c
 
 IDL_SRCS = dx8vb.idl
diff --git a/dlls/dx8vb/d3dx8.c b/dlls/dx8vb/d3dx8.c
new file mode 100644
index 0000000000..160976639f
--- /dev/null
+++ b/dlls/dx8vb/d3dx8.c
@@ -0,0 +1,852 @@
+ /*
+ * Copyright 2017 Fabian Maurer
+ *
+ * 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
+ */
+
+#define COBJMACROS
+
+#include "config.h"
+
+#include "dx8vb_private.h"
+#include "ocidl.h"
+
+#include "wine/debug.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(dx8vb);
+
+struct d3dx8
+{
+    ID3DX8 ID3DX8_iface;
+    LONG ref;
+};
+
+static inline struct d3dx8 *impl_from_ID3DX8(ID3DX8 *iface)
+{
+    return CONTAINING_RECORD(iface, struct d3dx8, ID3DX8_iface);
+}
+
+/*** d3dx8 - IUnknown methods ***/
+
+static HRESULT WINAPI d3dx8_QueryInterface(ID3DX8 *iface, REFIID riid, void **ppv)
+{
+    struct d3dx8 *this = impl_from_ID3DX8(iface);
+
+    TRACE("(%p/%p)->(%s,%p)\n", iface, this, debugstr_guid(riid), ppv);
+
+     if (IsEqualGUID(riid, &IID_ID3DX8)
+            || IsEqualGUID(riid, &IID_IUnknown))
+    {
+        IUnknown_AddRef(iface);
+        *ppv = iface;
+        return S_OK;
+    }
+
+    WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid));
+    *ppv = NULL;
+    return E_NOINTERFACE;
+}
+
+static ULONG WINAPI d3dx8_AddRef(ID3DX8 *iface)
+{
+    struct d3dx8 *this = impl_from_ID3DX8(iface);
+    ULONG ref = InterlockedIncrement(&this->ref);
+
+    TRACE("(%p/%p)->(): new ref %d\n", iface, this, ref);
+
+    return ref;
+}
+
+static ULONG WINAPI d3dx8_Release(ID3DX8 *iface)
+{
+    struct d3dx8 *this = impl_from_ID3DX8(iface);
+    ULONG ref = InterlockedDecrement(&this->ref);
+
+    TRACE("(%p/%p)->(): new ref %d\n", iface, this, ref);
+
+    if (!ref)
+        HeapFree(GetProcessHeap(), 0, this);
+
+    return ref;
+}
+
+/*** d3dx8 - ID3DX8 methods ***/
+
+static HRESULT WINAPI d3dx8_CreateFont(ID3DX8 *iface, Direct3DDevice8 *device,
+          LONG font_handle, D3DXFont **font)
+{
+    FIXME("(%p, %d, %p): stub!\n", device, font_handle, font);
+
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3dx8_DrawText(ID3DX8 *iface, D3DXFont *d3dfont, LONG color, BSTR text, RECT *rect, LONG format)
+{
+    FIXME("(%p, %d, %s, %s, %d): stub!\n", d3dfont, color, debugstr_w(text), wine_dbgstr_rect(rect), format);
+
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3dx8_GetFVFVertexSize(ID3DX8 *iface, LONG fvf, LONG *size)
+{
+    FIXME("(%d, %p): stub!\n", fvf, size);
+
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3dx8_AssembleShaderFromFile(ID3DX8 *iface, BSTR file, LONG flags, BSTR *log,
+        D3DXBuffer **constants, D3DXBuffer **vertexshader)
+{
+    FIXME("(%s, %d, %p, %p, %p): stub!\n", debugstr_w(file), flags, log, constants, vertexshader);
+
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3dx8_AssembleShader(ID3DX8 *iface, BSTR data, LONG flags, D3DXBuffer **constants,
+        BSTR *log, D3DXBuffer **vertexshader)
+{
+    FIXME("(%s, %d, %p, %p, %p): stub!\n", debugstr_w(data), flags, constants, log, vertexshader);
+
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3dx8_GetErrorString(ID3DX8 *iface, LONG hr, BSTR *str)
+{
+    FIXME("(%d, %p): stub!\n", hr, str);
+
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3dx8_LoadSurfaceFromFile(ID3DX8 *iface, Direct3DSurface8 *dst_surface, void *dst_palette,
+        void *dst_rect, BSTR src_file, void *src_rect, LONG filter, LONG color_key, void *src_info)
+{
+    FIXME("(%p, %p, %p, %s, %s, %d, %d, %p): stub!\n", dst_surface, dst_palette, dst_rect, debugstr_w(src_file),
+            wine_dbgstr_rect(src_rect), filter, color_key, src_info);
+
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3dx8_LoadSurfaceFromFileInMemory(ID3DX8 *iface, Direct3DSurface8 *dst_surface, void *dst_palette,
+        void *dst_rect, void *src_data, LONG length_in_bytes, void *src_rect, LONG filter, LONG color_key, void *src_info)
+{
+   FIXME("(%p, %p, %p, %p, %d, %s, %d, %d, %p): stub!\n", dst_surface, dst_palette, dst_rect, src_data, length_in_bytes,
+           wine_dbgstr_rect(src_rect), filter, color_key, src_info);
+
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3dx8_LoadSurfaceFromSurface(ID3DX8 *iface, Direct3DSurface8 *dst_surface, void *dst_palette,
+        void *dst_rect,Direct3DSurface8 *src_surface, void *src_palette, void *src_rect, LONG filter, LONG color_key)
+{
+    FIXME("(%p, %p, %p, %p, %p, %s, %d, %d): stub!\n", dst_surface, dst_palette, dst_rect, src_surface, src_palette,
+            wine_dbgstr_rect(src_rect), filter, color_key);
+
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3dx8_LoadSurfaceFromMemory(ID3DX8 *iface, Direct3DSurface8 *dst_surface, void *dst_palette,
+        void *dst_rect, void *src_data, D3DFORMAT src_format, LONG src_pitch, void *src_palette, RECT *src_rect,
+        LONG filter, LONG color_key)
+{
+    FIXME("(%p, %p, %p, %p, %u, %d, %p, %s, %d, %d): stub!\n", dst_surface, dst_palette, dst_rect, src_data, src_format,
+            src_pitch, src_palette, wine_dbgstr_rect(src_rect), filter, color_key);
+
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3dx8_CheckTextureRequirements(ID3DX8 *iface, Direct3DDevice8 *device, LONG *width, LONG *height,
+        LONG *mip_levels, LONG usage, D3DFORMAT *pixelformat, D3DPOOL pool)
+{
+    FIXME("(%p, %p, %p, %p, %d, %p, %u): stub!\n", device, width, height, mip_levels, usage, pixelformat, pool);
+
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3dx8_CreateTexture(ID3DX8 *iface, Direct3DDevice8 *device, LONG width, LONG height,
+        LONG mip_levels, LONG usage, D3DFORMAT pixelformat, D3DPOOL pool, Direct3DTexture8 **texture)
+{
+    FIXME("(%p, %d, %d, %d, %d, %u, %u, %p): stub!\n", device, width, height, mip_levels, usage,
+            pixelformat, pool, texture);
+
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3dx8_CreateTextureFromResource(ID3DX8 *iface, Direct3DDevice8 *device, LONG module,
+        BSTR src_resource, Direct3DTexture8 **texture)
+{
+    FIXME("(%p, %d, %s, %p): stub!\n", device, module, debugstr_w(src_resource), texture);
+
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3dx8_CreateTextureFromFile(ID3DX8 *iface, Direct3DDevice8 *device, BSTR src_file,
+        Direct3DTexture8 **texture)
+{
+    FIXME("(%p, %s, %p): stub!\n", device, debugstr_w(src_file), texture);
+
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3dx8_CreateTextureFromFileEx(ID3DX8 *iface, Direct3DDevice8 *device, BSTR src_file, LONG width,
+        LONG height, LONG mip_levels, LONG usage, D3DFORMAT pixelformat, D3DPOOL pool, LONG filter, LONG mip_filter,
+        LONG color_key, void *src_info, void *palette, Direct3DTexture8 **texture)
+{
+    FIXME("(%p, %s, %d, %d, %d, %d, %u, %u, %d, %d, %d, %p, %p, %p): stub!\n", device, debugstr_w(src_file), width,
+            height, mip_levels, usage, pixelformat, pool, filter, mip_filter, color_key, src_info, palette, texture);
+
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3dx8_CreateTextureFromFileInMemory(ID3DX8 *iface, Direct3DDevice8 *device, void *src_data,
+        LONG length_in_bytes, Direct3DTexture8 **texture)
+{
+    FIXME("(%p, %p, %d, %p): stub!\n", device, src_data, length_in_bytes, texture);
+
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3dx8_CreateTextureFromFileInMemoryEx(ID3DX8 *iface, Direct3DDevice8 *device, void *src_data,
+        LONG length_in_bytes, LONG width, LONG height, LONG mip_levels, LONG usage, D3DFORMAT pixelformat, D3DPOOL pool,
+        LONG filter, LONG mip_filter, LONG color_key, void *src_info, void *palette, Direct3DTexture8 **texture)
+{
+    FIXME("(%p, %p, %d, %d, %d, %d, %d, %u, %u, %d, %d, %d, %p, %p, %p): stub!\n", device, src_data, length_in_bytes,
+            width, height, mip_levels, usage, pixelformat, pool, filter, mip_filter,
+            color_key, src_info, palette, texture);
+
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3dx8_FilterTexture(ID3DX8 *iface, Direct3DTexture8 *texture, void *palette,
+        LONG src_level, LONG filter)
+{
+    FIXME("(%p, %p, %d, %d): stub!\n", texture, palette, src_level, filter);
+
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3dx8_CheckCubeTextureRequirements(ID3DX8 *iface, Direct3DDevice8 *device,LONG *size,
+        LONG *mip_levels, LONG usage, D3DFORMAT *pixelformat, D3DPOOL pool)
+{
+    FIXME("(%p, %p, %p, %d, %p, %u): stub!\n", device, size, mip_levels, usage, pixelformat, pool);
+
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3dx8_CreateCubeTexture(ID3DX8 *iface, Direct3DDevice8 *device, LONG size, LONG mip_levels,
+        LONG usage, D3DFORMAT pixelformat, D3DPOOL pool, Direct3DCubeTexture8 **cube_texture)
+{
+    FIXME("(%p, %d, %d, %d, %u, %u, %p): stub!\n", device, size, mip_levels, usage, pixelformat, pool, cube_texture);
+
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3dx8_CreateCubeTextureFromFile(ID3DX8 *iface, Direct3DDevice8 *device, BSTR src_file,
+        Direct3DCubeTexture8 **cube_texture)
+{
+    FIXME("(%p, %s, %p): stub!\n", device, debugstr_w(src_file), cube_texture);
+
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3dx8_CreateCubeTextureFromFileEx(ID3DX8 *iface, Direct3DDevice8 *device, BSTR src_file,
+        LONG texture_size, LONG mip_levels, LONG usage, D3DFORMAT pixelformat, D3DPOOL pool, LONG filter,
+        LONG mip_filter, LONG color_key, void *src_info, void *palette, Direct3DCubeTexture8 **texture)
+{
+    FIXME("(%p, %s, %d, %d, %d, %u, %u, %d, %d, %d, %p, %p, %p): stub!\n", device, debugstr_w(src_file), texture_size,
+            mip_levels, usage, pixelformat, pool, filter, mip_filter, color_key, src_info, palette, texture);
+
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3dx8_CreateCubeTextureFromFileInMemory(ID3DX8 *iface, Direct3DDevice8 *device, void *src_data,
+        LONG length_in_bytes, Direct3DCubeTexture8 **texture)
+{
+    FIXME("(%p, %p, %d, %p): stub!\n", device, src_data,length_in_bytes, texture);
+
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3dx8_CreateCubeTextureFromFileInMemoryEx(ID3DX8 *iface, Direct3DDevice8 *device, void *src_data,
+        LONG length_in_bytes, LONG texture_size, LONG mip_levels, LONG usage, D3DFORMAT pixelformat, D3DPOOL pool,
+        LONG filter, LONG mip_filter, LONG color_key, void *src_info, void *palette, Direct3DCubeTexture8 **texture)
+{
+    FIXME("(%p, %p, %d, %d, %d, %d, %u, %u, %d, %d, %d, %p, %p, %p): stub!\n", device, src_data, length_in_bytes,
+            texture_size, mip_levels, usage, pixelformat, pool, filter, mip_filter, color_key, src_info, palette, texture);
+
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3dx8_FilterCubeTexture(ID3DX8 *iface, Direct3DCubeTexture8 *cube_texture, void *palette,
+        LONG src_level, LONG filter)
+{
+    FIXME("(%p, %p, %d, %d): stub!\n", cube_texture, palette, src_level, filter);
+
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3dx8_CheckVolumeTextureRequirements(ID3DX8 *iface, Direct3DDevice8 *device, LONG *width,
+        LONG *height, LONG *depth, LONG *mip_levels, LONG usage, D3DFORMAT *pixelformat, D3DPOOL pool)
+{
+    FIXME("(%p, %p, %p, %p, %p, %d, %p, %u): stub!\n", device, width, height, depth,
+            mip_levels, usage, pixelformat, pool);
+
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3dx8_CreateTextureFromResourceEx(ID3DX8 *iface, Direct3DDevice8 *device, LONG src_module,
+        BSTR src_resource, LONG width, LONG height, LONG mip_levels, LONG usage, D3DFORMAT pixelformat, D3DPOOL pool,
+        LONG filter, LONG mip_filter, LONG color_key, void *src_info, void *palette, Direct3DTexture8 **texture)
+{
+    FIXME("(%p, %d, %s, %d, %d, %d, %d, %u, %u, %d, %d, %d, %p, %p, %p): stub!\n", device, src_module,
+            debugstr_w(src_resource), width, height, mip_levels, usage, pixelformat, pool, filter, mip_filter,
+            color_key, src_info, palette, texture);
+
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3dx8_CreateVolumeTexture(ID3DX8 *iface, Direct3DDevice8 *device, LONG width, LONG height,
+        LONG depth, LONG mip_levels, LONG usage, D3DFORMAT pixelformat, D3DPOOL pool, Direct3DVolume8 **volume_texture)
+{
+    FIXME("(%p, %d, %d, %d, %d, %d, %u, %u, %p): stub!\n", device, width, height, depth, mip_levels,
+            usage, pixelformat, pool, volume_texture);
+
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3dx8_FilterVolumeTexture(ID3DX8 *iface, Direct3DVolume8 *texture,
+        void *palette, LONG src_level, LONG filter)
+{
+    FIXME("(%p, %p, %d, %d): stub!\n", texture, palette, src_level, filter);
+
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3dx8_LoadSurfaceFromResource(ID3DX8 *iface, Direct3DSurface8 *dst_surface, void *dst_palette,
+        void *dst_rect, LONG src_module, BSTR src_resource, void *src_rect, LONG filter, LONG color_key, void *src_info)
+{
+    FIXME("(%p, %p, %p, %d, %s, %p, %d, %d, %p): stub!\n", dst_surface, dst_palette, dst_rect, src_module,
+            debugstr_w(src_resource), src_rect, filter, color_key, src_info);
+
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3dx8_LoadVolumeFromVolume(ID3DX8 *iface, Direct3DVolume8 *dst_volume, void *dst_palette,
+        void *dst_box, Direct3DVolume8 *src_volume, void *src_palette, void *src_box, LONG filter, LONG color_key)
+{
+    FIXME("(%p, %p, %p, %p, %p, %p, %d, %d): stub!\n", dst_volume, dst_palette, dst_box, src_volume,
+            src_palette, src_box, filter, color_key);
+
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3dx8_LoadVolumeFromMemory(ID3DX8 *iface, Direct3DVolume8 *dst_volume, void *dst_palette,
+        void *dst_box, void *src_memory, LONG src_format, LONG src_row_pitch, LONG src_slice_pitch, void *src_palette,
+        void *src_box, LONG filter, LONG color_key)
+{
+    FIXME("(%p, %p, %p, %p, %d, %d, %d, %p, %p, %d, %d): stub!\n", dst_volume, dst_palette, dst_box, src_memory,
+            src_format, src_row_pitch, src_slice_pitch, src_palette, src_box, filter, color_key);
+
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3dx8_CreateMesh(ID3DX8 *iface, LONG num_faces, LONG num_vertices, LONG options,
+        void *declaration, Direct3DDevice8 *device, D3DXMesh **mesh)
+{
+    FIXME("(%d, %d, %d, %p, %p, %p): stub!\n", num_faces, num_vertices, options, declaration, device, mesh);
+
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3dx8_CreateMeshFVF(ID3DX8 *iface, LONG num_faces, LONG num_vertices, LONG options, LONG fvf,
+        Direct3DDevice8 *device, D3DXMesh **mesh)
+{
+    FIXME("(%d, %d, %d, %d, %p, %p): stub!\n", num_faces, num_vertices, options, fvf, device, mesh);
+
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3dx8_CreateSPMesh(ID3DX8 *iface, D3DXMesh *mesh, void *adjacency, void *vertex_attribute_weights,
+        void *vertex_weights, D3DXSPMesh **spmesh)
+{
+    FIXME("(%p, %p, %p, %p, %p): stub!\n", mesh, adjacency, vertex_attribute_weights, vertex_weights, spmesh);
+
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3dx8_GeneratePMesh(ID3DX8 *iface, D3DXMesh *mesh, void *adjacency, void *vertex_attribute_weights,
+        void *vertex_weights, LONG minValue, LONG options, D3DXPMesh **pmesh)
+{
+    FIXME("(%p, %p, %p, %p, %d, %d, %p): stub!\n", mesh, adjacency, vertex_attribute_weights, vertex_weights,
+            minValue, options, pmesh);
+
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3dx8_SimplifyMesh(ID3DX8 *iface, D3DXMesh *mesh_in, void *adjacency, void *vertex_attribute_weights,
+        void *vertex_weights, LONG minValue, LONG options, D3DXMesh **mesh_out)
+{
+    FIXME("(%p, %p, %p, %p, %d, %d, %p): stub!\n", mesh_in, adjacency, vertex_attribute_weights, vertex_weights,
+            minValue, options, mesh_out);
+
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3dx8_ComputeBoundingSphere(ID3DX8 *iface, void *points_fvf, LONG num_vertices, LONG fvf,
+        D3DVECTOR *centers, float *radius_array)
+{
+    FIXME("(%p, %d, %d, %p, %p): stub!\n", points_fvf, num_vertices, fvf, centers, radius_array);
+
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3dx8_ComputeBoundingBox(ID3DX8 *iface, void *points_fvf, LONG num_vertices, LONG fvf,
+        D3DVECTOR *min_vert, D3DVECTOR *max_vert)
+{
+    FIXME("(%p, %d, %d, %p, %p): stub!\n", points_fvf, num_vertices, fvf, min_vert, max_vert);
+
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3dx8_ComputeNormals(ID3DX8 *iface, D3DXBaseMesh *mesh)
+{
+    FIXME("(%p): stub!\n", mesh);
+
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3dx8_DeclaratorFromFVF(ID3DX8 *iface, LONG fvf, D3DXDECLARATOR *declarator)
+{
+    FIXME("(%d, %p): stub!\n", fvf, declarator);
+
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3dx8_FVFFromDeclarator(ID3DX8 *iface, D3DXDECLARATOR *declarator, LONG *fvf)
+{
+    FIXME("(%p, %p): stub!\n", declarator, fvf);
+
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3dx8_CreateBuffer(ID3DX8 *iface, LONG num_bytes, D3DXBuffer **buffer)
+{
+    FIXME("(%d, %p): stub!\n", num_bytes, buffer);
+
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3dx8_LoadMeshFromX(ID3DX8 *iface, BSTR filename, LONG options, Direct3DDevice8 *device,
+        D3DXBuffer **adjacency, D3DXBuffer **materials, LONG *materials_count, D3DXMesh **mesh)
+{
+    FIXME("(%s, %d, %p, %p, %p, %p, %p): stub!\n", debugstr_w(filename), options, device, adjacency,
+            materials, materials_count, mesh);
+
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3dx8_SaveMeshToX(ID3DX8 *iface, BSTR filename, D3DXMesh *mesh, void *adjacency_array,
+        D3DXMATERIAL *materials, LONG material_count, LONG xformat)
+{
+    FIXME("(%s, %p, %p, %p, %d, %d): stub!\n", debugstr_w(filename), mesh, adjacency_array,
+            materials, material_count, xformat);
+
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3dx8_LoadMeshFromXof(ID3DX8 *iface, IUnknown *xofobj_mesh, LONG options, Direct3DDevice8 *device,
+        D3DXBuffer **adjacency, D3DXBuffer **materials, LONG *materials_count, D3DXMesh **mesh)
+{
+    FIXME("(%p, %d, %p, %p, %p, %p, %p): stub!\n", xofobj_mesh, options, device, adjacency,
+            materials, materials_count, mesh);
+
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3dx8_TessellateNPatches(ID3DX8 *iface, D3DXMesh *mesh_in, void *adjacency_in, float num_segs,
+        VARIANT_BOOL quadratic_interp_normals, D3DXBuffer **adjacency_out, D3DXMesh **mesh_out)
+{
+    FIXME("(%p, %p, %f, %#x, %p, %p): stub!\n", mesh_in, adjacency_in, num_segs, quadratic_interp_normals,
+            adjacency_out, mesh_out);
+
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3dx8_BufferGetMaterial(ID3DX8 *iface, D3DXBuffer *material_buffer, LONG index, D3DMATERIAL8 *mat)
+{
+    FIXME("(%p, %d, %p): stub!\n", material_buffer, index, mat);
+
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3dx8_BufferGetTextureName(ID3DX8 *iface, D3DXBuffer *material_buffer, LONG index, BSTR *name)
+{
+    FIXME("(%p, %d, %p): stub!\n", material_buffer, index, name);
+
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3dx8_BufferGetData(ID3DX8 *iface, D3DXBuffer *buffer, LONG index, LONG typesize,
+        LONG typecount, void *data)
+{
+    FIXME("(%p, %d, %d, %d, %p): stub!\n", buffer, index, typesize, typecount, data);
+
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3dx8_BufferSetData(ID3DX8 *iface, D3DXBuffer *buffer, LONG index, LONG typesize,
+        LONG typecount, void *data)
+{
+    FIXME("(%p, %d, %d, %d, %p): stub!\n", buffer, index, typesize, typecount, data);
+
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3dx8_Intersect(ID3DX8 *iface, D3DXMesh *mesh_in, D3DVECTOR *ray_pos, D3DVECTOR *ray_dir,
+        LONG *ray_hit, LONG *face_index, float *u, float *v, float *dist, LONG *count_hits, D3DXBuffer **all_hits)
+{
+    FIXME("(%p, %p, %p, %p, %p, %p, %p, %p, %p, %p): stub!\n", mesh_in, ray_pos, ray_dir, ray_hit, face_index, u, v,
+            dist, count_hits, all_hits);
+
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3dx8_SphereBoundProbe(ID3DX8 *iface, D3DVECTOR *center, float radius, D3DVECTOR *ray_position,
+        D3DVECTOR *ray_direction, VARIANT_BOOL *ray_hit)
+{
+    FIXME("(%p, %f, %p, %p, %p): stub!\n", center, radius, ray_position, ray_direction, ray_hit);
+
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3dx8_ComputeBoundingSphereFromMesh(ID3DX8 *iface, D3DXMesh *mesh_in,
+        D3DVECTOR *centers, float *radius_array)
+{
+    FIXME("(%p, %p, %p): stub!\n", mesh_in, centers, radius_array);
+
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3dx8_ComputeBoundingBoxFromMesh(ID3DX8 *iface, D3DXMesh *mesh_in,
+        D3DVECTOR *min_array, D3DVECTOR *max_array)
+{
+    FIXME("(%p, %p, %p): stub!\n", mesh_in, min_array, max_array);
+
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3dx8_CreateSkinMesh(ID3DX8 *iface, LONG num_faces, LONG num_vertices, LONG num_bones, LONG options,
+        void *declaration, Direct3DDevice8 *device, D3DXSkinMesh **mesh)
+{
+    FIXME("(%d, %d, %d, %d, %p, %p, %p): stub!\n", num_faces, num_vertices, num_bones, options, declaration,
+            device, mesh);
+
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3dx8_CreateSkinMeshFVF(ID3DX8 *iface, LONG num_faces, LONG num_vertices, LONG num_bones,
+        LONG options, LONG fvf, Direct3DDevice8 *device, D3DXSkinMesh **mesh)
+{
+    FIXME("(%d, %d, %d, %d, %d, %p, %p): stub!\n", num_faces, num_vertices, num_bones, options, fvf, device, mesh);
+
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3dx8_CreateSkinMeshFromMesh(ID3DX8 *iface, D3DXMesh *mesh,
+        LONG num_bones, D3DXSkinMesh **skinmesh)
+{
+    FIXME("(%p, %d, %p): stub!\n", mesh, num_bones, skinmesh);
+
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3dx8_LoadSkinMeshFromXof(ID3DX8 *iface, IUnknown *xofobj_mesh, LONG options,
+        Direct3DDevice8 *device, D3DXBuffer **adjacency_out, D3DXBuffer **materialsOut, LONG *num_mat_out,
+        D3DXBuffer **bone_names_out, D3DXBuffer **bone_transforms_out, D3DXSkinMesh **mesh)
+{
+    FIXME("(%p, %d, %p, %p, %p, %p, %p, %p, %p): stub!\n", xofobj_mesh, options, device, adjacency_out,
+            materialsOut, num_mat_out, bone_names_out, bone_transforms_out, mesh);
+
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3dx8_CreatePolygon(ID3DX8 *iface, Direct3DDevice8 *device, float length, LONG sides,
+        D3DXBuffer **adjacency, D3DXMesh **mesh)
+{
+    FIXME("(%p, %f, %d, %p, %p): stub!\n", device, length, sides, adjacency, mesh);
+
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3dx8_CreateBox(ID3DX8 *iface, Direct3DDevice8 *device, float width, float height, float depth,
+        D3DXBuffer **adjacency, D3DXMesh **mesh)
+{
+    FIXME("(%p, %f, %f, %f, %p, %p): stub!\n", device, width, height, depth, adjacency, mesh);
+
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3dx8_CreateCylinder(ID3DX8 *iface, Direct3DDevice8 *device, float radius1, float radius2,
+        float length, LONG slices, LONG stacks, D3DXBuffer **adjacency, D3DXMesh **mesh)
+{
+    FIXME("(%p, %f, %f, %f, %d, %d, %p, %p): stub!\n", device, radius1, radius2, length, slices,
+            stacks, adjacency, mesh);
+
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3dx8_CreateSphere(ID3DX8 *iface, Direct3DDevice8 *device, float radius, LONG slices,
+        LONG stacks, D3DXBuffer **adjacency, D3DXMesh **mesh)
+{
+    FIXME("(%p, %f, %d, %d, %p, %p): stub!\n", device, radius, slices, stacks, adjacency, mesh);
+
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3dx8_CreateTorus(ID3DX8 *iface, Direct3DDevice8 *device, float radius_inner,
+        float radius_outer, LONG sides, LONG rings, D3DXBuffer **adjacency, D3DXMesh **mesh)
+{
+    FIXME("(%p, %f, %f, %d, %d, %p, %p): stub!\n", device, radius_inner, radius_outer, sides,
+            rings, adjacency, mesh);
+
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3dx8_CreateTeapot(ID3DX8 *iface, Direct3DDevice8 *device,
+        D3DXBuffer **adjacency, D3DXMesh **mesh)
+{
+    FIXME("(%p, %p, %p): stub!\n", device, adjacency, mesh);
+
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3dx8_CreateText(ID3DX8 *iface, Direct3DDevice8 *device, LONG dc, BSTR text, float deviation,
+        float extrusion, D3DXMesh **mesh, D3DXBuffer **adjacency_out, void *glyph_metrics)
+{
+    FIXME("(%p, %d, %s, %f, %f, %p, %p, %p): stub!\n", device, dc, debugstr_w(text), deviation, extrusion,
+            mesh, adjacency_out, glyph_metrics);
+
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3dx8_BufferGetBoneName(ID3DX8 *iface, D3DXBuffer *bone_name_buffer, LONG index, BSTR *name)
+{
+    FIXME("(%p, %d, %p): stub!\n", bone_name_buffer, index, name);
+
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3dx8_CreateSprite(ID3DX8 *iface, Direct3DDevice8 *device, D3DXSprite **sprite)
+{
+    FIXME("(%p, %p): stub!\n", device, sprite);
+
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3dx8_CreateRenderToSurface(ID3DX8 *iface, Direct3DDevice8 *device, LONG width, LONG height,
+        D3DFORMAT format, LONG depth_stencil, D3DFORMAT depth_stencil_format, D3DXRenderToSurface **render_to_surface)
+{
+    FIXME("(%p, %d, %d, %u, %d, %u, %p): stub!\n", device, width, height, format, depth_stencil,
+            depth_stencil_format, render_to_surface);
+
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3dx8_CleanMesh(ID3DX8 *iface, D3DXMesh *mesh_in, void *adjacency, BSTR *log,
+        D3DXBuffer *adjacency_out, D3DXMesh **mesh_out)
+{
+    FIXME("(%p, %p, %p, %p, %p): stub!\n", mesh_in, adjacency, log, adjacency_out, mesh_out);
+
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3dx8_ValidMesh(ID3DX8 *iface, D3DXMesh *mesh_in, void *adjacency, BSTR *log, VARIANT_BOOL *ret)
+{
+    FIXME("(%p, %p, %p, %p): stub!\n", mesh_in, adjacency, log, ret);
+
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3dx8_BoxBoundProbe(ID3DX8 *iface, D3DVECTOR *min_vert, D3DVECTOR *max_vert,
+        D3DVECTOR *ray_position, D3DVECTOR *ray_direction, VARIANT_BOOL *ret)
+{
+    FIXME("(%p, %p, %p, %p, %p): stub!\n", min_vert, max_vert, ray_position, ray_direction, ret);
+
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3dx8_SavePMeshToFile(ID3DX8 *iface, BSTR filename, D3DXPMesh *mesh,
+        D3DXMATERIAL *materials, LONG material_count)
+{
+    FIXME("(%s, %p, %p, %d): stub!\n", debugstr_w(filename), mesh, materials, material_count);
+
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3dx8_LoadPMeshFromFile(ID3DX8 *iface, BSTR filename, LONG options, Direct3DDevice8 *device,
+        D3DXBuffer **materials, LONG *materials_count, D3DXPMesh **mesh)
+{
+    FIXME("(%s, %d, %p, %p, %p, %p): stub!\n", debugstr_w(filename), options, device,
+            materials, materials_count, mesh);
+
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3dx8_BufferGetBoneCombo(ID3DX8 *iface, D3DXBuffer *bone_combo_buffer,
+        LONG index, D3DXBONECOMBINATION *bone_combo)
+{
+    FIXME("(%p, %d, %p): stub!\n", bone_combo_buffer, index, bone_combo);
+
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3dx8_BufferGetBoneComboBoneIds(ID3DX8 *iface, D3DXBuffer *bone_combo_buffer,
+        LONG index, LONG size_palette, void *bone_ids)
+{
+    FIXME("(%p, %d, %d, %p): stub!\n", bone_combo_buffer, index, size_palette, bone_ids);
+
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3dx8_SaveSurfaceToFile(ID3DX8 *iface, BSTR dst_file, D3DXIMAGE_FILEFORMAT dst_format,
+        Direct3DSurface8 *src_surface, PALETTEENTRY *src_palette, RECT *src_rect)
+{
+    FIXME("(%s, %u, %p, %p, %s): stub!\n", debugstr_w(dst_file), dst_format,
+            src_surface, src_palette, wine_dbgstr_rect(src_rect));
+
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3dx8_SaveVolumeToFile(ID3DX8 *iface, BSTR dst_file, D3DXIMAGE_FILEFORMAT dst_format,
+        Direct3DVolume8 *src_volume, PALETTEENTRY *src_palette, void *src_box)
+{
+    FIXME("(%s, %u, %p, %p, %p): stub!\n", debugstr_w(dst_file), dst_format, src_volume, src_palette, src_box);
+
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3dx8_SaveTextureToFile(ID3DX8 *iface, BSTR dst_file, D3DXIMAGE_FILEFORMAT dst_format,
+        Direct3DBaseTexture8 *src_texture, PALETTEENTRY *src_palette)
+{
+    FIXME("(%s, %u, %p, %p): stub!\n", debugstr_w(dst_file), dst_format, src_texture, src_palette);
+
+    return E_NOTIMPL;
+}
+
+static const ID3DX8Vtbl d3dx8_vtbl =
+{
+    /*** IUnknown methods ***/
+    d3dx8_QueryInterface,
+    d3dx8_AddRef,
+    d3dx8_Release,
+    /*** ID3DX8 methods ***/
+    d3dx8_CreateFont,
+    d3dx8_DrawText,
+    d3dx8_GetFVFVertexSize,
+    d3dx8_AssembleShaderFromFile,
+    d3dx8_AssembleShader,
+    d3dx8_GetErrorString,
+    d3dx8_LoadSurfaceFromFile,
+    d3dx8_LoadSurfaceFromFileInMemory,
+    d3dx8_LoadSurfaceFromSurface,
+    d3dx8_LoadSurfaceFromMemory,
+    d3dx8_CheckTextureRequirements,
+    d3dx8_CreateTexture,
+    d3dx8_CreateTextureFromResource,
+    d3dx8_CreateTextureFromFile,
+    d3dx8_CreateTextureFromFileEx,
+    d3dx8_CreateTextureFromFileInMemory,
+    d3dx8_CreateTextureFromFileInMemoryEx,
+    d3dx8_FilterTexture,
+    d3dx8_CheckCubeTextureRequirements,
+    d3dx8_CreateCubeTexture,
+    d3dx8_CreateCubeTextureFromFile,
+    d3dx8_CreateCubeTextureFromFileEx,
+    d3dx8_CreateCubeTextureFromFileInMemory,
+    d3dx8_CreateCubeTextureFromFileInMemoryEx,
+    d3dx8_FilterCubeTexture,
+    d3dx8_CheckVolumeTextureRequirements,
+    d3dx8_CreateTextureFromResourceEx,
+    d3dx8_CreateVolumeTexture,
+    d3dx8_FilterVolumeTexture,
+    d3dx8_LoadSurfaceFromResource,
+    d3dx8_LoadVolumeFromVolume,
+    d3dx8_LoadVolumeFromMemory,
+    d3dx8_CreateMesh,
+    d3dx8_CreateMeshFVF,
+    d3dx8_CreateSPMesh,
+    d3dx8_GeneratePMesh,
+    d3dx8_SimplifyMesh,
+    d3dx8_ComputeBoundingSphere,
+    d3dx8_ComputeBoundingBox,
+    d3dx8_ComputeNormals,
+    d3dx8_DeclaratorFromFVF,
+    d3dx8_FVFFromDeclarator,
+    d3dx8_CreateBuffer,
+    d3dx8_LoadMeshFromX,
+    d3dx8_SaveMeshToX,
+    d3dx8_LoadMeshFromXof,
+    d3dx8_TessellateNPatches,
+    d3dx8_BufferGetMaterial,
+    d3dx8_BufferGetTextureName,
+    d3dx8_BufferGetData,
+    d3dx8_BufferSetData,
+    d3dx8_Intersect,
+    d3dx8_SphereBoundProbe,
+    d3dx8_ComputeBoundingSphereFromMesh,
+    d3dx8_ComputeBoundingBoxFromMesh,
+    d3dx8_CreateSkinMesh,
+    d3dx8_CreateSkinMeshFVF,
+    d3dx8_CreateSkinMeshFromMesh,
+    d3dx8_LoadSkinMeshFromXof,
+    d3dx8_CreatePolygon,
+    d3dx8_CreateBox,
+    d3dx8_CreateCylinder,
+    d3dx8_CreateSphere,
+    d3dx8_CreateTorus,
+    d3dx8_CreateTeapot,
+    d3dx8_CreateText,
+    d3dx8_BufferGetBoneName,
+    d3dx8_CreateSprite,
+    d3dx8_CreateRenderToSurface,
+    d3dx8_CleanMesh,
+    d3dx8_ValidMesh,
+    d3dx8_BoxBoundProbe,
+    d3dx8_SavePMeshToFile,
+    d3dx8_LoadPMeshFromFile,
+    d3dx8_BufferGetBoneCombo,
+    d3dx8_BufferGetBoneComboBoneIds,
+    d3dx8_SaveSurfaceToFile,
+    d3dx8_SaveVolumeToFile,
+    d3dx8_SaveTextureToFile
+};
+
+HRESULT d3dx8_create(IUnknown *outer_unk, void **ppv)
+{
+    struct d3dx8 *object;
+
+    TRACE("(%p,%p)\n", outer_unk, ppv);
+
+    object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
+    if (!object)
+        return E_OUTOFMEMORY;
+
+    object->ID3DX8_iface.lpVtbl = &d3dx8_vtbl;
+    object->ref = 1;
+
+    *ppv = &object->ID3DX8_iface;
+
+    return S_OK;
+}
+
diff --git a/dlls/dx8vb/dx8vb_private.h b/dlls/dx8vb/dx8vb_private.h
new file mode 100644
index 0000000000..2d4c6c501a
--- /dev/null
+++ b/dlls/dx8vb/dx8vb_private.h
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2017 Fabian Maurer
+ *
+ * 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
+ */
+
+#ifndef __DX8VB_PRIVATE_INCLUDED__
+#define __DX8VB_PRIVATE_INCLUDED__
+
+#include <stdarg.h>
+#include <string.h>
+
+#include "windef.h"
+#include "winbase.h"
+#include "winuser.h"
+#include "winreg.h"
+#include "wingdi.h"
+
+#undef CreateFont
+#undef DrawText
+#undef CreateEvent
+
+#include "dx8vb.h"
+
+HRESULT d3dx8_create(IUnknown *outer_unk, void **ppv) DECLSPEC_HIDDEN;
+
+
+#endif /* __DX8VB_PRIVATE_INCLUDED__ */
+
diff --git a/dlls/dx8vb/main.c b/dlls/dx8vb/main.c
index aa6b9436ce..c5a6131928 100644
--- a/dlls/dx8vb/main.c
+++ b/dlls/dx8vb/main.c
@@ -20,18 +20,11 @@
 
 #include "config.h"
 
-#include <stdarg.h>
-#include <string.h>
-
-#include "windef.h"
-#include "winbase.h"
-#include "winuser.h"
-#include "winreg.h"
-
 #include "ole2.h"
 #include "rpcproxy.h"
 
-#include "unknwn.h"
+#include "initguid.h"
+#include "dx8vb_private.h"
 
 #include "wine/debug.h"
 
@@ -76,7 +69,7 @@ struct object_creation_info
 
 static const struct object_creation_info object_creation[] =
 {
-    { &GUID_NULL, 0 },
+    { &CLSID_D3DX8, d3dx8_create },
 };
 
 static HRESULT WINAPI classfactory_QueryInterface(IClassFactory *iface, REFIID riid, void **ppobj)
-- 
2.15.0




More information about the wine-patches mailing list