[Scummvm-git-logs] scummvm master -> 26ba833c6a39d8018c709c014631f9ec77c3fc46
sev-
sev at scummvm.org
Mon Mar 30 21:37:39 UTC 2020
This automated email contains information about 4 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
b468cc0706 DIRECTOR: Fix memory leak
4ac9f9739e DIRECTOR: Implement kTransDissolvePatterns
e6d78fd059 DIRECTOR: Small optimization to transition rendering
26ba833c6a GRIFFON: Remove redundant call
Commit: b468cc07063c29cfbf5e9e51a2a5de1bab24b764
https://github.com/scummvm/scummvm/commit/b468cc07063c29cfbf5e9e51a2a5de1bab24b764
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2020-03-30T23:37:21+02:00
Commit Message:
DIRECTOR: Fix memory leak
Changed paths:
engines/director/score.cpp
diff --git a/engines/director/score.cpp b/engines/director/score.cpp
index b797e1724b..ff1bd94c87 100644
--- a/engines/director/score.cpp
+++ b/engines/director/score.cpp
@@ -433,6 +433,9 @@ Score::~Score() {
delete _surface;
delete _trailSurface;
+ for (uint i = 0; i < _frames.size(); i++)
+ delete _frames[i];
+
if (_movieArchive)
_movieArchive->close();
Commit: 4ac9f9739e7ae7d4c9c2f4b4bc2b7cafde19ebc8
https://github.com/scummvm/scummvm/commit/4ac9f9739e7ae7d4c9c2f4b4bc2b7cafde19ebc8
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2020-03-30T23:37:21+02:00
Commit Message:
DIRECTOR: Implement kTransDissolvePatterns
Changed paths:
engines/director/transitions.cpp
diff --git a/engines/director/transitions.cpp b/engines/director/transitions.cpp
index b08cf82d05..7ca846ca80 100644
--- a/engines/director/transitions.cpp
+++ b/engines/director/transitions.cpp
@@ -144,6 +144,7 @@ struct TransParams {
static void initTransParams(TransParams &t, Score *score, Common::Rect &clipRect);
static void dissolveTrans(TransParams &t, Score *score, Common::Rect &clipRect);
+static void dissolvePatternsTrans(TransParams &t, Score *score, Common::Rect &clipRect);
void Frame::playTransition(Score *score) {
TransParams t;
@@ -164,6 +165,12 @@ void Frame::playTransition(Score *score) {
initTransParams(t, score, clipRect);
+ if (t.type == kTransDissolvePatterns) {
+ dissolvePatternsTrans(t, score, clipRect);
+
+ return;
+ }
+
if (transProps[t.type].algo == kTransAlgoDissolve) {
dissolveTrans(t, score, clipRect);
@@ -401,6 +408,111 @@ static void dissolveTrans(TransParams &t, Score *score, Common::Rect &clipRect)
}
}
+static byte dissolvePatterns[][8] = {
+ { 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
+ { 0x80, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00 },
+ { 0x88, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00 },
+ { 0x88, 0x00, 0x00, 0x00, 0x88, 0x00, 0x00, 0x00 },
+ { 0x88, 0x00, 0x20, 0x00, 0x88, 0x00, 0x00, 0x00 },
+ { 0x88, 0x00, 0x20, 0x00, 0x88, 0x00, 0x02, 0x00 },
+ { 0x88, 0x00, 0x22, 0x00, 0x88, 0x00, 0x02, 0x00 },
+ { 0x88, 0x00, 0x22, 0x00, 0x88, 0x00, 0x22, 0x00 },
+ { 0xa8, 0x00, 0x22, 0x00, 0x88, 0x00, 0x22, 0x00 },
+ { 0xa8, 0x00, 0x22, 0x00, 0x8a, 0x00, 0x22, 0x00 },
+ { 0xaa, 0x00, 0x22, 0x00, 0x8a, 0x00, 0x22, 0x00 },
+ { 0xaa, 0x00, 0x22, 0x00, 0xaa, 0x00, 0x22, 0x00 },
+ { 0xaa, 0x00, 0xa2, 0x00, 0xaa, 0x00, 0x22, 0x00 },
+ { 0xaa, 0x00, 0xa2, 0x00, 0xaa, 0x00, 0x2a, 0x00 },
+ { 0xaa, 0x00, 0xaa, 0x00, 0xaa, 0x00, 0x2a, 0x00 },
+ { 0xaa, 0x00, 0xaa, 0x00, 0xaa, 0x00, 0xaa, 0x00 },
+ { 0xaa, 0x40, 0xaa, 0x00, 0xaa, 0x00, 0xaa, 0x00 },
+ { 0xaa, 0x40, 0xaa, 0x00, 0xaa, 0x04, 0xaa, 0x00 },
+ { 0xaa, 0x44, 0xaa, 0x00, 0xaa, 0x04, 0xaa, 0x00 },
+ { 0xaa, 0x44, 0xaa, 0x00, 0xaa, 0x44, 0xaa, 0x00 },
+ { 0xaa, 0x44, 0xaa, 0x10, 0xaa, 0x44, 0xaa, 0x00 },
+ { 0xaa, 0x44, 0xaa, 0x10, 0xaa, 0x44, 0xaa, 0x01 },
+ { 0xaa, 0x44, 0xaa, 0x11, 0xaa, 0x44, 0xaa, 0x01 },
+ { 0xaa, 0x44, 0xaa, 0x11, 0xaa, 0x44, 0xaa, 0x11 },
+ { 0xaa, 0x54, 0xaa, 0x11, 0xaa, 0x44, 0xaa, 0x11 },
+ { 0xaa, 0x54, 0xaa, 0x11, 0xaa, 0x45, 0xaa, 0x11 },
+ { 0xaa, 0x55, 0xaa, 0x11, 0xaa, 0x45, 0xaa, 0x11 },
+ { 0xaa, 0x55, 0xaa, 0x11, 0xaa, 0x55, 0xaa, 0x11 },
+ { 0xaa, 0x55, 0xaa, 0x51, 0xaa, 0x55, 0xaa, 0x11 },
+ { 0xaa, 0x55, 0xaa, 0x51, 0xaa, 0x55, 0xaa, 0x15 },
+ { 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x15 },
+ { 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55 },
+ { 0xea, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55 },
+ { 0xea, 0x55, 0xaa, 0x55, 0xae, 0x55, 0xaa, 0x55 },
+ { 0xee, 0x55, 0xaa, 0x55, 0xae, 0x55, 0xaa, 0x55 },
+ { 0xee, 0x55, 0xaa, 0x55, 0xee, 0x55, 0xaa, 0x55 },
+ { 0xee, 0x55, 0xba, 0x55, 0xee, 0x55, 0xaa, 0x55 },
+ { 0xee, 0x55, 0xba, 0x55, 0xee, 0x55, 0xab, 0x55 },
+ { 0xee, 0x55, 0xbb, 0x55, 0xee, 0x55, 0xab, 0x55 },
+ { 0xee, 0x55, 0xbb, 0x55, 0xee, 0x55, 0xbb, 0x55 },
+ { 0xfe, 0x55, 0xbb, 0x55, 0xee, 0x55, 0xbb, 0x55 },
+ { 0xfe, 0x55, 0xbb, 0x55, 0xef, 0x55, 0xbb, 0x55 },
+ { 0xff, 0x55, 0xbb, 0x55, 0xef, 0x55, 0xbb, 0x55 },
+ { 0xff, 0x55, 0xbb, 0x55, 0xff, 0x55, 0xbb, 0x55 },
+ { 0xff, 0x55, 0xfb, 0x55, 0xff, 0x55, 0xbb, 0x55 },
+ { 0xff, 0x55, 0xfb, 0x55, 0xff, 0x55, 0xbf, 0x55 },
+ { 0xff, 0x55, 0xff, 0x55, 0xff, 0x55, 0xbf, 0x55 },
+ { 0xff, 0x55, 0xff, 0x55, 0xff, 0x55, 0xff, 0x55 },
+ { 0xff, 0xd5, 0xff, 0x55, 0xff, 0x55, 0xff, 0x55 },
+ { 0xff, 0xd5, 0xff, 0x55, 0xff, 0x5d, 0xff, 0x55 },
+ { 0xff, 0xdd, 0xff, 0x55, 0xff, 0x5d, 0xff, 0x55 },
+ { 0xff, 0xdd, 0xff, 0x55, 0xff, 0xdd, 0xff, 0x55 },
+ { 0xff, 0xdd, 0xff, 0x75, 0xff, 0xdd, 0xff, 0x55 },
+ { 0xff, 0xdd, 0xff, 0x75, 0xff, 0xdd, 0xff, 0x57 },
+ { 0xff, 0xdd, 0xff, 0x77, 0xff, 0xdd, 0xff, 0x57 },
+ { 0xff, 0xdd, 0xff, 0x77, 0xff, 0xdd, 0xff, 0x77 },
+ { 0xff, 0xfd, 0xff, 0x77, 0xff, 0xdd, 0xff, 0x77 },
+ { 0xff, 0xfd, 0xff, 0x77, 0xff, 0xdf, 0xff, 0x77 },
+ { 0xff, 0xff, 0xff, 0x77, 0xff, 0xdf, 0xff, 0x77 },
+ { 0xff, 0xff, 0xff, 0x77, 0xff, 0xff, 0xff, 0x77 },
+ { 0xff, 0xff, 0xff, 0xf7, 0xff, 0xff, 0xff, 0x77 },
+ { 0xff, 0xff, 0xff, 0xf7, 0xff, 0xff, 0xff, 0x7f },
+ { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f },
+ { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }
+};
+
+static void dissolvePatternsTrans(TransParams &t, Score *score, Common::Rect &clipRect) {
+ uint w = clipRect.width();
+ uint h = clipRect.height();
+
+ // Get previous frame
+ score->_backSurface->copyFrom(*score->_backSurface2);
+
+ t.steps = 64;
+ t.stepDuration = t.duration / t.steps;
+
+ for (int i = 0; i < t.steps; i++) {
+ for (int y = 0; y < h; y++) {
+ byte pat = dissolvePatterns[i][y % 8];
+ byte *dst = (byte *)score->_backSurface->getBasePtr(0, y);
+ byte *src = (byte *)score->_surface->getBasePtr(0, y);
+
+ for (int x = 0; x < w;) {
+ byte mask = 0x80;
+ for (int b = 0; b < 8 && x < w; b++, x++) {
+ if (pat & mask)
+ *dst = *src;
+
+ dst++;
+ src++;
+ mask >>= 1;
+ }
+ }
+ }
+
+ g_system->copyRectToScreen(score->_backSurface->getPixels(), score->_backSurface->pitch, 0, 0, w, h);
+ g_system->updateScreen();
+
+ g_system->delayMillis(t.stepDuration);
+ if (processQuitEvent(true))
+ break;
+ }
+}
+
static void initTransParams(TransParams &t, Score *score, Common::Rect &clipRect) {
int w = clipRect.width();
int h = clipRect.height();
Commit: e6d78fd0590831b9fb76e91ab83c786e7ceddceb
https://github.com/scummvm/scummvm/commit/e6d78fd0590831b9fb76e91ab83c786e7ceddceb
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2020-03-30T23:37:21+02:00
Commit Message:
DIRECTOR: Small optimization to transition rendering
Changed paths:
engines/director/transitions.cpp
diff --git a/engines/director/transitions.cpp b/engines/director/transitions.cpp
index 7ca846ca80..81cf8f9dd1 100644
--- a/engines/director/transitions.cpp
+++ b/engines/director/transitions.cpp
@@ -279,7 +279,7 @@ static int getLog2(int n) {
return res;
}
-uint32 randomSeed[33] = {
+static uint32 randomSeed[33] = {
0x00000000UL,
0x00000000UL, 0x00000003UL, 0x00000006UL, 0x0000000cUL,
0x00000014UL, 0x00000030UL, 0x00000060UL, 0x000000b8UL,
@@ -397,12 +397,12 @@ static void dissolveTrans(TransParams &t, Score *score, Common::Rect &clipRect)
} while (rnd != seed);
g_system->copyRectToScreen(score->_backSurface->getPixels(), score->_backSurface->pitch, 0, 0, realw, realh);
+ g_system->updateScreen();
- g_system->delayMillis(t.stepDuration);
if (processQuitEvent(true))
break;
- g_system->updateScreen();
+ g_system->delayMillis(t.stepDuration);
t.steps--;
}
@@ -507,9 +507,10 @@ static void dissolvePatternsTrans(TransParams &t, Score *score, Common::Rect &cl
g_system->copyRectToScreen(score->_backSurface->getPixels(), score->_backSurface->pitch, 0, 0, w, h);
g_system->updateScreen();
- g_system->delayMillis(t.stepDuration);
if (processQuitEvent(true))
break;
+
+ g_system->delayMillis(t.stepDuration);
}
}
Commit: 26ba833c6a39d8018c709c014631f9ec77c3fc46
https://github.com/scummvm/scummvm/commit/26ba833c6a39d8018c709c014631f9ec77c3fc46
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2020-03-30T23:37:21+02:00
Commit Message:
GRIFFON: Remove redundant call
Changed paths:
engines/griffon/draw.cpp
diff --git a/engines/griffon/draw.cpp b/engines/griffon/draw.cpp
index fe5354c587..401392cec1 100644
--- a/engines/griffon/draw.cpp
+++ b/engines/griffon/draw.cpp
@@ -823,8 +823,6 @@ void GriffonEngine::drawNPCs(int mode) {
rcDest.left = (float)(sx + 36 - ii * 8 + ii * cos(3.14159 * 2 * (fr3 - ii) / 16) * 2);
rcDest.top = (float)(sy + 16 + ii * sin(3.14159 * 2 * (fr3 - ii) / 16) * 3 - ii); // * 4
- _spellImg->setAlpha(i2 / 3 * 224, true);
-
_spellImg->blit(*_videoBuffer, rcDest.left, rcDest.top, Graphics::FLIP_NONE, &rcSrc);
xloc = rcDest.left;
More information about the Scummvm-git-logs
mailing list