Commit 90d97a93 authored by Aaryaman Vasishta's avatar Aaryaman Vasishta Committed by Alexandre Julliard

d3drm: Move struct d3drm_device to d3drm_private.h.

parent 44af0bb8
...@@ -279,7 +279,7 @@ static HRESULT WINAPI d3drm1_CreateDevice(IDirect3DRM *iface, ...@@ -279,7 +279,7 @@ static HRESULT WINAPI d3drm1_CreateDevice(IDirect3DRM *iface,
if (FAILED(hr = d3drm_device_create(&object, iface))) if (FAILED(hr = d3drm_device_create(&object, iface)))
return hr; return hr;
*device = IDirect3DRMDevice_from_impl(object); *device = &object->IDirect3DRMDevice_iface;
return D3DRM_OK; return D3DRM_OK;
} }
...@@ -304,7 +304,7 @@ static HRESULT WINAPI d3drm1_CreateDeviceFromSurface(IDirect3DRM *iface, GUID *g ...@@ -304,7 +304,7 @@ static HRESULT WINAPI d3drm1_CreateDeviceFromSurface(IDirect3DRM *iface, GUID *g
return hr; return hr;
if (SUCCEEDED(hr = d3drm_device_init(object, 1, ddraw, backbuffer, TRUE))) if (SUCCEEDED(hr = d3drm_device_init(object, 1, ddraw, backbuffer, TRUE)))
*device = IDirect3DRMDevice_from_impl(object); *device = &object->IDirect3DRMDevice_iface;
else else
d3drm_device_destroy(object); d3drm_device_destroy(object);
...@@ -333,7 +333,7 @@ static HRESULT WINAPI d3drm1_CreateDeviceFromD3D(IDirect3DRM *iface, ...@@ -333,7 +333,7 @@ static HRESULT WINAPI d3drm1_CreateDeviceFromD3D(IDirect3DRM *iface,
d3drm_device_destroy(object); d3drm_device_destroy(object);
return hr; return hr;
} }
*device = IDirect3DRMDevice_from_impl(object); *device = &object->IDirect3DRMDevice_iface;
return D3DRM_OK; return D3DRM_OK;
} }
...@@ -381,7 +381,7 @@ static HRESULT WINAPI d3drm1_CreateDeviceFromClipper(IDirect3DRM *iface, ...@@ -381,7 +381,7 @@ static HRESULT WINAPI d3drm1_CreateDeviceFromClipper(IDirect3DRM *iface,
if (FAILED(hr)) if (FAILED(hr))
d3drm_device_destroy(object); d3drm_device_destroy(object);
else else
*device = IDirect3DRMDevice_from_impl(object); *device = &object->IDirect3DRMDevice_iface;
return hr; return hr;
} }
...@@ -759,7 +759,7 @@ static HRESULT WINAPI d3drm2_CreateDevice(IDirect3DRM2 *iface, ...@@ -759,7 +759,7 @@ static HRESULT WINAPI d3drm2_CreateDevice(IDirect3DRM2 *iface,
if (FAILED(hr = d3drm_device_create(&object, &d3drm->IDirect3DRM_iface))) if (FAILED(hr = d3drm_device_create(&object, &d3drm->IDirect3DRM_iface)))
return hr; return hr;
*device = IDirect3DRMDevice2_from_impl(object); *device = &object->IDirect3DRMDevice2_iface;
return D3DRM_OK; return D3DRM_OK;
} }
...@@ -1309,7 +1309,7 @@ static HRESULT WINAPI d3drm3_CreateDevice(IDirect3DRM3 *iface, ...@@ -1309,7 +1309,7 @@ static HRESULT WINAPI d3drm3_CreateDevice(IDirect3DRM3 *iface,
if (FAILED(hr = d3drm_device_create(&object, &d3drm->IDirect3DRM_iface))) if (FAILED(hr = d3drm_device_create(&object, &d3drm->IDirect3DRM_iface)))
return hr; return hr;
*device = IDirect3DRMDevice3_from_impl(object); *device = &object->IDirect3DRMDevice3_iface;
return D3DRM_OK; return D3DRM_OK;
} }
...@@ -1338,7 +1338,7 @@ static HRESULT WINAPI d3drm3_CreateDeviceFromSurface(IDirect3DRM3 *iface, GUID * ...@@ -1338,7 +1338,7 @@ static HRESULT WINAPI d3drm3_CreateDeviceFromSurface(IDirect3DRM3 *iface, GUID *
use_z_surface = !(flags & D3DRMDEVICE_NOZBUFFER); use_z_surface = !(flags & D3DRMDEVICE_NOZBUFFER);
if (SUCCEEDED(hr = d3drm_device_init(object, 3, ddraw, backbuffer, use_z_surface))) if (SUCCEEDED(hr = d3drm_device_init(object, 3, ddraw, backbuffer, use_z_surface)))
*device = IDirect3DRMDevice3_from_impl(object); *device = &object->IDirect3DRMDevice3_iface;
else else
d3drm_device_destroy(object); d3drm_device_destroy(object);
...@@ -1428,7 +1428,7 @@ static HRESULT WINAPI d3drm3_CreateDeviceFromClipper(IDirect3DRM3 *iface, ...@@ -1428,7 +1428,7 @@ static HRESULT WINAPI d3drm3_CreateDeviceFromClipper(IDirect3DRM3 *iface,
if (FAILED(hr)) if (FAILED(hr))
d3drm_device_destroy(object); d3drm_device_destroy(object);
else else
*device = IDirect3DRMDevice3_from_impl(object); *device = &object->IDirect3DRMDevice3_iface;
return hr; return hr;
} }
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
#include "d3drm.h" #include "d3drm.h"
#include "dxfile.h" #include "dxfile.h"
#include "d3drmwin.h"
#include "wine/list.h" #include "wine/list.h"
...@@ -30,7 +31,6 @@ ...@@ -30,7 +31,6 @@
#define ARRAY_SIZE(a) (sizeof(a) / sizeof(*(a))) #define ARRAY_SIZE(a) (sizeof(a) / sizeof(*(a)))
#endif #endif
struct d3drm_device;
struct d3drm_object struct d3drm_object
{ {
LONG ref; LONG ref;
...@@ -81,6 +81,25 @@ struct d3drm_viewport ...@@ -81,6 +81,25 @@ struct d3drm_viewport
D3DRMPROJECTIONTYPE projection; D3DRMPROJECTIONTYPE projection;
}; };
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;
DWORD rendermode;
DWORD height;
DWORD width;
};
HRESULT d3drm_device_create(struct d3drm_device **device, IDirect3DRM *d3drm) DECLSPEC_HIDDEN; HRESULT d3drm_device_create(struct d3drm_device **device, IDirect3DRM *d3drm) DECLSPEC_HIDDEN;
HRESULT d3drm_device_create_surfaces_from_clipper(struct d3drm_device *object, IDirectDraw *ddraw, HRESULT d3drm_device_create_surfaces_from_clipper(struct d3drm_device *object, IDirectDraw *ddraw,
IDirectDrawClipper *clipper, int width, int height, IDirectDrawSurface **surface) DECLSPEC_HIDDEN; IDirectDrawClipper *clipper, int width, int height, IDirectDrawSurface **surface) DECLSPEC_HIDDEN;
...@@ -98,9 +117,6 @@ void d3drm_object_cleanup(IDirect3DRMObject *iface, struct d3drm_object *object) ...@@ -98,9 +117,6 @@ void d3drm_object_cleanup(IDirect3DRMObject *iface, struct d3drm_object *object)
HRESULT d3drm_texture_create(struct d3drm_texture **texture, IDirect3DRM *d3drm) DECLSPEC_HIDDEN; HRESULT d3drm_texture_create(struct d3drm_texture **texture, IDirect3DRM *d3drm) DECLSPEC_HIDDEN;
HRESULT d3drm_frame_create(struct d3drm_frame **frame, IUnknown *parent_frame, IDirect3DRM *d3drm) DECLSPEC_HIDDEN; HRESULT d3drm_frame_create(struct d3drm_frame **frame, IUnknown *parent_frame, IDirect3DRM *d3drm) DECLSPEC_HIDDEN;
HRESULT d3drm_viewport_create(struct d3drm_viewport **viewport, IDirect3DRM *d3drm) DECLSPEC_HIDDEN; HRESULT d3drm_viewport_create(struct d3drm_viewport **viewport, IDirect3DRM *d3drm) 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 Direct3DRMFace_create(REFIID riid, IUnknown** ret_iface) DECLSPEC_HIDDEN;
HRESULT Direct3DRMLight_create(IUnknown** ppObj) DECLSPEC_HIDDEN; HRESULT Direct3DRMLight_create(IUnknown** ppObj) DECLSPEC_HIDDEN;
HRESULT Direct3DRMMesh_create(IDirect3DRMMesh** obj) DECLSPEC_HIDDEN; HRESULT Direct3DRMMesh_create(IDirect3DRMMesh** obj) DECLSPEC_HIDDEN;
......
...@@ -27,29 +27,9 @@ ...@@ -27,29 +27,9 @@
#include "d3drm_private.h" #include "d3drm_private.h"
#include "initguid.h" #include "initguid.h"
#include "d3drmwin.h"
WINE_DEFAULT_DEBUG_CHANNEL(d3drm); WINE_DEFAULT_DEBUG_CHANNEL(d3drm);
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;
DWORD rendermode;
DWORD height;
DWORD width;
};
static inline struct d3drm_device *impl_from_IDirect3DRMDevice(IDirect3DRMDevice *iface) static inline struct d3drm_device *impl_from_IDirect3DRMDevice(IDirect3DRMDevice *iface)
{ {
return CONTAINING_RECORD(iface, struct d3drm_device, IDirect3DRMDevice_iface); return CONTAINING_RECORD(iface, struct d3drm_device, IDirect3DRMDevice_iface);
...@@ -65,21 +45,6 @@ static inline struct d3drm_device *impl_from_IDirect3DRMDevice3(IDirect3DRMDevic ...@@ -65,21 +45,6 @@ static inline struct d3drm_device *impl_from_IDirect3DRMDevice3(IDirect3DRMDevic
return CONTAINING_RECORD(iface, struct d3drm_device, IDirect3DRMDevice3_iface); 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) void d3drm_device_destroy(struct d3drm_device *device)
{ {
if (device->device) if (device->device)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment