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
10411fb2
Commit
10411fb2
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: Move the surface desc fixups from ddraw_surface_init() to ddraw_surface_create_texture().
parent
45d37313
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
94 additions
and
141 deletions
+94
-141
ddraw.c
dlls/ddraw/ddraw.c
+5
-30
ddraw_private.h
dlls/ddraw/ddraw_private.h
+3
-3
surface.c
dlls/ddraw/surface.c
+86
-108
No files found.
dlls/ddraw/ddraw.c
View file @
10411fb2
...
...
@@ -2722,38 +2722,13 @@ static HRESULT WINAPI ddraw7_StartModeTest(IDirectDraw7 *iface, SIZE *Modes, DWO
return
DD_OK
;
}
/*****************************************************************************
* ddraw_create_surface
*
* A helper function for IDirectDraw7::CreateSurface. It creates a new surface
* with the passed parameters.
*
* Params:
* DDSD: Description of the surface to create
* Surf: Address to store the interface pointer at
*
* Returns:
* DD_OK on success
*
*****************************************************************************/
static
HRESULT
ddraw_create_surface
(
struct
ddraw
*
ddraw
,
DDSURFACEDESC2
*
desc
,
DWORD
flags
,
struct
ddraw_surface
**
surface
,
UINT
version
)
const
struct
wined3d_resource_desc
*
wined3d_desc
,
DWORD
flags
,
struct
ddraw_surface
**
surface
,
UINT
version
)
{
HRESULT
hr
;
TRACE
(
"ddraw %p, desc %p, flags %#x, surface %p.
\n
"
,
ddraw
,
desc
,
flags
,
surface
);
if
(
TRACE_ON
(
ddraw
))
{
TRACE
(
"Requesting surface desc:
\n
"
);
DDRAW_dump_surface_desc
(
desc
);
}
if
((
desc
->
ddsCaps
.
dwCaps
&
DDSCAPS_3DDEVICE
)
&&
(
ddraw
->
flags
&
DDRAW_NO3D
))
{
WARN
(
"The application requests a 3D capable surface, but the ddraw object was created without 3D support.
\n
"
);
/* Do not fail surface creation, only fail 3D device creation. */
}
TRACE
(
"ddraw %p, desc %p, wined3d_desc %p, flags %#x, surface %p.
\n
"
,
ddraw
,
desc
,
wined3d_desc
,
flags
,
surface
);
/* Create the Surface object */
*
surface
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
**
surface
));
...
...
@@ -2763,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
,
flags
,
version
)))
if
(
FAILED
(
hr
=
ddraw_surface_init
(
*
surface
,
ddraw
,
desc
,
wined3d_desc
,
flags
,
version
)))
{
WARN
(
"Failed to initialize surface, hr %#x.
\n
"
,
hr
);
HeapFree
(
GetProcessHeap
(),
0
,
*
surface
);
...
...
@@ -5150,7 +5125,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
,
texture
->
version
)))
if
(
FAILED
(
hr
=
ddraw_create_surface
(
ddraw
,
&
desc
,
wined3d_desc
,
flags
,
&
ddraw_surface
,
texture
->
version
)))
return
hr
;
*
surface
=
ddraw_surface
->
wined3d_surface
;
...
...
dlls/ddraw/ddraw_private.h
View file @
10411fb2
...
...
@@ -193,10 +193,10 @@ struct ddraw_texture
struct
ddraw_surface
*
root
;
};
HRESULT
ddraw_surface_create_texture
(
struct
ddraw
*
ddraw
,
const
DDSURFACEDESC2
*
desc
,
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
,
DDSURFACEDESC2
*
desc
,
DWORD
flags
,
UINT
version
)
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
;
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 @
10411fb2
This diff is collapsed.
Click to expand it.
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