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
2b8281a8
Commit
2b8281a8
authored
Jan 30, 2004
by
Lionel Ulmer
Committed by
Alexandre Julliard
Jan 30, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix palette deletion issue seen in DungeonKeeper.
parent
2ae876fa
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
2 deletions
+21
-2
main.c
dlls/ddraw/ddraw/main.c
+13
-0
main.c
dlls/ddraw/dsurface/main.c
+8
-2
No files found.
dlls/ddraw/ddraw/main.c
View file @
2b8281a8
...
...
@@ -1307,6 +1307,8 @@ void Main_DirectDraw_AddPalette(IDirectDrawImpl* This,
void
Main_DirectDraw_RemovePalette
(
IDirectDrawImpl
*
This
,
IDirectDrawPaletteImpl
*
palette
)
{
IDirectDrawSurfaceImpl
*
surf
;
assert
(
palette
->
ddraw_owner
==
This
);
if
(
This
->
palettes
==
palette
)
...
...
@@ -1316,6 +1318,17 @@ void Main_DirectDraw_RemovePalette(IDirectDrawImpl* This,
palette
->
next_ddraw
->
prev_ddraw
=
palette
->
prev_ddraw
;
if
(
palette
->
prev_ddraw
)
palette
->
prev_ddraw
->
next_ddraw
=
palette
->
next_ddraw
;
/* Here we need also to remove tha palette from any surface which has it as the
* current palette (checked on Windows)
*/
for
(
surf
=
This
->
surfaces
;
surf
!=
NULL
;
surf
=
surf
->
next_ddraw
)
{
if
(
surf
->
palette
==
palette
)
{
TRACE
(
"Palette %p attached to surface %p.
\n
"
,
palette
,
surf
);
surf
->
palette
=
NULL
;
surf
->
set_palette
(
surf
,
NULL
);
}
}
}
static
void
Main_DirectDraw_DeletePalettes
(
IDirectDrawImpl
*
This
)
...
...
dlls/ddraw/dsurface/main.c
View file @
2b8281a8
...
...
@@ -1211,6 +1211,7 @@ Main_DirectDrawSurface_SetPalette(LPDIRECTDRAWSURFACE7 iface,
LPDIRECTDRAWPALETTE
pPalette
)
{
ICOM_THIS
(
IDirectDrawSurfaceImpl
,
iface
);
IDirectDrawPalette
*
pal_to_rel
=
NULL
;
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
pPalette
);
if
(
pPalette
==
ICOM_INTERFACE
(
This
->
palette
,
IDirectDrawPalette
))
...
...
@@ -1219,8 +1220,7 @@ Main_DirectDrawSurface_SetPalette(LPDIRECTDRAWSURFACE7 iface,
if
(
This
->
palette
!=
NULL
)
{
if
(
This
->
surface_desc
.
ddsCaps
.
dwCaps
&
DDSCAPS_PRIMARYSURFACE
)
This
->
palette
->
global
.
dwFlags
&=
~
DDPCAPS_PRIMARYSURFACE
;
IDirectDrawPalette_Release
(
ICOM_INTERFACE
(
This
->
palette
,
IDirectDrawPalette
));
pal_to_rel
=
ICOM_INTERFACE
(
This
->
palette
,
IDirectDrawPalette
);
}
This
->
palette
=
ICOM_OBJECT
(
IDirectDrawPaletteImpl
,
IDirectDrawPalette
,
...
...
@@ -1233,6 +1233,12 @@ Main_DirectDrawSurface_SetPalette(LPDIRECTDRAWSURFACE7 iface,
This
->
set_palette
(
This
,
This
->
palette
);
/* Do the palette release at the end to prevent doing some 'loop' when removing
* the surface maintaining the last reference on a palette.
*/
if
(
pal_to_rel
!=
NULL
)
IDirectDrawPalette_Release
(
pal_to_rel
);
return
DD_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