Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
561895a9
Commit
561895a9
authored
May 18, 2000
by
Ove Kaaven
Committed by
Alexandre Julliard
May 18, 2000
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Made IDirectDrawSurface::SetPalette set the surface's DIBSection color
map to point to the IDirectDrawPalette's own depth conversion color map.
parent
9d0abdbc
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
68 additions
and
3 deletions
+68
-3
dga_private.h
dlls/ddraw/dga_private.h
+2
-0
dga.c
dlls/ddraw/dsurface/dga.c
+32
-1
dga2.c
dlls/ddraw/dsurface/dga2.c
+1
-1
x11.c
dlls/ddraw/dsurface/x11.c
+32
-1
x11_private.h
dlls/ddraw/x11_private.h
+1
-0
No files found.
dlls/ddraw/dga_private.h
View file @
561895a9
...
...
@@ -28,12 +28,14 @@ typedef x11_dp_private dga_dp_private; /* reuse X11 palette stuff */
typedef
struct
dga_ds_private
{
DWORD
fb_height
;
int
*
oldDIBmap
;
}
dga_ds_private
;
/* For usage in DGA2 */
extern
ULONG
WINAPI
DGA_IDirectDrawSurface4Impl_Release
(
LPDIRECTDRAWSURFACE4
iface
)
;
extern
HRESULT
WINAPI
DGA_IDirectDrawSurface4Impl_SetPalette
(
LPDIRECTDRAWSURFACE4
iface
,
LPDIRECTDRAWPALETTE
pal
)
;
extern
HRESULT
WINAPI
DGA_IDirectDrawSurface4Impl_Unlock
(
LPDIRECTDRAWSURFACE4
iface
,
LPVOID
surface
)
;
extern
HRESULT
WINAPI
DGA_IDirectDrawSurface4Impl_GetDC
(
LPDIRECTDRAWSURFACE4
iface
,
HDC
*
lphdc
);
extern
HRESULT
WINAPI
DGA_IDirectDraw2Impl_CreateSurface_no_VT
(
LPDIRECTDRAW2
iface
,
LPDDSURFACEDESC
lpddsd
,
LPDIRECTDRAWSURFACE
*
lpdsf
,
IUnknown
*
lpunk
)
;
...
...
dlls/ddraw/dsurface/dga.c
View file @
561895a9
...
...
@@ -15,6 +15,7 @@
#include "debugtools.h"
#include "dga_private.h"
#include "bitmap.h"
DEFAULT_DEBUG_CHANNEL
(
ddraw
);
...
...
@@ -100,6 +101,14 @@ HRESULT WINAPI DGA_IDirectDrawSurface4Impl_SetPalette(
This
->
s
.
palette
=
ipal
;
fppriv
=
(
dga_dp_private
*
)
This
->
s
.
palette
->
private
;
ddpriv
->
InstallColormap
(
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_HEAP_UNLOCK
(
This
->
s
.
DIBsection
);
}
}
return
DD_OK
;
}
...
...
@@ -123,6 +132,12 @@ ULONG WINAPI DGA_IDirectDrawSurface4Impl_Release(LPDIRECTDRAWSURFACE4 iface) {
/* Free the DIBSection (if any) */
if
(
This
->
s
.
hdc
!=
0
)
{
/* hack: restore the original DIBsection color map */
BITMAPOBJ
*
bmp
=
(
BITMAPOBJ
*
)
GDI_GetObjPtr
(
This
->
s
.
DIBsection
,
BITMAP_MAGIC
);
X11DRV_DIBSECTION
*
dib
=
(
X11DRV_DIBSECTION
*
)
bmp
->
dib
;
dib
->
colorMap
=
dspriv
->
oldDIBmap
;
GDI_HEAP_UNLOCK
(
This
->
s
.
DIBsection
);
SelectObject
(
This
->
s
.
hdc
,
This
->
s
.
holdbitmap
);
DeleteDC
(
This
->
s
.
hdc
);
DeleteObject
(
This
->
s
.
DIBsection
);
...
...
@@ -146,6 +161,22 @@ HRESULT WINAPI DGA_IDirectDrawSurface4Impl_Unlock(
return
DD_OK
;
}
HRESULT
WINAPI
DGA_IDirectDrawSurface4Impl_GetDC
(
LPDIRECTDRAWSURFACE4
iface
,
HDC
*
lphdc
)
{
ICOM_THIS
(
IDirectDrawSurface4Impl
,
iface
);
DSPRIVATE
(
This
);
int
was_ok
=
This
->
s
.
hdc
!=
0
;
HRESULT
result
=
IDirectDrawSurface4Impl_GetDC
(
iface
,
lphdc
);
if
(
This
->
s
.
hdc
&&
!
was_ok
)
{
/* hack: take over the DIBsection color map */
BITMAPOBJ
*
bmp
=
(
BITMAPOBJ
*
)
GDI_GetObjPtr
(
This
->
s
.
DIBsection
,
BITMAP_MAGIC
);
X11DRV_DIBSECTION
*
dib
=
(
X11DRV_DIBSECTION
*
)
bmp
->
dib
;
dspriv
->
oldDIBmap
=
dib
->
colorMap
;
dib
->
colorMap
=
This
->
s
.
palette
?
This
->
s
.
palette
->
screen_palents
:
NULL
;
GDI_HEAP_UNLOCK
(
This
->
s
.
DIBsection
);
}
return
result
;
}
ICOM_VTABLE
(
IDirectDrawSurface4
)
dga_dds4vt
=
{
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
...
...
@@ -166,7 +197,7 @@ ICOM_VTABLE(IDirectDrawSurface4) dga_dds4vt =
IDirectDrawSurface4Impl_GetCaps
,
IDirectDrawSurface4Impl_GetClipper
,
IDirectDrawSurface4Impl_GetColorKey
,
IDirectDrawSurface4Impl_GetDC
,
DGA_
IDirectDrawSurface4Impl_GetDC
,
IDirectDrawSurface4Impl_GetFlipStatus
,
IDirectDrawSurface4Impl_GetOverlayPosition
,
IDirectDrawSurface4Impl_GetPalette
,
...
...
dlls/ddraw/dsurface/dga2.c
View file @
561895a9
...
...
@@ -89,7 +89,7 @@ ICOM_VTABLE(IDirectDrawSurface4) dga2_dds4vt =
IDirectDrawSurface4Impl_GetCaps
,
IDirectDrawSurface4Impl_GetClipper
,
IDirectDrawSurface4Impl_GetColorKey
,
IDirectDrawSurface4Impl_GetDC
,
DGA_
IDirectDrawSurface4Impl_GetDC
,
IDirectDrawSurface4Impl_GetFlipStatus
,
IDirectDrawSurface4Impl_GetOverlayPosition
,
IDirectDrawSurface4Impl_GetPalette
,
...
...
dlls/ddraw/dsurface/x11.c
View file @
561895a9
...
...
@@ -16,6 +16,7 @@
#include "options.h"
#include "debugtools.h"
#include "x11_private.h"
#include "bitmap.h"
#ifdef HAVE_OPENGL
/* for d3d texture stuff */
...
...
@@ -313,6 +314,14 @@ HRESULT WINAPI Xlib_IDirectDrawSurface4Impl_SetPalette(
This
->
s
.
palette
=
ipal
;
/* Perform the refresh */
TSXSetWindowColormap
(
display
,
ddpriv
->
drawable
,
dppriv
->
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_HEAP_UNLOCK
(
This
->
s
.
DIBsection
);
}
}
return
DD_OK
;
}
...
...
@@ -370,6 +379,12 @@ ULONG WINAPI Xlib_IDirectDrawSurface4Impl_Release(LPDIRECTDRAWSURFACE4 iface) {
/* Free the DIBSection (if any) */
if
(
This
->
s
.
hdc
!=
0
)
{
/* hack: restore the original DIBsection color map */
BITMAPOBJ
*
bmp
=
(
BITMAPOBJ
*
)
GDI_GetObjPtr
(
This
->
s
.
DIBsection
,
BITMAP_MAGIC
);
X11DRV_DIBSECTION
*
dib
=
(
X11DRV_DIBSECTION
*
)
bmp
->
dib
;
dib
->
colorMap
=
dspriv
->
oldDIBmap
;
GDI_HEAP_UNLOCK
(
This
->
s
.
DIBsection
);
SelectObject
(
This
->
s
.
hdc
,
This
->
s
.
holdbitmap
);
DeleteDC
(
This
->
s
.
hdc
);
DeleteObject
(
This
->
s
.
DIBsection
);
...
...
@@ -383,6 +398,22 @@ ULONG WINAPI Xlib_IDirectDrawSurface4Impl_Release(LPDIRECTDRAWSURFACE4 iface) {
return
S_OK
;
}
HRESULT
WINAPI
Xlib_IDirectDrawSurface4Impl_GetDC
(
LPDIRECTDRAWSURFACE4
iface
,
HDC
*
lphdc
)
{
ICOM_THIS
(
IDirectDrawSurface4Impl
,
iface
);
DSPRIVATE
(
This
);
int
was_ok
=
This
->
s
.
hdc
!=
0
;
HRESULT
result
=
IDirectDrawSurface4Impl_GetDC
(
iface
,
lphdc
);
if
(
This
->
s
.
hdc
&&
!
was_ok
)
{
/* hack: take over the DIBsection color map */
BITMAPOBJ
*
bmp
=
(
BITMAPOBJ
*
)
GDI_GetObjPtr
(
This
->
s
.
DIBsection
,
BITMAP_MAGIC
);
X11DRV_DIBSECTION
*
dib
=
(
X11DRV_DIBSECTION
*
)
bmp
->
dib
;
dspriv
->
oldDIBmap
=
dib
->
colorMap
;
dib
->
colorMap
=
This
->
s
.
palette
?
This
->
s
.
palette
->
screen_palents
:
NULL
;
GDI_HEAP_UNLOCK
(
This
->
s
.
DIBsection
);
}
return
result
;
}
ICOM_VTABLE
(
IDirectDrawSurface4
)
xlib_dds4vt
=
{
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
...
...
@@ -403,7 +434,7 @@ ICOM_VTABLE(IDirectDrawSurface4) xlib_dds4vt =
IDirectDrawSurface4Impl_GetCaps
,
IDirectDrawSurface4Impl_GetClipper
,
IDirectDrawSurface4Impl_GetColorKey
,
IDirectDrawSurface4Impl_GetDC
,
Xlib_
IDirectDrawSurface4Impl_GetDC
,
IDirectDrawSurface4Impl_GetFlipStatus
,
IDirectDrawSurface4Impl_GetOverlayPosition
,
IDirectDrawSurface4Impl_GetPalette
,
...
...
dlls/ddraw/x11_private.h
View file @
561895a9
...
...
@@ -50,6 +50,7 @@ typedef struct x11_ds_private {
#ifdef HAVE_LIBXXSHM
XShmSegmentInfo
shminfo
;
#endif
int
*
oldDIBmap
;
}
x11_ds_private
;
#ifdef HAVE_LIBXXSHM
...
...
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