Module: wine Branch: master Commit: 27a0b8a5f0a1e385efd451f615d2bba24899ff46 URL: http://source.winehq.org/git/wine.git/?a=commit;h=27a0b8a5f0a1e385efd451f615...
Author: Henri Verbeet hverbeet@codeweavers.com Date: Tue Apr 29 22:02:48 2014 +0200
ddraw: Only output a warning when clearing a viewport without background material.
---
dlls/ddraw/viewport.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-)
diff --git a/dlls/ddraw/viewport.c b/dlls/ddraw/viewport.c index e557161..a1126ec 100644 --- a/dlls/ddraw/viewport.c +++ b/dlls/ddraw/viewport.c @@ -665,16 +665,13 @@ static HRESULT WINAPI d3d_viewport_Clear(IDirect3DViewport3 *iface,
if (flags & D3DCLEAR_TARGET) { - if (This->background == NULL) { - ERR(" Trying to clear the color buffer without background material!\n"); - } + if (!This->background) + WARN("No background material set.\n"); else - { - color = ((int)((This->background->mat.u.diffuse.u1.r) * 255) << 16) - | ((int) ((This->background->mat.u.diffuse.u2.g) * 255) << 8) - | ((int) ((This->background->mat.u.diffuse.u3.b) * 255) << 0) - | ((int) ((This->background->mat.u.diffuse.u4.a) * 255) << 24); - } + color = D3DRGBA(This->background->mat.u.diffuse.u1.r, + This->background->mat.u.diffuse.u2.g, + This->background->mat.u.diffuse.u3.b, + This->background->mat.u.diffuse.u4.a); }
/* Need to temporarily activate viewport to clear it. Previously active one will be restored