DXGL r359 - Code Review

Jump to navigation Jump to search
Repository:DXGL
Revision:r358‎ | r359 | r360 >
Date:00:33, 21 March 2013
Author:admin
Status:new
Tags:
Comment:
Add D3DLIGHTSTATETYPE enum decoder to trace.cpp
Modified paths:
  • /ddraw/trace.cpp (modified) (history)

Diff [purge]

Index: ddraw/trace.cpp
@@ -44,11 +44,12 @@
4545 22 - int BOOL
4646 23 - HRESULT
4747 24 - GUID pointer
48 -25 - SIZE pointer
 48+25 - SIZE or POINT pointer
4949 26 - RECT pointer
5050 27 - D3DRENDERSTATETYPE
5151 28 - D3DTEXTURESTAGESTATETYPE
5252 29 - D3DTRANSFORMSTATETYPE
 53+30 - D3DLIGHTSTATETYPE
5354 */
5455
5556 #ifdef _TRACE
@@ -751,6 +752,43 @@
752753 WriteFile(outfile,str,strlen(str),&byteswritten,NULL);
753754 }
754755
 756+static void trace_decode_d3dlightstate(DWORD ls)
 757+{
 758+ DWORD byteswritten;
 759+ char str[64];
 760+ switch(ls)
 761+ {
 762+ case D3DLIGHTSTATE_MATERIAL:
 763+ strcpy(str,"D3DLIGHTSTATE_MATERIAL");
 764+ break;
 765+ case D3DLIGHTSTATE_AMBIENT:
 766+ strcpy(str,"D3DLIGHTSTATE_AMBIENT");
 767+ break;
 768+ case D3DLIGHTSTATE_COLORMODEL:
 769+ strcpy(str,"D3DLIGHTSTATE_COLORMODEL");
 770+ break;
 771+ case D3DLIGHTSTATE_FOGMODE:
 772+ strcpy(str,"D3DLIGHTSTATE_FOGMODE");
 773+ break;
 774+ case D3DLIGHTSTATE_FOGSTART:
 775+ strcpy(str,"D3DLIGHTSTATE_FOGSTART");
 776+ break;
 777+ case D3DLIGHTSTATE_FOGEND:
 778+ strcpy(str,"D3DLIGHTSTATE_FOGEND");
 779+ break;
 780+ case D3DLIGHTSTATE_FOGDENSITY:
 781+ strcpy(str,"D3DLIGHTSTATE_FOGDENSITY");
 782+ break;
 783+ case D3DLIGHTSTATE_COLORVERTEX:
 784+ strcpy(str,"D3DLIGHTSTATE_COLORVERTEX");
 785+ break;
 786+ default:
 787+ sprintf(str,"(D3DTRANSFORMSTATETYPE)%u",ls);
 788+ break;
 789+ }
 790+ WriteFile(outfile,str,strlen(str),&byteswritten,NULL);
 791+}
 792+
755793 static void trace_decode_guid(GUID *guid)
756794 {
757795 DWORD byteswritten;
@@ -980,7 +1018,7 @@
9811019 else if(arg == (void*)DDCREATE_EMULATIONONLY) WriteFile(outfile,"DDCREATE_EMULATIONONLY",22,&byteswritten,NULL);
9821020 else trace_decode_guid((GUID*)arg);
9831021 break;
984 - case 25: // SIZE pointer
 1022+ case 25: // SIZE or POINT pointer
9851023 if(!arg) WriteFile(outfile,"NULL",4,&byteswritten,NULL);
9861024 else trace_decode_size((SIZE*)arg);
9871025 break;
@@ -997,6 +1035,9 @@
9981036 case 29: // D3DTRANSFORMSTATETYPE
9991037 trace_decode_d3dtransformstate((DWORD)arg);
10001038 break;
 1039+ case 30: // D3DLIGHTSTATETYPE
 1040+ trace_decode_d3dlightstate((DWORD)arg);
 1041+ break;
10011042 default:
10021043 WriteFile(outfile,"Unknown type",12,&byteswritten,NULL);
10031044 break;