Commit 95469309 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Consistently use Map/Unmap for mapping resources.

parent 0d4e0bc9
...@@ -284,7 +284,8 @@ static HRESULT WINAPI IDirect3DCubeTexture8Impl_LockRect(LPDIRECT3DCUBETEXTURE8 ...@@ -284,7 +284,8 @@ static HRESULT WINAPI IDirect3DCubeTexture8Impl_LockRect(LPDIRECT3DCUBETEXTURE8
iface, FaceType, Level, pLockedRect, pRect, Flags); iface, FaceType, Level, pLockedRect, pRect, Flags);
wined3d_mutex_lock(); wined3d_mutex_lock();
hr = IWineD3DCubeTexture_LockRect(This->wineD3DCubeTexture, (WINED3DCUBEMAP_FACES) FaceType, Level, (WINED3DLOCKED_RECT *) pLockedRect, pRect, Flags); hr = IWineD3DCubeTexture_Map(This->wineD3DCubeTexture, (WINED3DCUBEMAP_FACES)FaceType,
Level, (WINED3DLOCKED_RECT *)pLockedRect, pRect, Flags);
wined3d_mutex_unlock(); wined3d_mutex_unlock();
return hr; return hr;
...@@ -297,7 +298,7 @@ static HRESULT WINAPI IDirect3DCubeTexture8Impl_UnlockRect(LPDIRECT3DCUBETEXTURE ...@@ -297,7 +298,7 @@ static HRESULT WINAPI IDirect3DCubeTexture8Impl_UnlockRect(LPDIRECT3DCUBETEXTURE
TRACE("iface %p, face %#x, level %u.\n", iface, FaceType, Level); TRACE("iface %p, face %#x, level %u.\n", iface, FaceType, Level);
wined3d_mutex_lock(); wined3d_mutex_lock();
hr = IWineD3DCubeTexture_UnlockRect(This->wineD3DCubeTexture, (WINED3DCUBEMAP_FACES) FaceType, Level); hr = IWineD3DCubeTexture_Unmap(This->wineD3DCubeTexture, (WINED3DCUBEMAP_FACES)FaceType, Level);
wined3d_mutex_unlock(); wined3d_mutex_unlock();
return hr; return hr;
......
...@@ -233,7 +233,7 @@ static HRESULT WINAPI IDirect3DSurface8Impl_LockRect(LPDIRECT3DSURFACE8 iface, D ...@@ -233,7 +233,7 @@ static HRESULT WINAPI IDirect3DSurface8Impl_LockRect(LPDIRECT3DSURFACE8 iface, D
} }
} }
hr = IWineD3DSurface_LockRect(This->wineD3DSurface, (WINED3DLOCKED_RECT *) pLockedRect, pRect, Flags); hr = IWineD3DSurface_Map(This->wineD3DSurface, (WINED3DLOCKED_RECT *)pLockedRect, pRect, Flags);
wined3d_mutex_unlock(); wined3d_mutex_unlock();
return hr; return hr;
...@@ -246,7 +246,7 @@ static HRESULT WINAPI IDirect3DSurface8Impl_UnlockRect(LPDIRECT3DSURFACE8 iface) ...@@ -246,7 +246,7 @@ static HRESULT WINAPI IDirect3DSurface8Impl_UnlockRect(LPDIRECT3DSURFACE8 iface)
TRACE("iface %p.\n", iface); TRACE("iface %p.\n", iface);
wined3d_mutex_lock(); wined3d_mutex_lock();
hr = IWineD3DSurface_UnlockRect(This->wineD3DSurface); hr = IWineD3DSurface_Unmap(This->wineD3DSurface);
wined3d_mutex_unlock(); wined3d_mutex_unlock();
switch(hr) switch(hr)
......
...@@ -281,7 +281,7 @@ static HRESULT WINAPI IDirect3DTexture8Impl_LockRect(LPDIRECT3DTEXTURE8 iface, U ...@@ -281,7 +281,7 @@ static HRESULT WINAPI IDirect3DTexture8Impl_LockRect(LPDIRECT3DTEXTURE8 iface, U
iface, Level, pLockedRect, pRect, Flags); iface, Level, pLockedRect, pRect, Flags);
wined3d_mutex_lock(); wined3d_mutex_lock();
hr = IWineD3DTexture_LockRect(This->wineD3DTexture, Level, (WINED3DLOCKED_RECT *) pLockedRect, pRect, Flags); hr = IWineD3DTexture_Map(This->wineD3DTexture, Level, (WINED3DLOCKED_RECT *)pLockedRect, pRect, Flags);
wined3d_mutex_unlock(); wined3d_mutex_unlock();
return hr; return hr;
...@@ -294,7 +294,7 @@ static HRESULT WINAPI IDirect3DTexture8Impl_UnlockRect(LPDIRECT3DTEXTURE8 iface, ...@@ -294,7 +294,7 @@ static HRESULT WINAPI IDirect3DTexture8Impl_UnlockRect(LPDIRECT3DTEXTURE8 iface,
TRACE("iface %p, level %u.\n", iface, Level); TRACE("iface %p, level %u.\n", iface, Level);
wined3d_mutex_lock(); wined3d_mutex_lock();
hr = IWineD3DTexture_UnlockRect(This->wineD3DTexture, Level); hr = IWineD3DTexture_Unmap(This->wineD3DTexture, Level);
wined3d_mutex_unlock(); wined3d_mutex_unlock();
return hr; return hr;
......
...@@ -205,7 +205,8 @@ static HRESULT WINAPI IDirect3DVolume8Impl_LockBox(LPDIRECT3DVOLUME8 iface, D3DL ...@@ -205,7 +205,8 @@ static HRESULT WINAPI IDirect3DVolume8Impl_LockBox(LPDIRECT3DVOLUME8 iface, D3DL
iface, pLockedVolume, pBox, Flags); iface, pLockedVolume, pBox, Flags);
wined3d_mutex_lock(); wined3d_mutex_lock();
hr = IWineD3DVolume_LockBox(This->wineD3DVolume, (WINED3DLOCKED_BOX *) pLockedVolume, (CONST WINED3DBOX *) pBox, Flags); hr = IWineD3DVolume_Map(This->wineD3DVolume, (WINED3DLOCKED_BOX *)pLockedVolume,
(const WINED3DBOX *)pBox, Flags);
wined3d_mutex_unlock(); wined3d_mutex_unlock();
return hr; return hr;
...@@ -218,7 +219,7 @@ static HRESULT WINAPI IDirect3DVolume8Impl_UnlockBox(LPDIRECT3DVOLUME8 iface) { ...@@ -218,7 +219,7 @@ static HRESULT WINAPI IDirect3DVolume8Impl_UnlockBox(LPDIRECT3DVOLUME8 iface) {
TRACE("iface %p.\n", iface); TRACE("iface %p.\n", iface);
wined3d_mutex_lock(); wined3d_mutex_lock();
hr = IWineD3DVolume_UnlockBox(This->wineD3DVolume); hr = IWineD3DVolume_Unmap(This->wineD3DVolume);
wined3d_mutex_unlock(); wined3d_mutex_unlock();
return hr; return hr;
......
...@@ -281,7 +281,8 @@ static HRESULT WINAPI IDirect3DVolumeTexture8Impl_LockBox(LPDIRECT3DVOLUMETEXTUR ...@@ -281,7 +281,8 @@ static HRESULT WINAPI IDirect3DVolumeTexture8Impl_LockBox(LPDIRECT3DVOLUMETEXTUR
iface, Level, pLockedVolume, pBox, Flags); iface, Level, pLockedVolume, pBox, Flags);
wined3d_mutex_lock(); wined3d_mutex_lock();
hr = IWineD3DVolumeTexture_LockBox(This->wineD3DVolumeTexture, Level, (WINED3DLOCKED_BOX *) pLockedVolume, (CONST WINED3DBOX *) pBox, Flags); hr = IWineD3DVolumeTexture_Map(This->wineD3DVolumeTexture, Level,
(WINED3DLOCKED_BOX *)pLockedVolume, (const WINED3DBOX *)pBox, Flags);
wined3d_mutex_unlock(); wined3d_mutex_unlock();
return hr; return hr;
...@@ -294,7 +295,7 @@ static HRESULT WINAPI IDirect3DVolumeTexture8Impl_UnlockBox(LPDIRECT3DVOLUMETEXT ...@@ -294,7 +295,7 @@ static HRESULT WINAPI IDirect3DVolumeTexture8Impl_UnlockBox(LPDIRECT3DVOLUMETEXT
TRACE("iface %p, level %u.\n", iface, Level); TRACE("iface %p, level %u.\n", iface, Level);
wined3d_mutex_lock(); wined3d_mutex_lock();
hr = IWineD3DVolumeTexture_UnlockBox(This->wineD3DVolumeTexture, Level); hr = IWineD3DVolumeTexture_Unmap(This->wineD3DVolumeTexture, Level);
wined3d_mutex_unlock(); wined3d_mutex_unlock();
return hr; return hr;
......
...@@ -323,7 +323,8 @@ static HRESULT WINAPI IDirect3DCubeTexture9Impl_LockRect(LPDIRECT3DCUBETEXTURE9 ...@@ -323,7 +323,8 @@ static HRESULT WINAPI IDirect3DCubeTexture9Impl_LockRect(LPDIRECT3DCUBETEXTURE9
iface, FaceType, Level, pLockedRect, pRect, Flags); iface, FaceType, Level, pLockedRect, pRect, Flags);
wined3d_mutex_lock(); wined3d_mutex_lock();
hr = IWineD3DCubeTexture_LockRect(This->wineD3DCubeTexture, (WINED3DCUBEMAP_FACES) FaceType, Level, (WINED3DLOCKED_RECT *) pLockedRect, pRect, Flags); hr = IWineD3DCubeTexture_Map(This->wineD3DCubeTexture, (WINED3DCUBEMAP_FACES)FaceType,
Level, (WINED3DLOCKED_RECT *)pLockedRect, pRect, Flags);
wined3d_mutex_unlock(); wined3d_mutex_unlock();
return hr; return hr;
...@@ -336,7 +337,7 @@ static HRESULT WINAPI IDirect3DCubeTexture9Impl_UnlockRect(LPDIRECT3DCUBETEXTURE ...@@ -336,7 +337,7 @@ static HRESULT WINAPI IDirect3DCubeTexture9Impl_UnlockRect(LPDIRECT3DCUBETEXTURE
TRACE("iface %p, face %#x, level %u.\n", iface, FaceType, Level); TRACE("iface %p, face %#x, level %u.\n", iface, FaceType, Level);
wined3d_mutex_lock(); wined3d_mutex_lock();
hr = IWineD3DCubeTexture_UnlockRect(This->wineD3DCubeTexture, (WINED3DCUBEMAP_FACES) FaceType, Level); hr = IWineD3DCubeTexture_Unmap(This->wineD3DCubeTexture, (WINED3DCUBEMAP_FACES)FaceType, Level);
wined3d_mutex_unlock(); wined3d_mutex_unlock();
return hr; return hr;
......
...@@ -272,7 +272,7 @@ static HRESULT WINAPI IDirect3DSurface9Impl_LockRect(LPDIRECT3DSURFACE9 iface, D ...@@ -272,7 +272,7 @@ static HRESULT WINAPI IDirect3DSurface9Impl_LockRect(LPDIRECT3DSURFACE9 iface, D
TRACE("iface %p, locked_rect %p, rect %p, flags %#x.\n", iface, pLockedRect, pRect, Flags); TRACE("iface %p, locked_rect %p, rect %p, flags %#x.\n", iface, pLockedRect, pRect, Flags);
wined3d_mutex_lock(); wined3d_mutex_lock();
hr = IWineD3DSurface_LockRect(This->wineD3DSurface, (WINED3DLOCKED_RECT *) pLockedRect, pRect, Flags); hr = IWineD3DSurface_Map(This->wineD3DSurface, (WINED3DLOCKED_RECT *)pLockedRect, pRect, Flags);
wined3d_mutex_unlock(); wined3d_mutex_unlock();
return hr; return hr;
...@@ -285,7 +285,7 @@ static HRESULT WINAPI IDirect3DSurface9Impl_UnlockRect(LPDIRECT3DSURFACE9 iface) ...@@ -285,7 +285,7 @@ static HRESULT WINAPI IDirect3DSurface9Impl_UnlockRect(LPDIRECT3DSURFACE9 iface)
TRACE("iface %p.\n", iface); TRACE("iface %p.\n", iface);
wined3d_mutex_lock(); wined3d_mutex_lock();
hr = IWineD3DSurface_UnlockRect(This->wineD3DSurface); hr = IWineD3DSurface_Unmap(This->wineD3DSurface);
wined3d_mutex_unlock(); wined3d_mutex_unlock();
switch(hr) switch(hr)
......
...@@ -319,7 +319,7 @@ static HRESULT WINAPI IDirect3DTexture9Impl_LockRect(LPDIRECT3DTEXTURE9 iface, U ...@@ -319,7 +319,7 @@ static HRESULT WINAPI IDirect3DTexture9Impl_LockRect(LPDIRECT3DTEXTURE9 iface, U
iface, Level, pLockedRect, pRect, Flags); iface, Level, pLockedRect, pRect, Flags);
wined3d_mutex_lock(); wined3d_mutex_lock();
hr = IWineD3DTexture_LockRect(This->wineD3DTexture, Level, (WINED3DLOCKED_RECT *) pLockedRect, pRect, Flags); hr = IWineD3DTexture_Map(This->wineD3DTexture, Level, (WINED3DLOCKED_RECT *)pLockedRect, pRect, Flags);
wined3d_mutex_unlock(); wined3d_mutex_unlock();
return hr; return hr;
...@@ -332,7 +332,7 @@ static HRESULT WINAPI IDirect3DTexture9Impl_UnlockRect(LPDIRECT3DTEXTURE9 iface, ...@@ -332,7 +332,7 @@ static HRESULT WINAPI IDirect3DTexture9Impl_UnlockRect(LPDIRECT3DTEXTURE9 iface,
TRACE("iface %p, level %u.\n", iface, Level); TRACE("iface %p, level %u.\n", iface, Level);
wined3d_mutex_lock(); wined3d_mutex_lock();
hr = IWineD3DTexture_UnlockRect(This->wineD3DTexture, Level); hr = IWineD3DTexture_Unmap(This->wineD3DTexture, Level);
wined3d_mutex_unlock(); wined3d_mutex_unlock();
return hr; return hr;
......
...@@ -212,7 +212,7 @@ static HRESULT WINAPI IDirect3DVolume9Impl_LockBox(LPDIRECT3DVOLUME9 iface, D3DL ...@@ -212,7 +212,7 @@ static HRESULT WINAPI IDirect3DVolume9Impl_LockBox(LPDIRECT3DVOLUME9 iface, D3DL
wined3d_mutex_lock(); wined3d_mutex_lock();
hr = IWineD3DVolume_LockBox(This->wineD3DVolume, (WINED3DLOCKED_BOX *)pLockedVolume, hr = IWineD3DVolume_Map(This->wineD3DVolume, (WINED3DLOCKED_BOX *)pLockedVolume,
(const WINED3DBOX *)pBox, Flags); (const WINED3DBOX *)pBox, Flags);
wined3d_mutex_unlock(); wined3d_mutex_unlock();
...@@ -228,7 +228,7 @@ static HRESULT WINAPI IDirect3DVolume9Impl_UnlockBox(LPDIRECT3DVOLUME9 iface) { ...@@ -228,7 +228,7 @@ static HRESULT WINAPI IDirect3DVolume9Impl_UnlockBox(LPDIRECT3DVOLUME9 iface) {
wined3d_mutex_lock(); wined3d_mutex_lock();
hr = IWineD3DVolume_UnlockBox(This->wineD3DVolume); hr = IWineD3DVolume_Unmap(This->wineD3DVolume);
wined3d_mutex_unlock(); wined3d_mutex_unlock();
......
...@@ -348,8 +348,8 @@ static HRESULT WINAPI IDirect3DVolumeTexture9Impl_LockBox(LPDIRECT3DVOLUMETEXTUR ...@@ -348,8 +348,8 @@ static HRESULT WINAPI IDirect3DVolumeTexture9Impl_LockBox(LPDIRECT3DVOLUMETEXTUR
wined3d_mutex_lock(); wined3d_mutex_lock();
hr = IWineD3DVolumeTexture_LockBox(This->wineD3DVolumeTexture, Level, (WINED3DLOCKED_BOX *)pLockedVolume, hr = IWineD3DVolumeTexture_Map(This->wineD3DVolumeTexture, Level,
(const WINED3DBOX *)pBox, Flags); (WINED3DLOCKED_BOX *)pLockedVolume, (const WINED3DBOX *)pBox, Flags);
wined3d_mutex_unlock(); wined3d_mutex_unlock();
...@@ -364,7 +364,7 @@ static HRESULT WINAPI IDirect3DVolumeTexture9Impl_UnlockBox(LPDIRECT3DVOLUMETEXT ...@@ -364,7 +364,7 @@ static HRESULT WINAPI IDirect3DVolumeTexture9Impl_UnlockBox(LPDIRECT3DVOLUMETEXT
wined3d_mutex_lock(); wined3d_mutex_lock();
hr = IWineD3DVolumeTexture_UnlockBox(This->wineD3DVolumeTexture, Level); hr = IWineD3DVolumeTexture_Unmap(This->wineD3DVolumeTexture, Level);
wined3d_mutex_unlock(); wined3d_mutex_unlock();
......
...@@ -679,11 +679,8 @@ static HRESULT WINAPI ddraw_surface7_Lock(IDirectDrawSurface7 *iface, ...@@ -679,11 +679,8 @@ static HRESULT WINAPI ddraw_surface7_Lock(IDirectDrawSurface7 *iface,
} }
} }
hr = IWineD3DSurface_LockRect(This->WineD3DSurface, hr = IWineD3DSurface_Map(This->WineD3DSurface, &LockedRect, Rect, Flags);
&LockedRect, if (FAILED(hr))
Rect,
Flags);
if(hr != D3D_OK)
{ {
LeaveCriticalSection(&ddraw_cs); LeaveCriticalSection(&ddraw_cs);
switch(hr) switch(hr)
...@@ -744,8 +741,8 @@ static HRESULT WINAPI ddraw_surface7_Unlock(IDirectDrawSurface7 *iface, RECT *pR ...@@ -744,8 +741,8 @@ static HRESULT WINAPI ddraw_surface7_Unlock(IDirectDrawSurface7 *iface, RECT *pR
TRACE("iface %p, rect %s.\n", iface, wine_dbgstr_rect(pRect)); TRACE("iface %p, rect %s.\n", iface, wine_dbgstr_rect(pRect));
EnterCriticalSection(&ddraw_cs); EnterCriticalSection(&ddraw_cs);
hr = IWineD3DSurface_UnlockRect(This->WineD3DSurface); hr = IWineD3DSurface_Unmap(This->WineD3DSurface);
if(SUCCEEDED(hr)) if (SUCCEEDED(hr))
{ {
This->surface_desc.lpSurface = NULL; This->surface_desc.lpSurface = NULL;
} }
...@@ -3297,7 +3294,7 @@ static HRESULT WINAPI d3d_texture2_Load(IDirect3DTexture2 *iface, IDirect3DTextu ...@@ -3297,7 +3294,7 @@ static HRESULT WINAPI d3d_texture2_Load(IDirect3DTexture2 *iface, IDirect3DTextu
/* Copy the main memory texture into the surface that corresponds /* Copy the main memory texture into the surface that corresponds
* to the OpenGL texture object. */ * to the OpenGL texture object. */
hr = IWineD3DSurface_LockRect(src_surface->WineD3DSurface, &src_rect, NULL, 0); hr = IWineD3DSurface_Map(src_surface->WineD3DSurface, &src_rect, NULL, 0);
if (FAILED(hr)) if (FAILED(hr))
{ {
ERR("Failed to lock source surface, hr %#x.\n", hr); ERR("Failed to lock source surface, hr %#x.\n", hr);
...@@ -3305,11 +3302,11 @@ static HRESULT WINAPI d3d_texture2_Load(IDirect3DTexture2 *iface, IDirect3DTextu ...@@ -3305,11 +3302,11 @@ static HRESULT WINAPI d3d_texture2_Load(IDirect3DTexture2 *iface, IDirect3DTextu
return D3DERR_TEXTURE_LOAD_FAILED; return D3DERR_TEXTURE_LOAD_FAILED;
} }
hr = IWineD3DSurface_LockRect(dst_surface->WineD3DSurface, &dst_rect, NULL, 0); hr = IWineD3DSurface_Map(dst_surface->WineD3DSurface, &dst_rect, NULL, 0);
if (FAILED(hr)) if (FAILED(hr))
{ {
ERR("Failed to lock destination surface, hr %#x.\n", hr); ERR("Failed to lock destination surface, hr %#x.\n", hr);
IWineD3DSurface_UnlockRect(src_surface->WineD3DSurface); IWineD3DSurface_Unmap(src_surface->WineD3DSurface);
LeaveCriticalSection(&ddraw_cs); LeaveCriticalSection(&ddraw_cs);
return D3DERR_TEXTURE_LOAD_FAILED; return D3DERR_TEXTURE_LOAD_FAILED;
} }
...@@ -3319,8 +3316,8 @@ static HRESULT WINAPI d3d_texture2_Load(IDirect3DTexture2 *iface, IDirect3DTextu ...@@ -3319,8 +3316,8 @@ static HRESULT WINAPI d3d_texture2_Load(IDirect3DTexture2 *iface, IDirect3DTextu
else else
memcpy(dst_rect.pBits, src_rect.pBits, src_rect.Pitch * src_desc->dwHeight); memcpy(dst_rect.pBits, src_rect.pBits, src_rect.Pitch * src_desc->dwHeight);
IWineD3DSurface_UnlockRect(src_surface->WineD3DSurface); IWineD3DSurface_Unmap(src_surface->WineD3DSurface);
IWineD3DSurface_UnlockRect(dst_surface->WineD3DSurface); IWineD3DSurface_Unmap(dst_surface->WineD3DSurface);
} }
if (src_surface->surface_desc.ddsCaps.dwCaps & DDSCAPS_MIPMAP) if (src_surface->surface_desc.ddsCaps.dwCaps & DDSCAPS_MIPMAP)
......
...@@ -358,7 +358,7 @@ static HRESULT WINAPI IWineD3DCubeTextureImpl_GetCubeMapSurface(IWineD3DCubeText ...@@ -358,7 +358,7 @@ static HRESULT WINAPI IWineD3DCubeTextureImpl_GetCubeMapSurface(IWineD3DCubeText
return WINED3D_OK; return WINED3D_OK;
} }
static HRESULT WINAPI IWineD3DCubeTextureImpl_LockRect(IWineD3DCubeTexture *iface, static HRESULT WINAPI IWineD3DCubeTextureImpl_Map(IWineD3DCubeTexture *iface,
WINED3DCUBEMAP_FACES face, UINT level, WINED3DLOCKED_RECT *locked_rect, const RECT *rect, DWORD flags) WINED3DCUBEMAP_FACES face, UINT level, WINED3DLOCKED_RECT *locked_rect, const RECT *rect, DWORD flags)
{ {
IWineD3DBaseTextureImpl *texture = (IWineD3DBaseTextureImpl *)iface; IWineD3DBaseTextureImpl *texture = (IWineD3DBaseTextureImpl *)iface;
...@@ -373,10 +373,10 @@ static HRESULT WINAPI IWineD3DCubeTextureImpl_LockRect(IWineD3DCubeTexture *ifac ...@@ -373,10 +373,10 @@ static HRESULT WINAPI IWineD3DCubeTextureImpl_LockRect(IWineD3DCubeTexture *ifac
return WINED3DERR_INVALIDCALL; return WINED3DERR_INVALIDCALL;
} }
return IWineD3DSurface_LockRect(surface, locked_rect, rect, flags); return IWineD3DSurface_Map(surface, locked_rect, rect, flags);
} }
static HRESULT WINAPI IWineD3DCubeTextureImpl_UnlockRect(IWineD3DCubeTexture *iface, static HRESULT WINAPI IWineD3DCubeTextureImpl_Unmap(IWineD3DCubeTexture *iface,
WINED3DCUBEMAP_FACES face, UINT level) WINED3DCUBEMAP_FACES face, UINT level)
{ {
IWineD3DBaseTextureImpl *texture = (IWineD3DBaseTextureImpl *)iface; IWineD3DBaseTextureImpl *texture = (IWineD3DBaseTextureImpl *)iface;
...@@ -391,7 +391,7 @@ static HRESULT WINAPI IWineD3DCubeTextureImpl_UnlockRect(IWineD3DCubeTexture *if ...@@ -391,7 +391,7 @@ static HRESULT WINAPI IWineD3DCubeTextureImpl_UnlockRect(IWineD3DCubeTexture *if
return WINED3DERR_INVALIDCALL; return WINED3DERR_INVALIDCALL;
} }
return IWineD3DSurface_UnlockRect(surface); return IWineD3DSurface_Unmap(surface);
} }
static HRESULT WINAPI IWineD3DCubeTextureImpl_AddDirtyRect(IWineD3DCubeTexture *iface, static HRESULT WINAPI IWineD3DCubeTextureImpl_AddDirtyRect(IWineD3DCubeTexture *iface,
...@@ -446,8 +446,8 @@ static const IWineD3DCubeTextureVtbl IWineD3DCubeTexture_Vtbl = ...@@ -446,8 +446,8 @@ static const IWineD3DCubeTextureVtbl IWineD3DCubeTexture_Vtbl =
/* IWineD3DCubeTexture */ /* IWineD3DCubeTexture */
IWineD3DCubeTextureImpl_GetLevelDesc, IWineD3DCubeTextureImpl_GetLevelDesc,
IWineD3DCubeTextureImpl_GetCubeMapSurface, IWineD3DCubeTextureImpl_GetCubeMapSurface,
IWineD3DCubeTextureImpl_LockRect, IWineD3DCubeTextureImpl_Map,
IWineD3DCubeTextureImpl_UnlockRect, IWineD3DCubeTextureImpl_Unmap,
IWineD3DCubeTextureImpl_AddDirtyRect IWineD3DCubeTextureImpl_AddDirtyRect
}; };
......
...@@ -4918,22 +4918,23 @@ static HRESULT IWineD3DDeviceImpl_UpdateVolume(IWineD3DDevice *iface, ...@@ -4918,22 +4918,23 @@ static HRESULT IWineD3DDeviceImpl_UpdateVolume(IWineD3DDevice *iface,
/* TODO: Implement direct loading into the gl volume instead of using memcpy and /* TODO: Implement direct loading into the gl volume instead of using memcpy and
* dirtification to improve loading performance. * dirtification to improve loading performance.
*/ */
hr = IWineD3DVolume_LockBox(pSourceVolume, &src, NULL, WINED3DLOCK_READONLY); hr = IWineD3DVolume_Map(pSourceVolume, &src, NULL, WINED3DLOCK_READONLY);
if(FAILED(hr)) return hr; if (FAILED(hr)) return hr;
hr = IWineD3DVolume_LockBox(pDestinationVolume, &dst, NULL, WINED3DLOCK_DISCARD); hr = IWineD3DVolume_Map(pDestinationVolume, &dst, NULL, WINED3DLOCK_DISCARD);
if(FAILED(hr)) { if (FAILED(hr))
IWineD3DVolume_UnlockBox(pSourceVolume); {
return hr; IWineD3DVolume_Unmap(pSourceVolume);
return hr;
} }
memcpy(dst.pBits, src.pBits, ((IWineD3DVolumeImpl *) pDestinationVolume)->resource.size); memcpy(dst.pBits, src.pBits, ((IWineD3DVolumeImpl *) pDestinationVolume)->resource.size);
hr = IWineD3DVolume_UnlockBox(pDestinationVolume); hr = IWineD3DVolume_Unmap(pDestinationVolume);
if(FAILED(hr)) { if (FAILED(hr))
IWineD3DVolume_UnlockBox(pSourceVolume); IWineD3DVolume_Unmap(pSourceVolume);
} else { else
hr = IWineD3DVolume_UnlockBox(pSourceVolume); hr = IWineD3DVolume_Unmap(pSourceVolume);
}
return hr; return hr;
} }
...@@ -5827,7 +5828,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetCursorProperties(IWineD3DDevice *ifa ...@@ -5827,7 +5828,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetCursorProperties(IWineD3DDevice *ifa
*/ */
This->cursorWidth = s->currentDesc.Width; This->cursorWidth = s->currentDesc.Width;
This->cursorHeight = s->currentDesc.Height; This->cursorHeight = s->currentDesc.Height;
if (SUCCEEDED(IWineD3DSurface_LockRect(cursor_image, &rect, NULL, WINED3DLOCK_READONLY))) if (SUCCEEDED(IWineD3DSurface_Map(cursor_image, &rect, NULL, WINED3DLOCK_READONLY)))
{ {
const struct wined3d_gl_info *gl_info = &This->adapter->gl_info; const struct wined3d_gl_info *gl_info = &This->adapter->gl_info;
const struct wined3d_format *format = wined3d_get_format(gl_info, WINED3DFMT_B8G8R8A8_UNORM); const struct wined3d_format *format = wined3d_get_format(gl_info, WINED3DFMT_B8G8R8A8_UNORM);
...@@ -5847,7 +5848,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetCursorProperties(IWineD3DDevice *ifa ...@@ -5847,7 +5848,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetCursorProperties(IWineD3DDevice *ifa
mem = HeapAlloc(GetProcessHeap(), 0, width * height * bpp); mem = HeapAlloc(GetProcessHeap(), 0, width * height * bpp);
for(i = 0; i < height; i++) for(i = 0; i < height; i++)
memcpy(&mem[width * bpp * i], &bits[rect.Pitch * i], width * bpp); memcpy(&mem[width * bpp * i], &bits[rect.Pitch * i], width * bpp);
IWineD3DSurface_UnlockRect(cursor_image); IWineD3DSurface_Unmap(cursor_image);
context = context_acquire(This, NULL); context = context_acquire(This, NULL);
...@@ -5903,7 +5904,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetCursorProperties(IWineD3DDevice *ifa ...@@ -5903,7 +5904,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetCursorProperties(IWineD3DDevice *ifa
* chunks. */ * chunks. */
DWORD *maskBits = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, DWORD *maskBits = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,
(s->currentDesc.Width * s->currentDesc.Height / 8)); (s->currentDesc.Width * s->currentDesc.Height / 8));
IWineD3DSurface_LockRect(cursor_image, &lockedRect, NULL, IWineD3DSurface_Map(cursor_image, &lockedRect, NULL,
WINED3DLOCK_NO_DIRTY_UPDATE | WINED3DLOCK_READONLY); WINED3DLOCK_NO_DIRTY_UPDATE | WINED3DLOCK_READONLY);
TRACE("width: %u height: %u.\n", s->currentDesc.Width, s->currentDesc.Height); TRACE("width: %u height: %u.\n", s->currentDesc.Width, s->currentDesc.Height);
...@@ -5912,7 +5913,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetCursorProperties(IWineD3DDevice *ifa ...@@ -5912,7 +5913,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetCursorProperties(IWineD3DDevice *ifa
cursorInfo.yHotspot = YHotSpot; cursorInfo.yHotspot = YHotSpot;
cursorInfo.hbmMask = CreateBitmap(s->currentDesc.Width, s->currentDesc.Height, 1, 1, maskBits); cursorInfo.hbmMask = CreateBitmap(s->currentDesc.Width, s->currentDesc.Height, 1, 1, maskBits);
cursorInfo.hbmColor = CreateBitmap(s->currentDesc.Width, s->currentDesc.Height, 1, 32, lockedRect.pBits); cursorInfo.hbmColor = CreateBitmap(s->currentDesc.Width, s->currentDesc.Height, 1, 32, lockedRect.pBits);
IWineD3DSurface_UnlockRect(cursor_image); IWineD3DSurface_Unmap(cursor_image);
/* Create our cursor and clean up. */ /* Create our cursor and clean up. */
cursor = CreateIconIndirect(&cursorInfo); cursor = CreateIconIndirect(&cursorInfo);
SetCursor(cursor); SetCursor(cursor);
......
...@@ -1268,11 +1268,6 @@ static void read_from_framebuffer(IWineD3DSurfaceImpl *This, const RECT *rect, v ...@@ -1268,11 +1268,6 @@ static void read_from_framebuffer(IWineD3DSurfaceImpl *This, const RECT *rect, v
return; return;
} }
/* Activate the surface. Set it up for blitting now, although not necessarily needed for LockRect.
* Certain graphics drivers seem to dislike some enabled states when reading from opengl, the blitting usage
* should help here. Furthermore unlockrect will need the context set up for blitting. The context manager will find
* context->last_was_blit set on the unlock.
*/
context = context_acquire(device, This); context = context_acquire(device, This);
context_apply_blit_state(context, device); context_apply_blit_state(context, device);
gl_info = context->gl_info; gl_info = context->gl_info;
...@@ -1285,10 +1280,9 @@ static void read_from_framebuffer(IWineD3DSurfaceImpl *This, const RECT *rect, v ...@@ -1285,10 +1280,9 @@ static void read_from_framebuffer(IWineD3DSurfaceImpl *This, const RECT *rect, v
*/ */
if (surface_is_offscreen(This)) if (surface_is_offscreen(This))
{ {
/* Locking the primary render target which is not on a swapchain(=offscreen render target). /* Mapping the primary render target which is not on a swapchain.
* Read from the back buffer * Read from the back buffer. */
*/ TRACE("Mapping offscreen render target.\n");
TRACE("Locking offscreen render target\n");
glReadBuffer(device->offscreenBuffer); glReadBuffer(device->offscreenBuffer);
srcIsUpsideDown = TRUE; srcIsUpsideDown = TRUE;
} }
...@@ -1296,7 +1290,7 @@ static void read_from_framebuffer(IWineD3DSurfaceImpl *This, const RECT *rect, v ...@@ -1296,7 +1290,7 @@ static void read_from_framebuffer(IWineD3DSurfaceImpl *This, const RECT *rect, v
{ {
/* Onscreen surfaces are always part of a swapchain */ /* Onscreen surfaces are always part of a swapchain */
GLenum buffer = surface_get_gl_buffer(This); GLenum buffer = surface_get_gl_buffer(This);
TRACE("Locking %#x buffer\n", buffer); TRACE("Mapping %#x buffer.\n", buffer);
glReadBuffer(buffer); glReadBuffer(buffer);
checkGLcall("glReadBuffer"); checkGLcall("glReadBuffer");
srcIsUpsideDown = FALSE; srcIsUpsideDown = FALSE;
...@@ -1647,7 +1641,9 @@ static void surface_prepare_system_memory(IWineD3DSurfaceImpl *This) ...@@ -1647,7 +1641,9 @@ static void surface_prepare_system_memory(IWineD3DSurfaceImpl *This)
} }
} }
static HRESULT WINAPI IWineD3DSurfaceImpl_LockRect(IWineD3DSurface *iface, WINED3DLOCKED_RECT* pLockedRect, CONST RECT* pRect, DWORD Flags) { static HRESULT WINAPI IWineD3DSurfaceImpl_Map(IWineD3DSurface *iface,
WINED3DLOCKED_RECT *pLockedRect, const RECT *pRect, DWORD Flags)
{
IWineD3DSurfaceImpl *This = (IWineD3DSurfaceImpl *)iface; IWineD3DSurfaceImpl *This = (IWineD3DSurfaceImpl *)iface;
IWineD3DDeviceImpl *device = This->resource.device; IWineD3DDeviceImpl *device = This->resource.device;
const RECT *pass_rect = pRect; const RECT *pass_rect = pRect;
...@@ -1746,7 +1742,7 @@ lock_end: ...@@ -1746,7 +1742,7 @@ lock_end:
} }
} }
return IWineD3DBaseSurfaceImpl_LockRect(iface, pLockedRect, pRect, Flags); return IWineD3DBaseSurfaceImpl_Map(iface, pLockedRect, pRect, Flags);
} }
static void flush_to_framebuffer_drawpixels(IWineD3DSurfaceImpl *This, GLenum fmt, GLenum type, UINT bpp, const BYTE *mem) { static void flush_to_framebuffer_drawpixels(IWineD3DSurfaceImpl *This, GLenum fmt, GLenum type, UINT bpp, const BYTE *mem) {
...@@ -1846,7 +1842,8 @@ static void flush_to_framebuffer_drawpixels(IWineD3DSurfaceImpl *This, GLenum fm ...@@ -1846,7 +1842,8 @@ static void flush_to_framebuffer_drawpixels(IWineD3DSurfaceImpl *This, GLenum fm
context_release(context); context_release(context);
} }
static HRESULT WINAPI IWineD3DSurfaceImpl_UnlockRect(IWineD3DSurface *iface) { static HRESULT WINAPI IWineD3DSurfaceImpl_Unmap(IWineD3DSurface *iface)
{
IWineD3DSurfaceImpl *This = (IWineD3DSurfaceImpl *)iface; IWineD3DSurfaceImpl *This = (IWineD3DSurfaceImpl *)iface;
IWineD3DDeviceImpl *device = This->resource.device; IWineD3DDeviceImpl *device = This->resource.device;
BOOL fullsurface; BOOL fullsurface;
...@@ -1917,13 +1914,16 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_UnlockRect(IWineD3DSurface *iface) { ...@@ -1917,13 +1914,16 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_UnlockRect(IWineD3DSurface *iface) {
break; break;
} }
if(!fullsurface) { if (!fullsurface)
/* Partial rectangle tracking is not commonly implemented, it is only done for render targets. Overwrite {
* the flags to bring them back into a sane state. INSYSMEM was set before to tell LoadLocation where /* Partial rectangle tracking is not commonly implemented, it is
* to read the rectangle from. Indrawable is set because all modifications from the partial sysmem copy * only done for render targets. Overwrite the flags to bring
* are written back to the drawable, thus the surface is merged again in the drawable. The sysmem copy is * them back into a sane state. INSYSMEM was set before to tell
* not fully up to date because only a subrectangle was read in LockRect. * surface_load_location() where to read the rectangle from.
*/ * Indrawable is set because all modifications from the partial
* sysmem copy are written back to the drawable, thus the surface
* is merged again in the drawable. The sysmem copy is not fully
* up to date because only a subrectangle was read in Map(). */
This->Flags &= ~SFLAG_INSYSMEM; This->Flags &= ~SFLAG_INSYSMEM;
This->Flags |= SFLAG_INDRAWABLE; This->Flags |= SFLAG_INDRAWABLE;
} }
...@@ -2031,19 +2031,17 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_GetDC(IWineD3DSurface *iface, HDC *pHD ...@@ -2031,19 +2031,17 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_GetDC(IWineD3DSurface *iface, HDC *pHD
This->resource.allocatedMemory = This->dib.bitmap_data; This->resource.allocatedMemory = This->dib.bitmap_data;
} }
/* Lock the surface */ /* Map the surface */
hr = IWineD3DSurface_LockRect(iface, hr = IWineD3DSurface_Map(iface, &lock, NULL, 0);
&lock,
NULL,
0);
if(This->Flags & SFLAG_PBO) { /* Sync the DIB with the PBO. This can't be done earlier because Map()
/* Sync the DIB with the PBO. This can't be done earlier because LockRect activates the allocatedMemory */ * activates the allocatedMemory. */
if (This->Flags & SFLAG_PBO)
memcpy(This->dib.bitmap_data, This->resource.allocatedMemory, This->dib.bitmap_size); memcpy(This->dib.bitmap_data, This->resource.allocatedMemory, This->dib.bitmap_size);
}
if(FAILED(hr)) { if (FAILED(hr))
ERR("IWineD3DSurface_LockRect failed with hr = %08x\n", hr); {
ERR("IWineD3DSurface_Map failed, hr %#x.\n", hr);
/* keep the dib section */ /* keep the dib section */
return hr; return hr;
} }
...@@ -2105,7 +2103,7 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_ReleaseDC(IWineD3DSurface *iface, HDC ...@@ -2105,7 +2103,7 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_ReleaseDC(IWineD3DSurface *iface, HDC
} }
/* we locked first, so unlock now */ /* we locked first, so unlock now */
IWineD3DSurface_UnlockRect(iface); IWineD3DSurface_Unmap(iface);
This->Flags &= ~SFLAG_DCINUSE; This->Flags &= ~SFLAG_DCINUSE;
...@@ -2649,8 +2647,10 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_SetMem(IWineD3DSurface *iface, void *M ...@@ -2649,8 +2647,10 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_SetMem(IWineD3DSurface *iface, void *M
/* Now free the old memory if any */ /* Now free the old memory if any */
HeapFree(GetProcessHeap(), 0, release); HeapFree(GetProcessHeap(), 0, release);
} else if(This->Flags & SFLAG_USERPTR) { }
/* LockRect and GetDC will re-create the dib section and allocated memory */ else if (This->Flags & SFLAG_USERPTR)
{
/* Map and GetDC will re-create the dib section and allocated memory. */
This->resource.allocatedMemory = NULL; This->resource.allocatedMemory = NULL;
/* HeapMemory should be NULL already */ /* HeapMemory should be NULL already */
if (This->resource.heapMemory) if (This->resource.heapMemory)
...@@ -4732,8 +4732,8 @@ const IWineD3DSurfaceVtbl IWineD3DSurface_Vtbl = ...@@ -4732,8 +4732,8 @@ const IWineD3DSurfaceVtbl IWineD3DSurface_Vtbl =
IWineD3DBaseSurfaceImpl_GetType, IWineD3DBaseSurfaceImpl_GetType,
/* IWineD3DSurface */ /* IWineD3DSurface */
IWineD3DBaseSurfaceImpl_GetDesc, IWineD3DBaseSurfaceImpl_GetDesc,
IWineD3DSurfaceImpl_LockRect, IWineD3DSurfaceImpl_Map,
IWineD3DSurfaceImpl_UnlockRect, IWineD3DSurfaceImpl_Unmap,
IWineD3DSurfaceImpl_GetDC, IWineD3DSurfaceImpl_GetDC,
IWineD3DSurfaceImpl_ReleaseDC, IWineD3DSurfaceImpl_ReleaseDC,
IWineD3DSurfaceImpl_Flip, IWineD3DSurfaceImpl_Flip,
......
...@@ -823,16 +823,18 @@ static IWineD3DSurfaceImpl *surface_convert_format(IWineD3DSurfaceImpl *source, ...@@ -823,16 +823,18 @@ static IWineD3DSurfaceImpl *surface_convert_format(IWineD3DSurfaceImpl *source,
memset(&lock_src, 0, sizeof(lock_src)); memset(&lock_src, 0, sizeof(lock_src));
memset(&lock_dst, 0, sizeof(lock_dst)); memset(&lock_dst, 0, sizeof(lock_dst));
hr = IWineD3DSurface_LockRect((IWineD3DSurface *) source, &lock_src, NULL, WINED3DLOCK_READONLY); hr = IWineD3DSurface_Map((IWineD3DSurface *)source, &lock_src, NULL, WINED3DLOCK_READONLY);
if(FAILED(hr)) { if (FAILED(hr))
ERR("Failed to lock the source surface\n"); {
ERR("Failed to lock the source surface.\n");
IWineD3DSurface_Release(ret); IWineD3DSurface_Release(ret);
return NULL; return NULL;
} }
hr = IWineD3DSurface_LockRect(ret, &lock_dst, NULL, WINED3DLOCK_READONLY); hr = IWineD3DSurface_Map(ret, &lock_dst, NULL, WINED3DLOCK_READONLY);
if(FAILED(hr)) { if (FAILED(hr))
{
ERR("Failed to lock the dest surface\n"); ERR("Failed to lock the dest surface\n");
IWineD3DSurface_UnlockRect((IWineD3DSurface *) source); IWineD3DSurface_Unmap((IWineD3DSurface *)source);
IWineD3DSurface_Release(ret); IWineD3DSurface_Release(ret);
return NULL; return NULL;
} }
...@@ -840,8 +842,8 @@ static IWineD3DSurfaceImpl *surface_convert_format(IWineD3DSurfaceImpl *source, ...@@ -840,8 +842,8 @@ static IWineD3DSurfaceImpl *surface_convert_format(IWineD3DSurfaceImpl *source,
conv->convert(lock_src.pBits, lock_dst.pBits, lock_src.Pitch, lock_dst.Pitch, conv->convert(lock_src.pBits, lock_dst.pBits, lock_src.Pitch, lock_dst.Pitch,
source->currentDesc.Width, source->currentDesc.Height); source->currentDesc.Width, source->currentDesc.Height);
IWineD3DSurface_UnlockRect(ret); IWineD3DSurface_Unmap(ret);
IWineD3DSurface_UnlockRect((IWineD3DSurface *) source); IWineD3DSurface_Unmap((IWineD3DSurface *)source);
return (IWineD3DSurfaceImpl *) ret; return (IWineD3DSurfaceImpl *) ret;
} }
...@@ -1093,7 +1095,7 @@ HRESULT WINAPI IWineD3DBaseSurfaceImpl_Blt(IWineD3DSurface *iface, const RECT *D ...@@ -1093,7 +1095,7 @@ HRESULT WINAPI IWineD3DBaseSurfaceImpl_Blt(IWineD3DSurface *iface, const RECT *D
if (src == This) if (src == This)
{ {
IWineD3DSurface_LockRect(iface, &dlock, NULL, 0); IWineD3DSurface_Map(iface, &dlock, NULL, 0);
slock = dlock; slock = dlock;
sEntry = This->resource.format; sEntry = This->resource.format;
dEntry = sEntry; dEntry = sEntry;
...@@ -1113,7 +1115,7 @@ HRESULT WINAPI IWineD3DBaseSurfaceImpl_Blt(IWineD3DSurface *iface, const RECT *D ...@@ -1113,7 +1115,7 @@ HRESULT WINAPI IWineD3DBaseSurfaceImpl_Blt(IWineD3DSurface *iface, const RECT *D
goto release; goto release;
} }
} }
IWineD3DSurface_LockRect((IWineD3DSurface *)src, &slock, NULL, WINED3DLOCK_READONLY); IWineD3DSurface_Map((IWineD3DSurface *)src, &slock, NULL, WINED3DLOCK_READONLY);
sEntry = src->resource.format; sEntry = src->resource.format;
} }
else else
...@@ -1121,9 +1123,9 @@ HRESULT WINAPI IWineD3DBaseSurfaceImpl_Blt(IWineD3DSurface *iface, const RECT *D ...@@ -1121,9 +1123,9 @@ HRESULT WINAPI IWineD3DBaseSurfaceImpl_Blt(IWineD3DSurface *iface, const RECT *D
sEntry = dEntry; sEntry = dEntry;
} }
if (DestRect) if (DestRect)
IWineD3DSurface_LockRect(iface, &dlock, &xdst, 0); IWineD3DSurface_Map(iface, &dlock, &xdst, 0);
else else
IWineD3DSurface_LockRect(iface, &dlock, NULL, 0); IWineD3DSurface_Map(iface, &dlock, NULL, 0);
} }
if (!DDBltFx || !(DDBltFx->dwDDFX)) Flags &= ~WINEDDBLT_DDFX; if (!DDBltFx || !(DDBltFx->dwDDFX)) Flags &= ~WINEDDBLT_DDFX;
...@@ -1523,8 +1525,8 @@ error: ...@@ -1523,8 +1525,8 @@ error:
} }
release: release:
IWineD3DSurface_UnlockRect(iface); IWineD3DSurface_Unmap(iface);
if (src && src != This) IWineD3DSurface_UnlockRect((IWineD3DSurface *)src); if (src && src != This) IWineD3DSurface_Unmap((IWineD3DSurface *)src);
/* Release the converted surface if any */ /* Release the converted surface if any */
if (src && src_surface != (IWineD3DSurface *)src) IWineD3DSurface_Release((IWineD3DSurface *)src); if (src && src_surface != (IWineD3DSurface *)src) IWineD3DSurface_Release((IWineD3DSurface *)src);
return ret; return ret;
...@@ -1624,8 +1626,8 @@ HRESULT WINAPI IWineD3DBaseSurfaceImpl_BltFast(IWineD3DSurface *iface, DWORD dst ...@@ -1624,8 +1626,8 @@ HRESULT WINAPI IWineD3DBaseSurfaceImpl_BltFast(IWineD3DSurface *iface, DWORD dst
UnionRect(&lock_union, &lock_src, &lock_dst); UnionRect(&lock_union, &lock_src, &lock_dst);
/* Lock the union of the two rectangles */ /* Lock the union of the two rectangles */
ret = IWineD3DSurface_LockRect(iface, &dlock, &lock_union, 0); ret = IWineD3DSurface_Map(iface, &dlock, &lock_union, 0);
if(ret != WINED3D_OK) goto error; if (FAILED(ret)) goto error;
pitch = dlock.Pitch; pitch = dlock.Pitch;
slock.Pitch = dlock.Pitch; slock.Pitch = dlock.Pitch;
...@@ -1638,10 +1640,10 @@ HRESULT WINAPI IWineD3DBaseSurfaceImpl_BltFast(IWineD3DSurface *iface, DWORD dst ...@@ -1638,10 +1640,10 @@ HRESULT WINAPI IWineD3DBaseSurfaceImpl_BltFast(IWineD3DSurface *iface, DWORD dst
} }
else else
{ {
ret = IWineD3DSurface_LockRect(src_surface, &slock, &lock_src, WINED3DLOCK_READONLY); ret = IWineD3DSurface_Map(src_surface, &slock, &lock_src, WINED3DLOCK_READONLY);
if(ret != WINED3D_OK) goto error; if (FAILED(ret)) goto error;
ret = IWineD3DSurface_LockRect(iface, &dlock, &lock_dst, 0); ret = IWineD3DSurface_Map(iface, &dlock, &lock_dst, 0);
if(ret != WINED3D_OK) goto error; if (FAILED(ret)) goto error;
sbuf = slock.pBits; sbuf = slock.pBits;
dbuf = dlock.pBits; dbuf = dlock.pBits;
...@@ -1795,18 +1797,19 @@ HRESULT WINAPI IWineD3DBaseSurfaceImpl_BltFast(IWineD3DSurface *iface, DWORD dst ...@@ -1795,18 +1797,19 @@ HRESULT WINAPI IWineD3DBaseSurfaceImpl_BltFast(IWineD3DSurface *iface, DWORD dst
error: error:
if (src == This) if (src == This)
{ {
IWineD3DSurface_UnlockRect(iface); IWineD3DSurface_Unmap(iface);
} }
else else
{ {
IWineD3DSurface_UnlockRect(iface); IWineD3DSurface_Unmap(iface);
IWineD3DSurface_UnlockRect(src_surface); IWineD3DSurface_Unmap(src_surface);
} }
return ret; return ret;
} }
HRESULT WINAPI IWineD3DBaseSurfaceImpl_LockRect(IWineD3DSurface *iface, WINED3DLOCKED_RECT* pLockedRect, CONST RECT* pRect, DWORD Flags) HRESULT WINAPI IWineD3DBaseSurfaceImpl_Map(IWineD3DSurface *iface,
WINED3DLOCKED_RECT *pLockedRect, const RECT *pRect, DWORD Flags)
{ {
IWineD3DSurfaceImpl *This = (IWineD3DSurfaceImpl *)iface; IWineD3DSurfaceImpl *This = (IWineD3DSurfaceImpl *)iface;
......
...@@ -109,26 +109,8 @@ static void WINAPI IWineGDISurfaceImpl_UnLoad(IWineD3DSurface *iface) ...@@ -109,26 +109,8 @@ static void WINAPI IWineGDISurfaceImpl_UnLoad(IWineD3DSurface *iface)
ERR("(%p): Please report to wine-devel\n", iface); ERR("(%p): Please report to wine-devel\n", iface);
} }
/***************************************************************************** static HRESULT WINAPI IWineGDISurfaceImpl_Map(IWineD3DSurface *iface,
* IWineD3DSurface::LockRect, GDI version WINED3DLOCKED_RECT *pLockedRect, const RECT *pRect, DWORD Flags)
*
* Locks the surface and returns a pointer to the surface memory
*
* Params:
* pLockedRect: Address to return the locking info at
* pRect: Rectangle to lock
* Flags: Some flags
*
* Returns:
* WINED3D_OK on success
* WINED3DERR_INVALIDCALL on errors
*
*****************************************************************************/
static HRESULT WINAPI
IWineGDISurfaceImpl_LockRect(IWineD3DSurface *iface,
WINED3DLOCKED_RECT* pLockedRect,
CONST RECT* pRect,
DWORD Flags)
{ {
IWineD3DSurfaceImpl *This = (IWineD3DSurfaceImpl *)iface; IWineD3DSurfaceImpl *This = (IWineD3DSurfaceImpl *)iface;
...@@ -149,29 +131,17 @@ IWineGDISurfaceImpl_LockRect(IWineD3DSurface *iface, ...@@ -149,29 +131,17 @@ IWineGDISurfaceImpl_LockRect(IWineD3DSurface *iface,
This->resource.allocatedMemory = This->dib.bitmap_data; This->resource.allocatedMemory = This->dib.bitmap_data;
} }
return IWineD3DBaseSurfaceImpl_LockRect(iface, pLockedRect, pRect, Flags); return IWineD3DBaseSurfaceImpl_Map(iface, pLockedRect, pRect, Flags);
} }
/***************************************************************************** static HRESULT WINAPI IWineGDISurfaceImpl_Unmap(IWineD3DSurface *iface)
* IWineD3DSurface::UnlockRect, GDI version
*
* Unlocks a surface. This implementation doesn't do much, except updating
* the window if the front buffer is unlocked
*
* Returns:
* WINED3D_OK on success
* WINED3DERR_INVALIDCALL on failure
*
*****************************************************************************/
static HRESULT WINAPI
IWineGDISurfaceImpl_UnlockRect(IWineD3DSurface *iface)
{ {
IWineD3DSurfaceImpl *This = (IWineD3DSurfaceImpl *)iface; IWineD3DSurfaceImpl *This = (IWineD3DSurfaceImpl *)iface;
TRACE("(%p)\n", This); TRACE("(%p)\n", This);
if (!(This->Flags & SFLAG_LOCKED)) if (!(This->Flags & SFLAG_LOCKED))
{ {
WARN("trying to Unlock an unlocked surf@%p\n", This); WARN("Trying to unmap unmapped surfaces %p.\n", iface);
return WINEDDERR_NOTLOCKED; return WINEDDERR_NOTLOCKED;
} }
...@@ -278,13 +248,11 @@ static HRESULT WINAPI IWineGDISurfaceImpl_GetDC(IWineD3DSurface *iface, HDC *pHD ...@@ -278,13 +248,11 @@ static HRESULT WINAPI IWineGDISurfaceImpl_GetDC(IWineD3DSurface *iface, HDC *pHD
/* Should have a DIB section already */ /* Should have a DIB section already */
/* Lock the surface */ /* Map the surface. */
hr = IWineD3DSurface_LockRect(iface, hr = IWineD3DSurface_Map(iface, &lock, NULL, 0);
&lock, if (FAILED(hr))
NULL, {
0); ERR("IWineD3DSurface_Map failed, hr %#x.\n", hr);
if(FAILED(hr)) {
ERR("IWineD3DSurface_LockRect failed with hr = %08x\n", hr);
/* keep the dib section */ /* keep the dib section */
return hr; return hr;
} }
...@@ -338,7 +306,7 @@ static HRESULT WINAPI IWineGDISurfaceImpl_ReleaseDC(IWineD3DSurface *iface, HDC ...@@ -338,7 +306,7 @@ static HRESULT WINAPI IWineGDISurfaceImpl_ReleaseDC(IWineD3DSurface *iface, HDC
} }
/* we locked first, so unlock now */ /* we locked first, so unlock now */
IWineD3DSurface_UnlockRect(iface); IWineD3DSurface_Unmap(iface);
This->Flags &= ~SFLAG_DCINUSE; This->Flags &= ~SFLAG_DCINUSE;
...@@ -466,8 +434,10 @@ static HRESULT WINAPI IWineGDISurfaceImpl_SetMem(IWineD3DSurface *iface, void *M ...@@ -466,8 +434,10 @@ static HRESULT WINAPI IWineGDISurfaceImpl_SetMem(IWineD3DSurface *iface, void *M
/* Now free the old memory if any */ /* Now free the old memory if any */
HeapFree(GetProcessHeap(), 0, release); HeapFree(GetProcessHeap(), 0, release);
} else if(This->Flags & SFLAG_USERPTR) { }
/* LockRect and GetDC will re-create the dib section and allocated memory */ else if(This->Flags & SFLAG_USERPTR)
{
/* Map() and GetDC() will re-create the dib section and allocated memory. */
This->resource.allocatedMemory = NULL; This->resource.allocatedMemory = NULL;
This->Flags &= ~SFLAG_USERPTR; This->Flags &= ~SFLAG_USERPTR;
} }
...@@ -504,8 +474,8 @@ const IWineD3DSurfaceVtbl IWineGDISurface_Vtbl = ...@@ -504,8 +474,8 @@ const IWineD3DSurfaceVtbl IWineGDISurface_Vtbl =
IWineD3DBaseSurfaceImpl_GetType, IWineD3DBaseSurfaceImpl_GetType,
/* IWineD3DSurface */ /* IWineD3DSurface */
IWineD3DBaseSurfaceImpl_GetDesc, IWineD3DBaseSurfaceImpl_GetDesc,
IWineGDISurfaceImpl_LockRect, IWineGDISurfaceImpl_Map,
IWineGDISurfaceImpl_UnlockRect, IWineGDISurfaceImpl_Unmap,
IWineGDISurfaceImpl_GetDC, IWineGDISurfaceImpl_GetDC,
IWineGDISurfaceImpl_ReleaseDC, IWineGDISurfaceImpl_ReleaseDC,
IWineGDISurfaceImpl_Flip, IWineGDISurfaceImpl_Flip,
......
...@@ -376,7 +376,7 @@ static HRESULT WINAPI IWineD3DTextureImpl_GetSurfaceLevel(IWineD3DTexture *iface ...@@ -376,7 +376,7 @@ static HRESULT WINAPI IWineD3DTextureImpl_GetSurfaceLevel(IWineD3DTexture *iface
return WINED3D_OK; return WINED3D_OK;
} }
static HRESULT WINAPI IWineD3DTextureImpl_LockRect(IWineD3DTexture *iface, static HRESULT WINAPI IWineD3DTextureImpl_Map(IWineD3DTexture *iface,
UINT level, WINED3DLOCKED_RECT *locked_rect, const RECT *rect, DWORD flags) UINT level, WINED3DLOCKED_RECT *locked_rect, const RECT *rect, DWORD flags)
{ {
IWineD3DBaseTextureImpl *texture = (IWineD3DBaseTextureImpl *)iface; IWineD3DBaseTextureImpl *texture = (IWineD3DBaseTextureImpl *)iface;
...@@ -391,10 +391,10 @@ static HRESULT WINAPI IWineD3DTextureImpl_LockRect(IWineD3DTexture *iface, ...@@ -391,10 +391,10 @@ static HRESULT WINAPI IWineD3DTextureImpl_LockRect(IWineD3DTexture *iface,
return WINED3DERR_INVALIDCALL; return WINED3DERR_INVALIDCALL;
} }
return IWineD3DSurface_LockRect(surface, locked_rect, rect, flags); return IWineD3DSurface_Map(surface, locked_rect, rect, flags);
} }
static HRESULT WINAPI IWineD3DTextureImpl_UnlockRect(IWineD3DTexture *iface, UINT level) static HRESULT WINAPI IWineD3DTextureImpl_Unmap(IWineD3DTexture *iface, UINT level)
{ {
IWineD3DBaseTextureImpl *texture = (IWineD3DBaseTextureImpl *)iface; IWineD3DBaseTextureImpl *texture = (IWineD3DBaseTextureImpl *)iface;
IWineD3DSurface *surface; IWineD3DSurface *surface;
...@@ -407,7 +407,7 @@ static HRESULT WINAPI IWineD3DTextureImpl_UnlockRect(IWineD3DTexture *iface, UIN ...@@ -407,7 +407,7 @@ static HRESULT WINAPI IWineD3DTextureImpl_UnlockRect(IWineD3DTexture *iface, UIN
return WINED3DERR_INVALIDCALL; return WINED3DERR_INVALIDCALL;
} }
return IWineD3DSurface_UnlockRect(surface); return IWineD3DSurface_Unmap(surface);
} }
static HRESULT WINAPI IWineD3DTextureImpl_AddDirtyRect(IWineD3DTexture *iface, const RECT *dirty_rect) static HRESULT WINAPI IWineD3DTextureImpl_AddDirtyRect(IWineD3DTexture *iface, const RECT *dirty_rect)
...@@ -460,8 +460,8 @@ static const IWineD3DTextureVtbl IWineD3DTexture_Vtbl = ...@@ -460,8 +460,8 @@ static const IWineD3DTextureVtbl IWineD3DTexture_Vtbl =
/* IWineD3DTexture */ /* IWineD3DTexture */
IWineD3DTextureImpl_GetLevelDesc, IWineD3DTextureImpl_GetLevelDesc,
IWineD3DTextureImpl_GetSurfaceLevel, IWineD3DTextureImpl_GetSurfaceLevel,
IWineD3DTextureImpl_LockRect, IWineD3DTextureImpl_Map,
IWineD3DTextureImpl_UnlockRect, IWineD3DTextureImpl_Unmap,
IWineD3DTextureImpl_AddDirtyRect IWineD3DTextureImpl_AddDirtyRect
}; };
......
...@@ -205,7 +205,9 @@ static void WINAPI IWineD3DVolumeImpl_GetDesc(IWineD3DVolume *iface, WINED3DVOLU ...@@ -205,7 +205,9 @@ static void WINAPI IWineD3DVolumeImpl_GetDesc(IWineD3DVolume *iface, WINED3DVOLU
desc->Depth = volume->currentDesc.Depth; desc->Depth = volume->currentDesc.Depth;
} }
static HRESULT WINAPI IWineD3DVolumeImpl_LockBox(IWineD3DVolume *iface, WINED3DLOCKED_BOX* pLockedVolume, CONST WINED3DBOX* pBox, DWORD Flags) { static HRESULT WINAPI IWineD3DVolumeImpl_Map(IWineD3DVolume *iface,
WINED3DLOCKED_BOX *pLockedVolume, const WINED3DBOX *pBox, DWORD Flags)
{
IWineD3DVolumeImpl *This = (IWineD3DVolumeImpl *)iface; IWineD3DVolumeImpl *This = (IWineD3DVolumeImpl *)iface;
FIXME("(%p) : pBox=%p stub\n", This, pBox); FIXME("(%p) : pBox=%p stub\n", This, pBox);
...@@ -257,7 +259,8 @@ static HRESULT WINAPI IWineD3DVolumeImpl_LockBox(IWineD3DVolume *iface, WINED3DL ...@@ -257,7 +259,8 @@ static HRESULT WINAPI IWineD3DVolumeImpl_LockBox(IWineD3DVolume *iface, WINED3DL
return WINED3D_OK; return WINED3D_OK;
} }
static HRESULT WINAPI IWineD3DVolumeImpl_UnlockBox(IWineD3DVolume *iface) { static HRESULT WINAPI IWineD3DVolumeImpl_Unmap(IWineD3DVolume *iface)
{
IWineD3DVolumeImpl *This = (IWineD3DVolumeImpl *)iface; IWineD3DVolumeImpl *This = (IWineD3DVolumeImpl *)iface;
if (!This->locked) if (!This->locked)
{ {
...@@ -321,8 +324,8 @@ static const IWineD3DVolumeVtbl IWineD3DVolume_Vtbl = ...@@ -321,8 +324,8 @@ static const IWineD3DVolumeVtbl IWineD3DVolume_Vtbl =
IWineD3DVolumeImpl_GetType, IWineD3DVolumeImpl_GetType,
/* IWineD3DVolume */ /* IWineD3DVolume */
IWineD3DVolumeImpl_GetDesc, IWineD3DVolumeImpl_GetDesc,
IWineD3DVolumeImpl_LockBox, IWineD3DVolumeImpl_Map,
IWineD3DVolumeImpl_UnlockBox, IWineD3DVolumeImpl_Unmap,
/* Internal interface */ /* Internal interface */
IWineD3DVolumeImpl_LoadTexture, IWineD3DVolumeImpl_LoadTexture,
}; };
......
...@@ -293,7 +293,7 @@ static HRESULT WINAPI IWineD3DVolumeTextureImpl_GetVolumeLevel(IWineD3DVolumeTex ...@@ -293,7 +293,7 @@ static HRESULT WINAPI IWineD3DVolumeTextureImpl_GetVolumeLevel(IWineD3DVolumeTex
return WINED3D_OK; return WINED3D_OK;
} }
static HRESULT WINAPI IWineD3DVolumeTextureImpl_LockBox(IWineD3DVolumeTexture *iface, static HRESULT WINAPI IWineD3DVolumeTextureImpl_Map(IWineD3DVolumeTexture *iface,
UINT level, WINED3DLOCKED_BOX *locked_box, const WINED3DBOX *box, DWORD flags) UINT level, WINED3DLOCKED_BOX *locked_box, const WINED3DBOX *box, DWORD flags)
{ {
IWineD3DBaseTextureImpl *texture = (IWineD3DBaseTextureImpl *)iface; IWineD3DBaseTextureImpl *texture = (IWineD3DBaseTextureImpl *)iface;
...@@ -308,10 +308,10 @@ static HRESULT WINAPI IWineD3DVolumeTextureImpl_LockBox(IWineD3DVolumeTexture *i ...@@ -308,10 +308,10 @@ static HRESULT WINAPI IWineD3DVolumeTextureImpl_LockBox(IWineD3DVolumeTexture *i
return WINED3DERR_INVALIDCALL; return WINED3DERR_INVALIDCALL;
} }
return IWineD3DVolume_LockBox(volume, locked_box, box, flags); return IWineD3DVolume_Map(volume, locked_box, box, flags);
} }
static HRESULT WINAPI IWineD3DVolumeTextureImpl_UnlockBox(IWineD3DVolumeTexture *iface, UINT level) static HRESULT WINAPI IWineD3DVolumeTextureImpl_Unmap(IWineD3DVolumeTexture *iface, UINT level)
{ {
IWineD3DBaseTextureImpl *texture = (IWineD3DBaseTextureImpl *)iface; IWineD3DBaseTextureImpl *texture = (IWineD3DBaseTextureImpl *)iface;
IWineD3DVolume *volume; IWineD3DVolume *volume;
...@@ -324,7 +324,7 @@ static HRESULT WINAPI IWineD3DVolumeTextureImpl_UnlockBox(IWineD3DVolumeTexture ...@@ -324,7 +324,7 @@ static HRESULT WINAPI IWineD3DVolumeTextureImpl_UnlockBox(IWineD3DVolumeTexture
return WINED3DERR_INVALIDCALL; return WINED3DERR_INVALIDCALL;
} }
return IWineD3DVolume_UnlockBox(volume); return IWineD3DVolume_Unmap(volume);
} }
static HRESULT WINAPI IWineD3DVolumeTextureImpl_AddDirtyBox(IWineD3DVolumeTexture *iface, const WINED3DBOX *dirty_box) static HRESULT WINAPI IWineD3DVolumeTextureImpl_AddDirtyBox(IWineD3DVolumeTexture *iface, const WINED3DBOX *dirty_box)
...@@ -378,8 +378,8 @@ static const IWineD3DVolumeTextureVtbl IWineD3DVolumeTexture_Vtbl = ...@@ -378,8 +378,8 @@ static const IWineD3DVolumeTextureVtbl IWineD3DVolumeTexture_Vtbl =
/* volume texture */ /* volume texture */
IWineD3DVolumeTextureImpl_GetLevelDesc, IWineD3DVolumeTextureImpl_GetLevelDesc,
IWineD3DVolumeTextureImpl_GetVolumeLevel, IWineD3DVolumeTextureImpl_GetVolumeLevel,
IWineD3DVolumeTextureImpl_LockBox, IWineD3DVolumeTextureImpl_Map,
IWineD3DVolumeTextureImpl_UnlockBox, IWineD3DVolumeTextureImpl_Unmap,
IWineD3DVolumeTextureImpl_AddDirtyBox IWineD3DVolumeTextureImpl_AddDirtyBox
}; };
......
...@@ -2203,7 +2203,7 @@ HRESULT WINAPI IWineD3DBaseSurfaceImpl_Blt(IWineD3DSurface *iface, const RECT *d ...@@ -2203,7 +2203,7 @@ HRESULT WINAPI IWineD3DBaseSurfaceImpl_Blt(IWineD3DSurface *iface, const RECT *d
const RECT *src_rect, DWORD flags, const WINEDDBLTFX *fx, WINED3DTEXTUREFILTERTYPE filter) DECLSPEC_HIDDEN; const RECT *src_rect, DWORD flags, const WINEDDBLTFX *fx, WINED3DTEXTUREFILTERTYPE filter) DECLSPEC_HIDDEN;
HRESULT WINAPI IWineD3DBaseSurfaceImpl_BltFast(IWineD3DSurface *iface, DWORD dstx, DWORD dsty, HRESULT WINAPI IWineD3DBaseSurfaceImpl_BltFast(IWineD3DSurface *iface, DWORD dstx, DWORD dsty,
IWineD3DSurface *Source, const RECT *rsrc, DWORD trans) DECLSPEC_HIDDEN; IWineD3DSurface *Source, const RECT *rsrc, DWORD trans) DECLSPEC_HIDDEN;
HRESULT WINAPI IWineD3DBaseSurfaceImpl_LockRect(IWineD3DSurface *iface, WINED3DLOCKED_RECT *pLockedRect, HRESULT WINAPI IWineD3DBaseSurfaceImpl_Map(IWineD3DSurface *iface, WINED3DLOCKED_RECT *pLockedRect,
const RECT *pRect, DWORD Flags) DECLSPEC_HIDDEN; const RECT *pRect, DWORD Flags) DECLSPEC_HIDDEN;
const void *WINAPI IWineD3DBaseSurfaceImpl_GetData(IWineD3DSurface *iface) DECLSPEC_HIDDEN; const void *WINAPI IWineD3DBaseSurfaceImpl_GetData(IWineD3DSurface *iface) DECLSPEC_HIDDEN;
......
...@@ -2377,12 +2377,12 @@ interface IWineD3DSurface : IWineD3DResource ...@@ -2377,12 +2377,12 @@ interface IWineD3DSurface : IWineD3DResource
void GetDesc( void GetDesc(
[out] WINED3DSURFACE_DESC *desc [out] WINED3DSURFACE_DESC *desc
); );
HRESULT LockRect( HRESULT Map(
[out] WINED3DLOCKED_RECT *locked_rect, [out] WINED3DLOCKED_RECT *locked_rect,
[in] const RECT *rect, [in] const RECT *rect,
[in] DWORD flags [in] DWORD flags
); );
HRESULT UnlockRect( HRESULT Unmap(
); );
HRESULT GetDC( HRESULT GetDC(
[out] HDC *dc [out] HDC *dc
...@@ -2490,12 +2490,12 @@ interface IWineD3DVolume : IWineD3DResource ...@@ -2490,12 +2490,12 @@ interface IWineD3DVolume : IWineD3DResource
void GetDesc( void GetDesc(
[out] WINED3DVOLUME_DESC *desc [out] WINED3DVOLUME_DESC *desc
); );
HRESULT LockBox( HRESULT Map(
[out] WINED3DLOCKED_BOX *locked_box, [out] WINED3DLOCKED_BOX *locked_box,
[in] const WINED3DBOX *box, [in] const WINED3DBOX *box,
[in] DWORD flags [in] DWORD flags
); );
HRESULT UnlockBox( HRESULT Unmap(
); );
HRESULT LoadTexture( HRESULT LoadTexture(
[in] int gl_level, [in] int gl_level,
...@@ -2551,13 +2551,13 @@ interface IWineD3DTexture : IWineD3DBaseTexture ...@@ -2551,13 +2551,13 @@ interface IWineD3DTexture : IWineD3DBaseTexture
[in] UINT level, [in] UINT level,
[out] IWineD3DSurface **surface [out] IWineD3DSurface **surface
); );
HRESULT LockRect( HRESULT Map(
[in] UINT level, [in] UINT level,
[out] WINED3DLOCKED_RECT *locked_rect, [out] WINED3DLOCKED_RECT *locked_rect,
[in] const RECT *rect, [in] const RECT *rect,
[in] DWORD flags [in] DWORD flags
); );
HRESULT UnlockRect( HRESULT Unmap(
[in] UINT level [in] UINT level
); );
HRESULT AddDirtyRect( HRESULT AddDirtyRect(
...@@ -2581,14 +2581,14 @@ interface IWineD3DCubeTexture : IWineD3DBaseTexture ...@@ -2581,14 +2581,14 @@ interface IWineD3DCubeTexture : IWineD3DBaseTexture
[in] UINT level, [in] UINT level,
[out] IWineD3DSurface **surface [out] IWineD3DSurface **surface
); );
HRESULT LockRect( HRESULT Map(
[in] WINED3DCUBEMAP_FACES face, [in] WINED3DCUBEMAP_FACES face,
[in] UINT level, [in] UINT level,
[out] WINED3DLOCKED_RECT *locked_rect, [out] WINED3DLOCKED_RECT *locked_rect,
[in] const RECT *rect, [in] const RECT *rect,
[in] DWORD flags [in] DWORD flags
); );
HRESULT UnlockRect( HRESULT Unmap(
[in] WINED3DCUBEMAP_FACES face, [in] WINED3DCUBEMAP_FACES face,
[in] UINT level [in] UINT level
); );
...@@ -2613,13 +2613,13 @@ interface IWineD3DVolumeTexture : IWineD3DBaseTexture ...@@ -2613,13 +2613,13 @@ interface IWineD3DVolumeTexture : IWineD3DBaseTexture
[in] UINT level, [in] UINT level,
[out] IWineD3DVolume **volume [out] IWineD3DVolume **volume
); );
HRESULT LockBox( HRESULT Map(
[in] UINT level, [in] UINT level,
[out] WINED3DLOCKED_BOX *locked_box, [out] WINED3DLOCKED_BOX *locked_box,
[in] const WINED3DBOX *box, [in] const WINED3DBOX *box,
[in] DWORD flags [in] DWORD flags
); );
HRESULT UnlockBox( HRESULT Unmap(
[in] UINT level [in] UINT level
); );
HRESULT AddDirtyBox( HRESULT AddDirtyBox(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment