ddraw: Get rid of the "tex_root" hack.
This commit is contained in:
parent
0c658860b1
commit
46a9a7e548
|
@ -3093,11 +3093,7 @@ static HRESULT CreateSurface(struct ddraw *ddraw, DDSURFACEDESC2 *DDSD,
|
||||||
|
|
||||||
/* Create a WineD3DTexture if a texture was requested */
|
/* Create a WineD3DTexture if a texture was requested */
|
||||||
if (desc2.ddsCaps.dwCaps & DDSCAPS_TEXTURE)
|
if (desc2.ddsCaps.dwCaps & DDSCAPS_TEXTURE)
|
||||||
{
|
|
||||||
ddraw->tex_root = object;
|
|
||||||
ddraw_surface_create_texture(object);
|
ddraw_surface_create_texture(object);
|
||||||
ddraw->tex_root = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
return hr;
|
return hr;
|
||||||
}
|
}
|
||||||
|
@ -5364,15 +5360,16 @@ static HRESULT CDECL device_parent_create_texture_surface(struct wined3d_device_
|
||||||
void *container_parent, UINT width, UINT height, enum wined3d_format_id format, DWORD usage,
|
void *container_parent, UINT width, UINT height, enum wined3d_format_id format, DWORD usage,
|
||||||
enum wined3d_pool pool, UINT level, enum wined3d_cubemap_face face, struct wined3d_surface **surface)
|
enum wined3d_pool pool, UINT level, enum wined3d_cubemap_face face, struct wined3d_surface **surface)
|
||||||
{
|
{
|
||||||
struct ddraw *ddraw = ddraw_from_device_parent(device_parent);
|
struct ddraw_surface *tex_root = container_parent;
|
||||||
struct ddraw_surface *surf = NULL;
|
struct ddraw_surface *surf = NULL;
|
||||||
|
DDSCAPS2 searchcaps;
|
||||||
UINT i = 0;
|
UINT i = 0;
|
||||||
DDSCAPS2 searchcaps = ddraw->tex_root->surface_desc.ddsCaps;
|
|
||||||
|
|
||||||
TRACE("device_parent %p, container_parent %p, width %u, height %u, format %#x, usage %#x,\n"
|
TRACE("device_parent %p, container_parent %p, width %u, height %u, format %#x, usage %#x,\n"
|
||||||
"\tpool %#x, level %u, face %u, surface %p.\n",
|
"\tpool %#x, level %u, face %u, surface %p.\n",
|
||||||
device_parent, container_parent, width, height, format, usage, pool, level, face, surface);
|
device_parent, container_parent, width, height, format, usage, pool, level, face, surface);
|
||||||
|
|
||||||
|
searchcaps = tex_root->surface_desc.ddsCaps;
|
||||||
searchcaps.dwCaps2 &= ~DDSCAPS2_CUBEMAP_ALLFACES;
|
searchcaps.dwCaps2 &= ~DDSCAPS2_CUBEMAP_ALLFACES;
|
||||||
switch (face)
|
switch (face)
|
||||||
{
|
{
|
||||||
|
@ -5382,7 +5379,7 @@ static HRESULT CDECL device_parent_create_texture_surface(struct wined3d_device_
|
||||||
{
|
{
|
||||||
searchcaps.dwCaps2 |= DDSCAPS2_CUBEMAP_POSITIVEX;
|
searchcaps.dwCaps2 |= DDSCAPS2_CUBEMAP_POSITIVEX;
|
||||||
}
|
}
|
||||||
surf = ddraw->tex_root; break;
|
surf = tex_root; break;
|
||||||
case WINED3D_CUBEMAP_FACE_NEGATIVE_X:
|
case WINED3D_CUBEMAP_FACE_NEGATIVE_X:
|
||||||
TRACE("Asked for negative x\n");
|
TRACE("Asked for negative x\n");
|
||||||
searchcaps.dwCaps2 |= DDSCAPS2_CUBEMAP_NEGATIVEX; break;
|
searchcaps.dwCaps2 |= DDSCAPS2_CUBEMAP_NEGATIVEX; break;
|
||||||
|
@ -5405,7 +5402,7 @@ static HRESULT CDECL device_parent_create_texture_surface(struct wined3d_device_
|
||||||
if (!surf)
|
if (!surf)
|
||||||
{
|
{
|
||||||
IDirectDrawSurface7 *attached;
|
IDirectDrawSurface7 *attached;
|
||||||
IDirectDrawSurface7_GetAttachedSurface(&ddraw->tex_root->IDirectDrawSurface7_iface, &searchcaps, &attached);
|
IDirectDrawSurface7_GetAttachedSurface(&tex_root->IDirectDrawSurface7_iface, &searchcaps, &attached);
|
||||||
surf = unsafe_impl_from_IDirectDrawSurface7(attached);
|
surf = unsafe_impl_from_IDirectDrawSurface7(attached);
|
||||||
IDirectDrawSurface7_Release(attached);
|
IDirectDrawSurface7_Release(attached);
|
||||||
}
|
}
|
||||||
|
|
|
@ -92,9 +92,6 @@ struct ddraw
|
||||||
HWND devicewindow;
|
HWND devicewindow;
|
||||||
HWND dest_window;
|
HWND dest_window;
|
||||||
|
|
||||||
/* Helpers for surface creation */
|
|
||||||
struct ddraw_surface *tex_root;
|
|
||||||
|
|
||||||
/* For the dll unload cleanup code */
|
/* For the dll unload cleanup code */
|
||||||
struct list ddraw_list_entry;
|
struct list ddraw_list_entry;
|
||||||
/* The surface list - can't relay this to WineD3D
|
/* The surface list - can't relay this to WineD3D
|
||||||
|
|
Loading…
Reference in New Issue