DXGL r662 - Code Review

Jump to navigation Jump to search
Repository:DXGL
Revision:r661‎ | r662 | r663 >
Date:00:59, 8 June 2016
Author:admin
Status:new
Tags:
Comment:
Fix DXGLTest BltFast test to comply with parameter validation from r660 (which was based on r631)
Modified paths:
  • /dxgltest/Tests2D.cpp (modified) (history)

Diff [purge]

Index: dxgltest/Tests2D.cpp
@@ -434,6 +434,8 @@
435435 MultiDirectDrawSurface *temp1 = NULL;
436436 MultiDirectDrawSurface *temp2 = NULL;
437437 HRESULT error;
 438+ DDCOLORKEY ckey;
 439+ ckey.dwColorSpaceHighValue = ckey.dwColorSpaceLowValue = 0;
438440 if(ddver > 3)ddsd.dwSize = sizeof(DDSURFACEDESC2);
439441 else ddsd.dwSize = sizeof(DDSURFACEDESC);
440442 error = ddsrender->GetSurfaceDesc(&ddsd);
@@ -584,6 +586,10 @@
585587 sprites[0].rect.left = sprites[0].rect.top = 0;
586588 sprites[0].rect.right = ddsd.dwWidth;
587589 sprites[0].rect.bottom = ddsd.dwHeight;
 590+ if (backbuffers) ddsrender->GetAttachedSurface(&ddscaps, &temp1);
 591+ else temp1 = ddsrender;
 592+ temp1->SetColorKey(DDCKEY_DESTBLT, &ckey);
 593+ if (backbuffers) temp1->Release();
588594 for (int i = 1; i < 16; i++)
589595 {
590596 switch ((i - 1 & 3))
@@ -610,8 +616,6 @@
611617 default:
612618 break;
613619 }
614 - DDCOLORKEY ckey;
615 - ckey.dwColorSpaceHighValue = ckey.dwColorSpaceLowValue = 0;
616620 if (i < 5) sprites[i].bltflags = 0;
617621 else if (i < 9)
618622 {
@@ -619,8 +623,11 @@
620624 if (sprites[i].surface) sprites[i].surface->SetColorKey(DDCKEY_SRCBLT, &ckey);
621625 }
622626 else if (i < 13) sprites[i].bltflags = DDBLTFAST_DESTCOLORKEY;
623 - else sprites[i].bltflags = DDBLTFAST_SRCCOLORKEY | DDBLTFAST_DESTCOLORKEY;
624 - ddsrender->SetColorKey(DDCKEY_DESTBLT, &ckey);
 627+ else
 628+ {
 629+ sprites[i].bltflags = DDBLTFAST_SRCCOLORKEY | DDBLTFAST_DESTCOLORKEY;
 630+ if (sprites[i].surface) sprites[i].surface->SetColorKey(DDCKEY_SRCBLT, &ckey);
 631+ }
625632 sprites[i].x = randfloat((float)ddsd.dwWidth);
626633 sprites[i].y = randfloat((float)ddsd.dwHeight);
627634 sprites[i].xvelocity = randfloat(5);

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r631Get rid of render window. Currently breaks windowed mode and NULL hWnd coope...admin00:22, 1 January 2016
r660Bring back Blt surface isolation from r631 - currently breaks dest colorkey B...admin01:24, 6 June 2016