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
fd0189bb
Commit
fd0189bb
authored
May 15, 2014
by
Stefan Dösinger
Committed by
Alexandre Julliard
May 15, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Move get_dc palette updates to ddraw.
parent
caeecfa2
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
34 additions
and
32 deletions
+34
-32
ddraw_private.h
dlls/ddraw/ddraw_private.h
+7
-0
device.c
dlls/ddraw/device.c
+1
-4
surface.c
dlls/ddraw/surface.c
+17
-2
palette.c
dlls/wined3d/palette.c
+6
-0
surface.c
dlls/wined3d/surface.c
+1
-26
wined3d.spec
dlls/wined3d/wined3d.spec
+1
-0
wined3d.h
include/wine/wined3d.h
+1
-0
No files found.
dlls/ddraw/ddraw_private.h
View file @
fd0189bb
...
...
@@ -575,6 +575,13 @@ void DDSD2_to_DDSD(const DDSURFACEDESC2 *in, DDSURFACEDESC *out) DECLSPEC_HIDDEN
void
multiply_matrix
(
D3DMATRIX
*
dst
,
const
D3DMATRIX
*
src1
,
const
D3DMATRIX
*
src2
)
DECLSPEC_HIDDEN
;
static
inline
BOOL
format_is_paletteindexed
(
const
DDPIXELFORMAT
*
fmt
)
{
DWORD
flags
=
DDPF_PALETTEINDEXED1
|
DDPF_PALETTEINDEXED2
|
DDPF_PALETTEINDEXED4
|
DDPF_PALETTEINDEXED8
|
DDPF_PALETTEINDEXEDTO8
;
return
!!
(
fmt
->
dwFlags
&
flags
);
}
/* Used for generic dumping */
struct
flag_info
{
...
...
dlls/ddraw/device.c
View file @
fd0189bb
...
...
@@ -1798,10 +1798,7 @@ static HRESULT WINAPI d3d_device2_GetCurrentViewport(IDirect3DDevice2 *iface, ID
static
BOOL
validate_surface_palette
(
struct
ddraw_surface
*
surface
)
{
return
!
(
surface
->
surface_desc
.
u4
.
ddpfPixelFormat
.
dwFlags
&
(
DDPF_PALETTEINDEXED1
|
DDPF_PALETTEINDEXED2
|
DDPF_PALETTEINDEXED4
|
DDPF_PALETTEINDEXED8
|
DDPF_PALETTEINDEXEDTO8
))
return
!
format_is_paletteindexed
(
&
surface
->
surface_desc
.
u4
.
ddpfPixelFormat
)
||
surface
->
palette
;
}
...
...
dlls/ddraw/surface.c
View file @
fd0189bb
...
...
@@ -461,8 +461,7 @@ static HRESULT ddraw_surface_set_palette(struct ddraw_surface *surface, IDirectD
return
DDERR_INVALIDSURFACETYPE
;
}
if
(
!
(
surface
->
surface_desc
.
u4
.
ddpfPixelFormat
.
dwFlags
&
(
DDPF_PALETTEINDEXED1
|
DDPF_PALETTEINDEXED2
|
DDPF_PALETTEINDEXED4
|
DDPF_PALETTEINDEXED8
|
DDPF_PALETTEINDEXEDTO8
)))
if
(
!
format_is_paletteindexed
(
&
surface
->
surface_desc
.
u4
.
ddpfPixelFormat
))
return
DDERR_INVALIDPIXELFORMAT
;
wined3d_mutex_lock
();
...
...
@@ -2017,6 +2016,22 @@ static HRESULT WINAPI ddraw_surface7_GetDC(IDirectDrawSurface7 *iface, HDC *hdc)
hr
=
ddraw_surface_update_frontbuffer
(
surface
,
NULL
,
TRUE
);
if
(
SUCCEEDED
(
hr
))
hr
=
wined3d_surface_getdc
(
surface
->
wined3d_surface
,
hdc
);
if
(
SUCCEEDED
(
hr
)
&&
format_is_paletteindexed
(
&
surface
->
surface_desc
.
u4
.
ddpfPixelFormat
))
{
const
struct
ddraw_palette
*
palette
;
if
(
surface
->
palette
)
palette
=
surface
->
palette
;
else
if
(
surface
->
ddraw
->
primary
)
palette
=
surface
->
ddraw
->
primary
->
palette
;
else
palette
=
NULL
;
if
(
palette
)
wined3d_palette_apply_to_dc
(
palette
->
wineD3DPalette
,
*
hdc
);
}
wined3d_mutex_unlock
();
switch
(
hr
)
{
...
...
dlls/wined3d/palette.c
View file @
fd0189bb
...
...
@@ -83,6 +83,12 @@ HRESULT CDECL wined3d_palette_get_entries(const struct wined3d_palette *palette,
return
WINED3D_OK
;
}
void
CDECL
wined3d_palette_apply_to_dc
(
const
struct
wined3d_palette
*
palette
,
HDC
dc
)
{
if
(
SetDIBColorTable
(
dc
,
0
,
256
,
palette
->
colors
)
!=
256
)
ERR
(
"Failed to set DIB color table.
\n
"
);
}
HRESULT
CDECL
wined3d_palette_set_entries
(
struct
wined3d_palette
*
palette
,
DWORD
flags
,
DWORD
start
,
DWORD
count
,
const
PALETTEENTRY
*
entries
)
{
...
...
dlls/wined3d/surface.c
View file @
fd0189bb
...
...
@@ -1378,7 +1378,7 @@ static void gdi_surface_realize_palette(struct wined3d_surface *surface)
/* Tell the swapchain to update the screen. */
if
(
surface
->
swapchain
&&
surface
==
surface
->
swapchain
->
front_buffer
)
{
SetDIBColorTable
(
surface
->
hDC
,
0
,
256
,
palette
->
colors
);
wined3d_palette_apply_to_dc
(
palette
,
surface
->
hDC
);
x11_copy_to_screen
(
surface
->
swapchain
,
NULL
);
}
}
...
...
@@ -3122,31 +3122,6 @@ HRESULT CDECL wined3d_surface_getdc(struct wined3d_surface *surface, HDC *dc)
surface_load_location
(
surface
,
WINED3D_LOCATION_DIB
);
surface_invalidate_location
(
surface
,
~
WINED3D_LOCATION_DIB
);
if
(
surface
->
resource
.
format
->
id
==
WINED3DFMT_P8_UINT
||
surface
->
resource
.
format
->
id
==
WINED3DFMT_P8_UINT_A8_UNORM
)
{
/* GetDC on palettized formats is unsupported in D3D9, and the method
* is missing in D3D8, so this should only be used for DX <=7
* surfaces (with non-device palettes). */
const
RGBQUAD
*
colors
=
NULL
;
if
(
surface
->
palette
)
{
colors
=
surface
->
palette
->
colors
;
}
else
{
struct
wined3d_swapchain
*
swapchain
=
surface
->
resource
.
device
->
swapchains
[
0
];
struct
wined3d_surface
*
dds_primary
=
swapchain
->
front_buffer
;
if
(
dds_primary
&&
dds_primary
->
palette
)
colors
=
dds_primary
->
palette
->
colors
;
}
if
(
colors
)
SetDIBColorTable
(
surface
->
hDC
,
0
,
256
,
colors
);
}
surface
->
flags
|=
SFLAG_DCINUSE
;
surface
->
resource
.
map_count
++
;
...
...
dlls/wined3d/wined3d.spec
View file @
fd0189bb
...
...
@@ -160,6 +160,7 @@
@ cdecl wined3d_palette_create(ptr long long ptr ptr)
@ cdecl wined3d_palette_decref(ptr)
@ cdecl wined3d_palette_get_entries(ptr long long long ptr)
@ cdecl wined3d_palette_apply_to_dc(ptr ptr)
@ cdecl wined3d_palette_incref(ptr)
@ cdecl wined3d_palette_set_entries(ptr long long long ptr)
...
...
include/wine/wined3d.h
View file @
fd0189bb
...
...
@@ -2261,6 +2261,7 @@ HRESULT __cdecl wined3d_palette_create(struct wined3d_device *device, DWORD flag
ULONG
__cdecl
wined3d_palette_decref
(
struct
wined3d_palette
*
palette
);
HRESULT
__cdecl
wined3d_palette_get_entries
(
const
struct
wined3d_palette
*
palette
,
DWORD
flags
,
DWORD
start
,
DWORD
count
,
PALETTEENTRY
*
entries
);
void
__cdecl
wined3d_palette_apply_to_dc
(
const
struct
wined3d_palette
*
palette
,
HDC
dc
);
ULONG
__cdecl
wined3d_palette_incref
(
struct
wined3d_palette
*
palette
);
HRESULT
__cdecl
wined3d_palette_set_entries
(
struct
wined3d_palette
*
palette
,
DWORD
flags
,
DWORD
start
,
DWORD
count
,
const
PALETTEENTRY
*
entries
);
...
...
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