mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-15 06:50:23 +00:00
ddraw: Get rid of IDirectDrawSurfaceImpl.
This commit is contained in:
parent
6396ad9e45
commit
5f43cd2631
|
@ -2083,8 +2083,8 @@ static HRESULT WINAPI ddraw7_GetGDISurface(IDirectDraw7 *iface, IDirectDrawSurfa
|
|||
static HRESULT WINAPI ddraw4_GetGDISurface(IDirectDraw4 *iface, IDirectDrawSurface4 **surface)
|
||||
{
|
||||
struct ddraw *ddraw = impl_from_IDirectDraw4(iface);
|
||||
struct ddraw_surface *surface_impl;
|
||||
IDirectDrawSurface7 *surface7;
|
||||
IDirectDrawSurfaceImpl *surface_impl;
|
||||
HRESULT hr;
|
||||
|
||||
TRACE("iface %p, surface %p.\n", iface, surface);
|
||||
|
@ -2106,8 +2106,8 @@ static HRESULT WINAPI ddraw4_GetGDISurface(IDirectDraw4 *iface, IDirectDrawSurfa
|
|||
static HRESULT WINAPI ddraw2_GetGDISurface(IDirectDraw2 *iface, IDirectDrawSurface **surface)
|
||||
{
|
||||
struct ddraw *ddraw = impl_from_IDirectDraw2(iface);
|
||||
struct ddraw_surface *surface_impl;
|
||||
IDirectDrawSurface7 *surface7;
|
||||
IDirectDrawSurfaceImpl *surface_impl;
|
||||
HRESULT hr;
|
||||
|
||||
TRACE("iface %p, surface %p.\n", iface, surface);
|
||||
|
@ -2129,8 +2129,8 @@ static HRESULT WINAPI ddraw2_GetGDISurface(IDirectDraw2 *iface, IDirectDrawSurfa
|
|||
static HRESULT WINAPI ddraw1_GetGDISurface(IDirectDraw *iface, IDirectDrawSurface **surface)
|
||||
{
|
||||
struct ddraw *ddraw = impl_from_IDirectDraw(iface);
|
||||
struct ddraw_surface *surface_impl;
|
||||
IDirectDrawSurface7 *surface7;
|
||||
IDirectDrawSurfaceImpl *surface_impl;
|
||||
HRESULT hr;
|
||||
|
||||
TRACE("iface %p, surface %p.\n", iface, surface);
|
||||
|
@ -2486,8 +2486,8 @@ static HRESULT WINAPI ddraw4_GetSurfaceFromDC(IDirectDraw4 *iface, HDC dc,
|
|||
IDirectDrawSurface4 **surface)
|
||||
{
|
||||
struct ddraw *ddraw = impl_from_IDirectDraw4(iface);
|
||||
struct ddraw_surface *surface_impl;
|
||||
IDirectDrawSurface7 *surface7;
|
||||
IDirectDrawSurfaceImpl *surface_impl;
|
||||
HRESULT hr;
|
||||
|
||||
TRACE("iface %p, dc %p, surface %p.\n", iface, dc, surface);
|
||||
|
@ -2597,12 +2597,12 @@ static HRESULT WINAPI ddraw7_StartModeTest(IDirectDraw7 *iface, SIZE *Modes, DWO
|
|||
*
|
||||
*****************************************************************************/
|
||||
static HRESULT ddraw_create_surface(struct ddraw *ddraw, DDSURFACEDESC2 *pDDSD,
|
||||
IDirectDrawSurfaceImpl **ppSurf, UINT level, UINT version)
|
||||
struct ddraw_surface **surface, UINT level, UINT version)
|
||||
{
|
||||
HRESULT hr;
|
||||
|
||||
TRACE("ddraw %p, surface_desc %p, surface %p, level %u.\n",
|
||||
ddraw, pDDSD, ppSurf, level);
|
||||
ddraw, pDDSD, surface, level);
|
||||
|
||||
if (TRACE_ON(ddraw))
|
||||
{
|
||||
|
@ -2617,25 +2617,25 @@ static HRESULT ddraw_create_surface(struct ddraw *ddraw, DDSURFACEDESC2 *pDDSD,
|
|||
}
|
||||
|
||||
/* Create the Surface object */
|
||||
*ppSurf = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectDrawSurfaceImpl));
|
||||
if(!*ppSurf)
|
||||
*surface = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(**surface));
|
||||
if (!*surface)
|
||||
{
|
||||
ERR("Failed to allocate surface memory.\n");
|
||||
return DDERR_OUTOFVIDEOMEMORY;
|
||||
}
|
||||
|
||||
hr = ddraw_surface_init(*ppSurf, ddraw, pDDSD, level, version);
|
||||
hr = ddraw_surface_init(*surface, ddraw, pDDSD, level, version);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
WARN("Failed to initialize surface, hr %#x.\n", hr);
|
||||
HeapFree(GetProcessHeap(), 0, *ppSurf);
|
||||
HeapFree(GetProcessHeap(), 0, *surface);
|
||||
return hr;
|
||||
}
|
||||
|
||||
/* Increase the surface counter, and attach the surface */
|
||||
list_add_head(&ddraw->surface_list, &(*ppSurf)->surface_list_entry);
|
||||
list_add_head(&ddraw->surface_list, &(*surface)->surface_list_entry);
|
||||
|
||||
TRACE("Created surface %p.\n", *ppSurf);
|
||||
TRACE("Created surface %p.\n", *surface);
|
||||
|
||||
return DD_OK;
|
||||
}
|
||||
|
@ -2653,16 +2653,16 @@ static HRESULT ddraw_create_surface(struct ddraw *ddraw, DDSURFACEDESC2 *pDDSD,
|
|||
* creates an additional surface without the mipmapping flags
|
||||
*
|
||||
*****************************************************************************/
|
||||
static HRESULT CreateAdditionalSurfaces(struct ddraw *ddraw, IDirectDrawSurfaceImpl *root,
|
||||
static HRESULT CreateAdditionalSurfaces(struct ddraw *ddraw, struct ddraw_surface *root,
|
||||
UINT count, DDSURFACEDESC2 DDSD, BOOL CubeFaceRoot, UINT version)
|
||||
{
|
||||
struct ddraw_surface *last = root;
|
||||
UINT i, j, level = 0;
|
||||
HRESULT hr;
|
||||
IDirectDrawSurfaceImpl *last = root;
|
||||
|
||||
for(i = 0; i < count; i++)
|
||||
for (i = 0; i < count; ++i)
|
||||
{
|
||||
IDirectDrawSurfaceImpl *object2 = NULL;
|
||||
struct ddraw_surface *object2 = NULL;
|
||||
|
||||
/* increase the mipmap level, but only if a mipmap is created
|
||||
* In this case, also halve the size
|
||||
|
@ -2788,16 +2788,16 @@ static HRESULT CDECL ddraw_reset_enum_callback(struct wined3d_resource *resource
|
|||
*
|
||||
*****************************************************************************/
|
||||
static HRESULT CreateSurface(struct ddraw *ddraw, DDSURFACEDESC2 *DDSD,
|
||||
IDirectDrawSurfaceImpl **Surf, IUnknown *UnkOuter, UINT version)
|
||||
struct ddraw_surface **surface, IUnknown *UnkOuter, UINT version)
|
||||
{
|
||||
IDirectDrawSurfaceImpl *object = NULL;
|
||||
struct ddraw_surface *object = NULL;
|
||||
struct wined3d_display_mode mode;
|
||||
HRESULT hr;
|
||||
LONG extra_surfaces = 0;
|
||||
DDSURFACEDESC2 desc2;
|
||||
const DWORD sysvidmem = DDSCAPS_VIDEOMEMORY | DDSCAPS_SYSTEMMEMORY;
|
||||
|
||||
TRACE("ddraw %p, surface_desc %p, surface %p, outer_unknown %p.\n", ddraw, DDSD, Surf, UnkOuter);
|
||||
TRACE("ddraw %p, surface_desc %p, surface %p, outer_unknown %p.\n", ddraw, DDSD, surface, UnkOuter);
|
||||
|
||||
/* Some checks before we start */
|
||||
if (TRACE_ON(ddraw))
|
||||
|
@ -2812,7 +2812,7 @@ static HRESULT CreateSurface(struct ddraw *ddraw, DDSURFACEDESC2 *DDSD,
|
|||
return CLASS_E_NOAGGREGATION; /* unchecked */
|
||||
}
|
||||
|
||||
if (Surf == NULL)
|
||||
if (!surface)
|
||||
{
|
||||
FIXME("(%p) You want to get back a surface? Don't give NULL ptrs!\n", ddraw);
|
||||
return E_POINTER; /* unchecked */
|
||||
|
@ -2842,7 +2842,7 @@ static HRESULT CreateSurface(struct ddraw *ddraw, DDSURFACEDESC2 *DDSD,
|
|||
{
|
||||
TRACE("(%p): Attempt to create a flipable primary surface without DDSCL_EXCLUSIVE set\n",
|
||||
ddraw);
|
||||
*Surf = NULL;
|
||||
*surface = NULL;
|
||||
return DDERR_NOEXCLUSIVEMODE;
|
||||
}
|
||||
|
||||
|
@ -2856,7 +2856,7 @@ static HRESULT CreateSurface(struct ddraw *ddraw, DDSURFACEDESC2 *DDSD,
|
|||
{
|
||||
/* This is a special switch in ddrawex.dll, but not allowed in ddraw.dll */
|
||||
WARN("Application tries to put the surface in both system and video memory\n");
|
||||
*Surf = NULL;
|
||||
*surface = NULL;
|
||||
return DDERR_INVALIDCAPS;
|
||||
}
|
||||
|
||||
|
@ -2941,7 +2941,7 @@ static HRESULT CreateSurface(struct ddraw *ddraw, DDSURFACEDESC2 *DDSD,
|
|||
if(!(desc2.ddsCaps.dwCaps & DDSCAPS_PRIMARYSURFACE))
|
||||
{
|
||||
WARN("Creating a non-Primary surface without Width or Height info, returning DDERR_INVALIDPARAMS\n");
|
||||
*Surf = NULL;
|
||||
*surface = NULL;
|
||||
return DDERR_INVALIDPARAMS;
|
||||
}
|
||||
|
||||
|
@ -3037,7 +3037,7 @@ static HRESULT CreateSurface(struct ddraw *ddraw, DDSURFACEDESC2 *DDSD,
|
|||
}
|
||||
object->is_complex_root = TRUE;
|
||||
|
||||
*Surf = object;
|
||||
*surface = object;
|
||||
|
||||
/* Create Additional surfaces if necessary
|
||||
* This applies to Primary surfaces which have a back buffer count
|
||||
|
@ -3106,7 +3106,7 @@ static HRESULT WINAPI ddraw7_CreateSurface(IDirectDraw7 *iface, DDSURFACEDESC2 *
|
|||
IDirectDrawSurface7 **surface, IUnknown *outer_unknown)
|
||||
{
|
||||
struct ddraw *ddraw = impl_from_IDirectDraw7(iface);
|
||||
IDirectDrawSurfaceImpl *impl;
|
||||
struct ddraw_surface *impl;
|
||||
HRESULT hr;
|
||||
|
||||
TRACE("iface %p, surface_desc %p, surface %p, outer_unknown %p.\n",
|
||||
|
@ -3160,7 +3160,7 @@ static HRESULT WINAPI ddraw4_CreateSurface(IDirectDraw4 *iface,
|
|||
DDSURFACEDESC2 *surface_desc, IDirectDrawSurface4 **surface, IUnknown *outer_unknown)
|
||||
{
|
||||
struct ddraw *ddraw = impl_from_IDirectDraw4(iface);
|
||||
IDirectDrawSurfaceImpl *impl;
|
||||
struct ddraw_surface *impl;
|
||||
HRESULT hr;
|
||||
|
||||
TRACE("iface %p, surface_desc %p, surface %p, outer_unknown %p.\n",
|
||||
|
@ -3214,7 +3214,7 @@ static HRESULT WINAPI ddraw2_CreateSurface(IDirectDraw2 *iface,
|
|||
DDSURFACEDESC *surface_desc, IDirectDrawSurface **surface, IUnknown *outer_unknown)
|
||||
{
|
||||
struct ddraw *ddraw = impl_from_IDirectDraw2(iface);
|
||||
IDirectDrawSurfaceImpl *impl;
|
||||
struct ddraw_surface *impl;
|
||||
HRESULT hr;
|
||||
DDSURFACEDESC2 surface_desc2;
|
||||
|
||||
|
@ -3269,7 +3269,7 @@ static HRESULT WINAPI ddraw1_CreateSurface(IDirectDraw *iface,
|
|||
DDSURFACEDESC *surface_desc, IDirectDrawSurface **surface, IUnknown *outer_unknown)
|
||||
{
|
||||
struct ddraw *ddraw = impl_from_IDirectDraw(iface);
|
||||
IDirectDrawSurfaceImpl *impl;
|
||||
struct ddraw_surface *impl;
|
||||
HRESULT hr;
|
||||
DDSURFACEDESC2 surface_desc2;
|
||||
|
||||
|
@ -3437,7 +3437,7 @@ struct surfacescallback_context
|
|||
static HRESULT CALLBACK EnumSurfacesCallback2Thunk(IDirectDrawSurface7 *surface,
|
||||
DDSURFACEDESC2 *surface_desc, void *context)
|
||||
{
|
||||
IDirectDrawSurfaceImpl *surface_impl = impl_from_IDirectDrawSurface7(surface);
|
||||
struct ddraw_surface *surface_impl = impl_from_IDirectDrawSurface7(surface);
|
||||
struct surfacescallback2_context *cbcontext = context;
|
||||
|
||||
IDirectDrawSurface4_AddRef(&surface_impl->IDirectDrawSurface4_iface);
|
||||
|
@ -3450,7 +3450,7 @@ static HRESULT CALLBACK EnumSurfacesCallback2Thunk(IDirectDrawSurface7 *surface,
|
|||
static HRESULT CALLBACK EnumSurfacesCallbackThunk(IDirectDrawSurface7 *surface,
|
||||
DDSURFACEDESC2 *surface_desc, void *context)
|
||||
{
|
||||
IDirectDrawSurfaceImpl *surface_impl = impl_from_IDirectDrawSurface7(surface);
|
||||
struct ddraw_surface *surface_impl = impl_from_IDirectDrawSurface7(surface);
|
||||
struct surfacescallback_context *cbcontext = context;
|
||||
|
||||
IDirectDrawSurface_AddRef(&surface_impl->IDirectDrawSurface_iface);
|
||||
|
@ -3483,7 +3483,7 @@ static HRESULT WINAPI ddraw7_EnumSurfaces(IDirectDraw7 *iface, DWORD Flags,
|
|||
DDSURFACEDESC2 *DDSD, void *Context, LPDDENUMSURFACESCALLBACK7 Callback)
|
||||
{
|
||||
struct ddraw *ddraw = impl_from_IDirectDraw7(iface);
|
||||
IDirectDrawSurfaceImpl *surf;
|
||||
struct ddraw_surface *surf;
|
||||
BOOL all, nomatch;
|
||||
DDSURFACEDESC2 desc;
|
||||
struct list *entry, *entry2;
|
||||
|
@ -3502,7 +3502,7 @@ static HRESULT WINAPI ddraw7_EnumSurfaces(IDirectDraw7 *iface, DWORD Flags,
|
|||
/* Use the _SAFE enumeration, the app may destroy enumerated surfaces */
|
||||
LIST_FOR_EACH_SAFE(entry, entry2, &ddraw->surface_list)
|
||||
{
|
||||
surf = LIST_ENTRY(entry, IDirectDrawSurfaceImpl, surface_list_entry);
|
||||
surf = LIST_ENTRY(entry, struct ddraw_surface, surface_list_entry);
|
||||
|
||||
if (!surf->iface_count)
|
||||
{
|
||||
|
@ -3823,24 +3823,21 @@ static HRESULT WINAPI ddraw1_CreatePalette(IDirectDraw *iface, DWORD flags,
|
|||
static HRESULT WINAPI ddraw7_DuplicateSurface(IDirectDraw7 *iface,
|
||||
IDirectDrawSurface7 *Src, IDirectDrawSurface7 **Dest)
|
||||
{
|
||||
IDirectDrawSurfaceImpl *Surf = unsafe_impl_from_IDirectDrawSurface7(Src);
|
||||
struct ddraw_surface *src_surface = unsafe_impl_from_IDirectDrawSurface7(Src);
|
||||
|
||||
FIXME("iface %p, src %p, dst %p partial stub!\n", iface, Src, Dest);
|
||||
|
||||
/* For now, simply create a new, independent surface */
|
||||
return IDirectDraw7_CreateSurface(iface,
|
||||
&Surf->surface_desc,
|
||||
Dest,
|
||||
NULL);
|
||||
return IDirectDraw7_CreateSurface(iface, &src_surface->surface_desc, Dest, NULL);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI ddraw4_DuplicateSurface(IDirectDraw4 *iface, IDirectDrawSurface4 *src,
|
||||
IDirectDrawSurface4 **dst)
|
||||
{
|
||||
struct ddraw_surface *src_impl = unsafe_impl_from_IDirectDrawSurface4(src);
|
||||
struct ddraw *ddraw = impl_from_IDirectDraw4(iface);
|
||||
IDirectDrawSurfaceImpl *src_impl = unsafe_impl_from_IDirectDrawSurface4(src);
|
||||
struct ddraw_surface *dst_impl;
|
||||
IDirectDrawSurface7 *dst7;
|
||||
IDirectDrawSurfaceImpl *dst_impl;
|
||||
HRESULT hr;
|
||||
|
||||
TRACE("iface %p, src %p, dst %p.\n", iface, src, dst);
|
||||
|
@ -3863,10 +3860,10 @@ static HRESULT WINAPI ddraw4_DuplicateSurface(IDirectDraw4 *iface, IDirectDrawSu
|
|||
static HRESULT WINAPI ddraw2_DuplicateSurface(IDirectDraw2 *iface,
|
||||
IDirectDrawSurface *src, IDirectDrawSurface **dst)
|
||||
{
|
||||
struct ddraw_surface *src_impl = unsafe_impl_from_IDirectDrawSurface(src);
|
||||
struct ddraw *ddraw = impl_from_IDirectDraw2(iface);
|
||||
IDirectDrawSurfaceImpl *src_impl = unsafe_impl_from_IDirectDrawSurface(src);
|
||||
struct ddraw_surface *dst_impl;
|
||||
IDirectDrawSurface7 *dst7;
|
||||
IDirectDrawSurfaceImpl *dst_impl;
|
||||
HRESULT hr;
|
||||
|
||||
TRACE("iface %p, src %p, dst %p.\n", iface, src, dst);
|
||||
|
@ -3886,10 +3883,10 @@ static HRESULT WINAPI ddraw2_DuplicateSurface(IDirectDraw2 *iface,
|
|||
static HRESULT WINAPI ddraw1_DuplicateSurface(IDirectDraw *iface, IDirectDrawSurface *src,
|
||||
IDirectDrawSurface **dst)
|
||||
{
|
||||
struct ddraw_surface *src_impl = unsafe_impl_from_IDirectDrawSurface(src);
|
||||
struct ddraw *ddraw = impl_from_IDirectDraw(iface);
|
||||
IDirectDrawSurfaceImpl *src_impl = unsafe_impl_from_IDirectDrawSurface(src);
|
||||
struct ddraw_surface *dst_impl;
|
||||
IDirectDrawSurface7 *dst7;
|
||||
IDirectDrawSurfaceImpl *dst_impl;
|
||||
HRESULT hr;
|
||||
|
||||
TRACE("iface %p, src %p, dst %p.\n", iface, src, dst);
|
||||
|
@ -4421,7 +4418,7 @@ static HRESULT WINAPI d3d1_FindDevice(IDirect3D *iface, D3DFINDDEVICESEARCH *fds
|
|||
static HRESULT WINAPI d3d7_CreateDevice(IDirect3D7 *iface, REFCLSID riid,
|
||||
IDirectDrawSurface7 *surface, IDirect3DDevice7 **device)
|
||||
{
|
||||
IDirectDrawSurfaceImpl *target = unsafe_impl_from_IDirectDrawSurface7(surface);
|
||||
struct ddraw_surface *target = unsafe_impl_from_IDirectDrawSurface7(surface);
|
||||
struct ddraw *ddraw = impl_from_IDirect3D7(iface);
|
||||
IDirect3DDeviceImpl *object;
|
||||
HRESULT hr;
|
||||
|
@ -4478,8 +4475,8 @@ static HRESULT WINAPI d3d7_CreateDevice(IDirect3D7 *iface, REFCLSID riid,
|
|||
static HRESULT WINAPI d3d3_CreateDevice(IDirect3D3 *iface, REFCLSID riid,
|
||||
IDirectDrawSurface4 *surface, IDirect3DDevice3 **device, IUnknown *outer_unknown)
|
||||
{
|
||||
struct ddraw_surface *surface_impl = unsafe_impl_from_IDirectDrawSurface4(surface);
|
||||
struct ddraw *ddraw = impl_from_IDirect3D3(iface);
|
||||
IDirectDrawSurfaceImpl *surface_impl = unsafe_impl_from_IDirectDrawSurface4(surface);
|
||||
IDirect3DDevice7 *device7;
|
||||
IDirect3DDeviceImpl *device_impl;
|
||||
HRESULT hr;
|
||||
|
@ -4503,8 +4500,8 @@ static HRESULT WINAPI d3d3_CreateDevice(IDirect3D3 *iface, REFCLSID riid,
|
|||
static HRESULT WINAPI d3d2_CreateDevice(IDirect3D2 *iface, REFCLSID riid,
|
||||
IDirectDrawSurface *surface, IDirect3DDevice2 **device)
|
||||
{
|
||||
struct ddraw_surface *surface_impl = unsafe_impl_from_IDirectDrawSurface(surface);
|
||||
struct ddraw *ddraw = impl_from_IDirect3D2(iface);
|
||||
IDirectDrawSurfaceImpl *surface_impl = unsafe_impl_from_IDirectDrawSurface(surface);
|
||||
IDirect3DDevice7 *device7;
|
||||
IDirect3DDeviceImpl *device_impl;
|
||||
HRESULT hr;
|
||||
|
@ -5391,7 +5388,7 @@ static HRESULT CDECL device_parent_create_surface(struct wined3d_device_parent *
|
|||
enum wined3d_pool pool, UINT level, enum wined3d_cubemap_face face, struct wined3d_surface **surface)
|
||||
{
|
||||
struct ddraw *ddraw = ddraw_from_device_parent(device_parent);
|
||||
IDirectDrawSurfaceImpl *surf = NULL;
|
||||
struct ddraw_surface *surf = NULL;
|
||||
UINT i = 0;
|
||||
DDSCAPS2 searchcaps = ddraw->tex_root->surface_desc.ddsCaps;
|
||||
|
||||
|
|
|
@ -41,7 +41,6 @@ extern const struct wined3d_parent_ops ddraw_surface_wined3d_parent_ops DECLSPEC
|
|||
extern const struct wined3d_parent_ops ddraw_null_wined3d_parent_ops DECLSPEC_HIDDEN;
|
||||
|
||||
/* Typdef the interfaces */
|
||||
typedef struct IDirectDrawSurfaceImpl IDirectDrawSurfaceImpl;
|
||||
typedef struct IDirectDrawPaletteImpl IDirectDrawPaletteImpl;
|
||||
typedef struct IDirect3DDeviceImpl IDirect3DDeviceImpl;
|
||||
typedef struct IDirect3DLightImpl IDirect3DLightImpl;
|
||||
|
@ -82,7 +81,7 @@ struct ddraw
|
|||
struct wined3d_device *wined3d_device;
|
||||
BOOL d3d_initialized;
|
||||
|
||||
IDirectDrawSurfaceImpl *primary;
|
||||
struct ddraw_surface *primary;
|
||||
RECT primary_lock;
|
||||
struct wined3d_surface *wined3d_frontbuffer;
|
||||
struct wined3d_swapchain *wined3d_swapchain;
|
||||
|
@ -105,7 +104,7 @@ struct ddraw
|
|||
HWND dest_window;
|
||||
|
||||
/* Helpers for surface creation */
|
||||
IDirectDrawSurfaceImpl *tex_root;
|
||||
struct ddraw_surface *tex_root;
|
||||
|
||||
/* For the dll unload cleanup code */
|
||||
struct list ddraw_list_entry;
|
||||
|
@ -143,7 +142,7 @@ extern enum wined3d_surface_type DefaultSurfaceType DECLSPEC_HIDDEN;
|
|||
* IDirectDrawSurface implementation structure
|
||||
*****************************************************************************/
|
||||
|
||||
struct IDirectDrawSurfaceImpl
|
||||
struct ddraw_surface
|
||||
{
|
||||
/* IUnknown fields */
|
||||
IDirectDrawSurface7 IDirectDrawSurface7_iface;
|
||||
|
@ -166,8 +165,8 @@ struct IDirectDrawSurfaceImpl
|
|||
struct wined3d_texture *wined3d_texture;
|
||||
|
||||
/* This implementation handles attaching surfaces to other surfaces */
|
||||
IDirectDrawSurfaceImpl *next_attached;
|
||||
IDirectDrawSurfaceImpl *first_attached;
|
||||
struct ddraw_surface *next_attached;
|
||||
struct ddraw_surface *first_attached;
|
||||
IUnknown *attached_iface;
|
||||
|
||||
/* Complex surfaces are organized in a tree, although the tree is degenerated to a list in most cases.
|
||||
|
@ -176,7 +175,7 @@ struct IDirectDrawSurfaceImpl
|
|||
* to them. So hardcode the array to 6, a dynamic array or a list would be an overkill.
|
||||
*/
|
||||
#define MAX_COMPLEX_ATTACHED 6
|
||||
IDirectDrawSurfaceImpl *complex_array[MAX_COMPLEX_ATTACHED];
|
||||
struct ddraw_surface *complex_array[MAX_COMPLEX_ATTACHED];
|
||||
/* You can't traverse the tree upwards. Only a flag for Surface::Release because its needed there,
|
||||
* but no pointer to prevent temptations to traverse it in the wrong direction.
|
||||
*/
|
||||
|
@ -198,52 +197,52 @@ struct IDirectDrawSurfaceImpl
|
|||
DWORD Handle;
|
||||
};
|
||||
|
||||
HRESULT ddraw_surface_create_texture(IDirectDrawSurfaceImpl *surface) DECLSPEC_HIDDEN;
|
||||
HRESULT ddraw_surface_init(IDirectDrawSurfaceImpl *surface, struct ddraw *ddraw,
|
||||
HRESULT ddraw_surface_create_texture(struct ddraw_surface *surface) DECLSPEC_HIDDEN;
|
||||
HRESULT ddraw_surface_init(struct ddraw_surface *surface, struct ddraw *ddraw,
|
||||
DDSURFACEDESC2 *desc, UINT mip_level, UINT version) DECLSPEC_HIDDEN;
|
||||
ULONG ddraw_surface_release_iface(IDirectDrawSurfaceImpl *This) DECLSPEC_HIDDEN;
|
||||
ULONG ddraw_surface_release_iface(struct ddraw_surface *This) DECLSPEC_HIDDEN;
|
||||
|
||||
static inline IDirectDrawSurfaceImpl *impl_from_IDirect3DTexture(IDirect3DTexture *iface)
|
||||
static inline struct ddraw_surface *impl_from_IDirect3DTexture(IDirect3DTexture *iface)
|
||||
{
|
||||
return CONTAINING_RECORD(iface, IDirectDrawSurfaceImpl, IDirect3DTexture_iface);
|
||||
return CONTAINING_RECORD(iface, struct ddraw_surface, IDirect3DTexture_iface);
|
||||
}
|
||||
|
||||
static inline IDirectDrawSurfaceImpl *impl_from_IDirect3DTexture2(IDirect3DTexture2 *iface)
|
||||
static inline struct ddraw_surface *impl_from_IDirect3DTexture2(IDirect3DTexture2 *iface)
|
||||
{
|
||||
return CONTAINING_RECORD(iface, IDirectDrawSurfaceImpl, IDirect3DTexture2_iface);
|
||||
return CONTAINING_RECORD(iface, struct ddraw_surface, IDirect3DTexture2_iface);
|
||||
}
|
||||
|
||||
static inline IDirectDrawSurfaceImpl *impl_from_IDirectDrawSurface(IDirectDrawSurface *iface)
|
||||
static inline struct ddraw_surface *impl_from_IDirectDrawSurface(IDirectDrawSurface *iface)
|
||||
{
|
||||
return CONTAINING_RECORD(iface, IDirectDrawSurfaceImpl, IDirectDrawSurface_iface);
|
||||
return CONTAINING_RECORD(iface, struct ddraw_surface, IDirectDrawSurface_iface);
|
||||
}
|
||||
|
||||
static inline IDirectDrawSurfaceImpl *impl_from_IDirectDrawSurface2(IDirectDrawSurface2 *iface)
|
||||
static inline struct ddraw_surface *impl_from_IDirectDrawSurface2(IDirectDrawSurface2 *iface)
|
||||
{
|
||||
return CONTAINING_RECORD(iface, IDirectDrawSurfaceImpl, IDirectDrawSurface2_iface);
|
||||
return CONTAINING_RECORD(iface, struct ddraw_surface, IDirectDrawSurface2_iface);
|
||||
}
|
||||
|
||||
static inline IDirectDrawSurfaceImpl *impl_from_IDirectDrawSurface3(IDirectDrawSurface3 *iface)
|
||||
static inline struct ddraw_surface *impl_from_IDirectDrawSurface3(IDirectDrawSurface3 *iface)
|
||||
{
|
||||
return CONTAINING_RECORD(iface, IDirectDrawSurfaceImpl, IDirectDrawSurface3_iface);
|
||||
return CONTAINING_RECORD(iface, struct ddraw_surface, IDirectDrawSurface3_iface);
|
||||
}
|
||||
|
||||
static inline IDirectDrawSurfaceImpl *impl_from_IDirectDrawSurface4(IDirectDrawSurface4 *iface)
|
||||
static inline struct ddraw_surface *impl_from_IDirectDrawSurface4(IDirectDrawSurface4 *iface)
|
||||
{
|
||||
return CONTAINING_RECORD(iface, IDirectDrawSurfaceImpl, IDirectDrawSurface4_iface);
|
||||
return CONTAINING_RECORD(iface, struct ddraw_surface, IDirectDrawSurface4_iface);
|
||||
}
|
||||
|
||||
static inline IDirectDrawSurfaceImpl *impl_from_IDirectDrawSurface7(IDirectDrawSurface7 *iface)
|
||||
static inline struct ddraw_surface *impl_from_IDirectDrawSurface7(IDirectDrawSurface7 *iface)
|
||||
{
|
||||
return CONTAINING_RECORD(iface, IDirectDrawSurfaceImpl, IDirectDrawSurface7_iface);
|
||||
return CONTAINING_RECORD(iface, struct ddraw_surface, IDirectDrawSurface7_iface);
|
||||
}
|
||||
|
||||
IDirectDrawSurfaceImpl *unsafe_impl_from_IDirectDrawSurface(IDirectDrawSurface *iface) DECLSPEC_HIDDEN;
|
||||
IDirectDrawSurfaceImpl *unsafe_impl_from_IDirectDrawSurface4(IDirectDrawSurface4 *iface) DECLSPEC_HIDDEN;
|
||||
IDirectDrawSurfaceImpl *unsafe_impl_from_IDirectDrawSurface7(IDirectDrawSurface7 *iface) DECLSPEC_HIDDEN;
|
||||
struct ddraw_surface *unsafe_impl_from_IDirectDrawSurface(IDirectDrawSurface *iface) DECLSPEC_HIDDEN;
|
||||
struct ddraw_surface *unsafe_impl_from_IDirectDrawSurface4(IDirectDrawSurface4 *iface) DECLSPEC_HIDDEN;
|
||||
struct ddraw_surface *unsafe_impl_from_IDirectDrawSurface7(IDirectDrawSurface7 *iface) DECLSPEC_HIDDEN;
|
||||
|
||||
IDirectDrawSurfaceImpl *unsafe_impl_from_IDirect3DTexture(IDirect3DTexture *iface) DECLSPEC_HIDDEN;
|
||||
IDirectDrawSurfaceImpl *unsafe_impl_from_IDirect3DTexture2(IDirect3DTexture2 *iface) DECLSPEC_HIDDEN;
|
||||
struct ddraw_surface *unsafe_impl_from_IDirect3DTexture(IDirect3DTexture *iface) DECLSPEC_HIDDEN;
|
||||
struct ddraw_surface *unsafe_impl_from_IDirect3DTexture2(IDirect3DTexture2 *iface) DECLSPEC_HIDDEN;
|
||||
|
||||
#define DDRAW_INVALID_HANDLE ~0U
|
||||
|
||||
|
@ -289,7 +288,7 @@ struct IDirect3DDeviceImpl
|
|||
struct wined3d_device *wined3d_device;
|
||||
struct ddraw *ddraw;
|
||||
struct wined3d_buffer *indexbuffer;
|
||||
IDirectDrawSurfaceImpl *target;
|
||||
struct ddraw_surface *target;
|
||||
|
||||
/* Viewport management */
|
||||
struct list viewport_list;
|
||||
|
@ -321,7 +320,7 @@ struct IDirect3DDeviceImpl
|
|||
};
|
||||
|
||||
HRESULT d3d_device_init(IDirect3DDeviceImpl *device, struct ddraw *ddraw,
|
||||
IDirectDrawSurfaceImpl *target) DECLSPEC_HIDDEN;
|
||||
struct ddraw_surface *target) DECLSPEC_HIDDEN;
|
||||
|
||||
/* The IID */
|
||||
extern const GUID IID_D3DDEVICE_WineD3D DECLSPEC_HIDDEN;
|
||||
|
|
|
@ -354,7 +354,7 @@ IDirect3DDeviceImpl_7_Release(IDirect3DDevice7 *iface)
|
|||
|
||||
case DDRAW_HANDLE_SURFACE:
|
||||
{
|
||||
IDirectDrawSurfaceImpl *surf = entry->object;
|
||||
struct ddraw_surface *surf = entry->object;
|
||||
FIXME("Texture handle %#x (%p) not unset properly.\n", i + 1, surf);
|
||||
surf->Handle = 0;
|
||||
break;
|
||||
|
@ -610,8 +610,8 @@ IDirect3DDeviceImpl_2_SwapTextureHandles(IDirect3DDevice2 *iface,
|
|||
IDirect3DTexture2 *Tex2)
|
||||
{
|
||||
IDirect3DDeviceImpl *This = impl_from_IDirect3DDevice2(iface);
|
||||
IDirectDrawSurfaceImpl *surf1 = unsafe_impl_from_IDirect3DTexture2(Tex1);
|
||||
IDirectDrawSurfaceImpl *surf2 = unsafe_impl_from_IDirect3DTexture2(Tex2);
|
||||
struct ddraw_surface *surf1 = unsafe_impl_from_IDirect3DTexture2(Tex1);
|
||||
struct ddraw_surface *surf2 = unsafe_impl_from_IDirect3DTexture2(Tex2);
|
||||
DWORD h1, h2;
|
||||
|
||||
TRACE("iface %p, tex1 %p, tex2 %p.\n", iface, Tex1, Tex2);
|
||||
|
@ -634,8 +634,8 @@ static HRESULT WINAPI IDirect3DDeviceImpl_1_SwapTextureHandles(IDirect3DDevice *
|
|||
IDirect3DTexture *D3DTex1, IDirect3DTexture *D3DTex2)
|
||||
{
|
||||
IDirect3DDeviceImpl *This = impl_from_IDirect3DDevice(iface);
|
||||
IDirectDrawSurfaceImpl *surf1 = unsafe_impl_from_IDirect3DTexture(D3DTex1);
|
||||
IDirectDrawSurfaceImpl *surf2 = unsafe_impl_from_IDirect3DTexture(D3DTex2);
|
||||
struct ddraw_surface *surf1 = unsafe_impl_from_IDirect3DTexture(D3DTex1);
|
||||
struct ddraw_surface *surf2 = unsafe_impl_from_IDirect3DTexture(D3DTex2);
|
||||
IDirect3DTexture2 *t1 = surf1 ? &surf1->IDirect3DTexture2_iface : NULL;
|
||||
IDirect3DTexture2 *t2 = surf2 ? &surf2->IDirect3DTexture2_iface : NULL;
|
||||
|
||||
|
@ -1909,21 +1909,21 @@ static HRESULT WINAPI IDirect3DDeviceImpl_2_GetCurrentViewport(IDirect3DDevice2
|
|||
* D3D_OK on success, for details see IWineD3DDevice::SetRenderTarget
|
||||
*
|
||||
*****************************************************************************/
|
||||
static HRESULT d3d_device_set_render_target(IDirect3DDeviceImpl *This, IDirectDrawSurfaceImpl *Target)
|
||||
static HRESULT d3d_device_set_render_target(IDirect3DDeviceImpl *This, struct ddraw_surface *target)
|
||||
{
|
||||
HRESULT hr;
|
||||
|
||||
wined3d_mutex_lock();
|
||||
|
||||
if(This->target == Target)
|
||||
if (This->target == target)
|
||||
{
|
||||
TRACE("No-op SetRenderTarget operation, not doing anything\n");
|
||||
wined3d_mutex_unlock();
|
||||
return D3D_OK;
|
||||
}
|
||||
This->target = Target;
|
||||
This->target = target;
|
||||
hr = wined3d_device_set_render_target(This->wined3d_device, 0,
|
||||
Target ? Target->wined3d_surface : NULL, FALSE);
|
||||
target ? target->wined3d_surface : NULL, FALSE);
|
||||
if(hr != D3D_OK)
|
||||
{
|
||||
wined3d_mutex_unlock();
|
||||
|
@ -1942,14 +1942,14 @@ IDirect3DDeviceImpl_7_SetRenderTarget(IDirect3DDevice7 *iface,
|
|||
DWORD Flags)
|
||||
{
|
||||
IDirect3DDeviceImpl *This = impl_from_IDirect3DDevice7(iface);
|
||||
IDirectDrawSurfaceImpl *Target = unsafe_impl_from_IDirectDrawSurface7(NewTarget);
|
||||
struct ddraw_surface *target = unsafe_impl_from_IDirectDrawSurface7(NewTarget);
|
||||
|
||||
TRACE("iface %p, target %p, flags %#x.\n", iface, NewTarget, Flags);
|
||||
/* Flags: Not used */
|
||||
|
||||
IDirectDrawSurface7_AddRef(NewTarget);
|
||||
IDirectDrawSurface7_Release(&This->target->IDirectDrawSurface7_iface);
|
||||
return d3d_device_set_render_target(This, Target);
|
||||
return d3d_device_set_render_target(This, target);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI
|
||||
|
@ -1979,26 +1979,26 @@ static HRESULT WINAPI IDirect3DDeviceImpl_3_SetRenderTarget(IDirect3DDevice3 *if
|
|||
IDirectDrawSurface4 *NewRenderTarget, DWORD Flags)
|
||||
{
|
||||
IDirect3DDeviceImpl *This = impl_from_IDirect3DDevice3(iface);
|
||||
IDirectDrawSurfaceImpl *Target = unsafe_impl_from_IDirectDrawSurface4(NewRenderTarget);
|
||||
struct ddraw_surface *target = unsafe_impl_from_IDirectDrawSurface4(NewRenderTarget);
|
||||
|
||||
TRACE("iface %p, target %p, flags %#x.\n", iface, NewRenderTarget, Flags);
|
||||
|
||||
IDirectDrawSurface4_AddRef(NewRenderTarget);
|
||||
IDirectDrawSurface4_Release(&This->target->IDirectDrawSurface4_iface);
|
||||
return d3d_device_set_render_target(This, Target);
|
||||
return d3d_device_set_render_target(This, target);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI IDirect3DDeviceImpl_2_SetRenderTarget(IDirect3DDevice2 *iface,
|
||||
IDirectDrawSurface *NewRenderTarget, DWORD Flags)
|
||||
{
|
||||
IDirect3DDeviceImpl *This = impl_from_IDirect3DDevice2(iface);
|
||||
IDirectDrawSurfaceImpl *Target = unsafe_impl_from_IDirectDrawSurface(NewRenderTarget);
|
||||
struct ddraw_surface *target = unsafe_impl_from_IDirectDrawSurface(NewRenderTarget);
|
||||
|
||||
TRACE("iface %p, target %p, flags %#x.\n", iface, NewRenderTarget, Flags);
|
||||
|
||||
IDirectDrawSurface_AddRef(NewRenderTarget);
|
||||
IDirectDrawSurface_Release(&This->target->IDirectDrawSurface_iface);
|
||||
return d3d_device_set_render_target(This, Target);
|
||||
return d3d_device_set_render_target(This, target);
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
|
@ -2042,7 +2042,7 @@ static HRESULT WINAPI IDirect3DDeviceImpl_3_GetRenderTarget(IDirect3DDevice3 *if
|
|||
{
|
||||
IDirect3DDeviceImpl *This = impl_from_IDirect3DDevice3(iface);
|
||||
IDirectDrawSurface7 *RenderTarget7;
|
||||
IDirectDrawSurfaceImpl *RenderTargetImpl;
|
||||
struct ddraw_surface *RenderTargetImpl;
|
||||
HRESULT hr;
|
||||
|
||||
TRACE("iface %p, target %p.\n", iface, RenderTarget);
|
||||
|
@ -2064,7 +2064,7 @@ static HRESULT WINAPI IDirect3DDeviceImpl_2_GetRenderTarget(IDirect3DDevice2 *if
|
|||
{
|
||||
IDirect3DDeviceImpl *This = impl_from_IDirect3DDevice2(iface);
|
||||
IDirectDrawSurface7 *RenderTarget7;
|
||||
IDirectDrawSurfaceImpl *RenderTargetImpl;
|
||||
struct ddraw_surface *RenderTargetImpl;
|
||||
HRESULT hr;
|
||||
|
||||
TRACE("iface %p, target %p.\n", iface, RenderTarget);
|
||||
|
@ -2530,7 +2530,7 @@ IDirect3DDeviceImpl_3_GetRenderState(IDirect3DDevice3 *iface,
|
|||
{
|
||||
/* The parent of the texture is the IDirectDrawSurface7
|
||||
* interface of the ddraw surface. */
|
||||
IDirectDrawSurfaceImpl *parent = wined3d_texture_get_parent(tex);
|
||||
struct ddraw_surface *parent = wined3d_texture_get_parent(tex);
|
||||
if (parent) *lpdwRenderState = parent->Handle;
|
||||
wined3d_texture_decref(tex);
|
||||
}
|
||||
|
@ -2847,7 +2847,7 @@ IDirect3DDeviceImpl_3_SetRenderState(IDirect3DDevice3 *iface,
|
|||
{
|
||||
case D3DRENDERSTATE_TEXTUREHANDLE:
|
||||
{
|
||||
IDirectDrawSurfaceImpl *surf;
|
||||
struct ddraw_surface *surf;
|
||||
|
||||
if(Value == 0)
|
||||
{
|
||||
|
@ -4672,9 +4672,9 @@ static HRESULT WINAPI IDirect3DDeviceImpl_3_GetTexture(IDirect3DDevice3 *iface,
|
|||
IDirect3DTexture2 **Texture2)
|
||||
{
|
||||
IDirect3DDeviceImpl *This = impl_from_IDirect3DDevice3(iface);
|
||||
struct ddraw_surface *ret_val_impl;
|
||||
HRESULT ret;
|
||||
IDirectDrawSurface7 *ret_val;
|
||||
IDirectDrawSurfaceImpl *ret_val_impl;
|
||||
|
||||
TRACE("iface %p, stage %u, texture %p.\n", iface, Stage, Texture2);
|
||||
|
||||
|
@ -4710,7 +4710,7 @@ IDirect3DDeviceImpl_7_SetTexture(IDirect3DDevice7 *iface,
|
|||
IDirectDrawSurface7 *Texture)
|
||||
{
|
||||
IDirect3DDeviceImpl *This = impl_from_IDirect3DDevice7(iface);
|
||||
IDirectDrawSurfaceImpl *surf = unsafe_impl_from_IDirectDrawSurface7(Texture);
|
||||
struct ddraw_surface *surf = unsafe_impl_from_IDirectDrawSurface7(Texture);
|
||||
HRESULT hr;
|
||||
|
||||
TRACE("iface %p, stage %u, texture %p.\n", iface, Stage, Texture);
|
||||
|
@ -4753,7 +4753,7 @@ IDirect3DDeviceImpl_3_SetTexture(IDirect3DDevice3 *iface,
|
|||
IDirect3DTexture2 *Texture2)
|
||||
{
|
||||
IDirect3DDeviceImpl *This = impl_from_IDirect3DDevice3(iface);
|
||||
IDirectDrawSurfaceImpl *tex = unsafe_impl_from_IDirect3DTexture2(Texture2);
|
||||
struct ddraw_surface *tex = unsafe_impl_from_IDirect3DTexture2(Texture2);
|
||||
DWORD texmapblend;
|
||||
HRESULT hr;
|
||||
|
||||
|
@ -5771,7 +5771,7 @@ static HRESULT
|
|||
IDirect3DDeviceImpl_7_PreLoad(IDirect3DDevice7 *iface,
|
||||
IDirectDrawSurface7 *Texture)
|
||||
{
|
||||
IDirectDrawSurfaceImpl *surf = unsafe_impl_from_IDirectDrawSurface7(Texture);
|
||||
struct ddraw_surface *surface = unsafe_impl_from_IDirectDrawSurface7(Texture);
|
||||
|
||||
TRACE("iface %p, texture %p.\n", iface, Texture);
|
||||
|
||||
|
@ -5779,7 +5779,7 @@ IDirect3DDeviceImpl_7_PreLoad(IDirect3DDevice7 *iface,
|
|||
return DDERR_INVALIDPARAMS;
|
||||
|
||||
wined3d_mutex_lock();
|
||||
wined3d_surface_preload(surf->wined3d_surface);
|
||||
wined3d_surface_preload(surface->wined3d_surface);
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
return D3D_OK;
|
||||
|
@ -6082,10 +6082,9 @@ IDirect3DDeviceImpl_7_CreateStateBlock_FPUPreserve(IDirect3DDevice7 *iface,
|
|||
}
|
||||
|
||||
/* Helper function for IDirect3DDeviceImpl_7_Load. */
|
||||
static BOOL is_mip_level_subset(IDirectDrawSurfaceImpl *dest,
|
||||
IDirectDrawSurfaceImpl *src)
|
||||
static BOOL is_mip_level_subset(struct ddraw_surface *dest, struct ddraw_surface *src)
|
||||
{
|
||||
IDirectDrawSurfaceImpl *src_level, *dest_level;
|
||||
struct ddraw_surface *src_level, *dest_level;
|
||||
IDirectDrawSurface7 *temp;
|
||||
DDSURFACEDESC2 ddsd;
|
||||
BOOL levelFound; /* at least one suitable sublevel in dest found */
|
||||
|
@ -6131,13 +6130,10 @@ static BOOL is_mip_level_subset(IDirectDrawSurfaceImpl *dest,
|
|||
}
|
||||
|
||||
/* Helper function for IDirect3DDeviceImpl_7_Load. */
|
||||
static void copy_mipmap_chain(IDirect3DDeviceImpl *device,
|
||||
IDirectDrawSurfaceImpl *dest,
|
||||
IDirectDrawSurfaceImpl *src,
|
||||
const POINT *DestPoint,
|
||||
const RECT *SrcRect)
|
||||
static void copy_mipmap_chain(IDirect3DDeviceImpl *device, struct ddraw_surface *dest,
|
||||
struct ddraw_surface *src, const POINT *DestPoint, const RECT *SrcRect)
|
||||
{
|
||||
IDirectDrawSurfaceImpl *src_level, *dest_level;
|
||||
struct ddraw_surface *src_level, *dest_level;
|
||||
IDirectDrawSurface7 *temp;
|
||||
DDSURFACEDESC2 ddsd;
|
||||
POINT point;
|
||||
|
@ -6256,8 +6252,8 @@ IDirect3DDeviceImpl_7_Load(IDirect3DDevice7 *iface,
|
|||
DWORD Flags)
|
||||
{
|
||||
IDirect3DDeviceImpl *This = impl_from_IDirect3DDevice7(iface);
|
||||
IDirectDrawSurfaceImpl *dest = unsafe_impl_from_IDirectDrawSurface7(DestTex);
|
||||
IDirectDrawSurfaceImpl *src = unsafe_impl_from_IDirectDrawSurface7(SrcTex);
|
||||
struct ddraw_surface *dest = unsafe_impl_from_IDirectDrawSurface7(DestTex);
|
||||
struct ddraw_surface *src = unsafe_impl_from_IDirectDrawSurface7(SrcTex);
|
||||
POINT destpoint;
|
||||
RECT srcrect;
|
||||
|
||||
|
@ -6309,8 +6305,8 @@ IDirect3DDeviceImpl_7_Load(IDirect3DDevice7 *iface,
|
|||
|
||||
if (src->surface_desc.ddsCaps.dwCaps2 & DDSCAPS2_CUBEMAP)
|
||||
{
|
||||
struct ddraw_surface *src_face, *dest_face;
|
||||
DWORD src_face_flag, dest_face_flag;
|
||||
IDirectDrawSurfaceImpl *src_face, *dest_face;
|
||||
IDirectDrawSurface7 *temp;
|
||||
DDSURFACEDESC2 ddsd;
|
||||
int i;
|
||||
|
@ -7000,8 +6996,8 @@ IDirect3DDeviceImpl *unsafe_impl_from_IDirect3DDevice(IDirect3DDevice *iface)
|
|||
enum wined3d_depth_buffer_type IDirect3DDeviceImpl_UpdateDepthStencil(IDirect3DDeviceImpl *This)
|
||||
{
|
||||
IDirectDrawSurface7 *depthStencil = NULL;
|
||||
IDirectDrawSurfaceImpl *dsi;
|
||||
static DDSCAPS2 depthcaps = { DDSCAPS_ZBUFFER, 0, 0, 0 };
|
||||
struct ddraw_surface *dsi;
|
||||
|
||||
IDirectDrawSurface7_GetAttachedSurface(&This->target->IDirectDrawSurface7_iface, &depthcaps, &depthStencil);
|
||||
if(!depthStencil)
|
||||
|
@ -7019,7 +7015,7 @@ enum wined3d_depth_buffer_type IDirect3DDeviceImpl_UpdateDepthStencil(IDirect3DD
|
|||
return WINED3D_ZB_TRUE;
|
||||
}
|
||||
|
||||
HRESULT d3d_device_init(IDirect3DDeviceImpl *device, struct ddraw *ddraw, IDirectDrawSurfaceImpl *target)
|
||||
HRESULT d3d_device_init(IDirect3DDeviceImpl *device, struct ddraw *ddraw, struct ddraw_surface *target)
|
||||
{
|
||||
static const D3DMATRIX ident =
|
||||
{
|
||||
|
|
|
@ -762,7 +762,7 @@ DestroyCallback(IDirectDrawSurface7 *surf,
|
|||
DDSURFACEDESC2 *desc,
|
||||
void *context)
|
||||
{
|
||||
IDirectDrawSurfaceImpl *Impl = impl_from_IDirectDrawSurface7(surf);
|
||||
struct ddraw_surface *Impl = impl_from_IDirectDrawSurface7(surf);
|
||||
ULONG ref7, ref4, ref3, ref2, ref1, gamma_count, iface_count;
|
||||
|
||||
ref7 = IDirectDrawSurface7_Release(surf); /* For the EnumSurfaces */
|
||||
|
|
1199
dlls/ddraw/surface.c
1199
dlls/ddraw/surface.c
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue