Signed-off-by: Zhiyi Zhang zzhang@codeweavers.com --- dlls/ddraw/ddraw.c | 6 +----- dlls/ddraw/surface.c | 9 +-------- dlls/ddraw/utils.c | 7 +++++-- 3 files changed, 7 insertions(+), 15 deletions(-)
diff --git a/dlls/ddraw/ddraw.c b/dlls/ddraw/ddraw.c index 1c104548f64..7cfb56f45cc 100644 --- a/dlls/ddraw/ddraw.c +++ b/dlls/ddraw/ddraw.c @@ -1146,11 +1146,7 @@ static HRESULT WINAPI ddraw7_SetDisplayMode(IDirectDraw7 *iface, DWORD width, DW
wined3d_mutex_unlock();
- switch (hr) - { - case WINED3DERR_NOTAVAILABLE: return DDERR_UNSUPPORTED; - default: return hr; - } + return hr_ddraw_from_wined3d(hr); }
static HRESULT WINAPI ddraw4_SetDisplayMode(IDirectDraw4 *iface, DWORD width, DWORD height, diff --git a/dlls/ddraw/surface.c b/dlls/ddraw/surface.c index 04b398855ba..c418bb7b2b3 100644 --- a/dlls/ddraw/surface.c +++ b/dlls/ddraw/surface.c @@ -3931,14 +3931,7 @@ static HRESULT WINAPI ddraw_surface7_UpdateOverlay(IDirectDrawSurface7 *iface, R src_rect, dst_wined3d_texture, dst_sub_resource_idx, dst_rect, flags); wined3d_mutex_unlock();
- switch (hr) - { - case WINED3DERR_INVALIDCALL: return DDERR_INVALIDPARAMS; - case WINEDDERR_NOTAOVERLAYSURFACE: return DDERR_NOTAOVERLAYSURFACE; - case WINEDDERR_OVERLAYNOTVISIBLE: return DDERR_OVERLAYNOTVISIBLE; - default: - return hr; - } + return hr_ddraw_from_wined3d(hr); }
static HRESULT WINAPI ddraw_surface4_UpdateOverlay(IDirectDrawSurface4 *iface, RECT *src_rect, diff --git a/dlls/ddraw/utils.c b/dlls/ddraw/utils.c index 23e75a32fc7..efc1dddd189 100644 --- a/dlls/ddraw/utils.c +++ b/dlls/ddraw/utils.c @@ -1189,8 +1189,11 @@ hr_ddraw_from_wined3d(HRESULT hr) { switch(hr) { - case WINED3DERR_INVALIDCALL: return DDERR_INVALIDPARAMS; - default: return hr; + case WINED3DERR_INVALIDCALL: return DDERR_INVALIDPARAMS; + case WINED3DERR_NOTAVAILABLE: return DDERR_UNSUPPORTED; + case WINEDDERR_NOTAOVERLAYSURFACE: return DDERR_NOTAOVERLAYSURFACE; + case WINEDDERR_OVERLAYNOTVISIBLE: return DDERR_OVERLAYNOTVISIBLE; + default: return hr; } }