mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-14 21:35:43 +00:00
Make DirectDraw compile with DGA2 present.
This commit is contained in:
parent
af7e1ae5c5
commit
8903137cd6
|
@ -199,6 +199,7 @@ static HRESULT WINAPI DGA_IDirectDraw2Impl_SetCooperativeLevel(
|
|||
LPDIRECTDRAW2 iface,HWND hwnd,DWORD cooplevel
|
||||
) {
|
||||
ICOM_THIS(IDirectDraw2Impl,iface);
|
||||
DDPRIVATE(This);
|
||||
HRESULT ret;
|
||||
int evbase, erbase;
|
||||
|
||||
|
@ -223,8 +224,9 @@ static HRESULT WINAPI DGA_IDirectDraw2Impl_SetCooperativeLevel(
|
|||
#endif
|
||||
|
||||
#ifdef HAVE_LIBXXF86DGA2
|
||||
static void _DGA_Initialize_FrameBuffer(IDirectDrawImpl *This, int mode) {
|
||||
void _DGA_Initialize_FrameBuffer(IDirectDrawImpl *This, int mode) {
|
||||
DDPIXELFORMAT *pf = &(This->d.directdraw_pixelformat);
|
||||
DDPRIVATE(This);
|
||||
|
||||
/* Now, get the device / mode description */
|
||||
ddpriv->dev = TSXDGASetMode(display, DefaultScreen(display), mode);
|
||||
|
@ -513,6 +515,7 @@ static HRESULT WINAPI DGA_IDirectDraw2Impl_RestoreDisplayMode(LPDIRECTDRAW2 ifac
|
|||
|
||||
static ULONG WINAPI DGA_IDirectDraw2Impl_Release(LPDIRECTDRAW2 iface) {
|
||||
ICOM_THIS(IDirectDraw2Impl,iface);
|
||||
DDPRIVATE(This);
|
||||
TRACE("(%p)->() decrementing from %lu.\n", This, This->ref );
|
||||
|
||||
if (!--(This->ref)) {
|
||||
|
@ -524,7 +527,7 @@ static ULONG WINAPI DGA_IDirectDraw2Impl_Release(LPDIRECTDRAW2 iface) {
|
|||
TSXDGASetMode(display, DefaultScreen(display), 0);
|
||||
|
||||
/* Set the input handling back to absolute */
|
||||
X11DRV_EVENT_SetInputMethod(X11DRV_INPUT_ABSOLUTE);
|
||||
/*X11DRV_EVENT_SetInputMethod(X11DRV_INPUT_ABSOLUTE);*/
|
||||
|
||||
/* Remove the handling of DGA2 events */
|
||||
X11DRV_EVENT_SetDGAStatus(0, -1);
|
||||
|
@ -609,6 +612,7 @@ static HRESULT WINAPI DGA_IDirectDraw2Impl_EnumDisplayModes(
|
|||
) {
|
||||
ICOM_THIS(IDirectDraw2Impl,iface);
|
||||
DDSURFACEDESC ddsfd;
|
||||
DDPRIVATE(This);
|
||||
static struct {
|
||||
int w,h;
|
||||
} modes[5] = { /* some usual modes */
|
||||
|
|
|
@ -200,30 +200,29 @@ DGA_Create( LPDIRECTDRAW *lplpDD ) {
|
|||
dgpriv->modes = modes;
|
||||
dgpriv->num_modes = num_modes;
|
||||
|
||||
TRACE("Available modes :\n");
|
||||
for (i = 0; i < num_modes; i++) {
|
||||
if (TRACE_ON(ddraw)) {
|
||||
DPRINTF(" %d) - %s (FB: %dx%d / VP: %dx%d) - depth %d -",
|
||||
modes[i].num,
|
||||
modes[i].name, modes[i].imageWidth, modes[i].imageHeight,
|
||||
modes[i].viewportWidth, modes[i].viewportHeight,
|
||||
modes[i].depth
|
||||
);
|
||||
TRACE("Available modes :\n");
|
||||
for (i = 0; i < num_modes; i++) {
|
||||
if (TRACE_ON(ddraw)) {
|
||||
DPRINTF(" %d) - %s (FB: %dx%d / VP: %dx%d) - depth %d -",
|
||||
modes[i].num,
|
||||
modes[i].name, modes[i].imageWidth, modes[i].imageHeight,
|
||||
modes[i].viewportWidth, modes[i].viewportHeight,
|
||||
modes[i].depth
|
||||
);
|
||||
#define XX(x) if (modes[i].flags & x) DPRINTF(" "#x" ");
|
||||
XX(XDGAConcurrentAccess);
|
||||
XX(XDGASolidFillRect);
|
||||
XX(XDGABlitRect);
|
||||
XX(XDGABlitTransRect);
|
||||
XX(XDGAPixmap);
|
||||
XX(XDGAConcurrentAccess);
|
||||
XX(XDGASolidFillRect);
|
||||
XX(XDGABlitRect);
|
||||
XX(XDGABlitTransRect);
|
||||
XX(XDGAPixmap);
|
||||
#undef XX
|
||||
DPRINTF("\n");
|
||||
}
|
||||
if ((MONITOR_GetHeight(&MONITOR_PrimaryMonitor) == modes[i].viewportHeight) &&
|
||||
(MONITOR_GetWidth(&MONITOR_PrimaryMonitor) == modes[i].viewportWidth) &&
|
||||
(MONITOR_GetDepth(&MONITOR_PrimaryMonitor) == modes[i].depth)
|
||||
) {
|
||||
mode_to_use = modes[i].num;
|
||||
}
|
||||
DPRINTF("\n");
|
||||
}
|
||||
if ((MONITOR_GetHeight(&MONITOR_PrimaryMonitor) == modes[i].viewportHeight) &&
|
||||
(MONITOR_GetWidth(&MONITOR_PrimaryMonitor) == modes[i].viewportWidth) &&
|
||||
(MONITOR_GetDepth(&MONITOR_PrimaryMonitor) == modes[i].depth)
|
||||
) {
|
||||
mode_to_use = modes[i].num;
|
||||
}
|
||||
}
|
||||
if (mode_to_use == 0) {
|
||||
|
@ -234,9 +233,9 @@ DGA_Create( LPDIRECTDRAW *lplpDD ) {
|
|||
}
|
||||
|
||||
/* Initialize the frame buffer */
|
||||
_DGA_Initialize_FrameBuffer(*ilplpDD, mode_to_use);
|
||||
_DGA_Initialize_FrameBuffer(*lplpDD, mode_to_use);
|
||||
/* Set the input handling for relative mouse movements */
|
||||
X11DRV_EVENT_SetInputMehod(X11DRV_INPUT_RELATIVE);
|
||||
/*X11DRV_EVENT_SetInputMehod(X11DRV_INPUT_RELATIVE);*/
|
||||
}
|
||||
#endif /* defined(HAVE_LIBXXF86DGA2) */
|
||||
return DD_OK;
|
||||
|
|
|
@ -29,6 +29,11 @@ typedef struct dga_dd_private {
|
|||
DWORD fb_memsize; /* total memory on the card */
|
||||
DWORD vpmask; /* viewports in use flag bitmap */
|
||||
DWORD version; /* DGA version */
|
||||
#ifdef HAVE_LIBXXF86DGA2
|
||||
XDGADevice *dev;
|
||||
XDGAMode *modes;
|
||||
int num_modes;
|
||||
#endif
|
||||
} dga_dd_private;
|
||||
|
||||
typedef x11_dp_private dga_dp_private; /* reuse X11 palette stuff */
|
||||
|
@ -37,4 +42,8 @@ typedef struct dga_ds_private {
|
|||
DWORD fb_height;
|
||||
} dga_ds_private;
|
||||
|
||||
#ifdef HAVE_LIBXXF86DGA2
|
||||
extern void _DGA_Initialize_FrameBuffer(IDirectDrawImpl *This, int mode);
|
||||
#endif
|
||||
|
||||
#endif /* __WINE_DDRAW_DGA_PRIVATE_H */
|
||||
|
|
|
@ -26,6 +26,7 @@ HRESULT WINAPI DGA_IDirectDrawPaletteImpl_SetEntries(
|
|||
) {
|
||||
ICOM_THIS(IDirectDrawPaletteImpl,iface);
|
||||
DPPRIVATE(This);
|
||||
DDPRIVATE(This->ddraw);
|
||||
XColor xc;
|
||||
Colormap cm;
|
||||
int i;
|
||||
|
@ -56,7 +57,6 @@ HRESULT WINAPI DGA_IDirectDrawPaletteImpl_SetEntries(
|
|||
}
|
||||
#ifdef HAVE_LIBXXF86DGA2
|
||||
if (ddpriv->version == 2) {
|
||||
DDPRIVATE(This->ddraw);
|
||||
TSXDGAInstallColormap(display,DefaultScreen(display),dppriv->cm);
|
||||
} else
|
||||
#endif /* defined(HAVE_LIBXXF86DGA2) */
|
||||
|
|
|
@ -76,6 +76,7 @@ HRESULT WINAPI DGA2_IDirectDrawSurface4Impl_Flip(
|
|||
ICOM_THIS(IDirectDrawSurface4Impl,iface);
|
||||
IDirectDrawSurface4Impl* iflipto=(IDirectDrawSurface4Impl*)flipto;
|
||||
DWORD xheight;
|
||||
DSPRIVATE(This);
|
||||
dga_ds_private *fspriv;
|
||||
LPBYTE surf;
|
||||
|
||||
|
@ -112,6 +113,7 @@ HRESULT WINAPI DGA_IDirectDrawSurface4Impl_SetPalette(
|
|||
LPDIRECTDRAWSURFACE4 iface,LPDIRECTDRAWPALETTE pal
|
||||
) {
|
||||
ICOM_THIS(IDirectDrawSurface4Impl,iface);
|
||||
DDPRIVATE(This->s.ddraw);
|
||||
IDirectDrawPaletteImpl* ipal=(IDirectDrawPaletteImpl*)pal;
|
||||
|
||||
TRACE("(%p)->(%p)\n",This,ipal);
|
||||
|
|
Loading…
Reference in a new issue