From 90d97a93469d206e0cccbb33a32834dbcfa33697 Mon Sep 17 00:00:00 2001 From: Aaryaman Vasishta Date: Tue, 12 Jul 2016 19:07:25 +0200 Subject: [PATCH] d3drm: Move struct d3drm_device to d3drm_private.h. Signed-off-by: Aaryaman Vasishta Signed-off-by: Henri Verbeet Signed-off-by: Alexandre Julliard --- dlls/d3drm/d3drm.c | 16 ++++++++-------- dlls/d3drm/d3drm_private.h | 24 ++++++++++++++++++++---- dlls/d3drm/device.c | 35 ----------------------------------- 3 files changed, 28 insertions(+), 47 deletions(-) diff --git a/dlls/d3drm/d3drm.c b/dlls/d3drm/d3drm.c index d0145d977d8..87fffc94a38 100644 --- a/dlls/d3drm/d3drm.c +++ b/dlls/d3drm/d3drm.c @@ -279,7 +279,7 @@ static HRESULT WINAPI d3drm1_CreateDevice(IDirect3DRM *iface, if (FAILED(hr = d3drm_device_create(&object, iface))) return hr; - *device = IDirect3DRMDevice_from_impl(object); + *device = &object->IDirect3DRMDevice_iface; return D3DRM_OK; } @@ -304,7 +304,7 @@ static HRESULT WINAPI d3drm1_CreateDeviceFromSurface(IDirect3DRM *iface, GUID *g return hr; if (SUCCEEDED(hr = d3drm_device_init(object, 1, ddraw, backbuffer, TRUE))) - *device = IDirect3DRMDevice_from_impl(object); + *device = &object->IDirect3DRMDevice_iface; else d3drm_device_destroy(object); @@ -333,7 +333,7 @@ static HRESULT WINAPI d3drm1_CreateDeviceFromD3D(IDirect3DRM *iface, d3drm_device_destroy(object); return hr; } - *device = IDirect3DRMDevice_from_impl(object); + *device = &object->IDirect3DRMDevice_iface; return D3DRM_OK; } @@ -381,7 +381,7 @@ static HRESULT WINAPI d3drm1_CreateDeviceFromClipper(IDirect3DRM *iface, if (FAILED(hr)) d3drm_device_destroy(object); else - *device = IDirect3DRMDevice_from_impl(object); + *device = &object->IDirect3DRMDevice_iface; return hr; } @@ -759,7 +759,7 @@ static HRESULT WINAPI d3drm2_CreateDevice(IDirect3DRM2 *iface, if (FAILED(hr = d3drm_device_create(&object, &d3drm->IDirect3DRM_iface))) return hr; - *device = IDirect3DRMDevice2_from_impl(object); + *device = &object->IDirect3DRMDevice2_iface; return D3DRM_OK; } @@ -1309,7 +1309,7 @@ static HRESULT WINAPI d3drm3_CreateDevice(IDirect3DRM3 *iface, if (FAILED(hr = d3drm_device_create(&object, &d3drm->IDirect3DRM_iface))) return hr; - *device = IDirect3DRMDevice3_from_impl(object); + *device = &object->IDirect3DRMDevice3_iface; return D3DRM_OK; } @@ -1338,7 +1338,7 @@ static HRESULT WINAPI d3drm3_CreateDeviceFromSurface(IDirect3DRM3 *iface, GUID * use_z_surface = !(flags & D3DRMDEVICE_NOZBUFFER); if (SUCCEEDED(hr = d3drm_device_init(object, 3, ddraw, backbuffer, use_z_surface))) - *device = IDirect3DRMDevice3_from_impl(object); + *device = &object->IDirect3DRMDevice3_iface; else d3drm_device_destroy(object); @@ -1428,7 +1428,7 @@ static HRESULT WINAPI d3drm3_CreateDeviceFromClipper(IDirect3DRM3 *iface, if (FAILED(hr)) d3drm_device_destroy(object); else - *device = IDirect3DRMDevice3_from_impl(object); + *device = &object->IDirect3DRMDevice3_iface; return hr; } diff --git a/dlls/d3drm/d3drm_private.h b/dlls/d3drm/d3drm_private.h index 1a2aff11692..059d480c110 100644 --- a/dlls/d3drm/d3drm_private.h +++ b/dlls/d3drm/d3drm_private.h @@ -23,6 +23,7 @@ #include "d3drm.h" #include "dxfile.h" +#include "d3drmwin.h" #include "wine/list.h" @@ -30,7 +31,6 @@ #define ARRAY_SIZE(a) (sizeof(a) / sizeof(*(a))) #endif -struct d3drm_device; struct d3drm_object { LONG ref; @@ -81,6 +81,25 @@ struct d3drm_viewport 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_surfaces_from_clipper(struct d3drm_device *object, IDirectDraw *ddraw, IDirectDrawClipper *clipper, int width, int height, IDirectDrawSurface **surface) DECLSPEC_HIDDEN; @@ -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_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; -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 Direct3DRMLight_create(IUnknown** ppObj) DECLSPEC_HIDDEN; HRESULT Direct3DRMMesh_create(IDirect3DRMMesh** obj) DECLSPEC_HIDDEN; diff --git a/dlls/d3drm/device.c b/dlls/d3drm/device.c index ba61c29bb96..fd9c15cacce 100644 --- a/dlls/d3drm/device.c +++ b/dlls/d3drm/device.c @@ -27,29 +27,9 @@ #include "d3drm_private.h" #include "initguid.h" -#include "d3drmwin.h" 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) { return CONTAINING_RECORD(iface, struct d3drm_device, IDirect3DRMDevice_iface); @@ -65,21 +45,6 @@ static inline struct d3drm_device *impl_from_IDirect3DRMDevice3(IDirect3DRMDevic 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)