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
d70ab45f
Commit
d70ab45f
authored
Jan 14, 2013
by
Stefan Dösinger
Committed by
Alexandre Julliard
Jan 14, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d8: Return D3D_OK from the palette setters.
parent
c57511ce
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
69 additions
and
5 deletions
+69
-5
device.c
dlls/d3d8/device.c
+4
-4
device.c
dlls/d3d8/tests/device.c
+65
-1
No files found.
dlls/d3d8/device.c
View file @
d70ab45f
...
...
@@ -1839,12 +1839,12 @@ static HRESULT WINAPI d3d8_device_GetInfo(IDirect3DDevice8 *iface,
static
HRESULT
WINAPI
d3d8_device_SetPaletteEntries
(
IDirect3DDevice8
*
iface
,
UINT
palette_idx
,
const
PALETTEENTRY
*
entries
)
{
FIXME
(
"iface %p, palette_idx %u, entries %p unimplemented
\n
"
,
iface
,
palette_idx
,
entries
);
WARN
(
"iface %p, palette_idx %u, entries %p unimplemented
\n
"
,
iface
,
palette_idx
,
entries
);
/* GPUs stopped supporting palettized textures with the Shader Model 1 generation. Wined3d
* does not have a d3d8/9-style palette API */
return
D3D
ERR_INVALIDCALL
;
return
D3D
_OK
;
}
static
HRESULT
WINAPI
d3d8_device_GetPaletteEntries
(
IDirect3DDevice8
*
iface
,
...
...
@@ -1857,9 +1857,9 @@ static HRESULT WINAPI d3d8_device_GetPaletteEntries(IDirect3DDevice8 *iface,
static
HRESULT
WINAPI
d3d8_device_SetCurrentTexturePalette
(
IDirect3DDevice8
*
iface
,
UINT
palette_idx
)
{
FIXME
(
"iface %p, palette_idx %u unimplemented.
\n
"
,
iface
,
palette_idx
);
WARN
(
"iface %p, palette_idx %u unimplemented.
\n
"
,
iface
,
palette_idx
);
return
D3D
ERR_INVALIDCALL
;
return
D3D
_OK
;
}
static
HRESULT
WINAPI
d3d8_device_GetCurrentTexturePalette
(
IDirect3DDevice8
*
iface
,
UINT
*
palette_idx
)
...
...
dlls/d3d8/tests/device.c
View file @
d70ab45f
...
...
@@ -3,7 +3,7 @@
* Copyright (C) 2006 Chris Robinson
* Copyright (C) 2006 Louis Lenders
* Copyright 2006-2007 Henri Verbeet
* Copyright 20
10, 2011
Stefan Dösinger for CodeWeavers
* Copyright 20
06-2007, 2011-2013
Stefan Dösinger for CodeWeavers
* Copyright 2013 Henri Verbeet for CodeWeavers
*
* This library is free software; you can redistribute it and/or
...
...
@@ -4469,6 +4469,69 @@ static void test_surface_lockrect_blocks(void)
DestroyWindow
(
window
);
}
static
void
test_set_palette
(
void
)
{
IDirect3DDevice8
*
device
;
IDirect3D8
*
d3d8
;
UINT
refcount
;
HWND
window
;
HRESULT
hr
;
PALETTEENTRY
pal
[
256
];
unsigned
int
i
;
D3DCAPS8
caps
;
if
(
!
(
d3d8
=
pDirect3DCreate8
(
D3D_SDK_VERSION
)))
{
skip
(
"Failed to create d3d8 object, skipping tests.
\n
"
);
return
;
}
window
=
CreateWindowA
(
"d3d8_test_wc"
,
"d3d8_test"
,
WS_OVERLAPPEDWINDOW
,
0
,
0
,
640
,
480
,
0
,
0
,
0
,
0
);
if
(
!
(
device
=
create_device
(
d3d8
,
window
,
window
,
TRUE
)))
{
skip
(
"Failed to create a D3D device, skipping tests.
\n
"
);
IDirect3D8_Release
(
d3d8
);
DestroyWindow
(
window
);
return
;
}
for
(
i
=
0
;
i
<
sizeof
(
pal
)
/
sizeof
(
*
pal
);
i
++
)
{
pal
[
i
].
peRed
=
i
;
pal
[
i
].
peGreen
=
i
;
pal
[
i
].
peBlue
=
i
;
pal
[
i
].
peFlags
=
0xff
;
}
hr
=
IDirect3DDevice8_SetPaletteEntries
(
device
,
0
,
pal
);
ok
(
SUCCEEDED
(
hr
),
"Failed to set palette entries, hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DDevice8_GetDeviceCaps
(
device
,
&
caps
);
ok
(
SUCCEEDED
(
hr
),
"Failed to get device caps, hr %#x.
\n
"
,
hr
);
for
(
i
=
0
;
i
<
sizeof
(
pal
)
/
sizeof
(
*
pal
);
i
++
)
{
pal
[
i
].
peRed
=
i
;
pal
[
i
].
peGreen
=
i
;
pal
[
i
].
peBlue
=
i
;
pal
[
i
].
peFlags
=
i
;
}
if
(
caps
.
TextureCaps
&
D3DPTEXTURECAPS_ALPHAPALETTE
)
{
hr
=
IDirect3DDevice8_SetPaletteEntries
(
device
,
0
,
pal
);
ok
(
SUCCEEDED
(
hr
),
"Failed to set palette entries, hr %#x.
\n
"
,
hr
);
}
else
{
hr
=
IDirect3DDevice8_SetPaletteEntries
(
device
,
0
,
pal
);
ok
(
hr
==
D3DERR_INVALIDCALL
,
"SetPaletteEntries returned %#x, expected D3DERR_INVALIDCALL.
\n
"
,
hr
);
}
refcount
=
IDirect3DDevice8_Release
(
device
);
ok
(
!
refcount
,
"Device has %u references left.
\n
"
,
refcount
);
IDirect3D8_Release
(
d3d8
);
DestroyWindow
(
window
);
}
START_TEST
(
device
)
{
HMODULE
d3d8_handle
=
LoadLibraryA
(
"d3d8.dll"
);
...
...
@@ -4542,6 +4605,7 @@ START_TEST(device)
test_surface_format_null
();
test_surface_double_unlock
();
test_surface_lockrect_blocks
();
test_set_palette
();
}
UnregisterClassA
(
"d3d8_test_wc"
,
GetModuleHandleA
(
NULL
));
}
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