]> git.cworth.org Git - apitrace/commitdiff
d3dretrace: Fix MSVC build.
authorJosé Fonseca <jose.r.fonseca@gmail.com>
Thu, 8 Nov 2012 12:29:02 +0000 (12:29 +0000)
committerJosé Fonseca <jose.r.fonseca@gmail.com>
Thu, 8 Nov 2012 12:29:02 +0000 (12:29 +0000)
retrace/d3d9retrace.py
retrace/d3dretrace.hpp
retrace/d3dretrace_main.cpp
retrace/dllretrace.py

index 44104ce616e4676038ecabf43d8b2dfa23115920..7030f868f17b3a98a27d0e3048f7077f412f640c 100644 (file)
@@ -43,6 +43,20 @@ class D3DRetracer(Retracer):
 
         Retracer.retraceApi(self, api)
 
+    def invokeFunction(self, function):
+        if function.name in ('Direct3DCreate9', 'Direct3DCreate9Ex'):
+            print 'if (retrace::debug && !g_szD3D9DllName) {'
+            print '    /* '
+            print '     * XXX: D3D9D only works for simple things, it often introduces errors'
+            print '     * on complex traces, or traces which use unofficial D3D9 features.'
+            print '     */'
+            print '    if (0) {'
+            print '        g_szD3D9DllName = "d3d9d.dll";'
+            print '    }'
+            print '}'
+
+        Retracer.invokeFunction(self, function)
+
     def invokeInterfaceMethod(self, interface, method):
         # keep track of the last used device for state dumping
         if interface.name in ('IDirect3DDevice9', 'IDirect3DDevice9Ex'):
index b479237abd2fdf8bb79392bf86e995feb9537448..dc174a83bc49c1e233b6404e06ff3bbea847d8e3 100644 (file)
@@ -35,9 +35,6 @@
 struct IDirect3DDevice9;
 
 
-extern const char *g_szD3D9DllName;
-
-
 namespace d3dretrace {
 
 
index 4bd4b8013a924820482d6ebdbf7a2eb9ff8c6e6d..a19511a0439e29f8df336c94a36a138faa79411d 100644 (file)
@@ -39,15 +39,6 @@ d3dretrace::pLastDirect3DDevice9 = NULL;
 
 void
 retrace::setUp(void) {
-    if (retrace::debug) {
-        /* 
-         * XXX: D3D9D only works for simple things, it often introduces errors
-         * on complex traces, or traces which use unofficial D3D9 features.
-         */
-        if (0) {
-            g_szD3D9DllName = "d3d9d.dll";
-        }
-    }
 }
 
 
index 318741c63dbf6c0ec6b8ffc403dd0ab390eccf39..4fd481ca967560d2226a4b15d5c2571e1cf749fb 100644 (file)
@@ -50,7 +50,6 @@ class DllDispatcher(Dispatcher):
         print r'        if (!g_h%sModule) {' % tag
         print r'            os::log("error: failed to load %s.dll\n");' % api.name
         print r'            exit(1);'
-        print r'            return NULL;'
         print r'        }'
         print r'    }'
         print r'    return GetProcAddress(g_h%sModule, lpProcName);' % tag