DXGL r357 - Code Review

Jump to navigation Jump to search
Repository:DXGL
Revision:r356‎ | r357 | r358 >
Date:00:02, 20 March 2013
Author:admin
Status:new
Tags:
Comment:
Add D3DTEXTURESTAGESTATETYPE enum decoder to trace.cpp
Modified paths:
  • /ddraw/trace.cpp (modified) (history)

Diff [purge]

Index: ddraw/trace.cpp
@@ -47,6 +47,7 @@
4848 25 - SIZE pointer
4949 26 - RECT pointer
5050 27 - D3DRENDERSTATETYPE
 51+28 - D3DTEXTURESTAGESTATETYPE
5152 */
5253
5354 #ifdef _TRACE
@@ -609,6 +610,91 @@
610611 WriteFile(outfile,str,strlen(str),&byteswritten,NULL);
611612 }
612613
 614+static void trace_decode_d3dtexturestagestate(DWORD rs)
 615+{
 616+ DWORD byteswritten;
 617+ char str[64];
 618+ switch(rs)
 619+ {
 620+ case D3DTSS_COLOROP:
 621+ strcpy(str,"D3DTSS_COLOROP");
 622+ break;
 623+ case D3DTSS_COLORARG1:
 624+ strcpy(str,"D3DTSS_COLORARG1");
 625+ break;
 626+ case D3DTSS_COLORARG2:
 627+ strcpy(str,"D3DTSS_COLORARG2");
 628+ break;
 629+ case D3DTSS_ALPHAOP:
 630+ strcpy(str,"D3DTSS_ALPHAOP");
 631+ break;
 632+ case D3DTSS_ALPHAARG1:
 633+ strcpy(str,"D3DTSS_ALPHAARG1");
 634+ break;
 635+ case D3DTSS_ALPHAARG2:
 636+ strcpy(str,"D3DTSS_ALPHAARG2");
 637+ break;
 638+ case D3DTSS_BUMPENVMAT00:
 639+ strcpy(str,"D3DTSS_BUMPENVMAT00");
 640+ break;
 641+ case D3DTSS_BUMPENVMAT01:
 642+ strcpy(str,"D3DTSS_BUMPENVMAT01");
 643+ break;
 644+ case D3DTSS_BUMPENVMAT10:
 645+ strcpy(str,"D3DTSS_BUMPENVMAT10");
 646+ break;
 647+ case D3DTSS_BUMPENVMAT11:
 648+ strcpy(str,"D3DTSS_BUMPENVMAT11");
 649+ break;
 650+ case D3DTSS_TEXCOORDINDEX:
 651+ strcpy(str,"D3DTSS_TEXCOORDINDEX");
 652+ break;
 653+ case D3DTSS_ADDRESS:
 654+ strcpy(str,"D3DTSS_ADDRESS");
 655+ break;
 656+ case D3DTSS_ADDRESSU:
 657+ strcpy(str,"D3DTSS_ADDRESSU");
 658+ break;
 659+ case D3DTSS_ADDRESSV:
 660+ strcpy(str,"D3DTSS_ADDRESSV");
 661+ break;
 662+ case D3DTSS_BORDERCOLOR:
 663+ strcpy(str,"D3DTSS_BORDERCOLOR");
 664+ break;
 665+ case D3DTSS_MAGFILTER:
 666+ strcpy(str,"D3DTSS_MAGFILTER");
 667+ break;
 668+ case D3DTSS_MINFILTER:
 669+ strcpy(str,"D3DTSS_MINFILTER");
 670+ break;
 671+ case D3DTSS_MIPFILTER:
 672+ strcpy(str,"D3DTSS_MIPFILTER");
 673+ break;
 674+ case D3DTSS_MIPMAPLODBIAS:
 675+ strcpy(str,"D3DTSS_MIPMAPLODBIAS");
 676+ break;
 677+ case D3DTSS_MAXMIPLEVEL:
 678+ strcpy(str,"D3DTSS_MAXMIPLEVEL");
 679+ break;
 680+ case D3DTSS_MAXANISOTROPY:
 681+ strcpy(str,"D3DTSS_MAXANISOTROPY");
 682+ break;
 683+ case D3DTSS_BUMPENVLSCALE:
 684+ strcpy(str,"D3DTSS_BUMPENVLSCALE");
 685+ break;
 686+ case D3DTSS_BUMPENVLOFFSET:
 687+ strcpy(str,"D3DTSS_BUMPENVLOFFSET");
 688+ break;
 689+ case D3DTSS_TEXTURETRANSFORMFLAGS:
 690+ strcpy(str,"D3DTSS_TEXTURETRANSFORMFLAGS");
 691+ break;
 692+ default:
 693+ sprintf(str,"(D3DTEXTURESTAGESTATETYPE)%u",rs);
 694+ break;
 695+ }
 696+ WriteFile(outfile,str,strlen(str),&byteswritten,NULL);
 697+}
 698+
613699 static void trace_decode_guid(GUID *guid)
614700 {
615701 DWORD byteswritten;
@@ -849,6 +935,9 @@
850936 case 27: // D3DRENDERSTATETYPE
851937 trace_decode_d3drenderstate((DWORD)arg);
852938 break;
 939+ case 28: // D3DTEXTURESTAGESTATETYPE
 940+ trace_decode_d3dtexturestagestate((DWORD)arg);
 941+ break;
853942 default:
854943 WriteFile(outfile,"Unknown type",12,&byteswritten,NULL);
855944 break;