2002-03-09 23:29:33 +00:00
|
|
|
/*
|
|
|
|
* Copyright 2000-2001 TransGaming Technologies Inc.
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
*/
|
2001-01-04 22:44:55 +00:00
|
|
|
|
2000-04-09 14:30:50 +00:00
|
|
|
#ifndef __WINE_DLLS_DDRAW_DDRAW_PRIVATE_H
|
|
|
|
#define __WINE_DLLS_DDRAW_DDRAW_PRIVATE_H
|
1999-03-27 16:53:09 +00:00
|
|
|
|
2000-04-09 14:30:50 +00:00
|
|
|
/* MAY NOT CONTAIN X11 or DGA specific includes/defines/structs! */
|
1999-12-04 04:22:04 +00:00
|
|
|
|
2000-04-09 14:30:50 +00:00
|
|
|
#include "winbase.h"
|
2000-11-08 05:05:15 +00:00
|
|
|
#include "wtypes.h"
|
2000-04-09 14:30:50 +00:00
|
|
|
#include "wingdi.h"
|
1999-05-08 12:50:36 +00:00
|
|
|
#include "winuser.h"
|
2000-04-09 14:30:50 +00:00
|
|
|
#include "ddraw.h"
|
2002-12-15 01:17:59 +00:00
|
|
|
#include "d3d.h"
|
2001-01-04 22:44:55 +00:00
|
|
|
#include "ddcomimpl.h"
|
2001-04-16 19:06:13 +00:00
|
|
|
#include "ddrawi.h"
|
1999-03-27 16:53:09 +00:00
|
|
|
|
2001-01-04 22:44:55 +00:00
|
|
|
/* XXX Put this somewhere proper. */
|
|
|
|
#define DD_STRUCT_INIT(x) \
|
|
|
|
do { \
|
|
|
|
memset((x), 0, sizeof(*(x))); \
|
|
|
|
(x)->dwSize = sizeof(*x); \
|
|
|
|
} while (0)
|
1999-03-27 16:53:09 +00:00
|
|
|
|
2001-01-28 23:15:17 +00:00
|
|
|
#define DD_STRUCT_COPY_BYSIZE(to,from) \
|
|
|
|
do { \
|
2001-02-12 03:43:53 +00:00
|
|
|
DWORD __size = (to)->dwSize; \
|
|
|
|
DWORD __copysize = __size; \
|
2002-11-11 22:23:10 +00:00
|
|
|
memset(to,0,__size); \
|
2001-02-12 03:43:53 +00:00
|
|
|
if ((from)->dwSize < __size) \
|
|
|
|
__copysize = (from)->dwSize; \
|
|
|
|
memcpy(to,from,__copysize); \
|
|
|
|
(to)->dwSize = __size;/*restore size*/ \
|
2001-01-28 23:15:17 +00:00
|
|
|
} while (0)
|
|
|
|
|
1999-03-27 16:53:09 +00:00
|
|
|
/*****************************************************************************
|
2001-01-04 22:44:55 +00:00
|
|
|
* IDirectDraw implementation structure
|
1999-03-27 16:53:09 +00:00
|
|
|
*/
|
|
|
|
|
2001-01-04 22:44:55 +00:00
|
|
|
typedef struct IDirectDrawImpl IDirectDrawImpl;
|
|
|
|
typedef struct IDirectDrawPaletteImpl IDirectDrawPaletteImpl;
|
|
|
|
typedef struct IDirectDrawClipperImpl IDirectDrawClipperImpl;
|
2000-04-09 14:30:50 +00:00
|
|
|
typedef struct IDirectDrawSurfaceImpl IDirectDrawSurfaceImpl;
|
|
|
|
|
2001-01-04 22:44:55 +00:00
|
|
|
typedef void (*pixel_convert_func)(void *src, void *dst, DWORD width,
|
|
|
|
DWORD height, LONG pitch,
|
|
|
|
IDirectDrawPaletteImpl *palette);
|
1999-03-27 16:53:09 +00:00
|
|
|
|
2001-01-04 22:44:55 +00:00
|
|
|
typedef void (*palette_convert_func)(LPPALETTEENTRY palent,
|
|
|
|
void *screen_palette, DWORD start,
|
|
|
|
DWORD count);
|
1999-03-27 16:53:09 +00:00
|
|
|
|
|
|
|
struct IDirectDrawImpl
|
|
|
|
{
|
2001-01-04 22:44:55 +00:00
|
|
|
ICOM_VFIELD_MULTI(IDirectDraw7);
|
|
|
|
ICOM_VFIELD_MULTI(IDirectDraw4);
|
|
|
|
ICOM_VFIELD_MULTI(IDirectDraw2);
|
|
|
|
ICOM_VFIELD_MULTI(IDirectDraw);
|
|
|
|
|
|
|
|
DWORD ref;
|
|
|
|
|
|
|
|
/* TRUE if created via DirectDrawCreateEx or CoCreateInstance,
|
|
|
|
* FALSE if created via DirectDrawCreate. */
|
|
|
|
BOOL ex;
|
|
|
|
|
|
|
|
/* Linked list of surfaces, joined by next_ddraw in IDirectSurfaceImpl. */
|
|
|
|
IDirectDrawSurfaceImpl* surfaces;
|
|
|
|
/* Linked list of palettes, joined by next_ddraw. */
|
|
|
|
IDirectDrawPaletteImpl* palettes;
|
|
|
|
/* Linked list of clippers, joined by next_ddraw. */
|
|
|
|
IDirectDrawClipperImpl* clippers;
|
|
|
|
|
|
|
|
IDirectDrawSurfaceImpl* primary_surface;
|
|
|
|
|
2001-04-16 19:06:13 +00:00
|
|
|
DDRAWI_DIRECTDRAW_LCL local;
|
|
|
|
DDCAPS caps;
|
|
|
|
|
2001-01-04 22:44:55 +00:00
|
|
|
HWND window;
|
|
|
|
DWORD cooperative_level;
|
|
|
|
WNDPROC original_wndproc;
|
|
|
|
|
|
|
|
DWORD width, height;
|
|
|
|
LONG pitch;
|
|
|
|
DDPIXELFORMAT pixelformat;
|
|
|
|
|
|
|
|
/* Should each of these go into some structure? */
|
|
|
|
DWORD orig_width, orig_height;
|
|
|
|
LONG orig_pitch;
|
|
|
|
DDPIXELFORMAT orig_pixelformat;
|
|
|
|
|
|
|
|
/* Called when the refcount goes to 0. */
|
|
|
|
void (*final_release)(IDirectDrawImpl *This);
|
|
|
|
|
2001-04-16 19:06:13 +00:00
|
|
|
HRESULT (*set_exclusive_mode)(IDirectDrawImpl *This, DWORD dwExcl);
|
|
|
|
|
2001-01-04 22:44:55 +00:00
|
|
|
HRESULT (*create_palette)(IDirectDrawImpl* This, DWORD dwFlags,
|
|
|
|
LPDIRECTDRAWPALETTE* ppPalette,
|
|
|
|
LPUNKNOWN pUnkOuter);
|
|
|
|
|
|
|
|
/* Surface creation functions. For all of these, pOuter == NULL. */
|
|
|
|
|
|
|
|
/* Do not create any backbuffers or the flipping chain. */
|
|
|
|
HRESULT (*create_primary)(IDirectDrawImpl* This,
|
|
|
|
const DDSURFACEDESC2* pDDSD,
|
|
|
|
LPDIRECTDRAWSURFACE7* ppSurf, LPUNKNOWN pOuter);
|
|
|
|
|
|
|
|
/* Primary may be NULL if we are creating an unattached backbuffer. */
|
|
|
|
HRESULT (*create_backbuffer)(IDirectDrawImpl* This,
|
|
|
|
const DDSURFACEDESC2* pDDSD,
|
|
|
|
LPDIRECTDRAWSURFACE7* ppSurf,
|
|
|
|
LPUNKNOWN pOuter,
|
|
|
|
IDirectDrawSurfaceImpl* primary);
|
|
|
|
|
|
|
|
/* shiny happy offscreenplain surfaces */
|
|
|
|
HRESULT (*create_offscreen)(IDirectDrawImpl* This,
|
|
|
|
const DDSURFACEDESC2* pDDSD,
|
|
|
|
LPDIRECTDRAWSURFACE7* ppSurf,
|
|
|
|
LPUNKNOWN pOuter);
|
|
|
|
|
|
|
|
/* dwMipMapLevel is specified as per OpenGL. (i.e. 0 is base) */
|
|
|
|
HRESULT (*create_texture)(IDirectDrawImpl* This,
|
|
|
|
const DDSURFACEDESC2* pDDSD,
|
|
|
|
LPDIRECTDRAWSURFACE7* ppSurf, LPUNKNOWN pOuter,
|
|
|
|
DWORD dwMipMapLevel);
|
|
|
|
|
|
|
|
HRESULT (*create_zbuffer)(IDirectDrawImpl* This,
|
|
|
|
const DDSURFACEDESC2* pDDSD,
|
|
|
|
LPDIRECTDRAWSURFACE7* ppSurf, LPUNKNOWN pOuter);
|
2002-05-31 23:06:46 +00:00
|
|
|
|
2001-01-04 22:44:55 +00:00
|
|
|
LPVOID private;
|
2000-07-23 13:39:52 +00:00
|
|
|
|
2001-01-04 22:44:55 +00:00
|
|
|
/* Everything below here is still questionable. */
|
2000-07-23 13:39:52 +00:00
|
|
|
|
2001-01-04 22:44:55 +00:00
|
|
|
DDPIXELFORMAT screen_pixelformat;
|
2000-04-09 14:30:50 +00:00
|
|
|
|
2001-01-04 22:44:55 +00:00
|
|
|
int pixmap_depth;
|
|
|
|
pixel_convert_func pixel_convert;
|
|
|
|
palette_convert_func palette_convert;
|
2000-07-23 13:39:52 +00:00
|
|
|
|
2002-11-27 21:38:28 +00:00
|
|
|
/* Use to fool some too strict games */
|
|
|
|
INT32 (*allocate_memory)(IDirectDrawImpl *This, DWORD mem);
|
|
|
|
void (*free_memory)(IDirectDrawImpl *This, DWORD mem);
|
|
|
|
DWORD total_vidmem, available_vidmem;
|
|
|
|
|
|
|
|
/* This is to get the D3D object associated to this DDraw object */
|
|
|
|
struct IDirect3DImpl *d3d;
|
|
|
|
|
2001-01-04 22:44:55 +00:00
|
|
|
/* This is for the fake mainWindow */
|
|
|
|
ATOM winclass;
|
|
|
|
PAINTSTRUCT ps;
|
|
|
|
BOOL paintable;
|
2000-04-09 14:30:50 +00:00
|
|
|
};
|
2000-07-23 13:39:52 +00:00
|
|
|
|
2000-04-09 14:30:50 +00:00
|
|
|
/*****************************************************************************
|
|
|
|
* IDirectDrawPalette implementation structure
|
|
|
|
*/
|
|
|
|
struct IDirectDrawPaletteImpl
|
|
|
|
{
|
|
|
|
/* IUnknown fields */
|
2001-01-04 22:44:55 +00:00
|
|
|
ICOM_VFIELD_MULTI(IDirectDrawPalette);
|
|
|
|
DWORD ref;
|
2000-04-09 14:30:50 +00:00
|
|
|
|
2001-04-16 19:06:13 +00:00
|
|
|
DDRAWI_DDRAWPALETTE_LCL local;
|
|
|
|
DDRAWI_DDRAWPALETTE_GBL global;
|
|
|
|
|
2000-04-09 14:30:50 +00:00
|
|
|
/* IDirectDrawPalette fields */
|
2001-01-04 22:44:55 +00:00
|
|
|
HPALETTE hpal;
|
|
|
|
WORD palVersion, palNumEntries; /* LOGPALETTE */
|
2000-04-09 14:30:50 +00:00
|
|
|
PALETTEENTRY palents[256];
|
|
|
|
/* This is to store the palette in 'screen format' */
|
|
|
|
int screen_palents[256];
|
2001-01-04 22:44:55 +00:00
|
|
|
|
|
|
|
VOID (*final_release)(IDirectDrawPaletteImpl* This);
|
|
|
|
|
|
|
|
IDirectDrawImpl* ddraw_owner;
|
|
|
|
IDirectDrawPaletteImpl* prev_ddraw;
|
|
|
|
IDirectDrawPaletteImpl* next_ddraw;
|
|
|
|
|
2000-04-09 14:30:50 +00:00
|
|
|
LPVOID private;
|
|
|
|
};
|
|
|
|
|
|
|
|
/*****************************************************************************
|
|
|
|
* IDirectDrawClipper implementation structure
|
|
|
|
*/
|
|
|
|
struct IDirectDrawClipperImpl
|
|
|
|
{
|
|
|
|
/* IUnknown fields */
|
2001-01-04 22:44:55 +00:00
|
|
|
ICOM_VFIELD_MULTI(IDirectDrawClipper);
|
|
|
|
DWORD ref;
|
2000-04-09 14:30:50 +00:00
|
|
|
|
|
|
|
/* IDirectDrawClipper fields */
|
|
|
|
HWND hWnd;
|
2001-01-04 22:44:55 +00:00
|
|
|
|
|
|
|
IDirectDrawImpl* ddraw_owner;
|
|
|
|
IDirectDrawClipperImpl* prev_ddraw;
|
|
|
|
IDirectDrawClipperImpl* next_ddraw;
|
1999-03-27 16:53:09 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/*****************************************************************************
|
|
|
|
* IDirectDrawSurface implementation structure
|
|
|
|
*/
|
2001-01-04 22:44:55 +00:00
|
|
|
|
|
|
|
struct IDirectDrawSurfaceImpl
|
1999-03-27 16:53:09 +00:00
|
|
|
{
|
2001-01-04 22:44:55 +00:00
|
|
|
/* IUnknown fields */
|
|
|
|
ICOM_VFIELD_MULTI(IDirectDrawSurface7);
|
|
|
|
ICOM_VFIELD_MULTI(IDirectDrawSurface3);
|
2001-04-16 19:06:13 +00:00
|
|
|
ICOM_VFIELD_MULTI(IDirectDrawGammaControl);
|
2002-12-15 01:17:59 +00:00
|
|
|
ICOM_VFIELD_MULTI(IDirect3DTexture2);
|
|
|
|
ICOM_VFIELD_MULTI(IDirect3DTexture);
|
2001-01-04 22:44:55 +00:00
|
|
|
DWORD ref;
|
1999-07-03 11:57:29 +00:00
|
|
|
|
2001-01-04 22:44:55 +00:00
|
|
|
struct IDirectDrawSurfaceImpl* attached; /* attached surfaces */
|
1999-03-27 16:53:09 +00:00
|
|
|
|
2001-01-04 22:44:55 +00:00
|
|
|
struct IDirectDrawSurfaceImpl* next_ddraw; /* ddraw surface chain */
|
|
|
|
struct IDirectDrawSurfaceImpl* prev_ddraw;
|
|
|
|
struct IDirectDrawSurfaceImpl* next_attached; /* attached surface chain */
|
|
|
|
struct IDirectDrawSurfaceImpl* prev_attached;
|
1999-04-06 07:10:48 +00:00
|
|
|
|
2001-01-04 22:44:55 +00:00
|
|
|
IDirectDrawImpl* ddraw_owner;
|
|
|
|
IDirectDrawSurfaceImpl* surface_owner;
|
1999-03-27 16:53:09 +00:00
|
|
|
|
2001-01-04 22:44:55 +00:00
|
|
|
IDirectDrawPaletteImpl* palette; /* strong ref */
|
|
|
|
IDirectDrawClipperImpl* clipper; /* strong ref */
|
2000-04-09 14:30:50 +00:00
|
|
|
|
2001-04-16 19:06:13 +00:00
|
|
|
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;
|
|
|
|
|
2001-01-04 22:44:55 +00:00
|
|
|
DDSURFACEDESC2 surface_desc;
|
1999-03-27 16:53:09 +00:00
|
|
|
|
2001-01-04 22:44:55 +00:00
|
|
|
HDC hDC;
|
2001-09-10 23:12:16 +00:00
|
|
|
RECT lastlockrect;
|
2002-11-27 21:38:28 +00:00
|
|
|
DWORD lastlocktype;
|
2001-01-04 22:44:55 +00:00
|
|
|
BOOL dc_in_use;
|
|
|
|
|
|
|
|
HRESULT (*duplicate_surface)(IDirectDrawSurfaceImpl* src,
|
|
|
|
LPDIRECTDRAWSURFACE7* dst);
|
|
|
|
void (*final_release)(IDirectDrawSurfaceImpl *This);
|
2001-04-16 19:06:13 +00:00
|
|
|
HRESULT (*late_allocate)(IDirectDrawSurfaceImpl *This);
|
2001-01-04 22:44:55 +00:00
|
|
|
BOOL (*attach)(IDirectDrawSurfaceImpl *This, IDirectDrawSurfaceImpl *to);
|
|
|
|
BOOL (*detach)(IDirectDrawSurfaceImpl *This);
|
2001-09-10 23:12:16 +00:00
|
|
|
void (*lock_update)(IDirectDrawSurfaceImpl* This, LPCRECT pRect, DWORD dwFlags);
|
2001-01-04 22:44:55 +00:00
|
|
|
void (*unlock_update)(IDirectDrawSurfaceImpl* This, LPCRECT pRect);
|
|
|
|
void (*lose_surface)(IDirectDrawSurfaceImpl* This);
|
2001-04-16 19:06:13 +00:00
|
|
|
BOOL (*flip_data)(IDirectDrawSurfaceImpl* front,
|
|
|
|
IDirectDrawSurfaceImpl* back,
|
|
|
|
DWORD dwFlags);
|
|
|
|
void (*flip_update)(IDirectDrawSurfaceImpl* front, DWORD dwFlags);
|
2001-01-04 22:44:55 +00:00
|
|
|
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);
|
2001-04-16 19:06:13 +00:00
|
|
|
HRESULT (*get_gamma_ramp)(IDirectDrawSurfaceImpl *This, DWORD dwFlags, LPDDGAMMARAMP lpGammaRamp);
|
|
|
|
HRESULT (*set_gamma_ramp)(IDirectDrawSurfaceImpl *This, DWORD dwFlags, LPDDGAMMARAMP lpGammaRamp);
|
2001-01-04 22:44:55 +00:00
|
|
|
|
|
|
|
struct PrivateData* private_data;
|
|
|
|
|
|
|
|
DWORD max_lod;
|
|
|
|
DWORD priority;
|
|
|
|
|
|
|
|
BOOL lost;
|
|
|
|
|
|
|
|
DWORD uniqueness_value;
|
1999-03-27 16:53:09 +00:00
|
|
|
|
2000-04-09 14:30:50 +00:00
|
|
|
LPVOID private;
|
2001-01-04 22:44:55 +00:00
|
|
|
|
|
|
|
/* Everything below here is dodgy. */
|
|
|
|
/* For Direct3D use */
|
2002-11-27 21:38:28 +00:00
|
|
|
LPVOID aux_ctx, aux_data;
|
2001-01-04 22:44:55 +00:00
|
|
|
void (*aux_release)(LPVOID ctx, LPVOID data);
|
|
|
|
BOOL (*aux_flip)(LPVOID ctx, LPVOID data);
|
|
|
|
void (*aux_unlock)(LPVOID ctx, LPVOID data, LPRECT lpRect);
|
2002-12-15 01:17:59 +00:00
|
|
|
HRESULT (WINAPI *SetColorKey_cb)(struct IDirectDrawSurfaceImpl *texture, DWORD dwFlags, LPDDCOLORKEY ckey ) ;
|
2002-11-27 21:38:28 +00:00
|
|
|
/* This is to get the D3DDevice object associated to this surface */
|
|
|
|
struct IDirect3DDeviceImpl *d3ddevice;
|
2002-12-15 01:17:59 +00:00
|
|
|
LPVOID tex_private;
|
1999-03-27 16:53:09 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/*****************************************************************************
|
2001-01-04 22:44:55 +00:00
|
|
|
* Driver initialisation functions.
|
1999-03-27 16:53:09 +00:00
|
|
|
*/
|
2001-04-16 19:06:13 +00:00
|
|
|
BOOL DDRAW_HAL_Init(HINSTANCE, DWORD, LPVOID);
|
2001-01-04 22:44:55 +00:00
|
|
|
BOOL DDRAW_User_Init(HINSTANCE, DWORD, LPVOID);
|
1999-12-04 03:55:58 +00:00
|
|
|
|
2001-01-04 22:44:55 +00:00
|
|
|
typedef struct {
|
|
|
|
const DDDEVICEIDENTIFIER2* info;
|
|
|
|
int preference; /* how good we are. dga might get 100, xlib 50*/
|
|
|
|
HRESULT (*create)(const GUID*, LPDIRECTDRAW7*, LPUNKNOWN, BOOL ex);
|
1999-03-27 16:53:09 +00:00
|
|
|
|
2001-01-04 22:44:55 +00:00
|
|
|
/* For IDirectDraw7::Initialize. */
|
|
|
|
HRESULT (*init)(IDirectDrawImpl *, const GUID*);
|
|
|
|
} ddraw_driver;
|
|
|
|
|
|
|
|
void DDRAW_register_driver(const ddraw_driver*);
|
|
|
|
|
|
|
|
const ddraw_driver* DDRAW_FindDriver(const GUID* guid);
|
|
|
|
|
|
|
|
/******************************************************************************
|
|
|
|
* Random utilities
|
|
|
|
*/
|
2000-04-09 14:30:50 +00:00
|
|
|
|
|
|
|
/* Get DDSCAPS of surface (shortcutmacro) */
|
|
|
|
#define SDDSCAPS(iface) ((iface)->s.surface_desc.ddsCaps.dwCaps)
|
|
|
|
/* Get the number of bytes per pixel for a given surface */
|
2001-01-04 22:44:55 +00:00
|
|
|
#define PFGET_BPP(pf) (pf.dwFlags&DDPF_PALETTEINDEXED8?1:((pf.u1.dwRGBBitCount+7)/8))
|
|
|
|
#define GET_BPP(desc) PFGET_BPP(desc.u4.ddpfPixelFormat)
|
|
|
|
|
|
|
|
LONG DDRAW_width_bpp_to_pitch(DWORD width, DWORD bpp);
|
2000-04-09 14:30:50 +00:00
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
unsigned short bpp,depth;
|
|
|
|
unsigned int rmask,gmask,bmask;
|
|
|
|
} ConvertMode;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
void (*pixel_convert)(void *src, void *dst, DWORD width, DWORD height, LONG pitch, IDirectDrawPaletteImpl* palette);
|
|
|
|
void (*palette_convert)(LPPALETTEENTRY palent, void *screen_palette, DWORD start, DWORD count);
|
|
|
|
} ConvertFuncs;
|
1999-07-03 11:57:29 +00:00
|
|
|
|
2000-04-09 14:30:50 +00:00
|
|
|
typedef struct {
|
|
|
|
ConvertMode screen, dest;
|
|
|
|
ConvertFuncs funcs;
|
|
|
|
} Convert;
|
1999-03-27 16:53:09 +00:00
|
|
|
|
2001-01-04 22:44:55 +00:00
|
|
|
extern Convert ModeEmulations[8];
|
2000-06-13 01:06:53 +00:00
|
|
|
extern int _common_depth_to_pixelformat(DWORD depth,LPDIRECTDRAW ddraw);
|
1999-03-27 16:53:09 +00:00
|
|
|
|
2001-01-04 22:44:55 +00:00
|
|
|
/******************************************************************************
|
|
|
|
* Structure conversion (for thunks)
|
|
|
|
*/
|
|
|
|
void DDRAW_Convert_DDSCAPS_1_To_2(const DDSCAPS* pIn, DDSCAPS2* pOut);
|
2001-02-14 00:28:02 +00:00
|
|
|
void DDRAW_Convert_DDDEVICEIDENTIFIER_2_To_1(const DDDEVICEIDENTIFIER2* pIn,
|
|
|
|
DDDEVICEIDENTIFIER* pOut);
|
2000-04-09 14:30:50 +00:00
|
|
|
|
|
|
|
/******************************************************************************
|
|
|
|
* Debugging / Flags output functions
|
|
|
|
*/
|
2001-01-04 22:44:55 +00:00
|
|
|
extern void DDRAW_dump_DDBLTFX(DWORD flagmask);
|
|
|
|
extern void DDRAW_dump_DDBLTFAST(DWORD flagmask);
|
|
|
|
extern void DDRAW_dump_DDBLT(DWORD flagmask);
|
2002-11-11 22:23:10 +00:00
|
|
|
extern void DDRAW_dump_DDSCAPS(const DDSCAPS *in);
|
|
|
|
extern void DDRAW_dump_DDSCAPS2(const DDSCAPS2 *in);
|
2001-01-04 22:44:55 +00:00
|
|
|
extern void DDRAW_dump_pixelformat_flag(DWORD flagmask);
|
|
|
|
extern void DDRAW_dump_paletteformat(DWORD dwFlags);
|
|
|
|
extern void DDRAW_dump_pixelformat(const DDPIXELFORMAT *in);
|
|
|
|
extern void DDRAW_dump_colorkeyflag(DWORD ck);
|
|
|
|
extern void DDRAW_dump_surface_desc(const DDSURFACEDESC2 *lpddsd);
|
|
|
|
extern void DDRAW_dump_cooperativelevel(DWORD cooplevel);
|
2002-11-25 02:42:04 +00:00
|
|
|
extern void DDRAW_dump_lockflag(DWORD lockflag);
|
2001-01-04 22:44:55 +00:00
|
|
|
extern void DDRAW_dump_DDCOLORKEY(const DDCOLORKEY *in);
|
2002-07-16 01:16:14 +00:00
|
|
|
extern void DDRAW_dump_DDCAPS(const DDCAPS *lpcaps);
|
2002-11-30 19:06:52 +00:00
|
|
|
|
|
|
|
/* Used for generic dumping */
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
DWORD val;
|
|
|
|
const char* name;
|
|
|
|
} flag_info;
|
|
|
|
|
|
|
|
#define FE(x) { x, #x }
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
DWORD val;
|
|
|
|
const char* name;
|
|
|
|
void (*func)(const void *);
|
|
|
|
ptrdiff_t offset;
|
|
|
|
} member_info;
|
|
|
|
|
|
|
|
#define DDRAW_dump_flags(flags,names,num_names) DDRAW_dump_flags_(flags, names, num_names, 1)
|
|
|
|
#define ME(x,f,e) { x, #x, (void (*)(const void *))(f), offsetof(STRUCT, e) }
|
|
|
|
|
|
|
|
extern void DDRAW_dump_flags_(DWORD flags, const flag_info* names, size_t num_names, int newline);
|
|
|
|
extern void DDRAW_dump_members(DWORD flags, const void* data, const member_info* mems, size_t num_mems);
|
|
|
|
|
2000-04-09 14:30:50 +00:00
|
|
|
#endif /* __WINE_DLLS_DDRAW_DDRAW_PRIVATE_H */
|