From a4ffe2cf559cef835ca267d02018c48376857393 Mon Sep 17 00:00:00 2001 From: Strangerke Date: Thu, 7 Nov 2019 22:16:43 +0100 Subject: GRIFFON: Reduce the scope of two variables --- engines/griffon/dialogs.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/engines/griffon/dialogs.cpp b/engines/griffon/dialogs.cpp index 870de81c41..7c83639bdc 100644 --- a/engines/griffon/dialogs.cpp +++ b/engines/griffon/dialogs.cpp @@ -319,12 +319,11 @@ void GriffonEngine::configMenu() { _itemImg[15]->blit(*_videoBuffer, rc.left, rc.top); - float yy = 255.0; if (_ticks < ticks1 + 1000) { - yy = 255.0 * ((float)(_ticks - ticks1) / 1000.0); + float yy = 255.0 * ((float)(_ticks - ticks1) / 1000.0); yy = CLIP(yy, 0.0, 255.0); - _videoBuffer->setAlpha((int)yy); + _videoBuffer->setAlpha((uint8)yy); } _videoBuffer->blit(*_videoBuffer2); @@ -716,12 +715,11 @@ void GriffonEngine::saveLoadNew() { _itemImg[15]->blit(*_videoBuffer, rcDest.left, rcDest.top); } - int yy = 255; if (_ticks < ticks1 + 1000) { - yy = 255 * (_ticks - ticks1) / 1000; + int yy = 255 * (_ticks - ticks1) / 1000; yy = CLIP(yy, 0, 255); - _videoBuffer->setAlpha((int)yy); + _videoBuffer->setAlpha((uint8)yy); } _videoBuffer3->fillRect(Common::Rect(0, 0, _videoBuffer3->w, _videoBuffer3->h), 0); -- cgit v1.2.3