ddraw_private patch
Ove Kaaven
ovehk at ping.uio.no
Sun Apr 15 15:55:08 CDT 2001
I guess it's easiest if I submit the (non-3D-related) ddraw_private.h
modifications first... most of the rest will have to wait until this is
committed, I think.
Log:
Ove Kaaven <ovek at transgaming.com>
Added ddraw HAL and gamma ramp stuff to implementation structures.
Added a parameter and return value to flip_data and flip_update.
Index: dlls/ddraw/ddraw_private.h
===================================================================
RCS file: /home/wine/wine/dlls/ddraw/ddraw_private.h,v
retrieving revision 1.17
diff -u -r1.17 ddraw_private.h
--- dlls/ddraw/ddraw_private.h 2001/02/14 00:28:02 1.17
+++ dlls/ddraw/ddraw_private.h 2001/04/15 20:29:57
@@ -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 @@
IDirectDrawSurfaceImpl* primary_surface;
+ DDRAWI_DIRECTDRAW_LCL local;
+ DDCAPS caps;
+
HWND window;
DWORD cooperative_level;
WNDPROC original_wndproc;
@@ -84,6 +88,8 @@
/* 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 @@
ICOM_VFIELD_MULTI(IDirectDrawPalette);
DWORD ref;
+ DDRAWI_DDRAWPALETTE_LCL local;
+ DDRAWI_DDRAWPALETTE_GBL global;
+
/* IDirectDrawPalette fields */
DWORD flags;
HPALETTE hpal;
@@ -187,6 +196,7 @@
/* 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 @@
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 @@
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 @@
/*****************************************************************************
* Driver initialisation functions.
*/
+BOOL DDRAW_HAL_Init(HINSTANCE, DWORD, LPVOID);
BOOL DDRAW_User_Init(HINSTANCE, DWORD, LPVOID);
typedef struct {
Index: dlls/ddraw/dsurface/dga2.c
===================================================================
RCS file: /home/wine/wine/dlls/ddraw/dsurface/dga2.c,v
retrieving revision 1.6
diff -u -r1.6 dga2.c
--- dlls/ddraw/dsurface/dga2.c 2001/01/04 22:44:56 1.6
+++ dlls/ddraw/dsurface/dga2.c 2001/04/15 20:29:57
@@ -159,8 +159,9 @@
&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 @@
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);
Index: dlls/ddraw/dsurface/dga2.h
===================================================================
RCS file: /home/wine/wine/dlls/ddraw/dsurface/dga2.h,v
retrieving revision 1.1
diff -u -r1.1 dga2.h
--- dlls/ddraw/dsurface/dga2.h 2001/01/04 22:44:56 1.1
+++ dlls/ddraw/dsurface/dga2.h 2001/04/15 20:29:57
@@ -42,9 +42,10 @@
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
Index: dlls/ddraw/dsurface/dib.c
===================================================================
RCS file: /home/wine/wine/dlls/ddraw/dsurface/dib.c,v
retrieving revision 1.2
diff -u -r1.2 dib.c
--- dlls/ddraw/dsurface/dib.c 2001/01/26 20:43:42 1.2
+++ dlls/ddraw/dsurface/dib.c 2001/04/15 20:29:58
@@ -662,14 +662,14 @@
/* 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 @@
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 */
Index: dlls/ddraw/dsurface/dib.h
===================================================================
RCS file: /home/wine/wine/dlls/ddraw/dsurface/dib.h,v
retrieving revision 1.1
diff -u -r1.1 dib.h
--- dlls/ddraw/dsurface/dib.h 2001/01/04 22:44:56 1.1
+++ dlls/ddraw/dsurface/dib.h 2001/04/15 20:29:58
@@ -34,8 +34,9 @@
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);
Index: dlls/ddraw/dsurface/main.c
===================================================================
RCS file: /home/wine/wine/dlls/ddraw/dsurface/main.c,v
retrieving revision 1.18
diff -u -r1.18 main.c
--- dlls/ddraw/dsurface/main.c 2001/02/12 03:43:53 1.18
+++ dlls/ddraw/dsurface/main.c 2001/04/15 20:29:59
@@ -316,8 +316,9 @@
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 @@
front->dc_in_use = back->dc_in_use;
back->dc_in_use = tmp;
}
+
+ return TRUE;
}
HRESULT WINAPI
@@ -398,8 +401,8 @@
}
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;
}
Index: dlls/ddraw/dsurface/main.h
===================================================================
RCS file: /home/wine/wine/dlls/ddraw/dsurface/main.h,v
retrieving revision 1.1
diff -u -r1.1 main.h
--- dlls/ddraw/dsurface/main.h 2001/01/04 22:44:56 1.1
+++ dlls/ddraw/dsurface/main.h 2001/04/15 20:29:59
@@ -57,8 +57,9 @@
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 { \
Index: dlls/ddraw/dsurface/thunks.c
===================================================================
RCS file: /home/wine/wine/dlls/ddraw/dsurface/thunks.c,v
retrieving revision 1.2
diff -u -r1.2 thunks.c
--- dlls/ddraw/dsurface/thunks.c 2001/01/12 23:18:22 1.2
+++ dlls/ddraw/dsurface/thunks.c 2001/04/15 20:29:59
@@ -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, \
Index: dlls/ddraw/dsurface/user.c
===================================================================
RCS file: /home/wine/wine/dlls/ddraw/dsurface/user.c,v
retrieving revision 1.3
diff -u -r1.3 user.c
--- dlls/ddraw/dsurface/user.c 2001/01/26 20:43:42 1.3
+++ dlls/ddraw/dsurface/user.c 2001/04/15 20:29:59
@@ -205,8 +205,9 @@
&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 @@
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);
Index: dlls/ddraw/dsurface/user.h
===================================================================
RCS file: /home/wine/wine/dlls/ddraw/dsurface/user.h,v
retrieving revision 1.1
diff -u -r1.1 user.h
--- dlls/ddraw/dsurface/user.h 2001/01/04 22:44:56 1.1
+++ dlls/ddraw/dsurface/user.h 2001/04/15 20:29:59
@@ -46,9 +46,11 @@
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);
More information about the wine-patches
mailing list