DXGL r358 - Code Review

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

Diff [purge]

Index: ddraw/trace.cpp
@@ -48,6 +48,7 @@
4949 26 - RECT pointer
5050 27 - D3DRENDERSTATETYPE
5151 28 - D3DTEXTURESTAGESTATETYPE
 52+29 - D3DTRANSFORMSTATETYPE
5253 */
5354
5455 #ifdef _TRACE
@@ -610,11 +611,11 @@
611612 WriteFile(outfile,str,strlen(str),&byteswritten,NULL);
612613 }
613614
614 -static void trace_decode_d3dtexturestagestate(DWORD rs)
 615+static void trace_decode_d3dtexturestagestate(DWORD ts)
615616 {
616617 DWORD byteswritten;
617618 char str[64];
618 - switch(rs)
 619+ switch(ts)
619620 {
620621 case D3DTSS_COLOROP:
621622 strcpy(str,"D3DTSS_COLOROP");
@@ -689,12 +690,67 @@
690691 strcpy(str,"D3DTSS_TEXTURETRANSFORMFLAGS");
691692 break;
692693 default:
693 - sprintf(str,"(D3DTEXTURESTAGESTATETYPE)%u",rs);
 694+ sprintf(str,"(D3DTEXTURESTAGESTATETYPE)%u",ts);
694695 break;
695696 }
696697 WriteFile(outfile,str,strlen(str),&byteswritten,NULL);
697698 }
698699
 700+static void trace_decode_d3dtransformstate(DWORD ts)
 701+{
 702+ DWORD byteswritten;
 703+ char str[64];
 704+ switch(ts)
 705+ {
 706+ case D3DTRANSFORMSTATE_WORLD:
 707+ strcpy(str,"D3DTRANSFORMSTATE_WORLD");
 708+ break;
 709+ case D3DTRANSFORMSTATE_VIEW:
 710+ strcpy(str,"D3DTRANSFORMSTATE_VIEW");
 711+ break;
 712+ case D3DTRANSFORMSTATE_PROJECTION:
 713+ strcpy(str,"D3DTRANSFORMSTATE_PROJECTION");
 714+ break;
 715+ case D3DTRANSFORMSTATE_WORLD1:
 716+ strcpy(str,"D3DTRANSFORMSTATE_WORLD1");
 717+ break;
 718+ case D3DTRANSFORMSTATE_WORLD2:
 719+ strcpy(str,"D3DTRANSFORMSTATE_WORLD2");
 720+ break;
 721+ case D3DTRANSFORMSTATE_WORLD3:
 722+ strcpy(str,"D3DTRANSFORMSTATE_WORLD3");
 723+ break;
 724+ case D3DTRANSFORMSTATE_TEXTURE0:
 725+ strcpy(str,"D3DTRANSFORMSTATE_TEXTURE0");
 726+ break;
 727+ case D3DTRANSFORMSTATE_TEXTURE1:
 728+ strcpy(str,"D3DTRANSFORMSTATE_TEXTURE1");
 729+ break;
 730+ case D3DTRANSFORMSTATE_TEXTURE2:
 731+ strcpy(str,"D3DTRANSFORMSTATE_TEXTURE2");
 732+ break;
 733+ case D3DTRANSFORMSTATE_TEXTURE3:
 734+ strcpy(str,"D3DTRANSFORMSTATE_TEXTURE3");
 735+ break;
 736+ case D3DTRANSFORMSTATE_TEXTURE4:
 737+ strcpy(str,"D3DTRANSFORMSTATE_TEXTURE4");
 738+ break;
 739+ case D3DTRANSFORMSTATE_TEXTURE5:
 740+ strcpy(str,"D3DTRANSFORMSTATE_TEXTURE5");
 741+ break;
 742+ case D3DTRANSFORMSTATE_TEXTURE6:
 743+ strcpy(str,"D3DTRANSFORMSTATE_TEXTURE6");
 744+ break;
 745+ case D3DTRANSFORMSTATE_TEXTURE7:
 746+ strcpy(str,"D3DTRANSFORMSTATE_TEXTURE7");
 747+ break;
 748+ default:
 749+ sprintf(str,"(D3DTRANSFORMSTATETYPE)%u",ts);
 750+ break;
 751+ }
 752+ WriteFile(outfile,str,strlen(str),&byteswritten,NULL);
 753+}
 754+
699755 static void trace_decode_guid(GUID *guid)
700756 {
701757 DWORD byteswritten;
@@ -938,6 +994,9 @@
939995 case 28: // D3DTEXTURESTAGESTATETYPE
940996 trace_decode_d3dtexturestagestate((DWORD)arg);
941997 break;
 998+ case 29: // D3DTRANSFORMSTATETYPE
 999+ trace_decode_d3dtransformstate((DWORD)arg);
 1000+ break;
9421001 default:
9431002 WriteFile(outfile,"Unknown type",12,&byteswritten,NULL);
9441003 break;