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
45d37313
Commit
45d37313
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: Set WINED3D_SURFACE_PIN_SYSMEM directly in ddraw_surface_create_texture().
parent
fdb5e13f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
12 deletions
+12
-12
ddraw.c
dlls/ddraw/ddraw.c
+2
-8
ddraw_private.h
dlls/ddraw/ddraw_private.h
+1
-1
surface.c
dlls/ddraw/surface.c
+9
-3
No files found.
dlls/ddraw/ddraw.c
View file @
45d37313
...
@@ -2868,12 +2868,6 @@ static HRESULT CreateSurface(struct ddraw *ddraw, DDSURFACEDESC2 *DDSD,
...
@@ -2868,12 +2868,6 @@ static HRESULT CreateSurface(struct ddraw *ddraw, DDSURFACEDESC2 *DDSD,
HRESULT
hr
;
HRESULT
hr
;
DDSURFACEDESC2
desc2
;
DDSURFACEDESC2
desc2
;
const
DWORD
sysvidmem
=
DDSCAPS_VIDEOMEMORY
|
DDSCAPS_SYSTEMMEMORY
;
const
DWORD
sysvidmem
=
DDSCAPS_VIDEOMEMORY
|
DDSCAPS_SYSTEMMEMORY
;
/* Some applications assume surfaces will always be mapped at the same
* address. Some of those also assume that this address is valid even when
* the surface isn't mapped, and that updates done this way will be
* visible on the screen. The game Nox is such an application,
* Commandos: Behind Enemy Lines is another. */
const
DWORD
flags
=
WINED3D_SURFACE_PIN_SYSMEM
;
TRACE
(
"ddraw %p, surface_desc %p, surface %p, outer_unknown %p.
\n
"
,
ddraw
,
DDSD
,
surface
,
UnkOuter
);
TRACE
(
"ddraw %p, surface_desc %p, surface %p, outer_unknown %p.
\n
"
,
ddraw
,
DDSD
,
surface
,
UnkOuter
);
...
@@ -3116,7 +3110,7 @@ static HRESULT CreateSurface(struct ddraw *ddraw, DDSURFACEDESC2 *DDSD,
...
@@ -3116,7 +3110,7 @@ static HRESULT CreateSurface(struct ddraw *ddraw, DDSURFACEDESC2 *DDSD,
}
}
}
}
if
(
FAILED
(
hr
=
ddraw_surface_create_texture
(
ddraw
,
&
desc2
,
version
,
flags
,
&
object
)))
if
(
FAILED
(
hr
=
ddraw_surface_create_texture
(
ddraw
,
&
desc2
,
version
,
&
object
)))
{
{
WARN
(
"Failed to create texture, hr %#x.
\n
"
,
hr
);
WARN
(
"Failed to create texture, hr %#x.
\n
"
,
hr
);
return
hr
;
return
hr
;
...
@@ -3143,7 +3137,7 @@ static HRESULT CreateSurface(struct ddraw *ddraw, DDSURFACEDESC2 *DDSD,
...
@@ -3143,7 +3137,7 @@ static HRESULT CreateSurface(struct ddraw *ddraw, DDSURFACEDESC2 *DDSD,
{
{
struct
ddraw_surface
*
object2
=
NULL
;
struct
ddraw_surface
*
object2
=
NULL
;
if
(
FAILED
(
hr
=
ddraw_surface_create_texture
(
ddraw
,
&
desc2
,
version
,
flags
,
&
object2
)))
if
(
FAILED
(
hr
=
ddraw_surface_create_texture
(
ddraw
,
&
desc2
,
version
,
&
object2
)))
{
{
if
(
version
==
7
)
if
(
version
==
7
)
IDirectDrawSurface7_Release
(
&
object
->
IDirectDrawSurface7_iface
);
IDirectDrawSurface7_Release
(
&
object
->
IDirectDrawSurface7_iface
);
...
...
dlls/ddraw/ddraw_private.h
View file @
45d37313
...
@@ -194,7 +194,7 @@ struct ddraw_texture
...
@@ -194,7 +194,7 @@ struct ddraw_texture
};
};
HRESULT
ddraw_surface_create_texture
(
struct
ddraw
*
ddraw
,
const
DDSURFACEDESC2
*
desc
,
HRESULT
ddraw_surface_create_texture
(
struct
ddraw
*
ddraw
,
const
DDSURFACEDESC2
*
desc
,
unsigned
int
version
,
DWORD
surface_flags
,
struct
ddraw_surface
**
surface
)
DECLSPEC_HIDDEN
;
unsigned
int
version
,
struct
ddraw_surface
**
surface
)
DECLSPEC_HIDDEN
;
HRESULT
ddraw_surface_init
(
struct
ddraw_surface
*
surface
,
struct
ddraw
*
ddraw
,
HRESULT
ddraw_surface_init
(
struct
ddraw_surface
*
surface
,
struct
ddraw
*
ddraw
,
DDSURFACEDESC2
*
desc
,
DWORD
flags
,
UINT
version
)
DECLSPEC_HIDDEN
;
DDSURFACEDESC2
*
desc
,
DWORD
flags
,
UINT
version
)
DECLSPEC_HIDDEN
;
ULONG
ddraw_surface_release_iface
(
struct
ddraw_surface
*
This
)
DECLSPEC_HIDDEN
;
ULONG
ddraw_surface_release_iface
(
struct
ddraw_surface
*
This
)
DECLSPEC_HIDDEN
;
...
...
dlls/ddraw/surface.c
View file @
45d37313
...
@@ -5594,7 +5594,7 @@ static const struct wined3d_parent_ops ddraw_texture_wined3d_parent_ops =
...
@@ -5594,7 +5594,7 @@ static const struct wined3d_parent_ops ddraw_texture_wined3d_parent_ops =
};
};
HRESULT
ddraw_surface_create_texture
(
struct
ddraw
*
ddraw
,
const
DDSURFACEDESC2
*
desc
,
HRESULT
ddraw_surface_create_texture
(
struct
ddraw
*
ddraw
,
const
DDSURFACEDESC2
*
desc
,
unsigned
int
version
,
DWORD
surface_flags
,
struct
ddraw_surface
**
surface
)
unsigned
int
version
,
struct
ddraw_surface
**
surface
)
{
{
struct
ddraw_surface
*
root
,
*
mip
,
**
attach
;
struct
ddraw_surface
*
root
,
*
mip
,
**
attach
;
struct
wined3d_resource_desc
wined3d_desc
;
struct
wined3d_resource_desc
wined3d_desc
;
...
@@ -5658,17 +5658,23 @@ HRESULT ddraw_surface_create_texture(struct ddraw *ddraw, const DDSURFACEDESC2 *
...
@@ -5658,17 +5658,23 @@ HRESULT ddraw_surface_create_texture(struct ddraw *ddraw, const DDSURFACEDESC2 *
wined3d_desc
.
depth
=
1
;
wined3d_desc
.
depth
=
1
;
wined3d_desc
.
size
=
0
;
wined3d_desc
.
size
=
0
;
/* Some applications assume surfaces will always be mapped at the same
* address. Some of those also assume that this address is valid even when
* the surface isn't mapped, and that updates done this way will be
* visible on the screen. The game Nox is such an application,
* Commandos: Behind Enemy Lines is another. We set
* WINED3D_SURFACE_PIN_SYSMEM because of this. */
if
(
desc
->
ddsCaps
.
dwCaps2
&
DDSCAPS2_CUBEMAP
)
if
(
desc
->
ddsCaps
.
dwCaps2
&
DDSCAPS2_CUBEMAP
)
{
{
wined3d_desc
.
resource_type
=
WINED3D_RTYPE_CUBE_TEXTURE
;
wined3d_desc
.
resource_type
=
WINED3D_RTYPE_CUBE_TEXTURE
;
hr
=
wined3d_texture_create_cube
(
ddraw
->
wined3d_device
,
&
wined3d_desc
,
levels
,
hr
=
wined3d_texture_create_cube
(
ddraw
->
wined3d_device
,
&
wined3d_desc
,
levels
,
surface_flags
,
texture
,
&
ddraw_texture_wined3d_parent_ops
,
&
wined3d_texture
);
WINED3D_SURFACE_PIN_SYSMEM
,
texture
,
&
ddraw_texture_wined3d_parent_ops
,
&
wined3d_texture
);
}
}
else
else
{
{
wined3d_desc
.
resource_type
=
WINED3D_RTYPE_TEXTURE
;
wined3d_desc
.
resource_type
=
WINED3D_RTYPE_TEXTURE
;
hr
=
wined3d_texture_create_2d
(
ddraw
->
wined3d_device
,
&
wined3d_desc
,
levels
,
hr
=
wined3d_texture_create_2d
(
ddraw
->
wined3d_device
,
&
wined3d_desc
,
levels
,
surface_flags
,
texture
,
&
ddraw_texture_wined3d_parent_ops
,
&
wined3d_texture
);
WINED3D_SURFACE_PIN_SYSMEM
,
texture
,
&
ddraw_texture_wined3d_parent_ops
,
&
wined3d_texture
);
}
}
if
(
FAILED
(
hr
))
if
(
FAILED
(
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