Author: akhaldi
Date: Tue Nov 24 10:43:48 2015
New Revision: 70083
URL:
http://svn.reactos.org/svn/reactos?rev=70083&view=rev
Log:
[D3DRM] Sync with Wine Staging 1.7.55. CORE-10536
Modified:
trunk/reactos/dll/directx/wine/d3drm/CMakeLists.txt
trunk/reactos/dll/directx/wine/d3drm/d3drm.c
trunk/reactos/dll/directx/wine/d3drm/d3drm_private.h
trunk/reactos/dll/directx/wine/d3drm/device.c
trunk/reactos/dll/directx/wine/d3drm/frame.c
trunk/reactos/dll/directx/wine/d3drm/texture.c
trunk/reactos/dll/directx/wine/d3drm/viewport.c
trunk/reactos/media/doc/README.WINE
Modified: trunk/reactos/dll/directx/wine/d3drm/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3drm/CMa…
==============================================================================
--- trunk/reactos/dll/directx/wine/d3drm/CMakeLists.txt [iso-8859-1] (original)
+++ trunk/reactos/dll/directx/wine/d3drm/CMakeLists.txt [iso-8859-1] Tue Nov 24 10:43:48
2015
@@ -30,6 +30,6 @@
target_link_libraries(d3drm mingwex)
endif()
-add_importlibs(d3drm d3dxof msvcrt kernel32 ntdll)
+add_importlibs(d3drm ddraw d3dxof msvcrt kernel32 ntdll)
add_pch(d3drm d3drm_private.h SOURCE)
add_cd_file(TARGET d3drm DESTINATION reactos/system32 FOR all)
Modified: trunk/reactos/dll/directx/wine/d3drm/d3drm.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3drm/d3d…
==============================================================================
--- trunk/reactos/dll/directx/wine/d3drm/d3drm.c [iso-8859-1] (original)
+++ trunk/reactos/dll/directx/wine/d3drm/d3drm.c [iso-8859-1] Tue Nov 24 10:43:48 2015
@@ -220,37 +220,125 @@
static HRESULT WINAPI d3drm1_CreateDevice(IDirect3DRM *iface,
DWORD width, DWORD height, IDirect3DRMDevice **device)
{
+ struct d3drm_device *object;
+ HRESULT hr;
FIXME("iface %p, width %u, height %u, device %p partial stub!\n", iface,
width, height, device);
- return Direct3DRMDevice_create(&IID_IDirect3DRMDevice, (IUnknown **)device);
+ hr = d3drm_device_create(&object);
+ if (FAILED(hr))
+ return hr;
+
+ *device = IDirect3DRMDevice_from_impl(object);
+
+ return D3DRM_OK;
}
static HRESULT WINAPI d3drm1_CreateDeviceFromSurface(IDirect3DRM *iface, GUID *guid,
IDirectDraw *ddraw, IDirectDrawSurface *backbuffer, IDirect3DRMDevice **device)
{
- FIXME("iface %p, guid %s, ddraw %p, backbuffer %p, device %p partial
stub.\n",
+ struct d3drm *d3drm = impl_from_IDirect3DRM(iface);
+ struct d3drm_device *object;
+ HRESULT hr;
+
+ TRACE("iface %p, guid %s, ddraw %p, backbuffer %p, device %p.\n",
iface, debugstr_guid(guid), ddraw, backbuffer, device);
- return Direct3DRMDevice_create(&IID_IDirect3DRMDevice, (IUnknown **)device);
+ if (!device)
+ return D3DRMERR_BADVALUE;
+ *device = NULL;
+
+ if (!backbuffer || !ddraw)
+ return D3DRMERR_BADDEVICE;
+
+ hr = d3drm_device_create(&object);
+ if (FAILED(hr))
+ return hr;
+
+ hr = d3drm_device_init(object, 1, &d3drm->IDirect3DRM_iface, ddraw,
backbuffer, TRUE);
+ if (SUCCEEDED(hr))
+ *device = IDirect3DRMDevice_from_impl(object);
+ else
+ d3drm_device_destroy(object);
+
+ return hr;
}
static HRESULT WINAPI d3drm1_CreateDeviceFromD3D(IDirect3DRM *iface,
IDirect3D *d3d, IDirect3DDevice *d3d_device, IDirect3DRMDevice **device)
{
- FIXME("iface %p, d3d %p, d3d_device %p, device %p partial stub.\n",
+ struct d3drm_device *object;
+ HRESULT hr;
+ TRACE("iface %p, d3d %p, d3d_device %p, device %p.\n",
iface, d3d, d3d_device, device);
- return Direct3DRMDevice_create(&IID_IDirect3DRMDevice, (IUnknown **)device);
+ if (!device)
+ return D3DRMERR_BADVALUE;
+ *device = NULL;
+ if (!d3d || !d3d_device)
+ return D3DRMERR_BADVALUE;
+
+ hr = d3drm_device_create(&object);
+ if (FAILED(hr))
+ return hr;
+
+ hr = d3drm_device_set_ddraw_device_d3d(object, iface, d3d, d3d_device);
+ if (FAILED(hr))
+ {
+ d3drm_device_destroy(object);
+ return hr;
+ }
+ *device = IDirect3DRMDevice_from_impl(object);
+
+ return D3DRM_OK;
}
static HRESULT WINAPI d3drm1_CreateDeviceFromClipper(IDirect3DRM *iface,
IDirectDrawClipper *clipper, GUID *guid, int width, int height,
IDirect3DRMDevice **device)
{
- FIXME("iface %p, clipper %p, guid %s, width %d, height %d, device %p.\n",
+ struct d3drm_device *object;
+ IDirectDraw *ddraw;
+ IDirectDrawSurface *render_target;
+ HRESULT hr;
+
+ TRACE("iface %p, clipper %p, guid %s, width %d, height %d, device %p.\n",
iface, clipper, debugstr_guid(guid), width, height, device);
- return Direct3DRMDevice_create(&IID_IDirect3DRMDevice, (IUnknown **)device);
+ if (!device)
+ return D3DRMERR_BADVALUE;
+ *device = NULL;
+
+ if (!clipper || !width || !height)
+ return D3DRMERR_BADVALUE;
+
+ hr = DirectDrawCreate(NULL, &ddraw, NULL);
+ if (FAILED(hr))
+ return hr;
+
+ hr = d3drm_device_create(&object);
+ if (FAILED(hr))
+ {
+ IDirectDraw_Release(ddraw);
+ return hr;
+ }
+
+ hr = d3drm_device_create_surfaces_from_clipper(object, ddraw, clipper, width, height,
&render_target);
+ if (FAILED(hr))
+ {
+ IDirectDraw_Release(ddraw);
+ d3drm_device_destroy(object);
+ return hr;
+ }
+
+ hr = d3drm_device_init(object, 1, iface, ddraw, render_target, TRUE);
+ IDirectDraw_Release(ddraw);
+ IDirectDrawSurface_Release(render_target);
+ if (FAILED(hr))
+ d3drm_device_destroy(object);
+ else
+ *device = IDirect3DRMDevice_from_impl(object);
+
+ return hr;
}
static HRESULT WINAPI d3drm1_CreateTextureFromSurface(IDirect3DRM *iface,
@@ -572,37 +660,103 @@
static HRESULT WINAPI d3drm2_CreateDevice(IDirect3DRM2 *iface,
DWORD width, DWORD height, IDirect3DRMDevice2 **device)
{
- FIXME("iface %p, width %u, height %u, device %p.\n", iface, width, height,
device);
-
- return Direct3DRMDevice_create(&IID_IDirect3DRMDevice2, (IUnknown **)device);
+ struct d3drm_device *object;
+ HRESULT hr;
+ FIXME("iface %p, width %u, height %u, device %p partial stub!\n", iface,
width, height, device);
+
+ hr = d3drm_device_create(&object);
+ if (FAILED(hr))
+ return hr;
+
+ *device = IDirect3DRMDevice2_from_impl(object);
+
+ return D3DRM_OK;
}
static HRESULT WINAPI d3drm2_CreateDeviceFromSurface(IDirect3DRM2 *iface, GUID *guid,
IDirectDraw *ddraw, IDirectDrawSurface *backbuffer, IDirect3DRMDevice2 **device)
{
- FIXME("iface %p, guid %s, ddraw %p, backbuffer %p, device %p partial
stub.\n",
+ struct d3drm *d3drm = impl_from_IDirect3DRM2(iface);
+ IDirect3DRMDevice3 *device3;
+ HRESULT hr;
+ TRACE("iface %p, guid %s, ddraw %p, backbuffer %p, device %p.\n",
iface, debugstr_guid(guid), ddraw, backbuffer, device);
- return Direct3DRMDevice_create(&IID_IDirect3DRMDevice2, (IUnknown **)device);
+ if (!device)
+ return D3DRMERR_BADVALUE;
+ *device = NULL;
+ hr = IDirect3DRM3_CreateDeviceFromSurface(&d3drm->IDirect3DRM3_iface, guid,
ddraw, backbuffer, 0, &device3);
+ if (FAILED(hr))
+ return hr;
+
+ hr = IDirect3DRMDevice3_QueryInterface(device3, &IID_IDirect3DRMDevice2,
(void**)device);
+ IDirect3DRMDevice3_Release(device3);
+
+ return hr;
}
static HRESULT WINAPI d3drm2_CreateDeviceFromD3D(IDirect3DRM2 *iface,
- IDirect3D2 *d3d, IDirect3DDevice2 *d3d_device, IDirect3DRMDevice2 **device)
-{
- FIXME("iface %p, d3d %p, d3d_device %p, device %p partial stub.\n",
+ IDirect3D2 *d3d, IDirect3DDevice2 *d3d_device, IDirect3DRMDevice2 **device)
+{
+ struct d3drm *d3drm = impl_from_IDirect3DRM2(iface);
+ IDirect3D *d3d1;
+ IDirect3DDevice *d3d_device1;
+ IDirect3DRMDevice *device1;
+ HRESULT hr;
+ TRACE("iface %p, d3d %p, d3d_device %p, device %p.\n",
iface, d3d, d3d_device, device);
- return Direct3DRMDevice_create(&IID_IDirect3DRMDevice2, (IUnknown **)device);
+ if (!device)
+ return D3DRMERR_BADVALUE;
+ *device = NULL;
+ if (!d3d || !d3d_device)
+ return D3DRMERR_BADVALUE;
+
+ hr = IDirect3D2_QueryInterface(d3d, &IID_IDirect3D, (void **)&d3d1);
+ if (FAILED(hr))
+ return hr;
+
+ hr = IDirect3DDevice2_QueryInterface(d3d_device, &IID_IDirect3DDevice, (void
**)&d3d_device1);
+ if (FAILED(hr))
+ {
+ IDirect3D_Release(d3d1);
+ return hr;
+ }
+
+ hr = IDirect3DRM_CreateDeviceFromD3D(&d3drm->IDirect3DRM_iface, d3d1,
d3d_device1, &device1);
+ IDirect3D_Release(d3d1);
+ IDirect3DDevice_Release(d3d_device1);
+ if (FAILED(hr))
+ return hr;
+
+ hr = IDirect3DRMDevice_QueryInterface(device1, &IID_IDirect3DRMDevice2, (void
**)device);
+ IDirect3DRMDevice_Release(device1);
+
+ return hr;
}
static HRESULT WINAPI d3drm2_CreateDeviceFromClipper(IDirect3DRM2 *iface,
IDirectDrawClipper *clipper, GUID *guid, int width, int height,
IDirect3DRMDevice2 **device)
{
- FIXME("iface %p, clipper %p, guid %s, width %d, height %d, device %p partial
stub.\n",
+ struct d3drm *d3drm = impl_from_IDirect3DRM2(iface);
+ IDirect3DRMDevice3 *device3;
+ HRESULT hr;
+
+ TRACE("iface %p, clipper %p, guid %s, width %d, height %d, device %p.\n",
iface, clipper, debugstr_guid(guid), width, height, device);
- return Direct3DRMDevice_create(&IID_IDirect3DRMDevice2, (IUnknown **)device);
+ if (!device)
+ return D3DRMERR_BADVALUE;
+ *device = NULL;
+ hr = IDirect3DRM3_CreateDeviceFromClipper(&d3drm->IDirect3DRM3_iface, clipper,
guid, width, height, &device3);
+ if (FAILED(hr))
+ return hr;
+
+ hr = IDirect3DRMDevice3_QueryInterface(device3, &IID_IDirect3DRMDevice2,
(void**)device);
+ IDirect3DRMDevice3_Release(device3);
+
+ return hr;
}
static HRESULT WINAPI d3drm2_CreateTextureFromSurface(IDirect3DRM2 *iface,
@@ -946,37 +1100,139 @@
static HRESULT WINAPI d3drm3_CreateDevice(IDirect3DRM3 *iface,
DWORD width, DWORD height, IDirect3DRMDevice3 **device)
{
+ struct d3drm_device *object;
+ HRESULT hr;
FIXME("iface %p, width %u, height %u, device %p partial stub!\n", iface,
width, height, device);
- return Direct3DRMDevice_create(&IID_IDirect3DRMDevice3, (IUnknown **)device);
+ hr = d3drm_device_create(&object);
+ if (FAILED(hr))
+ return hr;
+
+ *device = IDirect3DRMDevice3_from_impl(object);
+
+ return D3DRM_OK;
}
static HRESULT WINAPI d3drm3_CreateDeviceFromSurface(IDirect3DRM3 *iface, GUID *guid,
IDirectDraw *ddraw, IDirectDrawSurface *backbuffer, DWORD flags,
IDirect3DRMDevice3 **device)
{
- FIXME("iface %p, guid %s, ddraw %p, backbuffer %p, flags %#x, device %p partial
stub.\n",
+ struct d3drm *d3drm = impl_from_IDirect3DRM3(iface);
+ struct d3drm_device *object;
+ BOOL use_z_surface;
+ HRESULT hr;
+
+ TRACE("iface %p, guid %s, ddraw %p, backbuffer %p, flags %#x, device
%p.\n",
iface, debugstr_guid(guid), ddraw, backbuffer, flags, device);
- return Direct3DRMDevice_create(&IID_IDirect3DRMDevice3, (IUnknown **)device);
+ if (!device)
+ return D3DRMERR_BADVALUE;
+ *device = NULL;
+
+ if (!backbuffer || !ddraw)
+ return D3DRMERR_BADDEVICE;
+
+ hr = d3drm_device_create(&object);
+ if (FAILED(hr))
+ return hr;
+
+ use_z_surface = !(flags & D3DRMDEVICE_NOZBUFFER);
+
+ hr = d3drm_device_init(object, 3, &d3drm->IDirect3DRM_iface, ddraw,
backbuffer, use_z_surface);
+ if (SUCCEEDED(hr))
+ *device = IDirect3DRMDevice3_from_impl(object);
+ else
+ d3drm_device_destroy(object);
+
+ return hr;
}
static HRESULT WINAPI d3drm3_CreateDeviceFromD3D(IDirect3DRM3 *iface,
IDirect3D2 *d3d, IDirect3DDevice2 *d3d_device, IDirect3DRMDevice3 **device)
{
- FIXME("iface %p, d3d %p, d3d_device %p, device %p partial stub.\n",
+ struct d3drm *d3drm = impl_from_IDirect3DRM3(iface);
+ IDirect3D *d3d1;
+ IDirect3DDevice *d3d_device1;
+ IDirect3DRMDevice *device1;
+ HRESULT hr;
+ TRACE("iface %p, d3d %p, d3d_device %p, device %p.\n",
iface, d3d, d3d_device, device);
- return Direct3DRMDevice_create(&IID_IDirect3DRMDevice3, (IUnknown **)device);
+ if (!device)
+ return D3DRMERR_BADVALUE;
+ *device = NULL;
+ if (!d3d || !d3d_device)
+ return D3DRMERR_BADVALUE;
+
+ hr = IDirect3D2_QueryInterface(d3d, &IID_IDirect3D, (void **)&d3d1);
+ if (FAILED(hr))
+ return hr;
+ hr = IDirect3DDevice2_QueryInterface(d3d_device, &IID_IDirect3DDevice, (void
**)&d3d_device1);
+ if (FAILED(hr))
+ {
+ IDirect3D_Release(d3d1);
+ return hr;
+ }
+
+ hr = IDirect3DRM_CreateDeviceFromD3D(&d3drm->IDirect3DRM_iface, d3d1,
d3d_device1, &device1);
+ IDirect3D_Release(d3d1);
+ IDirect3DDevice_Release(d3d_device1);
+ if (FAILED(hr))
+ return hr;
+
+ hr = IDirect3DRMDevice_QueryInterface(device1, &IID_IDirect3DRMDevice3, (void
**)device);
+ IDirect3DRMDevice_Release(device1);
+
+ return hr;
}
static HRESULT WINAPI d3drm3_CreateDeviceFromClipper(IDirect3DRM3 *iface,
IDirectDrawClipper *clipper, GUID *guid, int width, int height,
IDirect3DRMDevice3 **device)
{
- FIXME("iface %p, clipper %p, guid %s, width %d, height %d, device %p partial
stub.\n",
+ struct d3drm *d3drm = impl_from_IDirect3DRM3(iface);
+ struct d3drm_device *object;
+ IDirectDraw *ddraw;
+ IDirectDrawSurface *render_target;
+ HRESULT hr;
+
+ TRACE("iface %p, clipper %p, guid %s, width %d, height %d, device %p.\n",
iface, clipper, debugstr_guid(guid), width, height, device);
- return Direct3DRMDevice_create(&IID_IDirect3DRMDevice3, (IUnknown **)device);
+ if (!device)
+ return D3DRMERR_BADVALUE;
+ *device = NULL;
+
+ if (!clipper || !width || !height)
+ return D3DRMERR_BADVALUE;
+
+ hr = DirectDrawCreate(NULL, &ddraw, NULL);
+ if (FAILED(hr))
+ return hr;
+
+ hr = d3drm_device_create(&object);
+ if (FAILED(hr))
+ {
+ IDirectDraw_Release(ddraw);
+ return hr;
+ }
+
+ hr = d3drm_device_create_surfaces_from_clipper(object, ddraw, clipper, width, height,
&render_target);
+ if (FAILED(hr))
+ {
+ IDirectDraw_Release(ddraw);
+ d3drm_device_destroy(object);
+ return hr;
+ }
+
+ hr = d3drm_device_init(object, 3, &d3drm->IDirect3DRM_iface, ddraw,
render_target, TRUE);
+ IDirectDraw_Release(ddraw);
+ IDirectDrawSurface_Release(render_target);
+ if (FAILED(hr))
+ d3drm_device_destroy(object);
+ else
+ *device = IDirect3DRMDevice3_from_impl(object);
+
+ return hr;
}
static HRESULT WINAPI d3drm3_CreateShadow(IDirect3DRM3 *iface, IUnknown *object,
IDirect3DRMLight *light,
Modified: trunk/reactos/dll/directx/wine/d3drm/d3drm_private.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3drm/d3d…
==============================================================================
--- trunk/reactos/dll/directx/wine/d3drm/d3drm_private.h [iso-8859-1] (original)
+++ trunk/reactos/dll/directx/wine/d3drm/d3drm_private.h [iso-8859-1] Tue Nov 24 10:43:48
2015
@@ -38,7 +38,12 @@
#include <wine/debug.h>
WINE_DEFAULT_DEBUG_CHANNEL(d3drm);
-HRESULT Direct3DRMDevice_create(REFIID riid, IUnknown** ppObj) DECLSPEC_HIDDEN;
+struct d3drm_device;
+
+HRESULT d3drm_device_create(struct d3drm_device **out) DECLSPEC_HIDDEN;
+IDirect3DRMDevice *IDirect3DRMDevice_from_impl(struct d3drm_device *device)
DECLSPEC_HIDDEN;
+IDirect3DRMDevice2 *IDirect3DRMDevice2_from_impl(struct d3drm_device *device)
DECLSPEC_HIDDEN;
+IDirect3DRMDevice3 *IDirect3DRMDevice3_from_impl(struct d3drm_device *device)
DECLSPEC_HIDDEN;
HRESULT Direct3DRMFace_create(REFIID riid, IUnknown** ret_iface) DECLSPEC_HIDDEN;
HRESULT Direct3DRMFrame_create(REFIID riid, IUnknown* parent_frame, IUnknown** ret_iface)
DECLSPEC_HIDDEN;
HRESULT Direct3DRMLight_create(IUnknown** ppObj) DECLSPEC_HIDDEN;
@@ -51,6 +56,16 @@
HRESULT load_mesh_data(IDirect3DRMMeshBuilder3 *iface, IDirectXFileData *data,
D3DRMLOADTEXTURECALLBACK load_texture_proc, void *arg)
DECLSPEC_HIDDEN;
+void d3drm_device_destroy(struct d3drm_device *device) DECLSPEC_HIDDEN;
+
+HRESULT d3drm_device_create_surfaces_from_clipper(struct d3drm_device *object,
IDirectDraw *ddraw, IDirectDrawClipper *clipper, int width, int height,
+ IDirectDrawSurface **surface) DECLSPEC_HIDDEN;
+
+HRESULT d3drm_device_init(struct d3drm_device *device, UINT version, IDirect3DRM *d3drm,
IDirectDraw *ddraw, IDirectDrawSurface *surface,
+ BOOL create_z_surface) DECLSPEC_HIDDEN;
+
+HRESULT d3drm_device_set_ddraw_device_d3d(struct d3drm_device *device, IDirect3DRM
*d3drm, IDirect3D *d3d, IDirect3DDevice *d3d_device) DECLSPEC_HIDDEN;
+
struct d3drm_file_header
{
WORD major;
Modified: trunk/reactos/dll/directx/wine/d3drm/device.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3drm/dev…
==============================================================================
--- trunk/reactos/dll/directx/wine/d3drm/device.c [iso-8859-1] (original)
+++ trunk/reactos/dll/directx/wine/d3drm/device.c [iso-8859-1] Tue Nov 24 10:43:48 2015
@@ -24,9 +24,15 @@
struct d3drm_device
{
+ IDirect3DRMDevice IDirect3DRMDevice_iface;
IDirect3DRMDevice2 IDirect3DRMDevice2_iface;
IDirect3DRMDevice3 IDirect3DRMDevice3_iface;
IDirect3DRMWinDevice IDirect3DRMWinDevice_iface;
+ IDirect3DRM *d3drm;
+ IDirectDraw *ddraw;
+ IDirectDrawSurface *primary_surface, *render_target;
+ IDirectDrawClipper *clipper;
+ IDirect3DDevice *device;
LONG ref;
BOOL dither;
D3DRMRENDERQUALITY quality;
@@ -35,6 +41,11 @@
DWORD width;
};
+static inline struct d3drm_device *impl_from_IDirect3DRMDevice(IDirect3DRMDevice *iface)
+{
+ return CONTAINING_RECORD(iface, struct d3drm_device, IDirect3DRMDevice_iface);
+}
+
static inline struct d3drm_device *impl_from_IDirect3DRMDevice2(IDirect3DRMDevice2
*iface)
{
return CONTAINING_RECORD(iface, struct d3drm_device, IDirect3DRMDevice2_iface);
@@ -45,71 +56,570 @@
return CONTAINING_RECORD(iface, struct d3drm_device, IDirect3DRMDevice3_iface);
}
+IDirect3DRMDevice *IDirect3DRMDevice_from_impl(struct d3drm_device *device)
+{
+ return &device->IDirect3DRMDevice_iface;
+}
+
+IDirect3DRMDevice2 *IDirect3DRMDevice2_from_impl(struct d3drm_device *device)
+{
+ return &device->IDirect3DRMDevice2_iface;
+}
+
+IDirect3DRMDevice3 *IDirect3DRMDevice3_from_impl(struct d3drm_device *device)
+{
+ return &device->IDirect3DRMDevice3_iface;
+}
+
+void d3drm_device_destroy(struct d3drm_device *device)
+{
+ if (device->device)
+ {
+ TRACE("Releasing attached ddraw interfaces.\n");
+ IDirect3DDevice_Release(device->device);
+ }
+ if (device->render_target)
+ IDirectDrawSurface_Release(device->render_target);
+ if (device->primary_surface)
+ {
+ TRACE("Releasing primary surface and attached clipper.\n");
+ IDirectDrawSurface_Release(device->primary_surface);
+ IDirectDrawClipper_Release(device->clipper);
+ }
+ if (device->ddraw)
+ {
+ IDirectDraw_Release(device->ddraw);
+ IDirect3DRM_Release(device->d3drm);
+ }
+ HeapFree(GetProcessHeap(), 0, device);
+}
+
static inline struct d3drm_device *impl_from_IDirect3DRMWinDevice(IDirect3DRMWinDevice
*iface)
{
return CONTAINING_RECORD(iface, struct d3drm_device, IDirect3DRMWinDevice_iface);
}
-static HRESULT WINAPI d3drm_device2_QueryInterface(IDirect3DRMDevice2 *iface, REFIID
riid, void **out)
-{
- struct d3drm_device *device = impl_from_IDirect3DRMDevice2(iface);
-
- TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out);
-
- if (IsEqualGUID(riid, &IID_IDirect3DRMDevice2)
- || IsEqualGUID(riid, &IID_IDirect3DRMDevice)
- || IsEqualGUID(riid, &IID_IUnknown))
+HRESULT d3drm_device_create_surfaces_from_clipper(struct d3drm_device *object,
IDirectDraw *ddraw, IDirectDrawClipper *clipper, int width, int height, IDirectDrawSurface
**surface)
+{
+ DDSURFACEDESC surface_desc;
+ IDirectDrawSurface *primary_surface, *render_target;
+ HWND window;
+ HRESULT hr;
+
+ hr = IDirectDrawClipper_GetHWnd(clipper, &window);
+ if (FAILED(hr))
+ return hr;
+
+ hr = IDirectDraw_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL);
+ if (FAILED(hr))
+ return hr;
+
+ memset(&surface_desc, 0, sizeof(surface_desc));
+ surface_desc.dwSize = sizeof(surface_desc);
+ surface_desc.dwFlags = DDSD_CAPS;
+ surface_desc.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE;
+ hr = IDirectDraw_CreateSurface(ddraw, &surface_desc, &primary_surface,
NULL);
+ if (FAILED(hr))
+ return hr;
+ hr = IDirectDrawSurface_SetClipper(primary_surface, clipper);
+ if (FAILED(hr))
{
- *out = &device->IDirect3DRMDevice2_iface;
+ IDirectDrawSurface_Release(primary_surface);
+ return hr;
}
- else if (IsEqualGUID(riid, &IID_IDirect3DRMDevice3))
+
+ memset(&surface_desc, 0, sizeof(surface_desc));
+ surface_desc.dwSize = sizeof(surface_desc);
+ surface_desc.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT;
+ surface_desc.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | DDSCAPS_3DDEVICE;
+ surface_desc.dwWidth = width;
+ surface_desc.dwHeight = height;
+
+ hr = IDirectDraw_CreateSurface(ddraw, &surface_desc, &render_target, NULL);
+ if (FAILED(hr))
{
- *out = &device->IDirect3DRMDevice3_iface;
+ IDirectDrawSurface_Release(primary_surface);
+ return hr;
}
- else if (IsEqualGUID(riid, &IID_IDirect3DRMWinDevice))
+
+ object->primary_surface = primary_surface;
+ object->clipper = clipper;
+ IDirectDrawClipper_AddRef(clipper);
+ *surface = render_target;
+
+ return D3DRM_OK;
+}
+
+HRESULT d3drm_device_init(struct d3drm_device *device, UINT version, IDirect3DRM *d3drm,
IDirectDraw *ddraw, IDirectDrawSurface *surface,
+ BOOL create_z_surface)
+{
+ DDSCAPS caps = { DDSCAPS_ZBUFFER };
+ IDirectDrawSurface *ds = NULL;
+ IDirect3DDevice *device1 = NULL;
+ IDirect3DDevice2 *device2 = NULL;
+ IDirect3D2 *d3d2 = NULL;
+ DDSURFACEDESC desc, surface_desc;
+ HRESULT hr;
+
+ device->ddraw = ddraw;
+ IDirectDraw_AddRef(ddraw);
+ device->d3drm = d3drm;
+ IDirect3DRM_AddRef(d3drm);
+ device->render_target = surface;
+ IDirectDrawSurface_AddRef(surface);
+
+ desc.dwSize = sizeof(desc);
+ hr = IDirectDrawSurface_GetSurfaceDesc(surface, &desc);
+ if (FAILED(hr))
+ return hr;
+
+ if (!(desc.ddsCaps.dwCaps & DDSCAPS_3DDEVICE))
+ return DDERR_INVALIDCAPS;
+
+ hr = IDirectDrawSurface_GetAttachedSurface(surface, &caps, &ds);
+ if (SUCCEEDED(hr))
{
- *out = &device->IDirect3DRMWinDevice_iface;
+ create_z_surface = FALSE;
+ IDirectDrawSurface_Release(ds);
+ ds = NULL;
}
+
+ if (create_z_surface)
+ {
+ memset(&surface_desc, 0, sizeof(surface_desc));
+ surface_desc.dwSize = sizeof(surface_desc);
+ surface_desc.dwFlags = DDSD_CAPS | DDSD_ZBUFFERBITDEPTH | DDSD_WIDTH |
DDSD_HEIGHT;
+ surface_desc.ddsCaps.dwCaps = DDSCAPS_ZBUFFER;
+ surface_desc.u2.dwZBufferBitDepth = 16;
+ surface_desc.dwWidth = desc.dwWidth;
+ surface_desc.dwHeight = desc.dwHeight;
+ hr = IDirectDraw_CreateSurface(ddraw, &surface_desc, &ds, NULL);
+ if (FAILED(hr))
+ return hr;
+
+ hr = IDirectDrawSurface_AddAttachedSurface(surface, ds);
+ IDirectDrawSurface_Release(ds);
+ if (FAILED(hr))
+ return hr;
+ }
+
+ if (version == 1)
+ hr = IDirectDrawSurface_QueryInterface(surface, &IID_IDirect3DRGBDevice,
(void **)&device1);
else
{
- *out = NULL;
- WARN("%s not implemented, returning E_NOINTERFACE.\n",
debugstr_guid(riid));
- return E_NOINTERFACE;
+ IDirectDraw_QueryInterface(ddraw, &IID_IDirect3D2, (void**)&d3d2);
+ hr = IDirect3D2_CreateDevice(d3d2, &IID_IDirect3DRGBDevice, surface,
&device2);
+ IDirect3D2_Release(d3d2);
}
-
- IUnknown_AddRef((IUnknown *)*out);
- return S_OK;
+ if (FAILED(hr))
+ {
+ IDirectDrawSurface_DeleteAttachedSurface(surface, 0, ds);
+ return hr;
+ }
+
+ if (version != 1)
+ {
+ hr = IDirect3DDevice2_QueryInterface(device2, &IID_IDirect3DDevice,
(void**)&device1);
+ IDirect3DDevice2_Release(device2);
+ if (FAILED(hr))
+ {
+ IDirectDrawSurface_DeleteAttachedSurface(surface, 0, ds);
+ return hr;
+ }
+ }
+ device->device = device1;
+
+ return hr;
+}
+
+HRESULT d3drm_device_set_ddraw_device_d3d(struct d3drm_device *device, IDirect3DRM
*d3drm, IDirect3D *d3d, IDirect3DDevice *d3d_device)
+{
+ device->d3drm = d3drm;
+ IDirect3DRM_AddRef(d3drm);
+ device->device = d3d_device;
+ IDirect3DDevice_AddRef(d3d_device);
+
+ return IDirect3D_QueryInterface(d3d, &IID_IDirectDraw, (void
**)&device->ddraw);
+}
+
+static HRESULT WINAPI d3drm_device1_QueryInterface(IDirect3DRMDevice *iface, REFIID riid,
void **out)
+{
+ struct d3drm_device *device = impl_from_IDirect3DRMDevice(iface);
+
+ TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out);
+
+ return IDirect3DRMDevice3_QueryInterface(&device->IDirect3DRMDevice3_iface,
riid, out);
+}
+
+static ULONG WINAPI d3drm_device1_AddRef(IDirect3DRMDevice *iface)
+{
+ struct d3drm_device *device = impl_from_IDirect3DRMDevice(iface);
+
+ TRACE("iface %p.\n", iface);
+
+ return IDirect3DRMDevice3_AddRef(&device->IDirect3DRMDevice3_iface);
+}
+
+static ULONG WINAPI d3drm_device1_Release(IDirect3DRMDevice *iface)
+{
+ struct d3drm_device *device = impl_from_IDirect3DRMDevice(iface);
+
+ TRACE("iface %p.\n", iface);
+
+ return IDirect3DRMDevice3_Release(&device->IDirect3DRMDevice3_iface);
+}
+
+static HRESULT WINAPI d3drm_device1_Clone(IDirect3DRMDevice *iface,
+ IUnknown *outer, REFIID iid, void **out)
+{
+ struct d3drm_device *device = impl_from_IDirect3DRMDevice(iface);
+
+ TRACE("iface %p, outer %p, iid %s, out %p.\n", iface, outer,
debugstr_guid(iid), out);
+
+ return IDirect3DRMDevice3_Clone(&device->IDirect3DRMDevice3_iface, outer, iid,
out);
+}
+
+static HRESULT WINAPI d3drm_device1_AddDestroyCallback(IDirect3DRMDevice *iface,
+ D3DRMOBJECTCALLBACK cb, void *ctx)
+{
+ FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3drm_device1_DeleteDestroyCallback(IDirect3DRMDevice *iface,
+ D3DRMOBJECTCALLBACK cb, void *ctx)
+{
+ FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3drm_device1_SetAppData(IDirect3DRMDevice *iface, DWORD data)
+{
+ struct d3drm_device *device = impl_from_IDirect3DRMDevice(iface);
+
+ TRACE("iface %p, data %#x.\n", iface, data);
+
+ return IDirect3DRMDevice3_SetAppData(&device->IDirect3DRMDevice3_iface,
data);
+}
+
+static DWORD WINAPI d3drm_device1_GetAppData(IDirect3DRMDevice *iface)
+{
+ struct d3drm_device *device = impl_from_IDirect3DRMDevice(iface);
+
+ TRACE("iface %p.\n", iface);
+
+ return IDirect3DRMDevice3_GetAppData(&device->IDirect3DRMDevice3_iface);
+}
+
+static HRESULT WINAPI d3drm_device1_SetName(IDirect3DRMDevice *iface, const char *name)
+{
+ struct d3drm_device *device = impl_from_IDirect3DRMDevice(iface);
+
+ TRACE("iface %p, name %s.\n", iface, debugstr_a(name));
+
+ return IDirect3DRMDevice3_SetName(&device->IDirect3DRMDevice3_iface, name);
+}
+
+static HRESULT WINAPI d3drm_device1_GetName(IDirect3DRMDevice *iface, DWORD *size, char
*name)
+{
+ struct d3drm_device *device = impl_from_IDirect3DRMDevice(iface);
+
+ TRACE("iface %p, size %p, name %p.\n", iface, size, name);
+
+ return IDirect3DRMDevice3_GetName(&device->IDirect3DRMDevice3_iface, size,
name);
+}
+
+static HRESULT WINAPI d3drm_device1_GetClassName(IDirect3DRMDevice *iface, DWORD *size,
char *name)
+{
+ struct d3drm_device *device = impl_from_IDirect3DRMDevice(iface);
+
+ TRACE("iface %p, size %p, name %p.\n", iface, size, name);
+
+ return IDirect3DRMDevice3_GetClassName(&device->IDirect3DRMDevice3_iface,
size, name);
+}
+
+static HRESULT WINAPI d3drm_device1_Init(IDirect3DRMDevice *iface, ULONG width, ULONG
height)
+{
+ struct d3drm_device *device = impl_from_IDirect3DRMDevice(iface);
+
+ TRACE("iface %p, width %u, height %u.\n", iface, width, height);
+
+ return IDirect3DRMDevice3_Init(&device->IDirect3DRMDevice3_iface, width,
height);
+}
+
+static HRESULT WINAPI d3drm_device1_InitFromD3D(IDirect3DRMDevice *iface,
+ IDirect3D *d3d, IDirect3DDevice *d3d_device)
+{
+ struct d3drm_device *device = impl_from_IDirect3DRMDevice(iface);
+
+ TRACE("iface %p, d3d %p, d3d_device %p.\n", iface, d3d, d3d_device);
+
+ return IDirect3DRMDevice3_InitFromD3D(&device->IDirect3DRMDevice3_iface, d3d,
d3d_device);
+}
+
+static HRESULT WINAPI d3drm_device1_InitFromClipper(IDirect3DRMDevice *iface,
+ IDirectDrawClipper *clipper, GUID *guid, int width, int height)
+{
+ struct d3drm_device *device = impl_from_IDirect3DRMDevice(iface);
+
+ TRACE("iface %p, clipper %p, guid %s, width %d, height %d.\n",
+ iface, clipper, debugstr_guid(guid), width, height);
+
+ return IDirect3DRMDevice3_InitFromClipper(&device->IDirect3DRMDevice3_iface,
+ clipper, guid, width, height);
+}
+
+static HRESULT WINAPI d3drm_device1_Update(IDirect3DRMDevice *iface)
+{
+ FIXME("iface %p stub!\n", iface);
+
+ return D3DRM_OK;
+}
+
+static HRESULT WINAPI d3drm_device1_AddUpdateCallback(IDirect3DRMDevice *iface,
+ D3DRMUPDATECALLBACK cb, void *ctx)
+{
+ FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3drm_device1_DeleteUpdateCallback(IDirect3DRMDevice *iface,
+ D3DRMUPDATECALLBACK cb, void *ctx)
+{
+ FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3drm_device1_SetBufferCount(IDirect3DRMDevice *iface, DWORD
count)
+{
+ struct d3drm_device *device = impl_from_IDirect3DRMDevice(iface);
+
+ TRACE("iface %p, count %u.\n", iface, count);
+
+ return IDirect3DRMDevice3_SetBufferCount(&device->IDirect3DRMDevice3_iface,
count);
+}
+
+static DWORD WINAPI d3drm_device1_GetBufferCount(IDirect3DRMDevice *iface)
+{
+ struct d3drm_device *device = impl_from_IDirect3DRMDevice(iface);
+
+ TRACE("iface %p.\n", iface);
+
+ return IDirect3DRMDevice3_GetBufferCount(&device->IDirect3DRMDevice3_iface);
+}
+
+static HRESULT WINAPI d3drm_device1_SetDither(IDirect3DRMDevice *iface, BOOL enable)
+{
+ struct d3drm_device *device = impl_from_IDirect3DRMDevice(iface);
+
+ TRACE("iface %p, enabled %#x.\n", iface, enable);
+
+ return IDirect3DRMDevice3_SetDither(&device->IDirect3DRMDevice3_iface,
enable);
+}
+
+static HRESULT WINAPI d3drm_device1_SetShades(IDirect3DRMDevice *iface, DWORD count)
+{
+ struct d3drm_device *device = impl_from_IDirect3DRMDevice(iface);
+
+ TRACE("iface %p, count %u.\n", iface, count);
+
+ return IDirect3DRMDevice3_SetShades(&device->IDirect3DRMDevice3_iface,
count);
+}
+
+static HRESULT WINAPI d3drm_device1_SetQuality(IDirect3DRMDevice *iface,
D3DRMRENDERQUALITY quality)
+{
+ struct d3drm_device *device = impl_from_IDirect3DRMDevice(iface);
+
+ TRACE("iface %p, quality %u.\n", iface, quality);
+
+ return IDirect3DRMDevice3_SetQuality(&device->IDirect3DRMDevice3_iface,
quality);
+}
+
+static HRESULT WINAPI d3drm_device1_SetTextureQuality(IDirect3DRMDevice *iface,
D3DRMTEXTUREQUALITY quality)
+{
+ struct d3drm_device *device = impl_from_IDirect3DRMDevice(iface);
+
+ TRACE("iface %p, quality %u.\n", iface, quality);
+
+ return IDirect3DRMDevice3_SetTextureQuality(&device->IDirect3DRMDevice3_iface,
quality);
+}
+
+static HRESULT WINAPI d3drm_device1_GetViewports(IDirect3DRMDevice *iface,
IDirect3DRMViewportArray **array)
+{
+ struct d3drm_device *device = impl_from_IDirect3DRMDevice(iface);
+
+ TRACE("iface %p, array %p.\n", iface, array);
+
+ return IDirect3DRMDevice3_GetViewports(&device->IDirect3DRMDevice3_iface,
array);
+}
+
+static BOOL WINAPI d3drm_device1_GetDither(IDirect3DRMDevice *iface)
+{
+ struct d3drm_device *device = impl_from_IDirect3DRMDevice(iface);
+
+ TRACE("iface %p.\n", iface);
+
+ return IDirect3DRMDevice3_GetDither(&device->IDirect3DRMDevice3_iface);
+}
+
+static DWORD WINAPI d3drm_device1_GetShades(IDirect3DRMDevice *iface)
+{
+ struct d3drm_device *device = impl_from_IDirect3DRMDevice(iface);
+
+ TRACE("iface %p.\n", iface);
+
+ return IDirect3DRMDevice3_GetShades(&device->IDirect3DRMDevice3_iface);
+}
+
+static DWORD WINAPI d3drm_device1_GetHeight(IDirect3DRMDevice *iface)
+{
+ struct d3drm_device *device = impl_from_IDirect3DRMDevice(iface);
+
+ TRACE("iface %p.\n", iface);
+
+ return IDirect3DRMDevice3_GetHeight(&device->IDirect3DRMDevice3_iface);
+}
+
+static DWORD WINAPI d3drm_device1_GetWidth(IDirect3DRMDevice *iface)
+{
+ struct d3drm_device *device = impl_from_IDirect3DRMDevice(iface);
+
+ TRACE("iface %p.\n", iface);
+
+ return IDirect3DRMDevice3_GetWidth(&device->IDirect3DRMDevice3_iface);
+}
+
+static DWORD WINAPI d3drm_device1_GetTrianglesDrawn(IDirect3DRMDevice *iface)
+{
+ struct d3drm_device *device = impl_from_IDirect3DRMDevice(iface);
+
+ TRACE("iface %p.\n", iface);
+
+ return
IDirect3DRMDevice3_GetTrianglesDrawn(&device->IDirect3DRMDevice3_iface);
+}
+
+static DWORD WINAPI d3drm_device1_GetWireframeOptions(IDirect3DRMDevice *iface)
+{
+ struct d3drm_device *device = impl_from_IDirect3DRMDevice(iface);
+
+ TRACE("iface %p.\n", iface);
+
+ return
IDirect3DRMDevice3_GetWireframeOptions(&device->IDirect3DRMDevice3_iface);
+}
+
+static D3DRMRENDERQUALITY WINAPI d3drm_device1_GetQuality(IDirect3DRMDevice *iface)
+{
+ struct d3drm_device *device = impl_from_IDirect3DRMDevice(iface);
+
+ TRACE("iface %p.\n", iface);
+
+ return IDirect3DRMDevice3_GetQuality(&device->IDirect3DRMDevice3_iface);
+}
+
+static D3DCOLORMODEL WINAPI d3drm_device1_GetColorModel(IDirect3DRMDevice *iface)
+{
+ struct d3drm_device *device = impl_from_IDirect3DRMDevice(iface);
+
+ TRACE("iface %p stub!\n", iface);
+
+ return IDirect3DRMDevice3_GetColorModel(&device->IDirect3DRMDevice3_iface);
+}
+
+static D3DRMTEXTUREQUALITY WINAPI d3drm_device1_GetTextureQuality(IDirect3DRMDevice
*iface)
+{
+ struct d3drm_device *device = impl_from_IDirect3DRMDevice(iface);
+
+ TRACE("iface %p.\n", iface);
+
+ return
IDirect3DRMDevice3_GetTextureQuality(&device->IDirect3DRMDevice3_iface);
+}
+
+static HRESULT WINAPI d3drm_device1_GetDirect3DDevice(IDirect3DRMDevice *iface,
IDirect3DDevice **d3d_device)
+{
+ struct d3drm_device *device = impl_from_IDirect3DRMDevice(iface);
+
+ TRACE("iface %p, d3d_device %p.\n", iface, d3d_device);
+
+ return IDirect3DRMDevice3_GetDirect3DDevice(&device->IDirect3DRMDevice3_iface,
d3d_device);
+}
+
+static const struct IDirect3DRMDeviceVtbl d3drm_device1_vtbl =
+{
+ d3drm_device1_QueryInterface,
+ d3drm_device1_AddRef,
+ d3drm_device1_Release,
+ d3drm_device1_Clone,
+ d3drm_device1_AddDestroyCallback,
+ d3drm_device1_DeleteDestroyCallback,
+ d3drm_device1_SetAppData,
+ d3drm_device1_GetAppData,
+ d3drm_device1_SetName,
+ d3drm_device1_GetName,
+ d3drm_device1_GetClassName,
+ d3drm_device1_Init,
+ d3drm_device1_InitFromD3D,
+ d3drm_device1_InitFromClipper,
+ d3drm_device1_Update,
+ d3drm_device1_AddUpdateCallback,
+ d3drm_device1_DeleteUpdateCallback,
+ d3drm_device1_SetBufferCount,
+ d3drm_device1_GetBufferCount,
+ d3drm_device1_SetDither,
+ d3drm_device1_SetShades,
+ d3drm_device1_SetQuality,
+ d3drm_device1_SetTextureQuality,
+ d3drm_device1_GetViewports,
+ d3drm_device1_GetDither,
+ d3drm_device1_GetShades,
+ d3drm_device1_GetHeight,
+ d3drm_device1_GetWidth,
+ d3drm_device1_GetTrianglesDrawn,
+ d3drm_device1_GetWireframeOptions,
+ d3drm_device1_GetQuality,
+ d3drm_device1_GetColorModel,
+ d3drm_device1_GetTextureQuality,
+ d3drm_device1_GetDirect3DDevice,
+};
+
+static HRESULT WINAPI d3drm_device2_QueryInterface(IDirect3DRMDevice2 *iface, REFIID
riid, void **out)
+{
+ struct d3drm_device *device = impl_from_IDirect3DRMDevice2(iface);
+
+ TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out);
+
+ return IDirect3DRMDevice3_QueryInterface(&device->IDirect3DRMDevice3_iface,
riid, out);
}
static ULONG WINAPI d3drm_device2_AddRef(IDirect3DRMDevice2 *iface)
{
struct d3drm_device *device = impl_from_IDirect3DRMDevice2(iface);
- ULONG refcount = InterlockedIncrement(&device->ref);
-
- TRACE("%p increasing refcount to %u.\n", iface, refcount);
-
- return refcount;
+
+ TRACE("iface %p.\n", iface);
+
+ return IDirect3DRMDevice3_AddRef(&device->IDirect3DRMDevice3_iface);
}
static ULONG WINAPI d3drm_device2_Release(IDirect3DRMDevice2 *iface)
{
struct d3drm_device *device = impl_from_IDirect3DRMDevice2(iface);
- ULONG refcount = InterlockedDecrement(&device->ref);
-
- TRACE("%p decreasing refcount to %u.\n", iface, refcount);
-
- if (!refcount)
- HeapFree(GetProcessHeap(), 0, device);
-
- return refcount;
+
+ TRACE("iface %p.\n", iface);
+
+ return IDirect3DRMDevice3_Release(&device->IDirect3DRMDevice3_iface);
}
static HRESULT WINAPI d3drm_device2_Clone(IDirect3DRMDevice2 *iface,
IUnknown *outer, REFIID iid, void **out)
{
- FIXME("iface %p, outer %p, iid %s, out %p stub!\n", iface, outer,
debugstr_guid(iid), out);
-
- return E_NOTIMPL;
+ struct d3drm_device *device = impl_from_IDirect3DRMDevice2(iface);
+
+ TRACE("iface %p, outer %p, iid %s, out %p\n", iface, outer,
debugstr_guid(iid), out);
+
+ return IDirect3DRMDevice3_Clone(&device->IDirect3DRMDevice3_iface, outer, iid,
out);
}
static HRESULT WINAPI d3drm_device2_AddDestroyCallback(IDirect3DRMDevice2 *iface,
@@ -130,30 +640,38 @@
static HRESULT WINAPI d3drm_device2_SetAppData(IDirect3DRMDevice2 *iface, DWORD data)
{
- FIXME("iface %p, data %#x stub!\n", iface, data);
-
- return E_NOTIMPL;
+ struct d3drm_device *device = impl_from_IDirect3DRMDevice2(iface);
+
+ TRACE("iface %p, data %#x.\n", iface, data);
+
+ return IDirect3DRMDevice3_SetAppData(&device->IDirect3DRMDevice3_iface,
data);
}
static DWORD WINAPI d3drm_device2_GetAppData(IDirect3DRMDevice2 *iface)
{
- FIXME("iface %p stub!\n", iface);
-
- return 0;
+ struct d3drm_device *device = impl_from_IDirect3DRMDevice2(iface);
+
+ TRACE("iface %p.\n", iface);
+
+ return IDirect3DRMDevice3_GetAppData(&device->IDirect3DRMDevice3_iface);
}
static HRESULT WINAPI d3drm_device2_SetName(IDirect3DRMDevice2 *iface, const char *name)
{
- FIXME("iface %p, name %s stub!\n", iface, debugstr_a(name));
-
- return E_NOTIMPL;
+ struct d3drm_device *device = impl_from_IDirect3DRMDevice2(iface);
+
+ TRACE("iface %p, name %s.\n", iface, debugstr_a(name));
+
+ return IDirect3DRMDevice3_SetName(&device->IDirect3DRMDevice3_iface, name);
}
static HRESULT WINAPI d3drm_device2_GetName(IDirect3DRMDevice2 *iface, DWORD *size, char
*name)
{
- FIXME("iface %p, size %p, name %p stub!\n", iface, size, name);
-
- return E_NOTIMPL;
+ struct d3drm_device *device = impl_from_IDirect3DRMDevice2(iface);
+
+ TRACE("iface %p, size %p, name %p.\n", iface, size, name);
+
+ return IDirect3DRMDevice3_GetName(&device->IDirect3DRMDevice3_iface, size,
name);
}
static HRESULT WINAPI d3drm_device2_GetClassName(IDirect3DRMDevice2 *iface, DWORD *size,
char *name)
@@ -177,9 +695,11 @@
static HRESULT WINAPI d3drm_device2_InitFromD3D(IDirect3DRMDevice2 *iface,
IDirect3D *d3d, IDirect3DDevice *d3d_device)
{
- FIXME("iface %p, d3d %p, d3d_device %p stub!\n", iface, d3d, d3d_device);
-
- return E_NOTIMPL;
+ struct d3drm_device *device = impl_from_IDirect3DRMDevice2(iface);
+
+ TRACE("iface %p, d3d %p, d3d_device %p.\n", iface, d3d, d3d_device);
+
+ return IDirect3DRMDevice3_InitFromD3D(&device->IDirect3DRMDevice3_iface, d3d,
d3d_device);
}
static HRESULT WINAPI d3drm_device2_InitFromClipper(IDirect3DRMDevice2 *iface,
@@ -219,16 +739,20 @@
static HRESULT WINAPI d3drm_device2_SetBufferCount(IDirect3DRMDevice2 *iface, DWORD
count)
{
- FIXME("iface %p, count %u.\n", iface, count);
-
- return E_NOTIMPL;
+ struct d3drm_device *device = impl_from_IDirect3DRMDevice2(iface);
+
+ TRACE("iface %p, count %u.\n", iface, count);
+
+ return IDirect3DRMDevice3_SetBufferCount(&device->IDirect3DRMDevice3_iface,
count);
}
static DWORD WINAPI d3drm_device2_GetBufferCount(IDirect3DRMDevice2 *iface)
{
- FIXME("iface %p stub!\n", iface);
-
- return E_NOTIMPL;
+ struct d3drm_device *device = impl_from_IDirect3DRMDevice2(iface);
+
+ TRACE("iface %p.\n", iface);
+
+ return IDirect3DRMDevice3_GetBufferCount(&device->IDirect3DRMDevice3_iface);
}
static HRESULT WINAPI d3drm_device2_SetDither(IDirect3DRMDevice2 *iface, BOOL enable)
@@ -242,9 +766,11 @@
static HRESULT WINAPI d3drm_device2_SetShades(IDirect3DRMDevice2 *iface, DWORD count)
{
- FIXME("iface %p, count %u stub!\n", iface, count);
-
- return E_NOTIMPL;
+ struct d3drm_device *device = impl_from_IDirect3DRMDevice2(iface);
+
+ TRACE("iface %p, count %u.\n", iface, count);
+
+ return IDirect3DRMDevice3_SetShades(&device->IDirect3DRMDevice3_iface,
count);
}
static HRESULT WINAPI d3drm_device2_SetQuality(IDirect3DRMDevice2 *iface,
D3DRMRENDERQUALITY quality)
@@ -258,16 +784,20 @@
static HRESULT WINAPI d3drm_device2_SetTextureQuality(IDirect3DRMDevice2 *iface,
D3DRMTEXTUREQUALITY quality)
{
- FIXME("iface %p, quality %u stub!\n", iface, quality);
-
- return E_NOTIMPL;
+ struct d3drm_device *device = impl_from_IDirect3DRMDevice2(iface);
+
+ TRACE("iface %p, quality %u.\n", iface, quality);
+
+ return IDirect3DRMDevice3_SetTextureQuality(&device->IDirect3DRMDevice3_iface,
quality);
}
static HRESULT WINAPI d3drm_device2_GetViewports(IDirect3DRMDevice2 *iface,
IDirect3DRMViewportArray **array)
{
- FIXME("iface %p, array %p stub!\n", iface, array);
-
- return E_NOTIMPL;
+ struct d3drm_device *device = impl_from_IDirect3DRMDevice2(iface);
+
+ TRACE("iface %p, array %p.\n", iface, array);
+
+ return IDirect3DRMDevice3_GetViewports(&device->IDirect3DRMDevice3_iface,
array);
}
static BOOL WINAPI d3drm_device2_GetDither(IDirect3DRMDevice2 *iface)
@@ -281,9 +811,11 @@
static DWORD WINAPI d3drm_device2_GetShades(IDirect3DRMDevice2 *iface)
{
- FIXME("iface %p stub!\n", iface);
-
- return E_NOTIMPL;
+ struct d3drm_device *device = impl_from_IDirect3DRMDevice2(iface);
+
+ TRACE("iface %p.\n", iface);
+
+ return IDirect3DRMDevice3_GetShades(&device->IDirect3DRMDevice3_iface);
}
static DWORD WINAPI d3drm_device2_GetHeight(IDirect3DRMDevice2 *iface)
@@ -306,16 +838,20 @@
static DWORD WINAPI d3drm_device2_GetTrianglesDrawn(IDirect3DRMDevice2 *iface)
{
- FIXME("iface %p stub!\n", iface);
-
- return E_NOTIMPL;
+ struct d3drm_device *device = impl_from_IDirect3DRMDevice2(iface);
+
+ TRACE("iface %p.\n", iface);
+
+ return
IDirect3DRMDevice3_GetTrianglesDrawn(&device->IDirect3DRMDevice3_iface);
}
static DWORD WINAPI d3drm_device2_GetWireframeOptions(IDirect3DRMDevice2 *iface)
{
- FIXME("iface %p stub!\n", iface);
-
- return E_NOTIMPL;
+ struct d3drm_device *device = impl_from_IDirect3DRMDevice2(iface);
+
+ TRACE("iface %p.\n", iface);
+
+ return
IDirect3DRMDevice3_GetWireframeOptions(&device->IDirect3DRMDevice3_iface);
}
static D3DRMRENDERQUALITY WINAPI d3drm_device2_GetQuality(IDirect3DRMDevice2 *iface)
@@ -329,40 +865,50 @@
static D3DCOLORMODEL WINAPI d3drm_device2_GetColorModel(IDirect3DRMDevice2 *iface)
{
- FIXME("iface %p stub!\n", iface);
-
- return E_NOTIMPL;
+ struct d3drm_device *device = impl_from_IDirect3DRMDevice2(iface);
+
+ TRACE("iface %p.\n", iface);
+
+ return IDirect3DRMDevice3_GetColorModel(&device->IDirect3DRMDevice3_iface);
}
static D3DRMTEXTUREQUALITY WINAPI d3drm_device2_GetTextureQuality(IDirect3DRMDevice2
*iface)
{
- FIXME("iface %p stub!\n", iface);
-
- return E_NOTIMPL;
+ struct d3drm_device *device = impl_from_IDirect3DRMDevice2(iface);
+
+ TRACE("iface %p.\n", iface);
+
+ return
IDirect3DRMDevice3_GetTextureQuality(&device->IDirect3DRMDevice3_iface);
}
static HRESULT WINAPI d3drm_device2_GetDirect3DDevice(IDirect3DRMDevice2 *iface,
IDirect3DDevice **d3d_device)
{
- FIXME("iface %p, d3d_device %p stub!\n", iface, d3d_device);
-
- return E_NOTIMPL;
+ struct d3drm_device *device = impl_from_IDirect3DRMDevice2(iface);
+
+ TRACE("iface %p, d3d_device %p.\n", iface, d3d_device);
+
+ return IDirect3DRMDevice3_GetDirect3DDevice(&device->IDirect3DRMDevice3_iface,
d3d_device);
}
static HRESULT WINAPI d3drm_device2_InitFromD3D2(IDirect3DRMDevice2 *iface,
IDirect3D2 *d3d, IDirect3DDevice2 *d3d_device)
{
- FIXME("iface %p, d3d %p, d3d_device %p stub!\n", iface, d3d, d3d_device);
-
- return E_NOTIMPL;
+ struct d3drm_device *device = impl_from_IDirect3DRMDevice2(iface);
+
+ TRACE("iface %p, d3d %p, d3d_device %p.\n", iface, d3d, d3d_device);
+
+ return IDirect3DRMDevice3_InitFromD3D2(&device->IDirect3DRMDevice3_iface, d3d,
d3d_device);
}
static HRESULT WINAPI d3drm_device2_InitFromSurface(IDirect3DRMDevice2 *iface,
GUID *guid, IDirectDraw *ddraw, IDirectDrawSurface *backbuffer)
{
- FIXME("iface %p, guid %s, ddraw %p, backbuffer %p stub!\n",
+ struct d3drm_device *device = impl_from_IDirect3DRMDevice2(iface);
+
+ TRACE("iface %p, guid %s, ddraw %p, backbuffer %p.\n",
iface, debugstr_guid(guid), ddraw, backbuffer);
- return E_NOTIMPL;
+ return IDirect3DRMDevice3_InitFromSurface(&device->IDirect3DRMDevice3_iface,
guid, ddraw, backbuffer);
}
static HRESULT WINAPI d3drm_device2_SetRenderMode(IDirect3DRMDevice2 *iface, DWORD
flags)
@@ -385,9 +931,11 @@
static HRESULT WINAPI d3drm_device2_GetDirect3DDevice2(IDirect3DRMDevice2 *iface,
IDirect3DDevice2 **d3d_device)
{
- FIXME("iface %p, d3d_device %p stub!\n", iface, d3d_device);
-
- return E_NOTIMPL;
+ struct d3drm_device *device = impl_from_IDirect3DRMDevice2(iface);
+
+ TRACE("iface %p, d3d_device %p.\n", iface, d3d_device);
+
+ return
IDirect3DRMDevice3_GetDirect3DDevice2(&device->IDirect3DRMDevice3_iface,
d3d_device);
}
static const struct IDirect3DRMDevice2Vtbl d3drm_device2_vtbl =
@@ -437,21 +985,58 @@
{
struct d3drm_device *device = impl_from_IDirect3DRMDevice3(iface);
- return d3drm_device2_QueryInterface(&device->IDirect3DRMDevice2_iface, riid,
out);
+ TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out);
+
+ if (IsEqualGUID(riid, &IID_IDirect3DRMDevice3)
+ || IsEqualGUID(riid, &IID_IDirect3DRMObject)
+ || IsEqualGUID(riid, &IID_IUnknown))
+ {
+ *out = &device->IDirect3DRMDevice3_iface;
+ }
+ else if (IsEqualGUID(riid, &IID_IDirect3DRMDevice2))
+ {
+ *out = &device->IDirect3DRMDevice2_iface;
+ }
+ else if (IsEqualGUID(riid, &IID_IDirect3DRMDevice))
+ {
+ *out = &device->IDirect3DRMDevice_iface;
+ }
+ else if (IsEqualGUID(riid, &IID_IDirect3DRMWinDevice))
+ {
+ *out = &device->IDirect3DRMWinDevice_iface;
+ }
+ else
+ {
+ *out = NULL;
+ WARN("%s not implemented, returning CLASS_E_CLASSNOTAVAILABLE.\n",
debugstr_guid(riid));
+ return CLASS_E_CLASSNOTAVAILABLE;
+ }
+
+ IUnknown_AddRef((IUnknown *)*out);
+ return S_OK;
}
static ULONG WINAPI d3drm_device3_AddRef(IDirect3DRMDevice3 *iface)
{
struct d3drm_device *device = impl_from_IDirect3DRMDevice3(iface);
-
- return d3drm_device2_AddRef(&device->IDirect3DRMDevice2_iface);
+ ULONG refcount = InterlockedIncrement(&device->ref);
+
+ TRACE("%p increasing refcount to %u.\n", iface, refcount);
+
+ return refcount;
}
static ULONG WINAPI d3drm_device3_Release(IDirect3DRMDevice3 *iface)
{
struct d3drm_device *device = impl_from_IDirect3DRMDevice3(iface);
-
- return d3drm_device2_Release(&device->IDirect3DRMDevice2_iface);
+ ULONG refcount = InterlockedDecrement(&device->ref);
+
+ TRACE("%p decreasing refcount to %u.\n", iface, refcount);
+
+ if (!refcount)
+ d3drm_device_destroy(device);
+
+ return refcount;
}
static HRESULT WINAPI d3drm_device3_Clone(IDirect3DRMDevice3 *iface,
@@ -706,9 +1291,13 @@
static HRESULT WINAPI d3drm_device3_GetDirect3DDevice(IDirect3DRMDevice3 *iface,
IDirect3DDevice **d3d_device)
{
- FIXME("iface %p, d3d_device %p stub!\n", iface, d3d_device);
-
- return E_NOTIMPL;
+ struct d3drm_device *device = impl_from_IDirect3DRMDevice3(iface);
+ TRACE("iface %p, d3d_device %p!\n", iface, d3d_device);
+
+ *d3d_device = device->device;
+ IDirect3DDevice_AddRef(*d3d_device);
+
+ return D3DRM_OK;
}
static HRESULT WINAPI d3drm_device3_InitFromD3D2(IDirect3DRMDevice3 *iface,
@@ -750,9 +1339,13 @@
static HRESULT WINAPI d3drm_device3_GetDirect3DDevice2(IDirect3DRMDevice3 *iface,
IDirect3DDevice2 **d3d_device)
{
- FIXME("iface %p, d3d_device %p stub!\n", iface, d3d_device);
-
- return E_NOTIMPL;
+ struct d3drm_device *device = impl_from_IDirect3DRMDevice3(iface);
+
+ TRACE("iface %p, d3d_device %p.\n", iface, d3d_device);
+
+ IDirect3DDevice_QueryInterface(device->device, &IID_IDirect3DDevice2,
(void**)d3d_device);
+
+ return D3DRM_OK;
}
static HRESULT WINAPI d3drm_device3_FindPreferredTextureFormat(IDirect3DRMDevice3
*iface,
@@ -849,29 +1442,37 @@
{
struct d3drm_device *device = impl_from_IDirect3DRMWinDevice(iface);
- return d3drm_device2_QueryInterface(&device->IDirect3DRMDevice2_iface, riid,
out);
+ TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out);
+
+ return d3drm_device3_QueryInterface(&device->IDirect3DRMDevice3_iface, riid,
out);
}
static ULONG WINAPI d3drm_device_win_AddRef(IDirect3DRMWinDevice *iface)
{
struct d3drm_device *device = impl_from_IDirect3DRMWinDevice(iface);
- return d3drm_device2_AddRef(&device->IDirect3DRMDevice2_iface);
+ TRACE("iface %p.\n", iface);
+
+ return d3drm_device3_AddRef(&device->IDirect3DRMDevice3_iface);
}
static ULONG WINAPI d3drm_device_win_Release(IDirect3DRMWinDevice *iface)
{
struct d3drm_device *device = impl_from_IDirect3DRMWinDevice(iface);
- return d3drm_device2_Release(&device->IDirect3DRMDevice2_iface);
+ TRACE("iface %p.\n", iface);
+
+ return d3drm_device3_Release(&device->IDirect3DRMDevice3_iface);
}
static HRESULT WINAPI d3drm_device_win_Clone(IDirect3DRMWinDevice *iface,
IUnknown *outer, REFIID iid, void **out)
{
- FIXME("iface %p, outer %p, iid %s, out %p stub!\n", iface, outer,
debugstr_guid(iid), out);
-
- return E_NOTIMPL;
+ struct d3drm_device *device = impl_from_IDirect3DRMWinDevice(iface);
+
+ TRACE("iface %p, outer %p, iid %s, out %p\n", iface, outer,
debugstr_guid(iid), out);
+
+ return IDirect3DRMDevice3_Clone(&device->IDirect3DRMDevice3_iface, outer, iid,
out);
}
static HRESULT WINAPI d3drm_device_win_AddDestroyCallback(IDirect3DRMWinDevice *iface,
@@ -892,30 +1493,38 @@
static HRESULT WINAPI d3drm_device_win_SetAppData(IDirect3DRMWinDevice *iface, DWORD
data)
{
- FIXME("iface %p, data %#x stub!\n", iface, data);
-
- return E_NOTIMPL;
+ struct d3drm_device *device = impl_from_IDirect3DRMWinDevice(iface);
+
+ TRACE("iface %p, data %#x.\n", iface, data);
+
+ return IDirect3DRMDevice3_SetAppData(&device->IDirect3DRMDevice3_iface,
data);
}
static DWORD WINAPI d3drm_device_win_GetAppData(IDirect3DRMWinDevice *iface)
{
- FIXME("iface %p stub!\n", iface);
-
- return 0;
+ struct d3drm_device *device = impl_from_IDirect3DRMWinDevice(iface);
+
+ TRACE("iface %p.\n", iface);
+
+ return IDirect3DRMDevice3_GetAppData(&device->IDirect3DRMDevice3_iface);
}
static HRESULT WINAPI d3drm_device_win_SetName(IDirect3DRMWinDevice *iface, const char
*name)
{
- FIXME("iface %p, name %s stub!\n", iface, debugstr_a(name));
-
- return E_NOTIMPL;
+ struct d3drm_device *device = impl_from_IDirect3DRMWinDevice(iface);
+
+ TRACE("iface %p, name %s.\n", iface, debugstr_a(name));
+
+ return IDirect3DRMDevice3_SetName(&device->IDirect3DRMDevice3_iface, name);
}
static HRESULT WINAPI d3drm_device_win_GetName(IDirect3DRMWinDevice *iface, DWORD *size,
char *name)
{
- FIXME("iface %p, size %p, name %p stub!\n", iface, size, name);
-
- return E_NOTIMPL;
+ struct d3drm_device *device = impl_from_IDirect3DRMWinDevice(iface);
+
+ TRACE("iface %p, size %p, name %p stub!\n", iface, size, name);
+
+ return IDirect3DRMDevice3_GetName(&device->IDirect3DRMDevice3_iface, size,
name);
}
static HRESULT WINAPI d3drm_device_win_GetClassName(IDirect3DRMWinDevice *iface, DWORD
*size, char *name)
@@ -958,24 +1567,22 @@
d3drm_device_win_HandleActivate,
};
-HRESULT Direct3DRMDevice_create(REFIID riid, IUnknown **out)
+HRESULT d3drm_device_create(struct d3drm_device **out)
{
struct d3drm_device *object;
- TRACE("riid %s, out %p.\n", debugstr_guid(riid), out);
+ TRACE("out %p.\n", out);
if (!(object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object))))
return E_OUTOFMEMORY;
+ object->IDirect3DRMDevice_iface.lpVtbl = &d3drm_device1_vtbl;
object->IDirect3DRMDevice2_iface.lpVtbl = &d3drm_device2_vtbl;
object->IDirect3DRMDevice3_iface.lpVtbl = &d3drm_device3_vtbl;
object->IDirect3DRMWinDevice_iface.lpVtbl = &d3drm_device_win_vtbl;
object->ref = 1;
- if (IsEqualGUID(riid, &IID_IDirect3DRMDevice3))
- *out = (IUnknown*)&object->IDirect3DRMDevice3_iface;
- else
- *out = (IUnknown*)&object->IDirect3DRMDevice2_iface;
-
- return S_OK;
-}
+ *out = object;
+
+ return D3DRM_OK;
+}
Modified: trunk/reactos/dll/directx/wine/d3drm/frame.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3drm/fra…
==============================================================================
--- trunk/reactos/dll/directx/wine/d3drm/frame.c [iso-8859-1] (original)
+++ trunk/reactos/dll/directx/wine/d3drm/frame.c [iso-8859-1] Tue Nov 24 10:43:48 2015
@@ -1065,7 +1065,7 @@
{
FIXME("iface %p stub!\n", iface);
- return E_NOTIMPL;
+ return FALSE;
}
static HRESULT WINAPI d3drm_frame2_GetAxes(IDirect3DRMFrame2 *iface, D3DVECTOR *dir,
D3DVECTOR *up)
@@ -1086,7 +1086,7 @@
{
FIXME("iface %p stub!\n", iface);
- return E_NOTIMPL;
+ return FALSE;
}
static HRESULT WINAPI d3drm_frame2_GetHierarchyBox(IDirect3DRMFrame2 *iface, D3DRMBOX
*box)
@@ -2006,7 +2006,7 @@
{
FIXME("iface %p stub!\n", iface);
- return E_NOTIMPL;
+ return FALSE;
}
static HRESULT WINAPI d3drm_frame3_GetAxes(IDirect3DRMFrame3 *iface, D3DVECTOR *dir,
D3DVECTOR *up)
@@ -2027,7 +2027,7 @@
{
FIXME("iface %p stub!\n", iface);
- return E_NOTIMPL;
+ return FALSE;
}
static HRESULT WINAPI d3drm_frame3_GetHierarchyBox(IDirect3DRMFrame3 *iface, D3DRMBOX
*box)
Modified: trunk/reactos/dll/directx/wine/d3drm/texture.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3drm/tex…
==============================================================================
--- trunk/reactos/dll/directx/wine/d3drm/texture.c [iso-8859-1] (original)
+++ trunk/reactos/dll/directx/wine/d3drm/texture.c [iso-8859-1] Tue Nov 24 10:43:48 2015
@@ -22,12 +22,18 @@
struct d3drm_texture
{
+ IDirect3DRMTexture IDirect3DRMTexture_iface;
IDirect3DRMTexture2 IDirect3DRMTexture2_iface;
IDirect3DRMTexture3 IDirect3DRMTexture3_iface;
LONG ref;
DWORD app_data;
};
+static inline struct d3drm_texture *impl_from_IDirect3DRMTexture(IDirect3DRMTexture
*iface)
+{
+ return CONTAINING_RECORD(iface, struct d3drm_texture, IDirect3DRMTexture_iface);
+}
+
static inline struct d3drm_texture *impl_from_IDirect3DRMTexture2(IDirect3DRMTexture2
*iface)
{
return CONTAINING_RECORD(iface, struct d3drm_texture, IDirect3DRMTexture2_iface);
@@ -38,62 +44,337 @@
return CONTAINING_RECORD(iface, struct d3drm_texture, IDirect3DRMTexture3_iface);
}
+static HRESULT WINAPI d3drm_texture1_QueryInterface(IDirect3DRMTexture *iface, REFIID
riid, void **out)
+{
+ struct d3drm_texture *texture = impl_from_IDirect3DRMTexture(iface);
+
+ TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out);
+
+ return IDirect3DRMTexture3_QueryInterface(&texture->IDirect3DRMTexture3_iface,
riid, out);
+}
+
+static ULONG WINAPI d3drm_texture1_AddRef(IDirect3DRMTexture *iface)
+{
+ struct d3drm_texture *texture = impl_from_IDirect3DRMTexture(iface);
+
+ TRACE("iface %p.\n", iface);
+
+ return IDirect3DRMTexture3_AddRef(&texture->IDirect3DRMTexture3_iface);
+}
+
+static ULONG WINAPI d3drm_texture1_Release(IDirect3DRMTexture *iface)
+{
+ struct d3drm_texture *texture = impl_from_IDirect3DRMTexture(iface);
+
+ TRACE("iface %p.\n", iface);
+
+ return IDirect3DRMTexture3_Release(&texture->IDirect3DRMTexture3_iface);
+}
+
+static HRESULT WINAPI d3drm_texture1_Clone(IDirect3DRMTexture *iface,
+ IUnknown *outer, REFIID iid, void **out)
+{
+ struct d3drm_texture *texture = impl_from_IDirect3DRMTexture(iface);
+
+ TRACE("iface %p, outer %p, iid %s, out %p.\n", iface, outer,
debugstr_guid(iid), out);
+
+ return IDirect3DRMTexture3_Clone(&texture->IDirect3DRMTexture3_iface, outer,
iid, out);
+}
+
+static HRESULT WINAPI d3drm_texture1_AddDestroyCallback(IDirect3DRMTexture *iface,
+ D3DRMOBJECTCALLBACK cb, void *ctx)
+{
+ FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3drm_texture1_DeleteDestroyCallback(IDirect3DRMTexture *iface,
+ D3DRMOBJECTCALLBACK cb, void *ctx)
+{
+ FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3drm_texture1_SetAppData(IDirect3DRMTexture *iface, DWORD data)
+{
+ struct d3drm_texture *texture = impl_from_IDirect3DRMTexture(iface);
+
+ TRACE("iface %p, data %#x.\n", iface, data);
+
+ return IDirect3DRMTexture3_SetAppData(&texture->IDirect3DRMTexture3_iface,
data);
+}
+
+static DWORD WINAPI d3drm_texture1_GetAppData(IDirect3DRMTexture *iface)
+{
+ struct d3drm_texture *texture = impl_from_IDirect3DRMTexture(iface);
+
+ TRACE("iface %p.\n", iface);
+
+ return IDirect3DRMTexture3_GetAppData(&texture->IDirect3DRMTexture3_iface);
+}
+
+static HRESULT WINAPI d3drm_texture1_SetName(IDirect3DRMTexture *iface, const char
*name)
+{
+ struct d3drm_texture *texture = impl_from_IDirect3DRMTexture(iface);
+
+ TRACE("iface %p, name %s.\n", iface, debugstr_a(name));
+
+ return IDirect3DRMTexture3_SetName(&texture->IDirect3DRMTexture3_iface,
name);
+}
+
+static HRESULT WINAPI d3drm_texture1_GetName(IDirect3DRMTexture *iface, DWORD *size, char
*name)
+{
+ struct d3drm_texture *texture = impl_from_IDirect3DRMTexture(iface);
+
+ TRACE("iface %p, size %p, name %p.\n", iface, size, name);
+
+ return IDirect3DRMTexture3_GetName(&texture->IDirect3DRMTexture3_iface, size,
name);
+}
+
+static HRESULT WINAPI d3drm_texture1_GetClassName(IDirect3DRMTexture *iface, DWORD *size,
char *name)
+{
+ struct d3drm_texture *texture = impl_from_IDirect3DRMTexture(iface);
+
+ TRACE("iface %p, size %p, name %p.\n", iface, size, name);
+
+ return IDirect3DRMTexture3_GetClassName(&texture->IDirect3DRMTexture3_iface,
size, name);
+}
+
+static HRESULT WINAPI d3drm_texture1_InitFromFile(IDirect3DRMTexture *iface, const char
*filename)
+{
+ FIXME("iface %p, filename %s stub!\n", iface, debugstr_a(filename));
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3drm_texture1_InitFromSurface(IDirect3DRMTexture *iface,
+ IDirectDrawSurface *surface)
+{
+ FIXME("iface %p, surface %p stub!\n", iface, surface);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3drm_texture1_InitFromResource(IDirect3DRMTexture *iface, HRSRC
resource)
+{
+ FIXME("iface %p, resource %p stub!\n", iface, resource);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3drm_texture1_Changed(IDirect3DRMTexture *iface, BOOL pixels, BOOL
palette)
+{
+ FIXME("iface %p, pixels %#x, palette %#x stub!\n", iface, pixels,
palette);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3drm_texture1_SetColors(IDirect3DRMTexture *iface, DWORD
max_colors)
+{
+ struct d3drm_texture *texture = impl_from_IDirect3DRMTexture(iface);
+
+ TRACE("iface %p, max_colors %u.\n", iface, max_colors);
+
+ return IDirect3DRMTexture3_SetColors(&texture->IDirect3DRMTexture3_iface,
max_colors);
+}
+
+static HRESULT WINAPI d3drm_texture1_SetShades(IDirect3DRMTexture *iface, DWORD
max_shades)
+{
+ struct d3drm_texture *texture = impl_from_IDirect3DRMTexture(iface);
+
+ TRACE("iface %p, max_shades %u.\n", iface, max_shades);
+
+ return IDirect3DRMTexture3_SetShades(&texture->IDirect3DRMTexture3_iface,
max_shades);
+}
+
+static HRESULT WINAPI d3drm_texture1_SetDecalSize(IDirect3DRMTexture *iface, D3DVALUE
width, D3DVALUE height)
+{
+ struct d3drm_texture *texture = impl_from_IDirect3DRMTexture(iface);
+
+ TRACE("iface %p, width %.8e, height %.8e stub!\n", iface, width, height);
+
+ return IDirect3DRMTexture3_SetDecalSize(&texture->IDirect3DRMTexture3_iface,
width, height);
+}
+
+static HRESULT WINAPI d3drm_texture1_SetDecalOrigin(IDirect3DRMTexture *iface, LONG x,
LONG y)
+{
+ struct d3drm_texture *texture = impl_from_IDirect3DRMTexture(iface);
+
+ TRACE("iface %p, x %d, y %d.\n", iface, x, y);
+
+ return IDirect3DRMTexture3_SetDecalOrigin(&texture->IDirect3DRMTexture3_iface,
x, y);
+}
+
+static HRESULT WINAPI d3drm_texture1_SetDecalScale(IDirect3DRMTexture *iface, DWORD
scale)
+{
+ struct d3drm_texture *texture = impl_from_IDirect3DRMTexture(iface);
+
+ TRACE("iface %p, scale %u.\n", iface, scale);
+
+ return IDirect3DRMTexture3_SetDecalScale(&texture->IDirect3DRMTexture3_iface,
scale);
+}
+
+static HRESULT WINAPI d3drm_texture1_SetDecalTransparency(IDirect3DRMTexture *iface, BOOL
transparency)
+{
+ struct d3drm_texture *texture = impl_from_IDirect3DRMTexture(iface);
+
+ TRACE("iface %p, transparency %#x.\n", iface, transparency);
+
+ return
IDirect3DRMTexture3_SetDecalTransparency(&texture->IDirect3DRMTexture3_iface,
transparency);
+}
+
+static HRESULT WINAPI d3drm_texture1_SetDecalTransparentColor(IDirect3DRMTexture *iface,
D3DCOLOR color)
+{
+ struct d3drm_texture *texture = impl_from_IDirect3DRMTexture(iface);
+
+ TRACE("iface %p, color 0x%08x.\n", iface, color);
+
+ return
IDirect3DRMTexture3_SetDecalTransparentColor(&texture->IDirect3DRMTexture3_iface,
color);
+}
+
+static HRESULT WINAPI d3drm_texture1_GetDecalSize(IDirect3DRMTexture *iface, D3DVALUE
*width, D3DVALUE *height)
+{
+ struct d3drm_texture *texture = impl_from_IDirect3DRMTexture(iface);
+
+ TRACE("iface %p, width %p, height %p.\n", iface, width, height);
+
+ return IDirect3DRMTexture3_GetDecalSize(&texture->IDirect3DRMTexture3_iface,
width, height);
+}
+
+static HRESULT WINAPI d3drm_texture1_GetDecalOrigin(IDirect3DRMTexture *iface, LONG *x,
LONG *y)
+{
+ struct d3drm_texture *texture = impl_from_IDirect3DRMTexture(iface);
+
+ TRACE("iface %p, x %p, y %p.\n", iface, x, y);
+
+ return IDirect3DRMTexture3_GetDecalOrigin(&texture->IDirect3DRMTexture3_iface,
x, y);
+}
+
+static D3DRMIMAGE * WINAPI d3drm_texture1_GetImage(IDirect3DRMTexture *iface)
+{
+ struct d3drm_texture *texture = impl_from_IDirect3DRMTexture(iface);
+
+ TRACE("iface %p.\n", iface);
+
+ return IDirect3DRMTexture3_GetImage(&texture->IDirect3DRMTexture3_iface);
+}
+
+static DWORD WINAPI d3drm_texture1_GetShades(IDirect3DRMTexture *iface)
+{
+ struct d3drm_texture *texture = impl_from_IDirect3DRMTexture(iface);
+
+ TRACE("iface %p.\n", iface);
+
+ return IDirect3DRMTexture3_GetShades(&texture->IDirect3DRMTexture3_iface);
+}
+
+static DWORD WINAPI d3drm_texture1_GetColors(IDirect3DRMTexture *iface)
+{
+ struct d3drm_texture *texture = impl_from_IDirect3DRMTexture(iface);
+
+ TRACE("iface %p.\n", iface);
+
+ return IDirect3DRMTexture3_GetColors(&texture->IDirect3DRMTexture3_iface);
+}
+
+static DWORD WINAPI d3drm_texture1_GetDecalScale(IDirect3DRMTexture *iface)
+{
+ struct d3drm_texture *texture = impl_from_IDirect3DRMTexture(iface);
+
+ TRACE("iface %p.\n", iface);
+
+ return
IDirect3DRMTexture3_GetDecalScale(&texture->IDirect3DRMTexture3_iface);
+}
+
+static BOOL WINAPI d3drm_texture1_GetDecalTransparency(IDirect3DRMTexture *iface)
+{
+ struct d3drm_texture *texture = impl_from_IDirect3DRMTexture(iface);
+
+ TRACE("iface %p.\n", iface);
+
+ return
IDirect3DRMTexture3_GetDecalTransparency(&texture->IDirect3DRMTexture3_iface);
+}
+
+static D3DCOLOR WINAPI d3drm_texture1_GetDecalTransparentColor(IDirect3DRMTexture
*iface)
+{
+ struct d3drm_texture *texture = impl_from_IDirect3DRMTexture(iface);
+
+ TRACE("iface %p.\n", iface);
+
+ return
IDirect3DRMTexture3_GetDecalTransparentColor(&texture->IDirect3DRMTexture3_iface);
+}
+
+static const struct IDirect3DRMTextureVtbl d3drm_texture1_vtbl =
+{
+ d3drm_texture1_QueryInterface,
+ d3drm_texture1_AddRef,
+ d3drm_texture1_Release,
+ d3drm_texture1_Clone,
+ d3drm_texture1_AddDestroyCallback,
+ d3drm_texture1_DeleteDestroyCallback,
+ d3drm_texture1_SetAppData,
+ d3drm_texture1_GetAppData,
+ d3drm_texture1_SetName,
+ d3drm_texture1_GetName,
+ d3drm_texture1_GetClassName,
+ d3drm_texture1_InitFromFile,
+ d3drm_texture1_InitFromSurface,
+ d3drm_texture1_InitFromResource,
+ d3drm_texture1_Changed,
+ d3drm_texture1_SetColors,
+ d3drm_texture1_SetShades,
+ d3drm_texture1_SetDecalSize,
+ d3drm_texture1_SetDecalOrigin,
+ d3drm_texture1_SetDecalScale,
+ d3drm_texture1_SetDecalTransparency,
+ d3drm_texture1_SetDecalTransparentColor,
+ d3drm_texture1_GetDecalSize,
+ d3drm_texture1_GetDecalOrigin,
+ d3drm_texture1_GetImage,
+ d3drm_texture1_GetShades,
+ d3drm_texture1_GetColors,
+ d3drm_texture1_GetDecalScale,
+ d3drm_texture1_GetDecalTransparency,
+ d3drm_texture1_GetDecalTransparentColor,
+};
+
static HRESULT WINAPI d3drm_texture2_QueryInterface(IDirect3DRMTexture2 *iface, REFIID
riid, void **out)
{
struct d3drm_texture *texture = impl_from_IDirect3DRMTexture2(iface);
TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out);
- if (IsEqualGUID(riid, &IID_IDirect3DRMTexture2)
- || IsEqualGUID(riid, &IID_IDirect3DRMTexture)
- || IsEqualGUID(riid, &IID_IUnknown))
- {
- *out = &texture->IDirect3DRMTexture2_iface;
- }
- else if (IsEqualGUID(riid, &IID_IDirect3DRMTexture3))
- {
- *out = &texture->IDirect3DRMTexture3_iface;
- }
- else
- {
- *out = NULL;
- WARN("%s not implemented, returning E_NOINTERFACE.\n",
debugstr_guid(riid));
- return E_NOINTERFACE;
- }
-
- IUnknown_AddRef((IUnknown *)*out);
- return S_OK;
+ return IDirect3DRMTexture3_QueryInterface(&texture->IDirect3DRMTexture3_iface,
riid, out);
}
static ULONG WINAPI d3drm_texture2_AddRef(IDirect3DRMTexture2 *iface)
{
struct d3drm_texture *texture = impl_from_IDirect3DRMTexture2(iface);
- ULONG refcount = InterlockedIncrement(&texture->ref);
-
- TRACE("%p increasing refcount to %u.\n", iface, refcount);
-
- return refcount;
+
+ TRACE("iface %p.\n", iface);
+
+ return IDirect3DRMTexture3_AddRef(&texture->IDirect3DRMTexture3_iface);
}
static ULONG WINAPI d3drm_texture2_Release(IDirect3DRMTexture2 *iface)
{
struct d3drm_texture *texture = impl_from_IDirect3DRMTexture2(iface);
- ULONG refcount = InterlockedDecrement(&texture->ref);
-
- TRACE("%p decreasing refcount to %u.\n", iface, refcount);
-
- if (!refcount)
- HeapFree(GetProcessHeap(), 0, texture);
-
- return refcount;
+
+ TRACE("iface %p.\n", iface);
+
+ return IDirect3DRMTexture3_Release(&texture->IDirect3DRMTexture3_iface);
}
static HRESULT WINAPI d3drm_texture2_Clone(IDirect3DRMTexture2 *iface,
IUnknown *outer, REFIID iid, void **out)
{
- FIXME("iface %p, outer %p, iid %s, out %p stub!\n", iface, outer,
debugstr_guid(iid), out);
-
- return E_NOTIMPL;
+ struct d3drm_texture *texture = impl_from_IDirect3DRMTexture2(iface);
+
+ TRACE("iface %p, outer %p, iid %s, out %p.\n", iface, outer,
debugstr_guid(iid), out);
+
+ return IDirect3DRMTexture3_Clone(&texture->IDirect3DRMTexture3_iface, outer,
iid, out);
}
static HRESULT WINAPI d3drm_texture2_AddDestroyCallback(IDirect3DRMTexture2 *iface,
@@ -132,16 +413,20 @@
static HRESULT WINAPI d3drm_texture2_SetName(IDirect3DRMTexture2 *iface, const char
*name)
{
- FIXME("iface %p, name %s stub!\n", iface, debugstr_a(name));
-
- return E_NOTIMPL;
+ struct d3drm_texture *texture = impl_from_IDirect3DRMTexture2(iface);
+
+ TRACE("iface %p, name %s.\n", iface, debugstr_a(name));
+
+ return IDirect3DRMTexture3_SetName(&texture->IDirect3DRMTexture3_iface,
name);
}
static HRESULT WINAPI d3drm_texture2_GetName(IDirect3DRMTexture2 *iface, DWORD *size,
char *name)
{
- FIXME("iface %p, size %p, name %p stub!\n", iface, size, name);
-
- return E_NOTIMPL;
+ struct d3drm_texture *texture = impl_from_IDirect3DRMTexture2(iface);
+
+ TRACE("iface %p, size %p, name %p.\n", iface, size, name);
+
+ return IDirect3DRMTexture3_GetName(&texture->IDirect3DRMTexture3_iface, size,
name);
}
static HRESULT WINAPI d3drm_texture2_GetClassName(IDirect3DRMTexture2 *iface, DWORD
*size, char *name)
@@ -184,107 +469,137 @@
static HRESULT WINAPI d3drm_texture2_SetColors(IDirect3DRMTexture2 *iface, DWORD
max_colors)
{
- FIXME("iface %p, max_colors %u stub!\n", iface, max_colors);
-
- return E_NOTIMPL;
+ struct d3drm_texture *texture = impl_from_IDirect3DRMTexture2(iface);
+
+ TRACE("iface %p, max_colors %u.\n", iface, max_colors);
+
+ return IDirect3DRMTexture3_SetColors(&texture->IDirect3DRMTexture3_iface,
max_colors);
}
static HRESULT WINAPI d3drm_texture2_SetShades(IDirect3DRMTexture2 *iface, DWORD
max_shades)
{
- FIXME("iface %p, max_shades %u stub!\n", iface, max_shades);
-
- return E_NOTIMPL;
+ struct d3drm_texture *texture = impl_from_IDirect3DRMTexture2(iface);
+
+ TRACE("iface %p, max_shades %u.\n", iface, max_shades);
+
+ return IDirect3DRMTexture3_SetShades(&texture->IDirect3DRMTexture3_iface,
max_shades);
}
static HRESULT WINAPI d3drm_texture2_SetDecalSize(IDirect3DRMTexture2 *iface, D3DVALUE
width, D3DVALUE height)
{
- FIXME("iface %p, width %.8e, height %.8e stub!\n", iface, width, height);
-
- return E_NOTIMPL;
+ struct d3drm_texture *texture = impl_from_IDirect3DRMTexture2(iface);
+
+ TRACE("iface %p, width %.8e, height %.8e stub!\n", iface, width, height);
+
+ return IDirect3DRMTexture3_SetDecalSize(&texture->IDirect3DRMTexture3_iface,
width, height);
}
static HRESULT WINAPI d3drm_texture2_SetDecalOrigin(IDirect3DRMTexture2 *iface, LONG x,
LONG y)
{
- FIXME("iface %p, x %d, y %d stub!\n", iface, x, y);
-
- return E_NOTIMPL;
+ struct d3drm_texture *texture = impl_from_IDirect3DRMTexture2(iface);
+
+ TRACE("iface %p, x %d, y %d.\n", iface, x, y);
+
+ return IDirect3DRMTexture3_SetDecalOrigin(&texture->IDirect3DRMTexture3_iface,
x, y);
}
static HRESULT WINAPI d3drm_texture2_SetDecalScale(IDirect3DRMTexture2 *iface, DWORD
scale)
{
- FIXME("iface %p, scale %u stub!\n", iface, scale);
-
- return E_NOTIMPL;
+ struct d3drm_texture *texture = impl_from_IDirect3DRMTexture2(iface);
+
+ TRACE("iface %p, scale %u.\n", iface, scale);
+
+ return IDirect3DRMTexture3_SetDecalScale(&texture->IDirect3DRMTexture3_iface,
scale);
}
static HRESULT WINAPI d3drm_texture2_SetDecalTransparency(IDirect3DRMTexture2 *iface,
BOOL transparency)
{
- FIXME("iface %p, transparency %#x stub!\n", iface, transparency);
-
- return E_NOTIMPL;
+ struct d3drm_texture *texture = impl_from_IDirect3DRMTexture2(iface);
+
+ TRACE("iface %p, transparency %#x.\n", iface, transparency);
+
+ return
IDirect3DRMTexture3_SetDecalTransparency(&texture->IDirect3DRMTexture3_iface,
transparency);
}
static HRESULT WINAPI d3drm_texture2_SetDecalTransparentColor(IDirect3DRMTexture2 *iface,
D3DCOLOR color)
{
- FIXME("iface %p, color 0x%08x stub!\n", iface, color);
-
- return E_NOTIMPL;
+ struct d3drm_texture *texture = impl_from_IDirect3DRMTexture2(iface);
+
+ TRACE("iface %p, color 0x%08x.\n", iface, color);
+
+ return
IDirect3DRMTexture3_SetDecalTransparentColor(&texture->IDirect3DRMTexture3_iface,
color);
}
static HRESULT WINAPI d3drm_texture2_GetDecalSize(IDirect3DRMTexture2 *iface, D3DVALUE
*width, D3DVALUE *height)
{
- FIXME("iface %p, width %p, height %p stub!\n", iface, width, height);
-
- return E_NOTIMPL;
+ struct d3drm_texture *texture = impl_from_IDirect3DRMTexture2(iface);
+
+ TRACE("iface %p, width %p, height %p.\n", iface, width, height);
+
+ return IDirect3DRMTexture3_GetDecalSize(&texture->IDirect3DRMTexture3_iface,
width, height);
}
static HRESULT WINAPI d3drm_texture2_GetDecalOrigin(IDirect3DRMTexture2 *iface, LONG *x,
LONG *y)
{
- FIXME("iface %p, x %p, y %p stub!\n", iface, x, y);
-
- return E_NOTIMPL;
+ struct d3drm_texture *texture = impl_from_IDirect3DRMTexture2(iface);
+
+ TRACE("iface %p, x %p, y %p.\n", iface, x, y);
+
+ return IDirect3DRMTexture3_GetDecalOrigin(&texture->IDirect3DRMTexture3_iface,
x, y);
}
static D3DRMIMAGE * WINAPI d3drm_texture2_GetImage(IDirect3DRMTexture2 *iface)
{
- FIXME("iface %p stub!\n", iface);
-
- return NULL;
+ struct d3drm_texture *texture = impl_from_IDirect3DRMTexture2(iface);
+
+ TRACE("iface %p.\n", iface);
+
+ return IDirect3DRMTexture3_GetImage(&texture->IDirect3DRMTexture3_iface);
}
static DWORD WINAPI d3drm_texture2_GetShades(IDirect3DRMTexture2 *iface)
{
- FIXME("iface %p stub!\n", iface);
-
- return 0;
+ struct d3drm_texture *texture = impl_from_IDirect3DRMTexture2(iface);
+
+ TRACE("iface %p.\n", iface);
+
+ return IDirect3DRMTexture3_GetShades(&texture->IDirect3DRMTexture3_iface);
}
static DWORD WINAPI d3drm_texture2_GetColors(IDirect3DRMTexture2 *iface)
{
- FIXME("iface %p stub!\n", iface);
-
- return 0;
+ struct d3drm_texture *texture = impl_from_IDirect3DRMTexture2(iface);
+
+ TRACE("iface %p.\n", iface);
+
+ return IDirect3DRMTexture3_GetColors(&texture->IDirect3DRMTexture3_iface);
}
static DWORD WINAPI d3drm_texture2_GetDecalScale(IDirect3DRMTexture2 *iface)
{
- FIXME("iface %p stub!\n", iface);
-
- return 0;
+ struct d3drm_texture *texture = impl_from_IDirect3DRMTexture2(iface);
+
+ TRACE("iface %p.\n", iface);
+
+ return
IDirect3DRMTexture3_GetDecalScale(&texture->IDirect3DRMTexture3_iface);
}
static BOOL WINAPI d3drm_texture2_GetDecalTransparency(IDirect3DRMTexture2 *iface)
{
- FIXME("iface %p stub!\n", iface);
-
- return FALSE;
+ struct d3drm_texture *texture = impl_from_IDirect3DRMTexture2(iface);
+
+ TRACE("iface %p.\n", iface);
+
+ return
IDirect3DRMTexture3_GetDecalTransparency(&texture->IDirect3DRMTexture3_iface);
}
static D3DCOLOR WINAPI d3drm_texture2_GetDecalTransparentColor(IDirect3DRMTexture2
*iface)
{
- FIXME("iface %p stub!\n", iface);
-
- return 0;
+ struct d3drm_texture *texture = impl_from_IDirect3DRMTexture2(iface);
+
+ TRACE("iface %p.\n", iface);
+
+ return
IDirect3DRMTexture3_GetDecalTransparentColor(&texture->IDirect3DRMTexture3_iface);
}
static HRESULT WINAPI d3drm_texture2_InitFromImage(IDirect3DRMTexture2 *iface, D3DRMIMAGE
*image)
@@ -305,9 +620,11 @@
static HRESULT WINAPI d3drm_texture2_GenerateMIPMap(IDirect3DRMTexture2 *iface, DWORD
flags)
{
- FIXME("iface %p, flags %#x stub!\n", iface, flags);
-
- return E_NOTIMPL;
+ struct d3drm_texture *texture = impl_from_IDirect3DRMTexture2(iface);
+
+ TRACE("iface %p, flags %#x.\n", iface, flags);
+
+ return IDirect3DRMTexture3_GenerateMIPMap(&texture->IDirect3DRMTexture3_iface,
flags);
}
static const struct IDirect3DRMTexture2Vtbl d3drm_texture2_vtbl =
@@ -710,20 +1027,20 @@
HRESULT Direct3DRMTexture_create(REFIID riid, IUnknown **out)
{
struct d3drm_texture *object;
+ HRESULT hr;
TRACE("riid %s, out %p.\n", debugstr_guid(riid), out);
if (!(object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object))))
return E_OUTOFMEMORY;
+ object->IDirect3DRMTexture_iface.lpVtbl = &d3drm_texture1_vtbl;
object->IDirect3DRMTexture2_iface.lpVtbl = &d3drm_texture2_vtbl;
object->IDirect3DRMTexture3_iface.lpVtbl = &d3drm_texture3_vtbl;
object->ref = 1;
- if (IsEqualGUID(riid, &IID_IDirect3DRMTexture3))
- *out = (IUnknown *)&object->IDirect3DRMTexture3_iface;
- else
- *out = (IUnknown *)&object->IDirect3DRMTexture2_iface;
-
- return S_OK;
-}
+ hr = IDirect3DRMTexture3_QueryInterface(&object->IDirect3DRMTexture3_iface,
riid, (void **)out);
+ IDirect3DRMTexture3_Release(&object->IDirect3DRMTexture3_iface);
+
+ return hr;
+}
Modified: trunk/reactos/dll/directx/wine/d3drm/viewport.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3drm/vie…
==============================================================================
--- trunk/reactos/dll/directx/wine/d3drm/viewport.c [iso-8859-1] (original)
+++ trunk/reactos/dll/directx/wine/d3drm/viewport.c [iso-8859-1] Tue Nov 24 10:43:48 2015
@@ -298,7 +298,7 @@
{
FIXME("iface %p stub!\n", iface);
- return E_NOTIMPL;
+ return FALSE;
}
static LONG WINAPI d3drm_viewport1_GetX(IDirect3DRMViewport *iface)
@@ -663,7 +663,7 @@
{
FIXME("iface %p stub!\n", iface);
- return E_NOTIMPL;
+ return FALSE;
}
static LONG WINAPI d3drm_viewport2_GetX(IDirect3DRMViewport2 *iface)
Modified: trunk/reactos/media/doc/README.WINE
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
==============================================================================
--- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original)
+++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Tue Nov 24 10:43:48 2015
@@ -25,7 +25,7 @@
reactos/dll/directx/wine/d3d8 # Synced to WineStaging-1.7.55
reactos/dll/directx/wine/d3d9 # Synced to WineStaging-1.7.55
reactos/dll/directx/wine/d3dcompiler_43 # Synced to WineStaging-1.7.55
-reactos/dll/directx/wine/d3drm # Synced to WineStaging-1.7.47
+reactos/dll/directx/wine/d3drm # Synced to WineStaging-1.7.55
reactos/dll/directx/wine/d3dx9_24 => 43 # Synced to WineStaging-1.7.55
reactos/dll/directx/wine/d3dxof # Synced to WineStaging-1.7.47
reactos/dll/directx/wine/ddraw # Synced to WineStaging-1.7.55