diff --git a/dlls/ddraw/ddraw_private.h b/dlls/ddraw/ddraw_private.h index 1bd5552ce50..196fe1072d6 100644 --- a/dlls/ddraw/ddraw_private.h +++ b/dlls/ddraw/ddraw_private.h @@ -169,7 +169,6 @@ struct IDirectDrawPaletteImpl DDRAWI_DDRAWPALETTE_GBL global; /* IDirectDrawPalette fields */ - DWORD flags; HPALETTE hpal; WORD palVersion, palNumEntries; /* LOGPALETTE */ PALETTEENTRY palents[256]; diff --git a/dlls/ddraw/dpalette/main.c b/dlls/ddraw/dpalette/main.c index a2c972f87fc..c83b90a4abf 100644 --- a/dlls/ddraw/dpalette/main.c +++ b/dlls/ddraw/dpalette/main.c @@ -49,7 +49,6 @@ HRESULT Main_DirectDrawPalette_Construct(IDirectDrawPaletteImpl* This, if (dwFlags & DDPCAPS_8BITENTRIES) WARN("creating palette with 8 bit entries\n"); - This->flags = dwFlags; This->palNumEntries = Main_DirectDrawPalette_Size(dwFlags); This->ref = 1; @@ -57,6 +56,7 @@ HRESULT Main_DirectDrawPalette_Construct(IDirectDrawPaletteImpl* This, This->local.lpDD_lcl = &pDD->local; This->global.lpDD_lcl = &pDD->local; This->global.dwProcessId = GetCurrentProcessId(); + This->global.dwFlags = dwFlags; This->final_release = Main_DirectDrawPalette_final_release; ICOM_INIT_INTERFACE(This, IDirectDrawPalette, DDRAW_Main_Palette_VTable); @@ -116,10 +116,10 @@ Main_DirectDrawPalette_GetEntries(LPDIRECTDRAWPALETTE iface, DWORD dwFlags, palent); 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; - if (This->flags & DDPCAPS_8BITENTRIES) + if (This->global.dwFlags & DDPCAPS_8BITENTRIES) { int i; 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, palent); - if (This->flags & DDPCAPS_8BITENTRIES) + if (This->global.dwFlags & DDPCAPS_8BITENTRIES) { int i; const BYTE* entry = (const BYTE*)palent; @@ -157,7 +157,7 @@ Main_DirectDrawPalette_SetEntries(LPDIRECTDRAWPALETTE iface, DWORD dwFlags, if (This->hpal) SetPaletteEntries(This->hpal, dwStart, dwCount, This->palents+dwStart); - if (This->flags & DDPCAPS_PRIMARYSURFACE) { + if (This->global.dwFlags & DDPCAPS_PRIMARYSURFACE) { /* update physical palette */ LPDIRECTDRAWSURFACE7 psurf = NULL; IDirectDraw7_GetGDISurface(ICOM_INTERFACE(This->ddraw_owner,IDirectDraw7), &psurf); @@ -241,7 +241,7 @@ Main_DirectDrawPalette_GetCaps(LPDIRECTDRAWPALETTE iface, LPDWORD lpdwCaps) ICOM_THIS(IDirectDrawPaletteImpl,iface); TRACE("(%p)->(%p)\n",This,lpdwCaps); - *lpdwCaps = This->flags; + *lpdwCaps = This->global.dwFlags; return DD_OK; } diff --git a/dlls/ddraw/dsurface/main.c b/dlls/ddraw/dsurface/main.c index c0b0794bdf7..58300ba7198 100644 --- a/dlls/ddraw/dsurface/main.c +++ b/dlls/ddraw/dsurface/main.c @@ -1062,7 +1062,7 @@ Main_DirectDrawSurface_SetPalette(LPDIRECTDRAWSURFACE7 iface, if (This->palette != NULL) { 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)); } @@ -1072,7 +1072,7 @@ Main_DirectDrawSurface_SetPalette(LPDIRECTDRAWSURFACE7 iface, if (pPalette != NULL) { IDirectDrawPalette_AddRef(pPalette); 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);