aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Sandulenko2019-11-06 14:49:18 +0100
committerEugene Sandulenko2019-11-13 22:07:08 +0100
commitce0f0f62e9ce7756b55f40254cad7d525580dd8a (patch)
tree331a85a2e116800347757edc01801679cc7e24e6
parent623686382decfe03bf742f2797d6dbc441a6b019 (diff)
downloadscummvm-rg350-ce0f0f62e9ce7756b55f40254cad7d525580dd8a.tar.gz
scummvm-rg350-ce0f0f62e9ce7756b55f40254cad7d525580dd8a.tar.bz2
scummvm-rg350-ce0f0f62e9ce7756b55f40254cad7d525580dd8a.zip
GRIFFON: Optimized transparent blitting
-rw-r--r--engines/griffon/dialogs.cpp14
-rw-r--r--engines/griffon/resources.cpp5
2 files changed, 8 insertions, 11 deletions
diff --git a/engines/griffon/dialogs.cpp b/engines/griffon/dialogs.cpp
index f7d6b14982..0e3e67b328 100644
--- a/engines/griffon/dialogs.cpp
+++ b/engines/griffon/dialogs.cpp
@@ -449,6 +449,8 @@ void GriffonEngine::configMenu() {
g_system->delayMillis(10);
} while (!_shouldQuit && !exitMenu);
+ _cloudImg->setAlpha(64, true);
+
configwindow->free();
_itemTicks = _ticks + 210;
}
@@ -458,9 +460,6 @@ void GriffonEngine::saveLoadNew() {
_cloudAngle = 0;
- _videoBuffer->setAlpha(255);
- _saveLoadImg->setAlpha(192, true);
-
int curRow = 0;
int curCol = 0;
bool lowerLock = false;
@@ -469,6 +468,8 @@ void GriffonEngine::saveLoadNew() {
int ticks1 = _ticks;
int tickpause = _ticks + 150;
+ _cloudImg->setAlpha(128, true);
+
do {
_videoBuffer->fillRect(Common::Rect(0, 0, _videoBuffer->w, _videoBuffer->h), 0);
@@ -479,18 +480,14 @@ void GriffonEngine::saveLoadNew() {
rcDest.setWidth(320);
rcDest.setHeight(240);
- _cloudImg->setAlpha(128, true);
_cloudImg->blit(*_videoBuffer, 0, 0, Graphics::FLIP_NONE, &rcDest);
- _cloudImg->setAlpha(64, true);
rcDest.left = 256;
rcDest.top = 192;
rcDest.setWidth(320);
rcDest.setHeight(240);
- _cloudImg->setAlpha(128, true);
_cloudImg->blit(*_videoBuffer, 0, 0, Graphics::FLIP_NONE, &rcDest);
- _cloudImg->setAlpha(64, true);
_saveLoadImg->blit(*_videoBuffer);
@@ -729,9 +726,10 @@ void GriffonEngine::saveLoadNew() {
if (_ticks < ticks1 + 1000) {
yy = 255 * (_ticks - ticks1) / 1000;
yy = CLIP(yy, 0, 255);
+
+ _videoBuffer->setAlpha((int)yy);
}
- _videoBuffer->setAlpha((int)yy);
g_system->copyRectToScreen(_videoBuffer->getPixels(), _videoBuffer->pitch, 0, 0, _videoBuffer->w, _videoBuffer->h);
g_system->updateScreen();
g_system->getEventManager()->pollEvent(_event);
diff --git a/engines/griffon/resources.cpp b/engines/griffon/resources.cpp
index e0da5c1d67..5ff8aa68e2 100644
--- a/engines/griffon/resources.cpp
+++ b/engines/griffon/resources.cpp
@@ -80,11 +80,10 @@ void GriffonEngine::initialize() {
}
_cloudImg = loadImage("art/clouds.bmp", true);
- _cloudImg->setAlpha(96, true);
-
+ _cloudImg->setAlpha(64, true);
_saveLoadImg = loadImage("art/saveloadnew.bmp", true);
- _saveLoadImg->setAlpha(160, true);
+ _saveLoadImg->setAlpha(192, true);
_titleImg = loadImage("art/titleb.bmp");
_titleImg2 = loadImage("art/titlea.bmp", true);