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
bacd2340
Commit
bacd2340
authored
Mar 23, 2008
by
Alexander Dorofeyev
Committed by
Alexandre Julliard
Mar 24, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ddraw/tests: Test SetPalette on non-palettized surfaces.
parent
4b53dde0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
2 deletions
+38
-2
dsurface.c
dlls/ddraw/tests/dsurface.c
+38
-2
No files found.
dlls/ddraw/tests/dsurface.c
View file @
bacd2340
...
...
@@ -2371,7 +2371,9 @@ static void BltParamTest(void)
static
void
PaletteTest
(
void
)
{
HRESULT
hr
;
IDirectDrawPalette
*
palette
;
LPDIRECTDRAWSURFACE
lpSurf
=
NULL
;
DDSURFACEDESC
ddsd
;
IDirectDrawPalette
*
palette
=
NULL
;
PALETTEENTRY
Table
[
256
];
PALETTEENTRY
palEntries
[
256
];
int
i
;
...
...
@@ -2387,7 +2389,7 @@ static void PaletteTest(void)
/* Create a 8bit palette without DDPCAPS_ALLOW256 set */
hr
=
IDirectDraw_CreatePalette
(
lpDD
,
DDPCAPS_8BIT
,
Table
,
&
palette
,
NULL
);
ok
(
hr
==
DD_OK
,
"CreatePalette failed with %08x
\n
"
,
hr
);
if
(
FAILED
(
hr
))
goto
err
;
/* Read back the palette and verify the entries. Without DDPCAPS_ALLOW256 set
/ entry 0 and 255 should have been overwritten with black and white */
IDirectDrawPalette_GetEntries
(
palette
,
0
,
0
,
256
,
&
palEntries
[
0
]);
...
...
@@ -2428,6 +2430,8 @@ static void PaletteTest(void)
/* Create a 8bit palette with DDPCAPS_ALLOW256 set */
hr
=
IDirectDraw_CreatePalette
(
lpDD
,
DDPCAPS_ALLOW256
|
DDPCAPS_8BIT
,
Table
,
&
palette
,
NULL
);
ok
(
hr
==
DD_OK
,
"CreatePalette failed with %08x
\n
"
,
hr
);
if
(
FAILED
(
hr
))
goto
err
;
IDirectDrawPalette_GetEntries
(
palette
,
0
,
0
,
256
,
&
palEntries
[
0
]);
ok
(
hr
==
DD_OK
,
"GetEntries failed with %08x
\n
"
,
hr
);
if
(
hr
==
DD_OK
)
...
...
@@ -2438,7 +2442,39 @@ static void PaletteTest(void)
"Palette entry %d should have contained (255,0,0) but was set to %d,%d,%d)
\n
"
,
i
,
palEntries
[
i
].
peRed
,
palEntries
[
i
].
peGreen
,
palEntries
[
i
].
peBlue
);
}
/* Try to set palette to a non-palettized surface */
ddsd
.
dwSize
=
sizeof
(
ddsd
);
ddsd
.
ddpfPixelFormat
.
dwSize
=
sizeof
(
ddsd
.
ddpfPixelFormat
);
ddsd
.
dwFlags
=
DDSD_CAPS
|
DDSD_WIDTH
|
DDSD_HEIGHT
|
DDSD_PIXELFORMAT
;
ddsd
.
ddsCaps
.
dwCaps
=
DDSCAPS_OFFSCREENPLAIN
;
ddsd
.
dwWidth
=
800
;
ddsd
.
dwHeight
=
600
;
ddsd
.
ddpfPixelFormat
.
dwFlags
=
DDPF_RGB
;
U1
(
ddsd
.
ddpfPixelFormat
).
dwRGBBitCount
=
32
;
U2
(
ddsd
.
ddpfPixelFormat
).
dwRBitMask
=
0xFF0000
;
U3
(
ddsd
.
ddpfPixelFormat
).
dwGBitMask
=
0x00FF00
;
U4
(
ddsd
.
ddpfPixelFormat
).
dwBBitMask
=
0x0000FF
;
hr
=
IDirectDraw_CreateSurface
(
lpDD
,
&
ddsd
,
&
lpSurf
,
NULL
);
ok
(
hr
==
DD_OK
,
"CreateSurface returned: %x
\n
"
,
hr
);
if
(
FAILED
(
hr
))
{
skip
(
"failed to create surface
\n
"
);
goto
err
;
}
hr
=
IDirectDrawSurface_SetPalette
(
lpSurf
,
palette
);
ok
(
hr
==
DDERR_INVALIDPIXELFORMAT
,
"CreateSurface returned: %x
\n
"
,
hr
);
IDirectDrawPalette_Release
(
palette
);
palette
=
NULL
;
hr
=
IDirectDrawSurface_GetPalette
(
lpSurf
,
&
palette
);
ok
(
hr
==
DDERR_NOPALETTEATTACHED
,
"CreateSurface returned: %x
\n
"
,
hr
);
err:
if
(
lpSurf
)
IDirectDrawSurface_Release
(
lpSurf
);
if
(
palette
)
IDirectDrawPalette_Release
(
palette
);
}
static
void
StructSizeTest
(
void
)
...
...
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