DXGL r284 - Code Review

Jump to navigation Jump to search
Repository:DXGL
Revision:r283‎ | r284 | r285 >
Date:00:37, 15 December 2012
Author:admin
Status:new
Tags:
Comment:
Add alpha tests to Texture Shader test.
Fix possible out-of-bounds texture stage selection on Texture Shader test.
Modified paths:

Diff [purge]

Index: dxgltest/Tests3D.cpp
@@ -1333,6 +1333,7 @@
13341334 SendDlgItemMessage(hWnd,IDC_FOGEND,WM_SETTEXT,0,(LPARAM)_T("1.0"));
13351335 SendDlgItemMessage(hWnd,IDC_FOGDENSITY,WM_SETTEXT,0,(LPARAM)_T("1.0"));
13361336 SendDlgItemMessage(hWnd,IDC_SPINSTAGE,UDM_SETRANGE32,0,7);
 1337+ SendDlgItemMessage(hWnd,IDC_SPINALPHAREF,UDM_SETRANGE32,0,255);
13371338 ::width = ddsd.dwWidth;
13381339 ::height = ddsd.dwHeight;
13391340 StartTimer(hWnd,WM_APP,60);
@@ -1347,6 +1348,8 @@
13481349 number = _ttoi(tmpstring);
13491350 if(number < 0) SendDlgItemMessage(hWnd,IDC_TEXSTAGE,WM_SETTEXT,0,(LPARAM)_T("0"));
13501351 if(number > 7) SendDlgItemMessage(hWnd,IDC_TEXSTAGE,WM_SETTEXT,0,(LPARAM)_T("7"));
 1352+ if(number < 0) number = 0;
 1353+ if(number > 7) number = 7;
13511354 texshaderstate.currentstage = number;
13521355 _itot(texshaderstate.texstages[number].keycolor,tmpstring,16);
13531356 strupper(tmpstring);
@@ -1572,6 +1575,31 @@
15731576 IDC_DESTBLEND,CB_GETCURSEL,0,0)+1);
15741577 }
15751578 break;
 1579+ case IDC_ALPHATEST:
 1580+ if(HIWORD(wParam) == BN_CLICKED)
 1581+ {
 1582+ if(SendDlgItemMessage(hWnd,IDC_ALPHATEST,BM_GETCHECK,0,0) == BST_CHECKED)
 1583+ d3d7dev->SetRenderState(D3DRENDERSTATE_ALPHATESTENABLE,TRUE);
 1584+ else d3d7dev->SetRenderState(D3DRENDERSTATE_ALPHATESTENABLE,FALSE);
 1585+ }
 1586+ case IDC_ALPHAFUNC:
 1587+ if(HIWORD(wParam) == CBN_SELCHANGE)
 1588+ {
 1589+ d3d7dev->SetRenderState(D3DRENDERSTATE_ALPHAFUNC,SendDlgItemMessage(hWnd,
 1590+ IDC_ALPHAFUNC,CB_GETCURSEL,0,0)+1);
 1591+ }
 1592+ break;
 1593+ case IDC_ALPHAREF:
 1594+ if(HIWORD(wParam) == EN_CHANGE)
 1595+ {
 1596+ SendDlgItemMessage(hWnd,IDC_ALPHAREF,WM_GETTEXT,MAX_PATH,(LPARAM)tmpstring);
 1597+ number = _ttoi(tmpstring);
 1598+ if(number < 0) SendDlgItemMessage(hWnd,IDC_ALPHAREF,WM_SETTEXT,0,(LPARAM)_T("0"));
 1599+ if(number > 255) SendDlgItemMessage(hWnd,IDC_ALPHAREF,WM_SETTEXT,0,(LPARAM)_T("255"));
 1600+ if(number < 0) number = 0;
 1601+ if(number > 255) number = 255;
 1602+ if(d3d7dev) d3d7dev->SetRenderState(D3DRENDERSTATE_ALPHAREF,number);
 1603+ }
15761604 case IDC_COLORKEY:
15771605 if(HIWORD(wParam) == BN_CLICKED)
15781606 {
Index: .
Property changes on: .
___________________________________________________________________
Modified: svn:ignore
## -10,3 +10,4 ##
15791607 enc_temp_folder
15801608 *.vcxproj.user
15811609 Debug No MSVCRT
 1610+pingme.txt