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
9b913b3b
Commit
9b913b3b
authored
Mar 25, 2008
by
Alexander Dorofeyev
Committed by
Alexandre Julliard
Mar 25, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Don't use device palettes in RealizePalette.
parent
13ce2192
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
30 deletions
+15
-30
surface.c
dlls/wined3d/surface.c
+7
-14
surface_gdi.c
dlls/wined3d/surface_gdi.c
+8
-16
No files found.
dlls/wined3d/surface.c
View file @
9b913b3b
...
...
@@ -3574,6 +3574,8 @@ HRESULT WINAPI IWineD3DSurfaceImpl_RealizePalette(IWineD3DSurface *iface) {
unsigned
int
n
;
TRACE
(
"(%p)
\n
"
,
This
);
if
(
!
pal
)
return
WINED3D_OK
;
if
(
This
->
resource
.
format
==
WINED3DFMT_P8
||
This
->
resource
.
format
==
WINED3DFMT_A8P8
)
{
...
...
@@ -3588,26 +3590,17 @@ HRESULT WINAPI IWineD3DSurfaceImpl_RealizePalette(IWineD3DSurface *iface) {
if
(
This
->
Flags
&
SFLAG_DIBSECTION
)
{
TRACE
(
"(%p): Updating the hdc's palette
\n
"
,
This
);
for
(
n
=
0
;
n
<
256
;
n
++
)
{
if
(
pal
)
{
col
[
n
].
rgbRed
=
pal
->
palents
[
n
].
peRed
;
col
[
n
].
rgbGreen
=
pal
->
palents
[
n
].
peGreen
;
col
[
n
].
rgbBlue
=
pal
->
palents
[
n
].
peBlue
;
}
else
{
IWineD3DDeviceImpl
*
device
=
This
->
resource
.
wineD3DDevice
;
/* Use the default device palette */
col
[
n
].
rgbRed
=
device
->
palettes
[
device
->
currentPalette
][
n
].
peRed
;
col
[
n
].
rgbGreen
=
device
->
palettes
[
device
->
currentPalette
][
n
].
peGreen
;
col
[
n
].
rgbBlue
=
device
->
palettes
[
device
->
currentPalette
][
n
].
peBlue
;
}
col
[
n
].
rgbRed
=
pal
->
palents
[
n
].
peRed
;
col
[
n
].
rgbGreen
=
pal
->
palents
[
n
].
peGreen
;
col
[
n
].
rgbBlue
=
pal
->
palents
[
n
].
peBlue
;
col
[
n
].
rgbReserved
=
0
;
}
SetDIBColorTable
(
This
->
hDC
,
0
,
256
,
col
);
}
/* Propagate the changes to the drawable when we have a palette. This function is also called
* when the palette is removed.
/* Propagate the changes to the drawable when we have a palette.
* TODO: in case of hardware p8 palettes we should only upload the palette. */
if
(
pal
&&
(
This
->
resource
.
usage
&
WINED3DUSAGE_RENDERTARGET
)
)
if
(
This
->
resource
.
usage
&
WINED3DUSAGE_RENDERTARGET
)
IWineD3DSurface_LoadLocation
(
iface
,
SFLAG_INDRAWABLE
,
NULL
);
return
WINED3D_OK
;
...
...
dlls/wined3d/surface_gdi.c
View file @
9b913b3b
...
...
@@ -635,30 +635,22 @@ HRESULT WINAPI IWineGDISurfaceImpl_RealizePalette(IWineD3DSurface *iface) {
unsigned
int
n
;
TRACE
(
"(%p)
\n
"
,
This
);
if
(
!
pal
)
return
WINED3D_OK
;
if
(
This
->
Flags
&
SFLAG_DIBSECTION
)
{
TRACE
(
"(%p): Updating the hdc's palette
\n
"
,
This
);
for
(
n
=
0
;
n
<
256
;
n
++
)
{
if
(
pal
)
{
col
[
n
].
rgbRed
=
pal
->
palents
[
n
].
peRed
;
col
[
n
].
rgbGreen
=
pal
->
palents
[
n
].
peGreen
;
col
[
n
].
rgbBlue
=
pal
->
palents
[
n
].
peBlue
;
}
else
{
IWineD3DDeviceImpl
*
device
=
This
->
resource
.
wineD3DDevice
;
/* Use the default device palette */
col
[
n
].
rgbRed
=
device
->
palettes
[
device
->
currentPalette
][
n
].
peRed
;
col
[
n
].
rgbGreen
=
device
->
palettes
[
device
->
currentPalette
][
n
].
peGreen
;
col
[
n
].
rgbBlue
=
device
->
palettes
[
device
->
currentPalette
][
n
].
peBlue
;
}
col
[
n
].
rgbRed
=
pal
->
palents
[
n
].
peRed
;
col
[
n
].
rgbGreen
=
pal
->
palents
[
n
].
peGreen
;
col
[
n
].
rgbBlue
=
pal
->
palents
[
n
].
peBlue
;
col
[
n
].
rgbReserved
=
0
;
}
SetDIBColorTable
(
This
->
hDC
,
0
,
256
,
col
);
}
/* Update the image because of the palette change. Note that this function is also
* called on a palette removal. In such a case we don't have to update the screen.
* Some games like e.g Red Alert call SetEntries a lot to implement fading.
*/
if
(
pal
&&
This
->
resource
.
usage
&
WINED3DUSAGE_RENDERTARGET
)
/* Update the image because of the palette change. Some games like e.g Red Alert
call SetEntries a lot to implement fading. */
if
(
This
->
resource
.
usage
&
WINED3DUSAGE_RENDERTARGET
)
x11_copy_to_screen
(
This
,
NULL
);
return
WINED3D_OK
;
...
...
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