Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
80055e1f
Commit
80055e1f
authored
Nov 14, 2013
by
Henri Verbeet
Committed by
Alexandre Julliard
Nov 14, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ddraw: Pass the ddraw texture to ddraw_surface_init().
parent
10411fb2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
18 deletions
+15
-18
ddraw.c
dlls/ddraw/ddraw.c
+6
-13
ddraw_private.h
dlls/ddraw/ddraw_private.h
+2
-2
surface.c
dlls/ddraw/surface.c
+7
-3
No files found.
dlls/ddraw/ddraw.c
View file @
80055e1f
...
...
@@ -2722,13 +2722,13 @@ static HRESULT WINAPI ddraw7_StartModeTest(IDirectDraw7 *iface, SIZE *Modes, DWO
return
DD_OK
;
}
static
HRESULT
ddraw_create_surface
(
struct
ddraw
*
ddraw
,
DDSURFACEDESC2
*
desc
,
const
struct
wined3d_resource_desc
*
wined3d_desc
,
DWORD
flags
,
struct
ddraw_surface
**
surface
,
UINT
version
)
static
HRESULT
ddraw_create_surface
(
struct
ddraw
*
ddraw
,
struct
ddraw_texture
*
texture
,
const
struct
wined3d_resource_desc
*
wined3d_desc
,
DWORD
flags
,
struct
ddraw_surface
**
surface
)
{
HRESULT
hr
;
TRACE
(
"ddraw %p,
desc
%p, wined3d_desc %p, flags %#x, surface %p.
\n
"
,
ddraw
,
desc
,
wined3d_desc
,
flags
,
surface
);
TRACE
(
"ddraw %p,
texture
%p, wined3d_desc %p, flags %#x, surface %p.
\n
"
,
ddraw
,
texture
,
wined3d_desc
,
flags
,
surface
);
/* Create the Surface object */
*
surface
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
**
surface
));
...
...
@@ -2738,7 +2738,7 @@ static HRESULT ddraw_create_surface(struct ddraw *ddraw, DDSURFACEDESC2 *desc,
return
DDERR_OUTOFVIDEOMEMORY
;
}
if
(
FAILED
(
hr
=
ddraw_surface_init
(
*
surface
,
ddraw
,
desc
,
wined3d_desc
,
flags
,
version
)))
if
(
FAILED
(
hr
=
ddraw_surface_init
(
*
surface
,
ddraw
,
texture
,
wined3d_desc
,
flags
)))
{
WARN
(
"Failed to initialize surface, hr %#x.
\n
"
,
hr
);
HeapFree
(
GetProcessHeap
(),
0
,
*
surface
);
...
...
@@ -5105,8 +5105,6 @@ static HRESULT CDECL device_parent_create_texture_surface(struct wined3d_device_
{
struct
ddraw
*
ddraw
=
ddraw_from_device_parent
(
device_parent
);
struct
ddraw_surface
*
ddraw_surface
;
struct
ddraw_texture
*
texture
;
DDSURFACEDESC2
desc
;
HRESULT
hr
;
TRACE
(
"device_parent %p, container_parent %p, wined3d_desc %p, sub_resource_idx %u, flags %#x, surface %p.
\n
"
,
...
...
@@ -5119,13 +5117,8 @@ static HRESULT CDECL device_parent_create_texture_surface(struct wined3d_device_
wined3d_desc
->
multisample_quality
,
WINED3D_SURFACE_MAPPABLE
,
NULL
,
&
ddraw_null_wined3d_parent_ops
,
surface
);
texture
=
container_parent
;
desc
=
texture
->
surface_desc
;
desc
.
dwWidth
=
wined3d_desc
->
width
;
desc
.
dwHeight
=
wined3d_desc
->
height
;
/* FIXME: Validate that format, usage, pool, etc. really make sense. */
if
(
FAILED
(
hr
=
ddraw_create_surface
(
ddraw
,
&
desc
,
wined3d_desc
,
flags
,
&
ddraw_surface
,
texture
->
version
)))
if
(
FAILED
(
hr
=
ddraw_create_surface
(
ddraw
,
container_parent
,
wined3d_desc
,
flags
,
&
ddraw_surface
)))
return
hr
;
*
surface
=
ddraw_surface
->
wined3d_surface
;
...
...
dlls/ddraw/ddraw_private.h
View file @
80055e1f
...
...
@@ -195,8 +195,8 @@ struct ddraw_texture
HRESULT
ddraw_surface_create_texture
(
struct
ddraw
*
ddraw
,
DDSURFACEDESC2
*
desc
,
unsigned
int
version
,
struct
ddraw_surface
**
surface
)
DECLSPEC_HIDDEN
;
HRESULT
ddraw_surface_init
(
struct
ddraw_surface
*
surface
,
struct
ddraw
*
ddraw
,
const
DDSURFACEDESC2
*
desc
,
const
struct
wined3d_resource_desc
*
wined3d_desc
,
DWORD
flags
,
UINT
version
)
DECLSPEC_HIDDEN
;
HRESULT
ddraw_surface_init
(
struct
ddraw_surface
*
surface
,
struct
ddraw
*
ddraw
,
struct
ddraw_texture
*
texture
,
const
struct
wined3d_resource_desc
*
wined3d_desc
,
DWORD
flags
)
DECLSPEC_HIDDEN
;
ULONG
ddraw_surface_release_iface
(
struct
ddraw_surface
*
This
)
DECLSPEC_HIDDEN
;
static
inline
struct
ddraw_surface
*
impl_from_IDirect3DTexture
(
IDirect3DTexture
*
iface
)
...
...
dlls/ddraw/surface.c
View file @
80055e1f
...
...
@@ -5793,9 +5793,11 @@ HRESULT ddraw_surface_create_texture(struct ddraw *ddraw, DDSURFACEDESC2 *desc,
return
DD_OK
;
}
HRESULT
ddraw_surface_init
(
struct
ddraw_surface
*
surface
,
struct
ddraw
*
ddraw
,
const
DDSURFACEDESC2
*
desc
,
const
struct
wined3d_resource_desc
*
wined3d_desc
,
DWORD
flags
,
UINT
version
)
HRESULT
ddraw_surface_init
(
struct
ddraw_surface
*
surface
,
struct
ddraw
*
ddraw
,
struct
ddraw_texture
*
texture
,
const
struct
wined3d_resource_desc
*
wined3d_desc
,
DWORD
flags
)
{
DDSURFACEDESC2
*
desc
=
&
surface
->
surface_desc
;
unsigned
int
version
=
texture
->
version
;
HRESULT
hr
;
surface
->
IDirectDrawSurface7_iface
.
lpVtbl
=
&
ddraw_surface7_vtbl
;
...
...
@@ -5826,7 +5828,9 @@ HRESULT ddraw_surface_init(struct ddraw_surface *surface, struct ddraw *ddraw, c
surface
->
texture_outer
=
(
IUnknown
*
)
&
surface
->
IDirectDrawSurface_iface
;
}
surface
->
surface_desc
=
*
desc
;
*
desc
=
texture
->
surface_desc
;
desc
->
dwWidth
=
wined3d_desc
->
width
;
desc
->
dwHeight
=
wined3d_desc
->
height
;
surface
->
first_attached
=
surface
;
if
(
FAILED
(
hr
=
wined3d_surface_create
(
ddraw
->
wined3d_device
,
wined3d_desc
->
width
,
wined3d_desc
->
height
,
...
...
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