Removed the flags fields of IDirectDrawPaletteImpl, as we should use

the dwFlags field of DDRAWI_DDRAWPALETTE_GBL structure instead.
This commit is contained in:
Ove Kaaven 2002-07-10 03:05:43 +00:00 committed by Alexandre Julliard
parent ea20614e39
commit 1d8f92c88c
3 changed files with 8 additions and 9 deletions

View File

@ -169,7 +169,6 @@ struct IDirectDrawPaletteImpl
DDRAWI_DDRAWPALETTE_GBL global; DDRAWI_DDRAWPALETTE_GBL global;
/* IDirectDrawPalette fields */ /* IDirectDrawPalette fields */
DWORD flags;
HPALETTE hpal; HPALETTE hpal;
WORD palVersion, palNumEntries; /* LOGPALETTE */ WORD palVersion, palNumEntries; /* LOGPALETTE */
PALETTEENTRY palents[256]; PALETTEENTRY palents[256];

View File

@ -49,7 +49,6 @@ HRESULT Main_DirectDrawPalette_Construct(IDirectDrawPaletteImpl* This,
if (dwFlags & DDPCAPS_8BITENTRIES) if (dwFlags & DDPCAPS_8BITENTRIES)
WARN("creating palette with 8 bit entries\n"); WARN("creating palette with 8 bit entries\n");
This->flags = dwFlags;
This->palNumEntries = Main_DirectDrawPalette_Size(dwFlags); This->palNumEntries = Main_DirectDrawPalette_Size(dwFlags);
This->ref = 1; This->ref = 1;
@ -57,6 +56,7 @@ HRESULT Main_DirectDrawPalette_Construct(IDirectDrawPaletteImpl* This,
This->local.lpDD_lcl = &pDD->local; This->local.lpDD_lcl = &pDD->local;
This->global.lpDD_lcl = &pDD->local; This->global.lpDD_lcl = &pDD->local;
This->global.dwProcessId = GetCurrentProcessId(); This->global.dwProcessId = GetCurrentProcessId();
This->global.dwFlags = dwFlags;
This->final_release = Main_DirectDrawPalette_final_release; This->final_release = Main_DirectDrawPalette_final_release;
ICOM_INIT_INTERFACE(This, IDirectDrawPalette, DDRAW_Main_Palette_VTable); ICOM_INIT_INTERFACE(This, IDirectDrawPalette, DDRAW_Main_Palette_VTable);
@ -116,10 +116,10 @@ Main_DirectDrawPalette_GetEntries(LPDIRECTDRAWPALETTE iface, DWORD dwFlags,
palent); palent);
if (dwFlags != 0) return DDERR_INVALIDPARAMS; /* unchecked */ if (dwFlags != 0) return DDERR_INVALIDPARAMS; /* unchecked */
if (dwStart + dwCount > Main_DirectDrawPalette_Size(This->flags)) if (dwStart + dwCount > Main_DirectDrawPalette_Size(This->global.dwFlags))
return DDERR_INVALIDPARAMS; return DDERR_INVALIDPARAMS;
if (This->flags & DDPCAPS_8BITENTRIES) if (This->global.dwFlags & DDPCAPS_8BITENTRIES)
{ {
int i; int i;
LPBYTE entry = (LPBYTE)palent; LPBYTE entry = (LPBYTE)palent;
@ -143,7 +143,7 @@ Main_DirectDrawPalette_SetEntries(LPDIRECTDRAWPALETTE iface, DWORD dwFlags,
TRACE("(%p)->SetEntries(%08lx,%ld,%ld,%p)\n",This,dwFlags,dwStart,dwCount, TRACE("(%p)->SetEntries(%08lx,%ld,%ld,%p)\n",This,dwFlags,dwStart,dwCount,
palent); palent);
if (This->flags & DDPCAPS_8BITENTRIES) if (This->global.dwFlags & DDPCAPS_8BITENTRIES)
{ {
int i; int i;
const BYTE* entry = (const BYTE*)palent; const BYTE* entry = (const BYTE*)palent;
@ -157,7 +157,7 @@ Main_DirectDrawPalette_SetEntries(LPDIRECTDRAWPALETTE iface, DWORD dwFlags,
if (This->hpal) if (This->hpal)
SetPaletteEntries(This->hpal, dwStart, dwCount, This->palents+dwStart); SetPaletteEntries(This->hpal, dwStart, dwCount, This->palents+dwStart);
if (This->flags & DDPCAPS_PRIMARYSURFACE) { if (This->global.dwFlags & DDPCAPS_PRIMARYSURFACE) {
/* update physical palette */ /* update physical palette */
LPDIRECTDRAWSURFACE7 psurf = NULL; LPDIRECTDRAWSURFACE7 psurf = NULL;
IDirectDraw7_GetGDISurface(ICOM_INTERFACE(This->ddraw_owner,IDirectDraw7), &psurf); IDirectDraw7_GetGDISurface(ICOM_INTERFACE(This->ddraw_owner,IDirectDraw7), &psurf);
@ -241,7 +241,7 @@ Main_DirectDrawPalette_GetCaps(LPDIRECTDRAWPALETTE iface, LPDWORD lpdwCaps)
ICOM_THIS(IDirectDrawPaletteImpl,iface); ICOM_THIS(IDirectDrawPaletteImpl,iface);
TRACE("(%p)->(%p)\n",This,lpdwCaps); TRACE("(%p)->(%p)\n",This,lpdwCaps);
*lpdwCaps = This->flags; *lpdwCaps = This->global.dwFlags;
return DD_OK; return DD_OK;
} }

View File

@ -1062,7 +1062,7 @@ Main_DirectDrawSurface_SetPalette(LPDIRECTDRAWSURFACE7 iface,
if (This->palette != NULL) { if (This->palette != NULL) {
if (This->surface_desc.ddsCaps.dwCaps & DDSCAPS_PRIMARYSURFACE) if (This->surface_desc.ddsCaps.dwCaps & DDSCAPS_PRIMARYSURFACE)
This->palette->flags &= ~DDPCAPS_PRIMARYSURFACE; This->palette->global.dwFlags &= ~DDPCAPS_PRIMARYSURFACE;
IDirectDrawPalette_Release(ICOM_INTERFACE(This->palette, IDirectDrawPalette_Release(ICOM_INTERFACE(This->palette,
IDirectDrawPalette)); IDirectDrawPalette));
} }
@ -1072,7 +1072,7 @@ Main_DirectDrawSurface_SetPalette(LPDIRECTDRAWSURFACE7 iface,
if (pPalette != NULL) { if (pPalette != NULL) {
IDirectDrawPalette_AddRef(pPalette); IDirectDrawPalette_AddRef(pPalette);
if (This->surface_desc.ddsCaps.dwCaps & DDSCAPS_PRIMARYSURFACE) if (This->surface_desc.ddsCaps.dwCaps & DDSCAPS_PRIMARYSURFACE)
This->palette->flags |= DDPCAPS_PRIMARYSURFACE; This->palette->global.dwFlags |= DDPCAPS_PRIMARYSURFACE;
} }
This->set_palette(This, This->palette); This->set_palette(This, This->palette);