]> git.cworth.org Git - apitrace/blobdiff - wrappers/d3d9trace.py
Refactor d3d9 lock tracking code further.
[apitrace] / wrappers / d3d9trace.py
index d3f2e024a0330146d35f79a2de80fd05148fbcf2..8d71a3cc90ec202436c07e19a2102b13e3ba765a 100644 (file)
@@ -59,20 +59,13 @@ class D3D9Tracer(DllTracer):
 
         DllTracer.implementWrapperInterfaceMethodBody(self, interface, base, method)
 
-        if method.name in ('Lock', 'LockRect', 'LockedBox'):
+        if method.name in ('Lock', 'LockRect', 'LockBox'):
+            # FIXME: handle recursive locks
             print '    if (SUCCEEDED(_result) && !(Flags & D3DLOCK_READONLY)) {'
-            print '        _LockedSize = _getLockSize(_this, %s);' % ', '.join(method.argNames()[:-1])
-            if method.name == 'Lock':
-                # FIXME: handle recursive locks
-                print '        m_pbData = *ppbData;'
-            elif method.name == 'LockRect':
-                print '        m_pbData = pLockedRect->pBits;'
-            elif method.name == 'LockBox':
-                print '        m_pbData = pLockedBox->pBits;'
-            else:
-                raise NotImplementedError
+            print '        _getLockInfo(_this, %s, m_pbData, _LockedSize);' % ', '.join(method.argNames()[:-1])
             print '    } else {'
             print '        m_pbData = NULL;'
+            print '        _LockedSize = 0;'
             print '    }'