]> git.cworth.org Git - apitrace/blobdiff - wrappers/d3d9trace.py
d3dretrace: Eliminate differences between d3d9/d3d10.
[apitrace] / wrappers / d3d9trace.py
index 33f6e9d9dfbfa18b5fae730d31fb0552803925b6..c1cadb67e49b10d39d6619992d6fb6acceb73977 100644 (file)
@@ -48,22 +48,16 @@ class D3D9Tracer(DllTracer):
            interface.getMethodByName('LockRect') is not None or \
            interface.getMethodByName('LockBox') is not None:
             variables += [
-                ('size_t', '_LockedSize', '0'),
+                ('size_t', '_MappedSize', '0'),
                 ('VOID *', 'm_pbData', '0'),
             ]
 
         return variables
 
     def implementWrapperInterfaceMethodBody(self, interface, base, method):
-        if method.name == 'DecodeExecute':
-            print r'    _NumCompBuffers = pExecuteParams->NumCompBuffers;'
-
-        if method.name == 'VideoProcessBlt':
-            print r'    _NumSrcSurfaces = pData->NumSrcSurfaces;'
-
         if method.name in ('Unlock', 'UnlockRect', 'UnlockBox'):
-            print '    if (_LockedSize && m_pbData) {'
-            self.emit_memcpy('(LPBYTE)m_pbData', '(LPBYTE)m_pbData', '_LockedSize')
+            print '    if (_MappedSize && m_pbData) {'
+            self.emit_memcpy('(LPBYTE)m_pbData', '(LPBYTE)m_pbData', '_MappedSize')
             print '    }'
 
         DllTracer.implementWrapperInterfaceMethodBody(self, interface, base, method)
@@ -71,10 +65,10 @@ class D3D9Tracer(DllTracer):
         if method.name in ('Lock', 'LockRect', 'LockBox'):
             # FIXME: handle recursive locks
             print '    if (SUCCEEDED(_result) && !(Flags & D3DLOCK_READONLY)) {'
-            print '        _getLockInfo(_this, %s, m_pbData, _LockedSize);' % ', '.join(method.argNames()[:-1])
+            print '        _getMapInfo(_this, %s, m_pbData, _MappedSize);' % ', '.join(method.argNames()[:-1])
             print '    } else {'
             print '        m_pbData = NULL;'
-            print '        _LockedSize = 0;'
+            print '        _MappedSize = 0;'
             print '    }'
 
 
@@ -99,10 +93,7 @@ _declCount(const D3DVERTEXELEMENT9 *pVertexElements) {
     }
     return count;
 }
-
-static UINT _NumCompBuffers = 0; /* XXX */
-static UINT _NumSrcSurfaces = 0; /* XXX */
 '''
     tracer = D3D9Tracer('d3d9.dll')
-    tracer.traceApi(d3d9)
+    tracer.traceModule(d3d9)