Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Johnny Cai
wine
Commits
5e14b079
Commit
5e14b079
authored
24 years ago
by
Lionel Ulmer
Committed by
Alexandre Julliard
24 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Fixed DGA / DGA 2 palette creation.
parent
0ca52b2e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
dlls/ddraw/dpalette/dga.c
+5
-12
5 additions, 12 deletions
dlls/ddraw/dpalette/dga.c
dlls/ddraw/dsurface/dga.c
+22
-1
22 additions, 1 deletion
dlls/ddraw/dsurface/dga.c
dlls/ddraw/dsurface/dga2.c
+57
-1
57 additions, 1 deletion
dlls/ddraw/dsurface/dga2.c
with
84 additions
and
14 deletions
dlls/ddraw/dpalette/dga.c
+
5
−
12
View file @
5e14b079
...
...
@@ -26,36 +26,29 @@ HRESULT WINAPI DGA_IDirectDrawPaletteImpl_SetEntries(
)
{
ICOM_THIS
(
IDirectDrawPaletteImpl
,
iface
);
DPPRIVATE
(
This
);
DDPRIVATE
(
This
->
ddraw
);
XColor
xc
;
Colormap
cm
;
int
i
;
TRACE
(
"(%p)->SetEntries(%08lx,%ld,%ld,%p)
\n
"
,
This
,
x
,
start
,
count
,
palent
);
if
(
!
dppriv
->
cm
)
/* should not happen */
{
FIXME
(
"app tried to set colormap in non-palettized mode
\n
"
);
return
DDERR_GENERIC
;
TRACE
(
"app tried to set colormap in non-palettized mode
\n
"
);
}
/* FIXME: free colorcells instead of freeing whole map */
cm
=
dppriv
->
cm
;
dppriv
->
cm
=
TSXCopyColormapAndFree
(
display
,
dppriv
->
cm
);
TSXFreeColormap
(
display
,
cm
);
for
(
i
=
0
;
i
<
count
;
i
++
)
{
xc
.
red
=
palent
[
i
].
peRed
<<
8
;
xc
.
blue
=
palent
[
i
].
peBlue
<<
8
;
xc
.
green
=
palent
[
i
].
peGreen
<<
8
;
xc
.
flags
=
DoRed
|
DoBlue
|
DoGreen
;
xc
.
pixel
=
i
+
start
;
TSXStoreColor
(
display
,
dppriv
->
cm
,
&
xc
);
if
(
dppriv
->
cm
)
TSXStoreColor
(
display
,
dppriv
->
cm
,
&
xc
);
This
->
palents
[
start
+
i
].
peRed
=
palent
[
i
].
peRed
;
This
->
palents
[
start
+
i
].
peBlue
=
palent
[
i
].
peBlue
;
This
->
palents
[
start
+
i
].
peGreen
=
palent
[
i
].
peGreen
;
This
->
palents
[
start
+
i
].
peFlags
=
palent
[
i
].
peFlags
;
}
ddpriv
->
InstallColormap
(
display
,
DefaultScreen
(
display
),
dppriv
->
cm
);
/* Flush the display queue so that palette updates are visible directly */
TSXFlush
(
display
);
return
DD_OK
;
}
...
...
This diff is collapsed.
Click to expand it.
dlls/ddraw/dsurface/dga.c
+
22
−
1
View file @
5e14b079
...
...
@@ -100,7 +100,28 @@ HRESULT WINAPI DGA_IDirectDrawSurface4Impl_SetPalette(
IDirectDrawPalette_Release
(
(
IDirectDrawPalette
*
)
This
->
s
.
palette
);
This
->
s
.
palette
=
ipal
;
fppriv
=
(
dga_dp_private
*
)
This
->
s
.
palette
->
private
;
ddpriv
->
InstallColormap
(
display
,
DefaultScreen
(
display
),
fppriv
->
cm
);
if
(
!
fppriv
->
cm
&&
(
This
->
s
.
ddraw
->
d
->
screen_pixelformat
.
u
.
dwRGBBitCount
<=
8
)
)
{
int
i
;
/* Delayed palette creation */
fppriv
->
cm
=
TSXCreateColormap
(
display
,
DefaultRootWindow
(
display
),
DefaultVisualOfScreen
(
X11DRV_GetXScreen
()),
AllocAll
);
for
(
i
=
0
;
i
<
256
;
i
++
)
{
XColor
xc
;
xc
.
red
=
ipal
->
palents
[
i
].
peRed
<<
8
;
xc
.
blue
=
ipal
->
palents
[
i
].
peBlue
<<
8
;
xc
.
green
=
ipal
->
palents
[
i
].
peGreen
<<
8
;
xc
.
flags
=
DoRed
|
DoBlue
|
DoGreen
;
xc
.
pixel
=
i
;
TSXStoreColor
(
display
,
fppriv
->
cm
,
&
xc
);
}
}
TSXF86DGAInstallColormap
(
display
,
DefaultScreen
(
display
),
fppriv
->
cm
);
if
(
This
->
s
.
hdc
!=
0
)
{
/* hack: set the DIBsection color map */
...
...
This diff is collapsed.
Click to expand it.
dlls/ddraw/dsurface/dga2.c
+
57
−
1
View file @
5e14b079
...
...
@@ -14,6 +14,7 @@
#include
"debugtools.h"
#include
"dga2_private.h"
#include
"bitmap.h"
DEFAULT_DEBUG_CHANNEL
(
ddraw
);
...
...
@@ -69,6 +70,61 @@ HRESULT WINAPI DGA2_IDirectDrawSurface4Impl_Flip(
return
DD_OK
;
}
HRESULT
WINAPI
DGA2_IDirectDrawSurface4Impl_SetPalette
(
LPDIRECTDRAWSURFACE4
iface
,
LPDIRECTDRAWPALETTE
pal
)
{
ICOM_THIS
(
IDirectDrawSurface4Impl
,
iface
);
DDPRIVATE
(
This
->
s
.
ddraw
);
IDirectDrawPaletteImpl
*
ipal
=
(
IDirectDrawPaletteImpl
*
)
pal
;
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
ipal
);
/* According to spec, we are only supposed to
* AddRef if this is not the same palette.
*/
if
(
This
->
s
.
palette
!=
ipal
)
{
dga_dp_private
*
fppriv
;
if
(
ipal
!=
NULL
)
IDirectDrawPalette_AddRef
(
(
IDirectDrawPalette
*
)
ipal
);
if
(
This
->
s
.
palette
!=
NULL
)
IDirectDrawPalette_Release
(
(
IDirectDrawPalette
*
)
This
->
s
.
palette
);
This
->
s
.
palette
=
ipal
;
fppriv
=
(
dga_dp_private
*
)
This
->
s
.
palette
->
private
;
if
(
!
fppriv
->
cm
&&
(
This
->
s
.
ddraw
->
d
->
screen_pixelformat
.
u
.
dwRGBBitCount
<=
8
)
)
{
int
i
;
/* Delayed palette creation */
fppriv
->
cm
=
TSXDGACreateColormap
(
display
,
DefaultScreen
(
display
),
ddpriv
->
dev
,
AllocAll
);
for
(
i
=
0
;
i
<
256
;
i
++
)
{
XColor
xc
;
xc
.
red
=
ipal
->
palents
[
i
].
peRed
<<
8
;
xc
.
blue
=
ipal
->
palents
[
i
].
peBlue
<<
8
;
xc
.
green
=
ipal
->
palents
[
i
].
peGreen
<<
8
;
xc
.
flags
=
DoRed
|
DoBlue
|
DoGreen
;
xc
.
pixel
=
i
;
TSXStoreColor
(
display
,
fppriv
->
cm
,
&
xc
);
}
}
TSXDGAInstallColormap
(
display
,
DefaultScreen
(
display
),
fppriv
->
cm
);
if
(
This
->
s
.
hdc
!=
0
)
{
/* hack: set the DIBsection color map */
BITMAPOBJ
*
bmp
=
(
BITMAPOBJ
*
)
GDI_GetObjPtr
(
This
->
s
.
DIBsection
,
BITMAP_MAGIC
);
X11DRV_DIBSECTION
*
dib
=
(
X11DRV_DIBSECTION
*
)
bmp
->
dib
;
dib
->
colorMap
=
This
->
s
.
palette
?
This
->
s
.
palette
->
screen_palents
:
NULL
;
GDI_ReleaseObj
(
This
->
s
.
DIBsection
);
}
TSXFlush
(
display
);
}
return
DD_OK
;
}
ICOM_VTABLE
(
IDirectDrawSurface4
)
dga2_dds4vt
=
{
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
...
...
@@ -103,7 +159,7 @@ ICOM_VTABLE(IDirectDrawSurface4) dga2_dds4vt =
IDirectDrawSurface4Impl_SetClipper
,
IDirectDrawSurface4Impl_SetColorKey
,
IDirectDrawSurface4Impl_SetOverlayPosition
,
DGA_IDirectDrawSurface4Impl_SetPalette
,
DGA
2
_IDirectDrawSurface4Impl_SetPalette
,
DGA_IDirectDrawSurface4Impl_Unlock
,
IDirectDrawSurface4Impl_UpdateOverlay
,
IDirectDrawSurface4Impl_UpdateOverlayDisplay
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment