X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=d3d9trace.py;h=e6bf0001b6b70db15784135f5d33301fe3fb54cd;hb=e923607ddc14a2f135e2c08317833bca902b4a65;hp=b83ebf6d9123af417d7308f90d2a86a847fe4cc4;hpb=ae2b4d32ed56e3ac193cc7205aeb58082c448ce8;p=apitrace diff --git a/d3d9trace.py b/d3d9trace.py index b83ebf6..e6bf000 100644 --- a/d3d9trace.py +++ b/d3d9trace.py @@ -25,7 +25,7 @@ from trace import DllTracer -from d3d9 import d3d9 +from specs.d3d9 import d3d9 class D3D9Tracer(DllTracer): @@ -33,7 +33,7 @@ class D3D9Tracer(DllTracer): def dump_arg_instance(self, function, arg): # Dump shaders as strings if function.name in ('CreateVertexShader', 'CreatePixelShader') and arg.name == 'pFunction': - print ' DumpShader(Trace::localWriter, %s);' % (arg.name) + print ' DumpShader(trace::localWriter, %s);' % (arg.name) return DllTracer.dump_arg_instance(self, function, arg) @@ -46,6 +46,17 @@ if __name__ == '__main__': print '#include "d3d9imports.hpp"' print '#include "d3dshader.hpp"' print + print ''' +static inline size_t +_declCount(const D3DVERTEXELEMENT9 *pVertexElements) { + size_t count = 0; + if (pVertexElements) { + while (pVertexElements[count++].Stream != 0xff) + ; + } + return count; +} +''' tracer = D3D9Tracer('d3d9.dll') tracer.trace_api(d3d9)