]> git.cworth.org Git - apitrace/blobdiff - d3d9trace.py
Cleanup/comment/format code.
[apitrace] / d3d9trace.py
index c489be6a6f53a2221533acb12e2898d63db82231..de1b4b676de957c0e9d819ab642c81e2c462c2de 100644 (file)
 ##########################################################################/
 
 
-from trace import DllTracer
+from dlltrace import DllTracer
 from specs.d3d9 import d3d9
 
 
 class D3D9Tracer(DllTracer):
 
-    def dump_arg_instance(self, function, arg):
+    def serializeArgValue(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)
+        DllTracer.serializeArgValue(self, function, arg)
 
 
 if __name__ == '__main__':
-    print '#include "trace_writer.hpp"'
+    print '#include "trace_writer_local.hpp"'
     print '#include "os.hpp"'
     print
     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)