-
- getDescMethod = interface.getMethodByName('GetDesc')
- descArg = getDescMethod.args[0]
- assert descArg.output
- descType = getDescMethod.args[0].type.type
-
- print ' if (_result == D3D_OK && !(Flags & D3DLOCK_READONLY)) {'
- if interface.name in self.bufferInterfaceNames:
- print ' if (SizeToLock) {'
- print ' m_SizeToLock = SizeToLock;'
- print ' } else {'
- print ' %s Desc;' % descType
- print ' m_pInstance->GetDesc(&Desc);'
- print ' m_SizeToLock = Desc.Size;'
- print ' }'
- print ' m_pbData = *ppbData;'
- elif interface.name == 'IDirect3DSurface9':
- print ' UINT Width;'
- print ' UINT Height;'
- print ' if (pRect) {'
- print ' Width = pRect->right - pRect->left;'
- print ' Height = pRect->bottom - pRect->top;'
- print ' } else {'
- print ' %s Desc;' % descType
- print ' m_pInstance->GetDesc(&Desc);'
- print ' Width = Desc.Width;'
- print ' Height = Desc.Height;'
- print ' }'
- print ' m_SizeToLock = Height * pLockedRect->Pitch;'
- # TODO: take in consideration the width and pixels and blocks
- print ' (void)Width;'
- print ' m_pbData = pLockedRect->pBits;'
- else:
- raise NotImplementedError
+ print ' if (SUCCEEDED(_result) && !(Flags & D3DLOCK_READONLY)) {'
+ print ' _getMapInfo(_this, %s, m_pbData, _MappedSize);' % ', '.join(method.argNames()[:-1])