DXGL r857 - Code Review

Jump to navigation Jump to search
Repository:DXGL
Revision:r856‎ | r857 | r858 >
Date:20:26, 7 September 2018
Author:admin
Status:new
Tags:
Comment:
Use DDPCAPS_PRIMARYSURFACE to track palette attachment.
Modified paths:
  • /ddraw/glDirectDrawPalette.c (modified) (history)
  • /ddraw/glDirectDrawSurface.cpp (modified) (history)
  • /ddraw/struct.h (modified) (history)

Diff [purge]

Index: ddraw/glDirectDrawPalette.c
@@ -244,7 +244,7 @@
245245 memcpy(ddsd.lpSurface, This->palette, 1024);
246246 glTexture_Unlock(This->texture, 0, NULL, FALSE);
247247 }
248 - if ((This->primary) && (This->surface))
 248+ if ((This->flags & DDPCAPS_PRIMARYSURFACE) && (This->surface))
249249 {
250250 if (!dxglcfg.DebugNoPaletteRedraw)
251251 {
@@ -300,7 +300,6 @@
301301 newpal->lpVtbl = &glDirectDrawPalette_iface;
302302 newpal->creator = NULL;
303303 newpal->texture = NULL;
304 - newpal->primary = FALSE;
305304 newpal->surface = NULL;
306305 newpal->timer = NULL;
307306 if (lpDDColorArray == NULL)
Index: ddraw/glDirectDrawSurface.cpp
@@ -1509,7 +1509,7 @@
15101510 {
15111511 if (palette)
15121512 {
1513 - palette->primary = FALSE;
 1513+ palette->flags &= ~DDPCAPS_PRIMARYSURFACE;
15141514 palette->surface = NULL;
15151515 palette->timer = NULL;
15161516 glDirectDrawPalette_Release(palette);
@@ -1521,13 +1521,13 @@
15221522 glDirectDrawPalette_AddRef(palette);
15231523 if (this->ddsd.ddsCaps.dwCaps & DDSCAPS_PRIMARYSURFACE)
15241524 {
1525 - palette->primary = TRUE;
 1525+ palette->flags |= DDPCAPS_PRIMARYSURFACE;
15261526 palette->surface = this;
15271527 palette->timer = &ddInterface->renderer->timer;
15281528 }
15291529 else
15301530 {
1531 - palette->primary = FALSE;
 1531+ palette->flags &= ~DDPCAPS_PRIMARYSURFACE;
15321532 palette->surface = NULL;
15331533 palette->timer = NULL;
15341534 }
@@ -1562,7 +1562,7 @@
15631563 {
15641564 if (palette)
15651565 {
1566 - palette->primary = FALSE;
 1566+ palette->flags &= ~DDPCAPS_PRIMARYSURFACE;
15671567 palette->surface = NULL;
15681568 palette->timer = NULL;
15691569 glDirectDrawPalette_Release(palette);
@@ -1574,13 +1574,13 @@
15751575 glDirectDrawPalette_AddRef(palette);
15761576 if (this->ddsd.ddsCaps.dwCaps & DDSCAPS_PRIMARYSURFACE)
15771577 {
1578 - palette->primary = TRUE;
 1578+ palette->flags |= DDPCAPS_PRIMARYSURFACE;
15791579 palette->surface = this;
15801580 palette->timer = &ddInterface->renderer->timer;
15811581 }
15821582 else
15831583 {
1584 - palette->primary = FALSE;
 1584+ palette->flags &= ~DDPCAPS_PRIMARYSURFACE;
15851585 palette->surface = NULL;
15861586 palette->timer = NULL;
15871587 }
Index: ddraw/struct.h
@@ -418,7 +418,6 @@
419419 glTexture *texture;
420420 DWORD flags;
421421 IUnknown *creator;
422 - BOOL primary;
423422 LPDIRECTDRAWSURFACE7 surface;
424423 DXGLTimer *timer;
425424 } glDirectDrawPalette;