Added ddraw HAL and gamma ramp stuff to implementation structures.
Added a parameter and return value to flip_data and flip_update.
This commit is contained in:
parent
6cba8bf47f
commit
01b9436018
|
@ -1,4 +1,4 @@
|
|||
/* Copyright 2000 TransGaming Technologies Inc. */
|
||||
/* Copyright 2000-2001 TransGaming Technologies Inc. */
|
||||
|
||||
#ifndef __WINE_DLLS_DDRAW_DDRAW_PRIVATE_H
|
||||
#define __WINE_DLLS_DDRAW_DDRAW_PRIVATE_H
|
||||
|
@ -11,6 +11,7 @@
|
|||
#include "winuser.h"
|
||||
#include "ddraw.h"
|
||||
#include "ddcomimpl.h"
|
||||
#include "ddrawi.h"
|
||||
|
||||
/* XXX Put this somewhere proper. */
|
||||
#define DD_STRUCT_INIT(x) \
|
||||
|
@ -68,6 +69,9 @@ struct IDirectDrawImpl
|
|||
|
||||
IDirectDrawSurfaceImpl* primary_surface;
|
||||
|
||||
DDRAWI_DIRECTDRAW_LCL local;
|
||||
DDCAPS caps;
|
||||
|
||||
HWND window;
|
||||
DWORD cooperative_level;
|
||||
WNDPROC original_wndproc;
|
||||
|
@ -84,6 +88,8 @@ struct IDirectDrawImpl
|
|||
/* Called when the refcount goes to 0. */
|
||||
void (*final_release)(IDirectDrawImpl *This);
|
||||
|
||||
HRESULT (*set_exclusive_mode)(IDirectDrawImpl *This, DWORD dwExcl);
|
||||
|
||||
HRESULT (*create_palette)(IDirectDrawImpl* This, DWORD dwFlags,
|
||||
LPDIRECTDRAWPALETTE* ppPalette,
|
||||
LPUNKNOWN pUnkOuter);
|
||||
|
@ -144,6 +150,9 @@ struct IDirectDrawPaletteImpl
|
|||
ICOM_VFIELD_MULTI(IDirectDrawPalette);
|
||||
DWORD ref;
|
||||
|
||||
DDRAWI_DDRAWPALETTE_LCL local;
|
||||
DDRAWI_DDRAWPALETTE_GBL global;
|
||||
|
||||
/* IDirectDrawPalette fields */
|
||||
DWORD flags;
|
||||
HPALETTE hpal;
|
||||
|
@ -187,6 +196,7 @@ struct IDirectDrawSurfaceImpl
|
|||
/* IUnknown fields */
|
||||
ICOM_VFIELD_MULTI(IDirectDrawSurface7);
|
||||
ICOM_VFIELD_MULTI(IDirectDrawSurface3);
|
||||
ICOM_VFIELD_MULTI(IDirectDrawGammaControl);
|
||||
DWORD ref;
|
||||
|
||||
struct IDirectDrawSurfaceImpl* attached; /* attached surfaces */
|
||||
|
@ -202,6 +212,14 @@ struct IDirectDrawSurfaceImpl
|
|||
IDirectDrawPaletteImpl* palette; /* strong ref */
|
||||
IDirectDrawClipperImpl* clipper; /* strong ref */
|
||||
|
||||
DDRAWI_DDRAWSURFACE_LCL local;
|
||||
DDRAWI_DDRAWSURFACE_MORE more;
|
||||
/* FIXME: since Flip should swap the GBL structures, they should
|
||||
* probably not be embedded into the IDirectDrawSurfaceImpl structure... */
|
||||
LPDDRAWI_DDRAWSURFACE_GBL_MORE gmore;
|
||||
DDRAWI_DDRAWSURFACE_GBL global;
|
||||
DDRAWI_DDRAWSURFACE_GBL_MORE global_more;
|
||||
|
||||
DDSURFACEDESC2 surface_desc;
|
||||
|
||||
HDC hDC;
|
||||
|
@ -210,20 +228,24 @@ struct IDirectDrawSurfaceImpl
|
|||
HRESULT (*duplicate_surface)(IDirectDrawSurfaceImpl* src,
|
||||
LPDIRECTDRAWSURFACE7* dst);
|
||||
void (*final_release)(IDirectDrawSurfaceImpl *This);
|
||||
HRESULT (*late_allocate)(IDirectDrawSurfaceImpl *This);
|
||||
BOOL (*attach)(IDirectDrawSurfaceImpl *This, IDirectDrawSurfaceImpl *to);
|
||||
BOOL (*detach)(IDirectDrawSurfaceImpl *This);
|
||||
void (*lock_update)(IDirectDrawSurfaceImpl* This, LPCRECT pRect);
|
||||
void (*unlock_update)(IDirectDrawSurfaceImpl* This, LPCRECT pRect);
|
||||
void (*lose_surface)(IDirectDrawSurfaceImpl* This);
|
||||
void (*flip_data)(IDirectDrawSurfaceImpl* front,
|
||||
IDirectDrawSurfaceImpl* back);
|
||||
void (*flip_update)(IDirectDrawSurfaceImpl* front);
|
||||
BOOL (*flip_data)(IDirectDrawSurfaceImpl* front,
|
||||
IDirectDrawSurfaceImpl* back,
|
||||
DWORD dwFlags);
|
||||
void (*flip_update)(IDirectDrawSurfaceImpl* front, DWORD dwFlags);
|
||||
HRESULT (*get_dc)(IDirectDrawSurfaceImpl* This, HDC* phDC);
|
||||
HRESULT (*release_dc)(IDirectDrawSurfaceImpl* This, HDC hDC);
|
||||
void (*set_palette)(IDirectDrawSurfaceImpl* This, IDirectDrawPaletteImpl* pal);
|
||||
void (*update_palette)(IDirectDrawSurfaceImpl* This, IDirectDrawPaletteImpl* pal,
|
||||
DWORD dwStart, DWORD dwCount, LPPALETTEENTRY palent);
|
||||
HWND (*get_display_window)(IDirectDrawSurfaceImpl *This);
|
||||
HRESULT (*get_gamma_ramp)(IDirectDrawSurfaceImpl *This, DWORD dwFlags, LPDDGAMMARAMP lpGammaRamp);
|
||||
HRESULT (*set_gamma_ramp)(IDirectDrawSurfaceImpl *This, DWORD dwFlags, LPDDGAMMARAMP lpGammaRamp);
|
||||
|
||||
struct PrivateData* private_data;
|
||||
|
||||
|
@ -249,6 +271,7 @@ struct IDirectDrawSurfaceImpl
|
|||
/*****************************************************************************
|
||||
* Driver initialisation functions.
|
||||
*/
|
||||
BOOL DDRAW_HAL_Init(HINSTANCE, DWORD, LPVOID);
|
||||
BOOL DDRAW_User_Init(HINSTANCE, DWORD, LPVOID);
|
||||
|
||||
typedef struct {
|
||||
|
|
|
@ -159,8 +159,9 @@ HRESULT XF86DGA2_DirectDrawSurface_duplicate_surface(IDirectDrawSurfaceImpl* Thi
|
|||
&This->surface_desc, ppDup, NULL);
|
||||
}
|
||||
|
||||
void XF86DGA2_DirectDrawSurface_flip_data(IDirectDrawSurfaceImpl* front,
|
||||
IDirectDrawSurfaceImpl* back)
|
||||
BOOL XF86DGA2_DirectDrawSurface_flip_data(IDirectDrawSurfaceImpl* front,
|
||||
IDirectDrawSurfaceImpl* back,
|
||||
DWORD dwFlags)
|
||||
{
|
||||
XF86DGA2_PRIV_VAR(front_priv, front);
|
||||
XF86DGA2_PRIV_VAR(back_priv, back);
|
||||
|
@ -178,10 +179,10 @@ void XF86DGA2_DirectDrawSurface_flip_data(IDirectDrawSurfaceImpl* front,
|
|||
back_priv->xf86dga2.fb_addr = tmp;
|
||||
}
|
||||
|
||||
DIB_DirectDrawSurface_flip_data(front, back);
|
||||
return DIB_DirectDrawSurface_flip_data(front, back, dwFlags);
|
||||
}
|
||||
|
||||
void XF86DGA2_DirectDrawSurface_flip_update(IDirectDrawSurfaceImpl* This)
|
||||
void XF86DGA2_DirectDrawSurface_flip_update(IDirectDrawSurfaceImpl* This, DWORD dwFlags)
|
||||
{
|
||||
XF86DGA2_PRIV_VAR(priv, This);
|
||||
|
||||
|
|
|
@ -42,9 +42,10 @@ void XF86DGA2_DirectDrawSurface_update_palette(IDirectDrawSurfaceImpl* This,
|
|||
LPPALETTEENTRY palent);
|
||||
HRESULT XF86DGA2_DirectDrawSurface_duplicate_surface(IDirectDrawSurfaceImpl* This,
|
||||
LPDIRECTDRAWSURFACE7* ppDup);
|
||||
void XF86DGA2_DirectDrawSurface_flip_data(IDirectDrawSurfaceImpl* front,
|
||||
IDirectDrawSurfaceImpl* back);
|
||||
void XF86DGA2_DirectDrawSurface_flip_update(IDirectDrawSurfaceImpl* This);
|
||||
BOOL XF86DGA2_DirectDrawSurface_flip_data(IDirectDrawSurfaceImpl* front,
|
||||
IDirectDrawSurfaceImpl* back,
|
||||
DWORD dwFlags);
|
||||
void XF86DGA2_DirectDrawSurface_flip_update(IDirectDrawSurfaceImpl* This, DWORD dwFlags);
|
||||
HWND XF86DGA2_DirectDrawSurface_get_display_window(IDirectDrawSurfaceImpl* This);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -662,14 +662,14 @@ error:
|
|||
/* EnumAttachedSurfaces: generic */
|
||||
/* EnumOverlayZOrders: generic, unimplemented */
|
||||
|
||||
void DIB_DirectDrawSurface_flip_data(IDirectDrawSurfaceImpl* front,
|
||||
IDirectDrawSurfaceImpl* back)
|
||||
BOOL DIB_DirectDrawSurface_flip_data(IDirectDrawSurfaceImpl* front,
|
||||
IDirectDrawSurfaceImpl* back,
|
||||
DWORD dwFlags)
|
||||
{
|
||||
DIB_DirectDrawSurfaceImpl* front_priv = front->private;
|
||||
DIB_DirectDrawSurfaceImpl* back_priv = back->private;
|
||||
|
||||
TRACE("(%p,%p)\n",front,back);
|
||||
Main_DirectDrawSurface_flip_data(front, back);
|
||||
|
||||
{
|
||||
HBITMAP tmp;
|
||||
|
@ -696,6 +696,8 @@ void DIB_DirectDrawSurface_flip_data(IDirectDrawSurfaceImpl* front,
|
|||
front_priv->dib.client_memory = back_priv->dib.client_memory;
|
||||
back_priv->dib.client_memory = tmp;
|
||||
}
|
||||
|
||||
return Main_DirectDrawSurface_flip_data(front, back, dwFlags);
|
||||
}
|
||||
|
||||
/* Flip: generic */
|
||||
|
|
|
@ -34,8 +34,9 @@ DIB_DirectDrawSurface_Create(IDirectDrawImpl *pDD,
|
|||
IUnknown *pUnkOuter);
|
||||
|
||||
void DIB_DirectDrawSurface_final_release(IDirectDrawSurfaceImpl* This);
|
||||
void DIB_DirectDrawSurface_flip_data(IDirectDrawSurfaceImpl* front,
|
||||
IDirectDrawSurfaceImpl* back);
|
||||
BOOL DIB_DirectDrawSurface_flip_data(IDirectDrawSurfaceImpl* front,
|
||||
IDirectDrawSurfaceImpl* back,
|
||||
DWORD dwFlags);
|
||||
|
||||
void DIB_DirectDrawSurface_set_palette(IDirectDrawSurfaceImpl* This,
|
||||
IDirectDrawPaletteImpl* pal);
|
||||
|
|
|
@ -316,8 +316,9 @@ Main_DirectDrawSurface_EnumOverlayZOrders(LPDIRECTDRAWSURFACE7 iface,
|
|||
return DD_OK;
|
||||
}
|
||||
|
||||
void Main_DirectDrawSurface_flip_data(IDirectDrawSurfaceImpl* front,
|
||||
IDirectDrawSurfaceImpl* back)
|
||||
BOOL Main_DirectDrawSurface_flip_data(IDirectDrawSurfaceImpl* front,
|
||||
IDirectDrawSurfaceImpl* back,
|
||||
DWORD dwFlags)
|
||||
{
|
||||
/* uniqueness_value? */
|
||||
/* This is necessary. But is it safe? */
|
||||
|
@ -332,6 +333,8 @@ void Main_DirectDrawSurface_flip_data(IDirectDrawSurfaceImpl* front,
|
|||
front->dc_in_use = back->dc_in_use;
|
||||
back->dc_in_use = tmp;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
HRESULT WINAPI
|
||||
|
@ -398,8 +401,8 @@ Main_DirectDrawSurface_Flip(LPDIRECTDRAWSURFACE7 iface,
|
|||
}
|
||||
|
||||
TRACE("flip to backbuffer: %p\n",target);
|
||||
This->flip_data(This, target);
|
||||
This->flip_update(This);
|
||||
if (This->flip_data(This, target, dwFlags))
|
||||
This->flip_update(This, dwFlags);
|
||||
|
||||
return DD_OK;
|
||||
}
|
||||
|
|
|
@ -57,8 +57,9 @@ Main_DirectDrawSurface_update_palette(IDirectDrawSurfaceImpl* This,
|
|||
HWND
|
||||
Main_DirectDrawSurface_get_display_window(IDirectDrawSurfaceImpl* This);
|
||||
|
||||
void Main_DirectDrawSurface_flip_data(IDirectDrawSurfaceImpl* front,
|
||||
IDirectDrawSurfaceImpl* back);
|
||||
BOOL Main_DirectDrawSurface_flip_data(IDirectDrawSurfaceImpl* front,
|
||||
IDirectDrawSurfaceImpl* back,
|
||||
DWORD dwFlags);
|
||||
|
||||
#define CHECK_LOST(This) \
|
||||
do { \
|
||||
|
|
|
@ -6,9 +6,9 @@
|
|||
#include "ddraw.h"
|
||||
#include "winerror.h"
|
||||
|
||||
#include "ddcomimpl.h"
|
||||
#include "dsurface/main.h"
|
||||
#include "dsurface/thunks.h"
|
||||
#include "ddcomimpl.h"
|
||||
|
||||
#define CONVERT(pdds) COM_INTERFACE_CAST(IDirectDrawSurfaceImpl, \
|
||||
IDirectDrawSurface3, \
|
||||
|
|
|
@ -205,8 +205,9 @@ HRESULT User_DirectDrawSurface_duplicate_surface(IDirectDrawSurfaceImpl* This,
|
|||
&This->surface_desc, ppDup, NULL);
|
||||
}
|
||||
|
||||
void User_DirectDrawSurface_flip_data(IDirectDrawSurfaceImpl* front,
|
||||
IDirectDrawSurfaceImpl* back)
|
||||
BOOL User_DirectDrawSurface_flip_data(IDirectDrawSurfaceImpl* front,
|
||||
IDirectDrawSurfaceImpl* back,
|
||||
DWORD dwFlags)
|
||||
{
|
||||
USER_PRIV_VAR(front_priv, front);
|
||||
USER_PRIV_VAR(back_priv, back);
|
||||
|
@ -218,10 +219,10 @@ void User_DirectDrawSurface_flip_data(IDirectDrawSurfaceImpl* front,
|
|||
back_priv->user.cached_dc = tmp;
|
||||
}
|
||||
|
||||
DIB_DirectDrawSurface_flip_data(front, back);
|
||||
return DIB_DirectDrawSurface_flip_data(front, back, dwFlags);
|
||||
}
|
||||
|
||||
void User_DirectDrawSurface_flip_update(IDirectDrawSurfaceImpl* This)
|
||||
void User_DirectDrawSurface_flip_update(IDirectDrawSurfaceImpl* This, DWORD dwFlags)
|
||||
{
|
||||
#ifdef SYNC_UPDATE
|
||||
assert(This->surface_desc.ddsCaps.dwCaps & DDSCAPS_PRIMARYSURFACE);
|
||||
|
|
|
@ -46,9 +46,11 @@ void User_DirectDrawSurface_update_palette(IDirectDrawSurfaceImpl* This,
|
|||
LPPALETTEENTRY palent);
|
||||
HRESULT User_DirectDrawSurface_duplicate_surface(IDirectDrawSurfaceImpl* This,
|
||||
LPDIRECTDRAWSURFACE7* ppDup);
|
||||
void User_DirectDrawSurface_flip_data(IDirectDrawSurfaceImpl* front,
|
||||
IDirectDrawSurfaceImpl* back);
|
||||
void User_DirectDrawSurface_flip_update(IDirectDrawSurfaceImpl* This);
|
||||
BOOL User_DirectDrawSurface_flip_data(IDirectDrawSurfaceImpl* front,
|
||||
IDirectDrawSurfaceImpl* back,
|
||||
DWORD dwFlags);
|
||||
void User_DirectDrawSurface_flip_update(IDirectDrawSurfaceImpl* This,
|
||||
DWORD dwFlags);
|
||||
HWND User_DirectDrawSurface_get_display_window(IDirectDrawSurfaceImpl* This);
|
||||
|
||||
HRESULT User_DirectDrawSurface_get_dc(IDirectDrawSurfaceImpl* This, HDC* phDC);
|
||||
|
|
Loading…
Reference in New Issue