DXGL r662 - Code Review
For
DXGL
(
recent comments
|
status changes
|
tags
|
authors
|
states
|
release notes
|
statistics
)
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 @@
435
435
MultiDirectDrawSurface *temp1 = NULL;
436
436
MultiDirectDrawSurface *temp2 = NULL;
437
437
HRESULT error;
438
+ DDCOLORKEY ckey;
439
+ ckey.dwColorSpaceHighValue = ckey.dwColorSpaceLowValue = 0;
438
440
if(ddver > 3)ddsd.dwSize = sizeof(DDSURFACEDESC2);
439
441
else ddsd.dwSize = sizeof(DDSURFACEDESC);
440
442
error = ddsrender->GetSurfaceDesc(&ddsd);
—
—
@@ -584,6 +586,10 @@
585
587
sprites[0].rect.left = sprites[0].rect.top = 0;
586
588
sprites[0].rect.right = ddsd.dwWidth;
587
589
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();
588
594
for (int i = 1; i < 16; i++)
589
595
{
590
596
switch ((i - 1 & 3))
—
—
@@ -610,8 +616,6 @@
611
617
default:
612
618
break;
613
619
}
614
- DDCOLORKEY ckey;
615
- ckey.dwColorSpaceHighValue = ckey.dwColorSpaceLowValue = 0;
616
620
if (i < 5) sprites[i].bltflags = 0;
617
621
else if (i < 9)
618
622
{
—
—
@@ -619,8 +623,11 @@
620
624
if (sprites[i].surface) sprites[i].surface->SetColorKey(DDCKEY_SRCBLT, &ckey);
621
625
}
622
626
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
+ }
625
632
sprites[i].x = randfloat((float)ddsd.dwWidth);
626
633
sprites[i].y = randfloat((float)ddsd.dwHeight);
627
634
sprites[i].xvelocity = randfloat(5);
Past revisions this follows-up on
Revision
Commit summary
Author
Date
r631
Get rid of render window. Currently breaks windowed mode and NULL hWnd coope...
admin
00:22, 1 January 2016
r660
Bring back Blt surface isolation from
r631
- currently breaks dest colorkey B...
admin
01:24, 6 June 2016
Navigation menu
Personal tools
Log in
Namespaces
Special page
English
expanded
collapsed
Views
More
expanded
collapsed
Search
Navigation
Home
Main page
Recent changes
Random page
MediaWiki help
Introduction
Progress
Downloads
Source code
Build from source
AppDB
Bug reports
Forums
Tools
Special pages
Printable version