Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
80dbeb96
Commit
80dbeb96
authored
Nov 12, 2013
by
Henri Verbeet
Committed by
Alexandre Julliard
Nov 12, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ddraw: Introduce a ddraw_texture structure as parent for textures.
parent
b83a0b9d
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
32 additions
and
14 deletions
+32
-14
ddraw.c
dlls/ddraw/ddraw.c
+4
-4
ddraw_private.h
dlls/ddraw/ddraw_private.h
+8
-0
device.c
dlls/ddraw/device.c
+5
-5
surface.c
dlls/ddraw/surface.c
+15
-5
No files found.
dlls/ddraw/ddraw.c
View file @
80dbeb96
...
...
@@ -5152,8 +5152,8 @@ static HRESULT CDECL device_parent_create_texture_surface(struct wined3d_device_
DWORD
flags
,
struct
wined3d_surface
**
surface
)
{
struct
ddraw
*
ddraw
=
ddraw_from_device_parent
(
device_parent
);
struct
ddraw_
surface
*
tex_root
=
container_parent
;
DDSURFACEDESC2
desc
=
tex
_root
->
surface_desc
;
struct
ddraw_
texture
*
texture
=
container_parent
;
DDSURFACEDESC2
desc
=
tex
ture
->
surface_desc
;
struct
ddraw_surface
*
ddraw_surface
;
HRESULT
hr
;
...
...
@@ -5163,7 +5163,7 @@ static HRESULT CDECL device_parent_create_texture_surface(struct wined3d_device_
/* The ddraw root surface is created before the wined3d texture. */
if
(
!
sub_resource_idx
)
{
ddraw_surface
=
tex
_
root
;
ddraw_surface
=
tex
ture
->
root
;
goto
done
;
}
...
...
@@ -5171,7 +5171,7 @@ static HRESULT CDECL device_parent_create_texture_surface(struct wined3d_device_
desc
.
dwHeight
=
wined3d_desc
->
height
;
/* FIXME: Validate that format, usage, pool, etc. really make sense. */
if
(
FAILED
(
hr
=
ddraw_create_surface
(
ddraw
,
&
desc
,
flags
,
&
ddraw_surface
,
tex
_root
->
version
)))
if
(
FAILED
(
hr
=
ddraw_create_surface
(
ddraw
,
&
desc
,
flags
,
&
ddraw_surface
,
tex
ture
->
version
)))
return
hr
;
done:
...
...
dlls/ddraw/ddraw_private.h
View file @
80dbeb96
...
...
@@ -185,6 +185,14 @@ struct ddraw_surface
DWORD
Handle
;
};
struct
ddraw_texture
{
unsigned
int
version
;
DDSURFACEDESC2
surface_desc
;
struct
ddraw_surface
*
root
;
};
HRESULT
ddraw_surface_create_texture
(
struct
ddraw_surface
*
surface
,
DWORD
surface_flags
)
DECLSPEC_HIDDEN
;
HRESULT
ddraw_surface_init
(
struct
ddraw_surface
*
surface
,
struct
ddraw
*
ddraw
,
DDSURFACEDESC2
*
desc
,
DWORD
flags
,
UINT
version
)
DECLSPEC_HIDDEN
;
...
...
dlls/ddraw/device.c
View file @
80dbeb96
...
...
@@ -2454,9 +2454,9 @@ static HRESULT WINAPI d3d_device3_GetRenderState(IDirect3DDevice3 *iface,
{
/* The parent of the texture is the IDirectDrawSurface7
* interface of the ddraw surface. */
struct
ddraw_
surfac
e
*
parent
=
wined3d_texture_get_parent
(
tex
);
struct
ddraw_
textur
e
*
parent
=
wined3d_texture_get_parent
(
tex
);
if
(
parent
)
*
value
=
parent
->
Handle
;
*
value
=
parent
->
root
->
Handle
;
}
wined3d_mutex_unlock
();
...
...
@@ -4586,7 +4586,7 @@ static HRESULT d3d_device7_GetTexture(IDirect3DDevice7 *iface,
{
struct
d3d_device
*
device
=
impl_from_IDirect3DDevice7
(
iface
);
struct
wined3d_texture
*
wined3d_texture
;
struct
ddraw_
surface
*
surfac
e
;
struct
ddraw_
texture
*
ddraw_textur
e
;
TRACE
(
"iface %p, stage %u, texture %p.
\n
"
,
iface
,
stage
,
texture
);
...
...
@@ -4601,8 +4601,8 @@ static HRESULT d3d_device7_GetTexture(IDirect3DDevice7 *iface,
return
D3D_OK
;
}
surfac
e
=
wined3d_texture_get_parent
(
wined3d_texture
);
*
texture
=
&
surface
->
IDirectDrawSurface7_iface
;
ddraw_textur
e
=
wined3d_texture_get_parent
(
wined3d_texture
);
*
texture
=
&
ddraw_texture
->
root
->
IDirectDrawSurface7_iface
;
IDirectDrawSurface7_AddRef
(
*
texture
);
wined3d_mutex_unlock
();
...
...
dlls/ddraw/surface.c
View file @
80dbeb96
...
...
@@ -5575,11 +5575,12 @@ static const struct wined3d_parent_ops ddraw_surface_wined3d_parent_ops =
static
void
STDMETHODCALLTYPE
ddraw_texture_wined3d_object_destroyed
(
void
*
parent
)
{
struct
ddraw_
surface
*
surfac
e
=
parent
;
struct
ddraw_
texture
*
textur
e
=
parent
;
TRACE
(
"
surface %p.
\n
"
,
surfac
e
);
TRACE
(
"
texture %p.
\n
"
,
textur
e
);
ddraw_surface_cleanup
(
surface
);
ddraw_surface_cleanup
(
texture
->
root
);
HeapFree
(
GetProcessHeap
(),
0
,
parent
);
}
static
const
struct
wined3d_parent_ops
ddraw_texture_wined3d_parent_ops
=
...
...
@@ -5593,11 +5594,19 @@ HRESULT ddraw_surface_create_texture(struct ddraw_surface *surface, DWORD surfac
struct
wined3d_resource_desc
wined3d_desc
;
struct
ddraw_surface
*
mip
,
**
attach
;
struct
wined3d_resource
*
resource
;
struct
ddraw_texture
*
texture
;
UINT
layers
,
levels
,
i
,
j
;
DDSURFACEDESC2
*
mip_desc
;
enum
wined3d_pool
pool
;
HRESULT
hr
;
if
(
!
(
texture
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
*
texture
))))
return
E_OUTOFMEMORY
;
texture
->
version
=
surface
->
version
;
texture
->
surface_desc
=
*
desc
;
texture
->
root
=
surface
;
if
(
desc
->
ddsCaps
.
dwCaps
&
DDSCAPS_MIPMAP
)
levels
=
desc
->
u2
.
dwMipMapCount
;
else
...
...
@@ -5640,13 +5649,13 @@ HRESULT ddraw_surface_create_texture(struct ddraw_surface *surface, DWORD surfac
{
wined3d_desc
.
resource_type
=
WINED3D_RTYPE_CUBE_TEXTURE
;
hr
=
wined3d_texture_create_cube
(
surface
->
ddraw
->
wined3d_device
,
&
wined3d_desc
,
levels
,
surface_flags
,
surfac
e
,
&
ddraw_texture_wined3d_parent_ops
,
&
surface
->
wined3d_texture
);
surface_flags
,
textur
e
,
&
ddraw_texture_wined3d_parent_ops
,
&
surface
->
wined3d_texture
);
}
else
{
wined3d_desc
.
resource_type
=
WINED3D_RTYPE_TEXTURE
;
hr
=
wined3d_texture_create_2d
(
surface
->
ddraw
->
wined3d_device
,
&
wined3d_desc
,
levels
,
surface_flags
,
surfac
e
,
&
ddraw_texture_wined3d_parent_ops
,
&
surface
->
wined3d_texture
);
surface_flags
,
textur
e
,
&
ddraw_texture_wined3d_parent_ops
,
&
surface
->
wined3d_texture
);
}
if
(
FAILED
(
hr
))
...
...
@@ -5662,6 +5671,7 @@ HRESULT ddraw_surface_create_texture(struct ddraw_surface *surface, DWORD surfac
FIXME
(
"Unexpected wined3d error %#x.
\n
"
,
hr
);
break
;
}
HeapFree
(
GetProcessHeap
(),
0
,
texture
);
return
hr
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment