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
5000eba6
Commit
5000eba6
authored
Sep 29, 2014
by
Henri Verbeet
Committed by
Alexandre Julliard
Sep 29, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ddraw: Set user memory in ddraw_surface_create() instead of ddraw_surface_init().
parent
e28800c6
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
46 deletions
+19
-46
ddraw.c
dlls/ddraw/ddraw.c
+1
-8
ddraw_private.h
dlls/ddraw/ddraw_private.h
+1
-1
surface.c
dlls/ddraw/surface.c
+17
-37
No files found.
dlls/ddraw/ddraw.c
View file @
5000eba6
...
@@ -4726,7 +4726,6 @@ static HRESULT CDECL device_parent_surface_created(struct wined3d_device_parent
...
@@ -4726,7 +4726,6 @@ static HRESULT CDECL device_parent_surface_created(struct wined3d_device_parent
{
{
struct
ddraw
*
ddraw
=
ddraw_from_device_parent
(
device_parent
);
struct
ddraw
*
ddraw
=
ddraw_from_device_parent
(
device_parent
);
struct
ddraw_surface
*
ddraw_surface
;
struct
ddraw_surface
*
ddraw_surface
;
HRESULT
hr
;
TRACE
(
"device_parent %p, container_parent %p, surface %p, parent %p, parent_ops %p.
\n
"
,
TRACE
(
"device_parent %p, container_parent %p, surface %p, parent %p, parent_ops %p.
\n
"
,
device_parent
,
container_parent
,
surface
,
parent
,
parent_ops
);
device_parent
,
container_parent
,
surface
,
parent
,
parent_ops
);
...
@@ -4746,13 +4745,7 @@ static HRESULT CDECL device_parent_surface_created(struct wined3d_device_parent
...
@@ -4746,13 +4745,7 @@ static HRESULT CDECL device_parent_surface_created(struct wined3d_device_parent
return
DDERR_OUTOFVIDEOMEMORY
;
return
DDERR_OUTOFVIDEOMEMORY
;
}
}
if
(
FAILED
(
hr
=
ddraw_surface_init
(
ddraw_surface
,
ddraw
,
container_parent
,
surface
,
parent_ops
)))
ddraw_surface_init
(
ddraw_surface
,
ddraw
,
container_parent
,
surface
,
parent_ops
);
{
WARN
(
"Failed to initialize surface, hr %#x.
\n
"
,
hr
);
HeapFree
(
GetProcessHeap
(),
0
,
ddraw_surface
);
return
hr
;
}
*
parent
=
ddraw_surface
;
*
parent
=
ddraw_surface
;
list_add_head
(
&
ddraw
->
surface_list
,
&
ddraw_surface
->
surface_list_entry
);
list_add_head
(
&
ddraw
->
surface_list
,
&
ddraw_surface
->
surface_list_entry
);
...
...
dlls/ddraw/ddraw_private.h
View file @
5000eba6
...
@@ -207,7 +207,7 @@ struct ddraw_texture
...
@@ -207,7 +207,7 @@ struct ddraw_texture
HRESULT
ddraw_surface_create
(
struct
ddraw
*
ddraw
,
const
DDSURFACEDESC2
*
surface_desc
,
HRESULT
ddraw_surface_create
(
struct
ddraw
*
ddraw
,
const
DDSURFACEDESC2
*
surface_desc
,
struct
ddraw_surface
**
surface
,
IUnknown
*
outer_unknown
,
unsigned
int
version
)
DECLSPEC_HIDDEN
;
struct
ddraw_surface
**
surface
,
IUnknown
*
outer_unknown
,
unsigned
int
version
)
DECLSPEC_HIDDEN
;
struct
wined3d_rendertarget_view
*
ddraw_surface_get_rendertarget_view
(
struct
ddraw_surface
*
surface
)
DECLSPEC_HIDDEN
;
struct
wined3d_rendertarget_view
*
ddraw_surface_get_rendertarget_view
(
struct
ddraw_surface
*
surface
)
DECLSPEC_HIDDEN
;
HRESULT
ddraw_surface_init
(
struct
ddraw_surface
*
surface
,
struct
ddraw
*
ddraw
,
struct
ddraw_texture
*
texture
,
void
ddraw_surface_init
(
struct
ddraw_surface
*
surface
,
struct
ddraw
*
ddraw
,
struct
ddraw_texture
*
texture
,
struct
wined3d_surface
*
wined3d_surface
,
const
struct
wined3d_parent_ops
**
parent_ops
)
DECLSPEC_HIDDEN
;
struct
wined3d_surface
*
wined3d_surface
,
const
struct
wined3d_parent_ops
**
parent_ops
)
DECLSPEC_HIDDEN
;
ULONG
ddraw_surface_release_iface
(
struct
ddraw_surface
*
This
)
DECLSPEC_HIDDEN
;
ULONG
ddraw_surface_release_iface
(
struct
ddraw_surface
*
This
)
DECLSPEC_HIDDEN
;
HRESULT
ddraw_surface_update_frontbuffer
(
struct
ddraw_surface
*
surface
,
HRESULT
ddraw_surface_update_frontbuffer
(
struct
ddraw_surface
*
surface
,
...
...
dlls/ddraw/surface.c
View file @
5000eba6
...
@@ -5605,6 +5605,7 @@ HRESULT ddraw_surface_create(struct ddraw *ddraw, const DDSURFACEDESC2 *surface_
...
@@ -5605,6 +5605,7 @@ HRESULT ddraw_surface_create(struct ddraw *ddraw, const DDSURFACEDESC2 *surface_
DDSURFACEDESC2
*
desc
,
*
mip_desc
;
DDSURFACEDESC2
*
desc
,
*
mip_desc
;
struct
ddraw_texture
*
texture
;
struct
ddraw_texture
*
texture
;
UINT
layers
,
levels
,
i
,
j
;
UINT
layers
,
levels
,
i
,
j
;
unsigned
int
pitch
=
0
;
HRESULT
hr
;
HRESULT
hr
;
TRACE
(
"ddraw %p, surface_desc %p, surface %p, outer_unknown %p, version %u.
\n
"
,
TRACE
(
"ddraw %p, surface_desc %p, surface %p, outer_unknown %p, version %u.
\n
"
,
...
@@ -5969,6 +5970,8 @@ HRESULT ddraw_surface_create(struct ddraw *ddraw, const DDSURFACEDESC2 *surface_
...
@@ -5969,6 +5970,8 @@ HRESULT ddraw_surface_create(struct ddraw *ddraw, const DDSURFACEDESC2 *surface_
HeapFree
(
GetProcessHeap
(),
0
,
texture
);
HeapFree
(
GetProcessHeap
(),
0
,
texture
);
return
DDERR_INVALIDPARAMS
;
return
DDERR_INVALIDPARAMS
;
}
}
pitch
=
desc
->
u1
.
lPitch
;
}
}
}
}
...
@@ -6073,6 +6076,14 @@ HRESULT ddraw_surface_create(struct ddraw *ddraw, const DDSURFACEDESC2 *surface_
...
@@ -6073,6 +6076,14 @@ HRESULT ddraw_surface_create(struct ddraw *ddraw, const DDSURFACEDESC2 *surface_
}
}
}
}
if
((
desc
->
dwFlags
&
DDSD_LPSURFACE
)
&&
FAILED
(
hr
=
wined3d_surface_update_desc
(
root
->
wined3d_surface
,
wined3d_desc
.
width
,
wined3d_desc
.
height
,
wined3d_desc
.
format
,
WINED3D_MULTISAMPLE_NONE
,
0
,
desc
->
lpSurface
,
pitch
)))
{
ERR
(
"Failed to set surface memory, hr %#x.
\n
"
,
hr
);
goto
fail
;
}
if
(
desc
->
dwFlags
&
DDSD_BACKBUFFERCOUNT
)
if
(
desc
->
dwFlags
&
DDSD_BACKBUFFERCOUNT
)
{
{
unsigned
int
count
=
desc
->
dwBackBufferCount
;
unsigned
int
count
=
desc
->
dwBackBufferCount
;
...
@@ -6148,13 +6159,12 @@ fail:
...
@@ -6148,13 +6159,12 @@ fail:
return
hr
;
return
hr
;
}
}
HRESULT
ddraw_surface_init
(
struct
ddraw_surface
*
surface
,
struct
ddraw
*
ddraw
,
struct
ddraw_texture
*
texture
,
void
ddraw_surface_init
(
struct
ddraw_surface
*
surface
,
struct
ddraw
*
ddraw
,
struct
ddraw_texture
*
texture
,
struct
wined3d_surface
*
wined3d_surface
,
const
struct
wined3d_parent_ops
**
parent_ops
)
struct
wined3d_surface
*
wined3d_surface
,
const
struct
wined3d_parent_ops
**
parent_ops
)
{
{
DDSURFACEDESC2
*
desc
=
&
surface
->
surface_desc
;
DDSURFACEDESC2
*
desc
=
&
surface
->
surface_desc
;
struct
wined3d_resource_desc
wined3d_desc
;
struct
wined3d_resource_desc
wined3d_desc
;
unsigned
int
version
=
texture
->
version
;
unsigned
int
version
=
texture
->
version
;
HRESULT
hr
;
surface
->
IDirectDrawSurface7_iface
.
lpVtbl
=
&
ddraw_surface7_vtbl
;
surface
->
IDirectDrawSurface7_iface
.
lpVtbl
=
&
ddraw_surface7_vtbl
;
surface
->
IDirectDrawSurface4_iface
.
lpVtbl
=
&
ddraw_surface4_vtbl
;
surface
->
IDirectDrawSurface4_iface
.
lpVtbl
=
&
ddraw_surface4_vtbl
;
...
@@ -6193,46 +6203,18 @@ HRESULT ddraw_surface_init(struct ddraw_surface *surface, struct ddraw *ddraw, s
...
@@ -6193,46 +6203,18 @@ HRESULT ddraw_surface_init(struct ddraw_surface *surface, struct ddraw *ddraw, s
if
(
format_is_compressed
(
&
desc
->
u4
.
ddpfPixelFormat
))
if
(
format_is_compressed
(
&
desc
->
u4
.
ddpfPixelFormat
))
{
{
if
(
desc
->
dwFlags
&
DDSD_LPSURFACE
)
if
(
desc
->
dwFlags
&
DDSD_LPSURFACE
)
{
if
(
FAILED
(
hr
=
wined3d_surface_update_desc
(
wined3d_surface
,
wined3d_desc
.
width
,
wined3d_desc
.
height
,
wined3d_desc
.
format
,
WINED3D_MULTISAMPLE_NONE
,
0
,
desc
->
lpSurface
,
0
)))
{
ERR
(
"Failed to set surface memory, hr %#x.
\n
"
,
hr
);
return
hr
;
}
desc
->
dwFlags
|=
DDSD_LINEARSIZE
;
desc
->
dwFlags
&=
~
(
DDSD_LPSURFACE
|
DDSD_PITCH
);
desc
->
u1
.
dwLinearSize
=
~
0u
;
desc
->
u1
.
dwLinearSize
=
~
0u
;
}
else
else
{
desc
->
dwFlags
|=
DDSD_LINEARSIZE
;
desc
->
dwFlags
&=
~
DDSD_PITCH
;
desc
->
u1
.
dwLinearSize
=
wined3d_surface_get_pitch
(
wined3d_surface
)
*
((
desc
->
dwHeight
+
3
)
/
4
);
desc
->
u1
.
dwLinearSize
=
wined3d_surface_get_pitch
(
wined3d_surface
)
*
((
desc
->
dwHeight
+
3
)
/
4
);
}
desc
->
dwFlags
|=
DDSD_LINEARSIZE
;
desc
->
dwFlags
&=
~
(
DDSD_LPSURFACE
|
DDSD_PITCH
);
}
}
else
else
{
{
if
(
desc
->
dwFlags
&
DDSD_LPSURFACE
)
if
(
!
(
desc
->
dwFlags
&
DDSD_LPSURFACE
))
{
if
(
FAILED
(
hr
=
wined3d_surface_update_desc
(
wined3d_surface
,
wined3d_desc
.
width
,
wined3d_desc
.
height
,
wined3d_desc
.
format
,
WINED3D_MULTISAMPLE_NONE
,
0
,
desc
->
lpSurface
,
desc
->
u1
.
lPitch
)))
{
ERR
(
"Failed to set surface memory, hr %#x.
\n
"
,
hr
);
return
hr
;
}
desc
->
dwFlags
&=
~
(
DDSD_LPSURFACE
|
DDSD_LINEARSIZE
);
}
else
{
desc
->
dwFlags
|=
DDSD_PITCH
;
desc
->
dwFlags
&=
~
DDSD_LINEARSIZE
;
desc
->
u1
.
lPitch
=
wined3d_surface_get_pitch
(
wined3d_surface
);
desc
->
u1
.
lPitch
=
wined3d_surface_get_pitch
(
wined3d_surface
);
}
desc
->
dwFlags
|=
DDSD_PITCH
;
desc
->
dwFlags
&=
~
(
DDSD_LPSURFACE
|
DDSD_LINEARSIZE
);
}
}
desc
->
lpSurface
=
NULL
;
desc
->
lpSurface
=
NULL
;
...
@@ -6241,8 +6223,6 @@ HRESULT ddraw_surface_init(struct ddraw_surface *surface, struct ddraw *ddraw, s
...
@@ -6241,8 +6223,6 @@ HRESULT ddraw_surface_init(struct ddraw_surface *surface, struct ddraw *ddraw, s
*
parent_ops
=
&
ddraw_surface_wined3d_parent_ops
;
*
parent_ops
=
&
ddraw_surface_wined3d_parent_ops
;
wined3d_private_store_init
(
&
surface
->
private_store
);
wined3d_private_store_init
(
&
surface
->
private_store
);
return
DD_OK
;
}
}
static
void
STDMETHODCALLTYPE
view_wined3d_object_destroyed
(
void
*
parent
)
static
void
STDMETHODCALLTYPE
view_wined3d_object_destroyed
(
void
*
parent
)
...
...
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