From 6c77bd02ffd5a976e946ad518d73d910ddeb0b32 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jos=C3=A9=20Fonseca?= Date: Wed, 2 May 2012 13:15:39 +0100 Subject: [PATCH] Fix volume locked size computation. --- helpers/d3dsize.hpp | 8 ++++---- wrappers/d3d9trace.py | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/helpers/d3dsize.hpp b/helpers/d3dsize.hpp index 9f66297..9a1102a 100644 --- a/helpers/d3dsize.hpp +++ b/helpers/d3dsize.hpp @@ -292,7 +292,7 @@ _getLockSize(IDirect3DCubeTexture9 *pTexture, D3DCUBEMAP_FACES FaceType, UINT Le static inline size_t -_getLockSize(IDirect3DVolume9 *pVolume, const D3DLOCKED_BOX *pLockedBox, const D3DBOX *pBox) { +_getLockSize(IDirect3DVolume9 *pVolume, const D3DLOCKED_BOX *pLockedVolume, const D3DBOX *pBox) { HRESULT hr; D3DVOLUME_DESC Desc; @@ -314,12 +314,12 @@ _getLockSize(IDirect3DVolume9 *pVolume, const D3DLOCKED_BOX *pLockedBox, const D Depth = Desc.Depth; } - return _getLockSize(Desc.Format, Width, Height, pLockedBox->RowPitch, Depth, pLockedBox->SlicePitch); + return _getLockSize(Desc.Format, Width, Height, pLockedVolume->RowPitch, Depth, pLockedVolume->SlicePitch); } static inline size_t -_getLockSize(IDirect3DVolumeTexture9 *pTexture, UINT Level, const D3DLOCKED_BOX *pLockedBox, const D3DBOX *pBox) { +_getLockSize(IDirect3DVolumeTexture9 *pTexture, UINT Level, const D3DLOCKED_BOX *pLockedVolume, const D3DBOX *pBox) { HRESULT hr; D3DVOLUME_DESC Desc; @@ -341,7 +341,7 @@ _getLockSize(IDirect3DVolumeTexture9 *pTexture, UINT Level, const D3DLOCKED_BOX Depth = Desc.Depth; } - return _getLockSize(Desc.Format, Width, Height, pLockedBox->RowPitch, Depth, pLockedBox->SlicePitch); + return _getLockSize(Desc.Format, Width, Height, pLockedVolume->RowPitch, Depth, pLockedVolume->SlicePitch); } diff --git a/wrappers/d3d9trace.py b/wrappers/d3d9trace.py index d3f2e02..c82d525 100644 --- a/wrappers/d3d9trace.py +++ b/wrappers/d3d9trace.py @@ -59,7 +59,7 @@ class D3D9Tracer(DllTracer): DllTracer.implementWrapperInterfaceMethodBody(self, interface, base, method) - if method.name in ('Lock', 'LockRect', 'LockedBox'): + if method.name in ('Lock', 'LockRect', 'LockBox'): print ' if (SUCCEEDED(_result) && !(Flags & D3DLOCK_READONLY)) {' print ' _LockedSize = _getLockSize(_this, %s);' % ', '.join(method.argNames()[:-1]) if method.name == 'Lock': @@ -68,7 +68,7 @@ class D3D9Tracer(DllTracer): elif method.name == 'LockRect': print ' m_pbData = pLockedRect->pBits;' elif method.name == 'LockBox': - print ' m_pbData = pLockedBox->pBits;' + print ' m_pbData = pLockedVolume->pBits;' else: raise NotImplementedError print ' } else {' -- 2.43.0