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
0fdb1aaf
Commit
0fdb1aaf
authored
Dec 11, 2013
by
Stefan Dösinger
Committed by
Alexandre Julliard
Dec 12, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ddraw: SetSurfaceDesc does not work on primaries.
parent
03fe6f3e
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
45 additions
and
29 deletions
+45
-29
surface.c
dlls/ddraw/surface.c
+3
-2
ddraw2.c
dlls/ddraw/tests/ddraw2.c
+14
-9
ddraw4.c
dlls/ddraw/tests/ddraw4.c
+14
-9
ddraw7.c
dlls/ddraw/tests/ddraw7.c
+14
-9
No files found.
dlls/ddraw/surface.c
View file @
0fdb1aaf
...
...
@@ -4293,8 +4293,9 @@ static HRESULT WINAPI ddraw_surface7_SetSurfaceDesc(IDirectDrawSurface7 *iface,
WARN
(
"Flags is %x, returning DDERR_INVALIDPARAMS
\n
"
,
Flags
);
return
DDERR_INVALIDPARAMS
;
}
if
(
!
(
This
->
surface_desc
.
ddsCaps
.
dwCaps
&
DDSCAPS_SYSTEMMEMORY
)
||
This
->
surface_desc
.
ddsCaps
.
dwCaps2
&
(
DDSCAPS2_TEXTUREMANAGE
|
DDSCAPS2_D3DTEXTUREMANAGE
))
if
(
!
(
This
->
surface_desc
.
ddsCaps
.
dwCaps
&
DDSCAPS_SYSTEMMEMORY
)
||
This
->
surface_desc
.
ddsCaps
.
dwCaps
&
DDSCAPS_PRIMARYSURFACE
||
This
->
surface_desc
.
ddsCaps
.
dwCaps2
&
(
DDSCAPS2_TEXTUREMANAGE
|
DDSCAPS2_D3DTEXTUREMANAGE
))
{
WARN
(
"Surface is not in system memory, returning DDERR_INVALIDSURFACETYPE.
\n
"
);
return
DDERR_INVALIDSURFACETYPE
;
...
...
dlls/ddraw/tests/ddraw2.c
View file @
0fdb1aaf
...
...
@@ -4580,6 +4580,7 @@ static void test_set_surface_desc(void)
{
{
DDSCAPS_VIDEOMEMORY
,
FALSE
,
"videomemory plain"
},
{
DDSCAPS_TEXTURE
|
DDSCAPS_SYSTEMMEMORY
,
TRUE
,
"systemmemory texture"
},
{
DDSCAPS_PRIMARYSURFACE
|
DDSCAPS_SYSTEMMEMORY
,
FALSE
,
"systemmemory primary"
},
};
if
(
!
(
ddraw
=
create_ddraw
()))
...
...
@@ -4810,16 +4811,20 @@ static void test_set_surface_desc(void)
for
(
i
=
0
;
i
<
sizeof
(
invalid_caps_tests
)
/
sizeof
(
*
invalid_caps_tests
);
i
++
)
{
reset_ddsd
(
&
ddsd
);
ddsd
.
dwFlags
=
DDSD_WIDTH
|
DDSD_HEIGHT
|
DDSD_CAPS
|
DDSD_PIXELFORMAT
;
ddsd
.
dwWidth
=
8
;
ddsd
.
dwHeight
=
8
;
ddsd
.
ddpfPixelFormat
.
dwSize
=
sizeof
(
ddsd
.
ddpfPixelFormat
);
ddsd
.
ddpfPixelFormat
.
dwFlags
=
DDPF_RGB
;
U1
(
ddsd
.
ddpfPixelFormat
).
dwRGBBitCount
=
32
;
U2
(
ddsd
.
ddpfPixelFormat
).
dwRBitMask
=
0x00ff0000
;
U3
(
ddsd
.
ddpfPixelFormat
).
dwGBitMask
=
0x0000ff00
;
U4
(
ddsd
.
ddpfPixelFormat
).
dwBBitMask
=
0x000000ff
;
ddsd
.
dwFlags
=
DDSD_CAPS
;
ddsd
.
ddsCaps
.
dwCaps
=
invalid_caps_tests
[
i
].
caps
;
if
(
!
(
invalid_caps_tests
[
i
].
caps
&
DDSCAPS_PRIMARYSURFACE
))
{
ddsd
.
dwFlags
|=
DDSD_WIDTH
|
DDSD_HEIGHT
|
DDSD_PIXELFORMAT
;
ddsd
.
dwWidth
=
8
;
ddsd
.
dwHeight
=
8
;
ddsd
.
ddpfPixelFormat
.
dwSize
=
sizeof
(
ddsd
.
ddpfPixelFormat
);
ddsd
.
ddpfPixelFormat
.
dwFlags
=
DDPF_RGB
;
U1
(
ddsd
.
ddpfPixelFormat
).
dwRGBBitCount
=
32
;
U2
(
ddsd
.
ddpfPixelFormat
).
dwRBitMask
=
0x00ff0000
;
U3
(
ddsd
.
ddpfPixelFormat
).
dwGBitMask
=
0x0000ff00
;
U4
(
ddsd
.
ddpfPixelFormat
).
dwBBitMask
=
0x000000ff
;
}
hr
=
IDirectDraw_CreateSurface
(
ddraw
,
&
ddsd
,
&
surface
,
NULL
);
ok
(
SUCCEEDED
(
hr
)
||
hr
==
DDERR_NODIRECTDRAWHW
,
"Failed to create surface, hr %#x.
\n
"
,
hr
);
...
...
dlls/ddraw/tests/ddraw4.c
View file @
0fdb1aaf
...
...
@@ -5185,6 +5185,7 @@ static void test_set_surface_desc(void)
{
DDSCAPS_TEXTURE
|
DDSCAPS_SYSTEMMEMORY
,
0
,
TRUE
,
"systemmemory texture"
},
{
DDSCAPS_TEXTURE
,
DDSCAPS2_D3DTEXTUREMANAGE
,
FALSE
,
"managed texture"
},
{
DDSCAPS_TEXTURE
,
DDSCAPS2_TEXTUREMANAGE
,
FALSE
,
"managed texture"
},
{
DDSCAPS_PRIMARYSURFACE
|
DDSCAPS_SYSTEMMEMORY
,
0
,
FALSE
,
"systemmemory primary"
},
};
if
(
!
(
ddraw
=
create_ddraw
()))
...
...
@@ -5414,17 +5415,21 @@ static void test_set_surface_desc(void)
for
(
i
=
0
;
i
<
sizeof
(
invalid_caps_tests
)
/
sizeof
(
*
invalid_caps_tests
);
i
++
)
{
reset_ddsd
(
&
ddsd
);
ddsd
.
dwFlags
=
DDSD_WIDTH
|
DDSD_HEIGHT
|
DDSD_CAPS
|
DDSD_PIXELFORMAT
;
ddsd
.
dwWidth
=
8
;
ddsd
.
dwHeight
=
8
;
U4
(
ddsd
).
ddpfPixelFormat
.
dwSize
=
sizeof
(
U4
(
ddsd
).
ddpfPixelFormat
);
U4
(
ddsd
).
ddpfPixelFormat
.
dwFlags
=
DDPF_RGB
;
U1
(
U4
(
ddsd
).
ddpfPixelFormat
).
dwRGBBitCount
=
32
;
U2
(
U4
(
ddsd
).
ddpfPixelFormat
).
dwRBitMask
=
0x00ff0000
;
U3
(
U4
(
ddsd
).
ddpfPixelFormat
).
dwGBitMask
=
0x0000ff00
;
U4
(
U4
(
ddsd
).
ddpfPixelFormat
).
dwBBitMask
=
0x000000ff
;
ddsd
.
dwFlags
=
DDSD_CAPS
;
ddsd
.
ddsCaps
.
dwCaps
=
invalid_caps_tests
[
i
].
caps
;
ddsd
.
ddsCaps
.
dwCaps2
=
invalid_caps_tests
[
i
].
caps2
;
if
(
!
(
invalid_caps_tests
[
i
].
caps
&
DDSCAPS_PRIMARYSURFACE
))
{
ddsd
.
dwFlags
|=
DDSD_WIDTH
|
DDSD_HEIGHT
|
DDSD_PIXELFORMAT
;
ddsd
.
dwWidth
=
8
;
ddsd
.
dwHeight
=
8
;
U4
(
ddsd
).
ddpfPixelFormat
.
dwSize
=
sizeof
(
U4
(
ddsd
).
ddpfPixelFormat
);
U4
(
ddsd
).
ddpfPixelFormat
.
dwFlags
=
DDPF_RGB
;
U1
(
U4
(
ddsd
).
ddpfPixelFormat
).
dwRGBBitCount
=
32
;
U2
(
U4
(
ddsd
).
ddpfPixelFormat
).
dwRBitMask
=
0x00ff0000
;
U3
(
U4
(
ddsd
).
ddpfPixelFormat
).
dwGBitMask
=
0x0000ff00
;
U4
(
U4
(
ddsd
).
ddpfPixelFormat
).
dwBBitMask
=
0x000000ff
;
}
hr
=
IDirectDraw4_CreateSurface
(
ddraw
,
&
ddsd
,
&
surface
,
NULL
);
ok
(
SUCCEEDED
(
hr
)
||
hr
==
DDERR_NODIRECTDRAWHW
,
"Failed to create surface, hr %#x.
\n
"
,
hr
);
...
...
dlls/ddraw/tests/ddraw7.c
View file @
0fdb1aaf
...
...
@@ -5072,6 +5072,7 @@ static void test_set_surface_desc(void)
{
DDSCAPS_TEXTURE
|
DDSCAPS_SYSTEMMEMORY
,
0
,
TRUE
,
"systemmemory texture"
},
{
DDSCAPS_TEXTURE
,
DDSCAPS2_D3DTEXTUREMANAGE
,
FALSE
,
"managed texture"
},
{
DDSCAPS_TEXTURE
,
DDSCAPS2_TEXTUREMANAGE
,
FALSE
,
"managed texture"
},
{
DDSCAPS_PRIMARYSURFACE
|
DDSCAPS_SYSTEMMEMORY
,
0
,
FALSE
,
"systemmemory primary"
},
};
if
(
!
(
ddraw
=
create_ddraw
()))
...
...
@@ -5302,17 +5303,21 @@ static void test_set_surface_desc(void)
for
(
i
=
0
;
i
<
sizeof
(
invalid_caps_tests
)
/
sizeof
(
*
invalid_caps_tests
);
i
++
)
{
reset_ddsd
(
&
ddsd
);
ddsd
.
dwFlags
=
DDSD_WIDTH
|
DDSD_HEIGHT
|
DDSD_CAPS
|
DDSD_PIXELFORMAT
;
ddsd
.
dwWidth
=
8
;
ddsd
.
dwHeight
=
8
;
U4
(
ddsd
).
ddpfPixelFormat
.
dwSize
=
sizeof
(
U4
(
ddsd
).
ddpfPixelFormat
);
U4
(
ddsd
).
ddpfPixelFormat
.
dwFlags
=
DDPF_RGB
;
U1
(
U4
(
ddsd
).
ddpfPixelFormat
).
dwRGBBitCount
=
32
;
U2
(
U4
(
ddsd
).
ddpfPixelFormat
).
dwRBitMask
=
0x00ff0000
;
U3
(
U4
(
ddsd
).
ddpfPixelFormat
).
dwGBitMask
=
0x0000ff00
;
U4
(
U4
(
ddsd
).
ddpfPixelFormat
).
dwBBitMask
=
0x000000ff
;
ddsd
.
dwFlags
=
DDSD_CAPS
;
ddsd
.
ddsCaps
.
dwCaps
=
invalid_caps_tests
[
i
].
caps
;
ddsd
.
ddsCaps
.
dwCaps2
=
invalid_caps_tests
[
i
].
caps2
;
if
(
!
(
invalid_caps_tests
[
i
].
caps
&
DDSCAPS_PRIMARYSURFACE
))
{
ddsd
.
dwFlags
|=
DDSD_WIDTH
|
DDSD_HEIGHT
|
DDSD_PIXELFORMAT
;
ddsd
.
dwWidth
=
8
;
ddsd
.
dwHeight
=
8
;
U4
(
ddsd
).
ddpfPixelFormat
.
dwSize
=
sizeof
(
U4
(
ddsd
).
ddpfPixelFormat
);
U4
(
ddsd
).
ddpfPixelFormat
.
dwFlags
=
DDPF_RGB
;
U1
(
U4
(
ddsd
).
ddpfPixelFormat
).
dwRGBBitCount
=
32
;
U2
(
U4
(
ddsd
).
ddpfPixelFormat
).
dwRBitMask
=
0x00ff0000
;
U3
(
U4
(
ddsd
).
ddpfPixelFormat
).
dwGBitMask
=
0x0000ff00
;
U4
(
U4
(
ddsd
).
ddpfPixelFormat
).
dwBBitMask
=
0x000000ff
;
}
hr
=
IDirectDraw7_CreateSurface
(
ddraw
,
&
ddsd
,
&
surface
,
NULL
);
ok
(
SUCCEEDED
(
hr
)
||
hr
==
DDERR_NODIRECTDRAWHW
,
"Failed to create surface, hr %#x.
\n
"
,
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