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
72c31c14
Commit
72c31c14
authored
Feb 16, 2018
by
Henri Verbeet
Committed by
Alexandre Julliard
Feb 16, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ddraw: Explicitly translate resource map flags.
Signed-off-by:
Henri Verbeet
<
hverbeet@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
b6f917b1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
13 deletions
+25
-13
ddraw_private.h
dlls/ddraw/ddraw_private.h
+1
-0
surface.c
dlls/ddraw/surface.c
+2
-1
utils.c
dlls/ddraw/utils.c
+20
-0
vertexbuffer.c
dlls/ddraw/vertexbuffer.c
+2
-12
No files found.
dlls/ddraw/ddraw_private.h
View file @
72c31c14
...
...
@@ -587,6 +587,7 @@ void ddrawformat_from_wined3dformat(DDPIXELFORMAT *ddraw_format,
BOOL
wined3d_colour_from_ddraw_colour
(
const
DDPIXELFORMAT
*
pf
,
const
struct
ddraw_palette
*
palette
,
DWORD
colour
,
struct
wined3d_color
*
wined3d_colour
)
DECLSPEC_HIDDEN
;
enum
wined3d_format_id
wined3dformat_from_ddrawformat
(
const
DDPIXELFORMAT
*
format
)
DECLSPEC_HIDDEN
;
unsigned
int
wined3dmapflags_from_ddrawmapflags
(
unsigned
int
flags
)
DECLSPEC_HIDDEN
;
void
DDRAW_dump_surface_desc
(
const
DDSURFACEDESC2
*
lpddsd
)
DECLSPEC_HIDDEN
;
void
dump_D3DMATRIX
(
const
D3DMATRIX
*
mat
)
DECLSPEC_HIDDEN
;
void
DDRAW_dump_DDCAPS
(
const
DDCAPS
*
lpcaps
)
DECLSPEC_HIDDEN
;
...
...
dlls/ddraw/surface.c
View file @
72c31c14
...
...
@@ -992,7 +992,8 @@ static HRESULT surface_lock(struct ddraw_surface *surface,
hr
=
ddraw_surface_update_frontbuffer
(
surface
,
rect
,
TRUE
);
if
(
SUCCEEDED
(
hr
))
hr
=
wined3d_resource_map
(
wined3d_texture_get_resource
(
surface
->
wined3d_texture
),
surface
->
sub_resource_idx
,
&
map_desc
,
rect
?
&
box
:
NULL
,
flags
);
surface
->
sub_resource_idx
,
&
map_desc
,
rect
?
&
box
:
NULL
,
wined3dmapflags_from_ddrawmapflags
(
flags
));
if
(
FAILED
(
hr
))
{
wined3d_mutex_unlock
();
...
...
dlls/ddraw/utils.c
View file @
72c31c14
...
...
@@ -561,6 +561,26 @@ enum wined3d_format_id wined3dformat_from_ddrawformat(const DDPIXELFORMAT *DDPix
return
WINED3DFMT_UNKNOWN
;
}
unsigned
int
wined3dmapflags_from_ddrawmapflags
(
unsigned
int
flags
)
{
static
const
unsigned
int
handled
=
DDLOCK_READONLY
|
DDLOCK_NOSYSLOCK
|
DDLOCK_NOOVERWRITE
|
DDLOCK_DISCARDCONTENTS
|
DDLOCK_DONOTWAIT
;
unsigned
int
wined3d_flags
;
wined3d_flags
=
flags
&
handled
;
if
(
flags
&
DDLOCK_NODIRTYUPDATE
)
wined3d_flags
|=
WINED3D_MAP_NO_DIRTY_UPDATE
;
flags
&=
~
(
handled
|
DDLOCK_WAIT
|
DDLOCK_NODIRTYUPDATE
);
if
(
flags
)
FIXME
(
"Unhandled flags %#x.
\n
"
,
flags
);
return
wined3d_flags
;
}
static
float
colour_to_float
(
DWORD
colour
,
DWORD
mask
)
{
if
(
!
mask
)
...
...
dlls/ddraw/vertexbuffer.c
View file @
72c31c14
...
...
@@ -162,26 +162,16 @@ static HRESULT WINAPI d3d_vertex_buffer7_Lock(IDirect3DVertexBuffer7 *iface,
struct
wined3d_resource
*
wined3d_resource
;
struct
wined3d_map_desc
wined3d_map_desc
;
HRESULT
hr
;
DWORD
wined3d_flags
=
0
;
TRACE
(
"iface %p, flags %#x, data %p, data_size %p.
\n
"
,
iface
,
flags
,
data
,
data_size
);
if
(
buffer
->
version
!=
7
)
flags
&=
~
(
DDLOCK_NOOVERWRITE
|
DDLOCK_DISCARDCONTENTS
);
/* Writeonly: Pointless. Event: Unsupported by native according to the sdk
* nosyslock: Not applicable
*/
if
(
!
(
flags
&
DDLOCK_WAIT
))
wined3d_flags
|=
WINED3D_MAP_DONOTWAIT
;
if
(
flags
&
DDLOCK_READONLY
)
wined3d_flags
|=
WINED3D_MAP_READONLY
;
if
(
flags
&
DDLOCK_NOOVERWRITE
)
wined3d_flags
|=
WINED3D_MAP_NOOVERWRITE
;
flags
|=
DDLOCK_DONOTWAIT
;
if
(
flags
&
DDLOCK_DISCARDCONTENTS
)
{
wined3d_flags
|=
WINED3D_MAP_DISCARD
;
if
(
!
buffer
->
dynamic
)
{
struct
wined3d_buffer
*
new_buffer
;
...
...
@@ -211,7 +201,7 @@ static HRESULT WINAPI d3d_vertex_buffer7_Lock(IDirect3DVertexBuffer7 *iface,
}
hr
=
wined3d_resource_map
(
wined3d_buffer_get_resource
(
buffer
->
wined3d_buffer
),
0
,
&
wined3d_map_desc
,
NULL
,
wined3d
_flags
);
0
,
&
wined3d_map_desc
,
NULL
,
wined3d
mapflags_from_ddrawmapflags
(
flags
)
);
*
data
=
wined3d_map_desc
.
data
;
wined3d_mutex_unlock
();
...
...
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