DXGL r465 - Code Review

Jump to navigation Jump to search
Repository:DXGL
Revision:r464‎ | r465 | r466 >
Date:00:13, 14 July 2014
Author:admin
Status:new
Tags:
Comment:
Initialize icon surface before drawing the icon in the ROP Blt test.
Modified paths:
  • /dxgltest/surfacegen.cpp (modified) (history)

Diff [purge]

Index: dxgltest/surfacegen.cpp
@@ -916,11 +916,20 @@
917917 HICON ico_x16;
918918 HDC hdc;
919919 DDSURFACEDESC2 ddsd;
 920+ int bltx, blty;
 921+ RECT bltrect;
 922+ DDBLTFX bltfx;
 923+ ZeroMemory(&bltfx, sizeof(DDBLTFX));
 924+ bltfx.dwSize = sizeof(DDBLTFX);
920925 ZeroMemory(&ddsd, sizeof(DDSURFACEDESC2));
921926 if (ddver > 3)ddsd.dwSize = sizeof(DDSURFACEDESC2);
922927 else ddsd.dwSize = sizeof(DDSURFACEDESC);
923928 ico_dxglsm = (HICON)LoadImage(GetModuleHandle(NULL), MAKEINTRESOURCE(IDI_DXGLSM), IMAGE_ICON, 16, 16, 0);
924929 ico_x16 = (HICON)LoadImage(GetModuleHandle(NULL), MAKEINTRESOURCE(IDI_X16), IMAGE_ICON, 16, 16, 0);
 930+ bltrect.left = bltrect.top = 0;
 931+ bltrect.bottom = bltrect.right = 16;
 932+ bltfx.dwFillColor = 0;
 933+ sprites[2].surface->Blt(&bltrect, NULL, NULL, DDBLT_COLORFILL, &bltfx);
925934 sprites[2].surface->GetDC(&hdc);
926935 DrawIconEx(hdc, 0, 0, ico_dxglsm, 16, 16, 0, NULL, DI_NORMAL);
927936 sprites[2].surface->ReleaseDC(hdc);
@@ -982,11 +991,6 @@
983992 break;
984993 }
985994 sprites[5].surface->Unlock(NULL);
986 - int bltx, blty;
987 - RECT bltrect;
988 - DDBLTFX bltfx;
989 - ZeroMemory(&bltfx, sizeof(DDBLTFX));
990 - bltfx.dwSize = sizeof(DDBLTFX);
991995 for (int y = 0; y < 32; y++)
992996 {
993997 for (int x = 0; x < 32; x++)