Commit 4ef92519 authored by Lionel Ulmer's avatar Lionel Ulmer Committed by Alexandre Julliard

- added a dump of the palette creation flags

- changed palette creation code in vga.c to prevent useless error message
parent e3728cd2
...@@ -232,6 +232,7 @@ static void _dump_DDBLT(DWORD flagmask) { ...@@ -232,6 +232,7 @@ static void _dump_DDBLT(DWORD flagmask) {
for (i=0;i<sizeof(flags)/sizeof(flags[0]);i++) for (i=0;i<sizeof(flags)/sizeof(flags[0]);i++)
if (flags[i].mask & flagmask) if (flags[i].mask & flagmask)
DUMP("%s ",flags[i].name); DUMP("%s ",flags[i].name);
DUMP("\n");
} }
static void _dump_DDSCAPS(DWORD flagmask) { static void _dump_DDSCAPS(DWORD flagmask) {
...@@ -335,6 +336,31 @@ static void _dump_DDCOLORKEY(DWORD flagmask) { ...@@ -335,6 +336,31 @@ static void _dump_DDCOLORKEY(DWORD flagmask) {
DUMP("\n"); DUMP("\n");
} }
static void _dump_paletteformat(DWORD dwFlags) {
int i;
const struct {
DWORD mask;
char *name;
} flags[] = {
#define FE(x) { x, #x},
FE(DDPCAPS_4BIT)
FE(DDPCAPS_8BITENTRIES)
FE(DDPCAPS_8BIT)
FE(DDPCAPS_INITIALIZE)
FE(DDPCAPS_PRIMARYSURFACE)
FE(DDPCAPS_PRIMARYSURFACELEFT)
FE(DDPCAPS_ALLOW256)
FE(DDPCAPS_VSYNC)
FE(DDPCAPS_1BIT)
FE(DDPCAPS_2BIT)
FE(DDPCAPS_ALPHA)
};
for (i=0;i<sizeof(flags)/sizeof(flags[0]);i++)
if (flags[i].mask & dwFlags)
DUMP("%s ",flags[i].name);
DUMP("\n");
}
static void _dump_pixelformat(LPDDPIXELFORMAT pf) { static void _dump_pixelformat(LPDDPIXELFORMAT pf) {
DUMP("Size : %ld\n", pf->dwSize); DUMP("Size : %ld\n", pf->dwSize);
if (pf->dwFlags) if (pf->dwFlags)
...@@ -2792,6 +2818,9 @@ static HRESULT WINAPI common_IDirectDraw2_CreatePalette( ...@@ -2792,6 +2818,9 @@ static HRESULT WINAPI common_IDirectDraw2_CreatePalette(
) { ) {
int size = 0; int size = 0;
if (TRACE_ON(ddraw))
_dump_paletteformat(dwFlags);
*lpddpal = (LPDIRECTDRAWPALETTE)HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(IDirectDrawPalette)); *lpddpal = (LPDIRECTDRAWPALETTE)HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(IDirectDrawPalette));
if (*lpddpal == NULL) return E_OUTOFMEMORY; if (*lpddpal == NULL) return E_OUTOFMEMORY;
(*lpddpal)->ref = 1; (*lpddpal)->ref = 1;
......
...@@ -36,7 +36,7 @@ int VGA_SetMode(unsigned Xres,unsigned Yres,unsigned Depth) ...@@ -36,7 +36,7 @@ int VGA_SetMode(unsigned Xres,unsigned Yres,unsigned Depth)
lpddraw=NULL; lpddraw=NULL;
return 1; return 1;
} }
lpddraw->lpvtbl->fnCreatePalette(lpddraw,0,NULL,&lpddpal,NULL); lpddraw->lpvtbl->fnCreatePalette(lpddraw,DDPCAPS_8BIT,NULL,&lpddpal,NULL);
memset(&sdesc,0,sizeof(sdesc)); memset(&sdesc,0,sizeof(sdesc));
sdesc.dwSize=sizeof(sdesc); sdesc.dwSize=sizeof(sdesc);
sdesc.dwFlags = DDSD_CAPS; sdesc.dwFlags = DDSD_CAPS;
......
...@@ -557,6 +557,7 @@ typedef struct _DDPIXELFORMAT { ...@@ -557,6 +557,7 @@ typedef struct _DDPIXELFORMAT {
#define DDPCAPS_VSYNC 0x00000080 #define DDPCAPS_VSYNC 0x00000080
#define DDPCAPS_1BIT 0x00000100 #define DDPCAPS_1BIT 0x00000100
#define DDPCAPS_2BIT 0x00000200 #define DDPCAPS_2BIT 0x00000200
#define DDPCAPS_ALPHA 0x00000400
/* DDCAPS.dwSVCaps */ /* DDCAPS.dwSVCaps */
#define DDSVCAPS_ENIGMA 0x00000001l #define DDSVCAPS_ENIGMA 0x00000001l
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment