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
5e14b079
Commit
5e14b079
authored
Sep 12, 2000
by
Lionel Ulmer
Committed by
Alexandre Julliard
Sep 12, 2000
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed DGA / DGA 2 palette creation.
parent
0ca52b2e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
84 additions
and
14 deletions
+84
-14
dga.c
dlls/ddraw/dpalette/dga.c
+5
-12
dga.c
dlls/ddraw/dsurface/dga.c
+22
-1
dga2.c
dlls/ddraw/dsurface/dga2.c
+57
-1
No files found.
dlls/ddraw/dpalette/dga.c
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
;
}
...
...
dlls/ddraw/dsurface/dga.c
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 */
...
...
dlls/ddraw/dsurface/dga2.c
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
,
...
...
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