[Scummvm-cvs-logs] scummvm master -> d8e650b4cbfd76ed448e5ebc2caab3db5b1d1d55
bluegr
bluegr at gmail.com
Tue Nov 4 10:53:29 CET 2014
This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
70fe89b92d GROOVIE: More work on transparency in the puzzle scenes for V2 games
d8e650b4cb GROOVIE: Handle flag 2 for V2 games (show a whole overlay video)
Commit: 70fe89b92d81bcdbc827c4467e508b3ad3d26051
https://github.com/scummvm/scummvm/commit/70fe89b92d81bcdbc827c4467e508b3ad3d26051
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2014-11-04T11:51:13+02:00
Commit Message:
GROOVIE: More work on transparency in the puzzle scenes for V2 games
This fixes most of the transparency issues in the puzzle screens.
They are still not correct, as the relevant videos play completely,
instead of showing a single frame. This also fixes issues with commit
2d42ab8
Changed paths:
engines/groovie/roq.cpp
engines/groovie/roq.h
diff --git a/engines/groovie/roq.cpp b/engines/groovie/roq.cpp
index 065621e..34689d8 100644
--- a/engines/groovie/roq.cpp
+++ b/engines/groovie/roq.cpp
@@ -47,6 +47,7 @@ namespace Groovie {
ROQPlayer::ROQPlayer(GroovieEngine *vm) :
VideoPlayer(vm), _codingTypeCount(0),
+ _fg(&_vm->_graphicsMan->_foreground),
_bg(&_vm->_graphicsMan->_background),
_firstFrame(true) {
@@ -119,18 +120,19 @@ uint16 ROQPlayer::loadInternal() {
}
void ROQPlayer::buildShowBuf() {
- uint32 transparent = _alpha ? 0 : _vm->_pixelFormat.RGBToColor(255, 255, 255);
+ if (_alpha)
+ _fg->copyFrom(*_bg);
for (int line = 0; line < _bg->h; line++) {
- uint32 *out = (uint32 *)_bg->getBasePtr(0, line);
+ uint32 *out = _alpha ? (uint32 *)_fg->getBasePtr(0, line) : (uint32 *)_bg->getBasePtr(0, line);
uint32 *in = (uint32 *)_currBuf->getBasePtr(0, line / _scaleY);
for (int x = 0; x < _bg->w; x++) {
- // Copy a pixel
- if (*in != transparent)
- *out++ = *in;
- else
+ // Copy a pixel, checking the alpha channel first
+ if (_alpha && !(*in & 0xFF))
out++;
+ else
+ *out++ = *in;
// Skip to the next pixel
if (!(x % _scaleX))
@@ -167,7 +169,8 @@ bool ROQPlayer::playFrameInternal() {
if (_dirty) {
// Update the screen
- _syst->copyRectToScreen(_bg->getPixels(), _bg->pitch, 0, (_syst->getHeight() - _bg->h) / 2, _bg->w, _bg->h);
+ void *src = (_alpha) ? _fg->getPixels() : _bg->getPixels();
+ _syst->copyRectToScreen(src, _bg->pitch, 0, (_syst->getHeight() - _bg->h) / 2, _bg->w, _bg->h);
_syst->updateScreen();
// Clear the dirty flag
@@ -302,8 +305,10 @@ bool ROQPlayer::processBlockInfo(ROQBlockHeader &blockHeader) {
_vm->_graphicsMan->switchToFullScreen(false);
// Clear the buffers with black
- _currBuf->fillRect(Common::Rect(width, height), _vm->_pixelFormat.RGBToColor(0, 0, 0));
- _prevBuf->fillRect(Common::Rect(width, height), _vm->_pixelFormat.RGBToColor(0, 0, 0));
+ if (!_alpha) {
+ _currBuf->fillRect(Common::Rect(width, height), _vm->_pixelFormat.RGBToColor(0, 0, 0));
+ _prevBuf->fillRect(Common::Rect(width, height), _vm->_pixelFormat.RGBToColor(0, 0, 0));
+ }
return true;
}
diff --git a/engines/groovie/roq.h b/engines/groovie/roq.h
index 7e7d385..3a85517 100644
--- a/engines/groovie/roq.h
+++ b/engines/groovie/roq.h
@@ -75,7 +75,7 @@ private:
byte _codebook4[256 * 4];
// Buffers
- Graphics::Surface *_bg;
+ Graphics::Surface *_fg, *_bg;
Graphics::Surface *_currBuf, *_prevBuf;
void buildShowBuf();
byte _scaleX, _scaleY;
Commit: d8e650b4cbfd76ed448e5ebc2caab3db5b1d1d55
https://github.com/scummvm/scummvm/commit/d8e650b4cbfd76ed448e5ebc2caab3db5b1d1d55
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2014-11-04T11:52:09+02:00
Commit Message:
GROOVIE: Handle flag 2 for V2 games (show a whole overlay video)
Changed paths:
engines/groovie/roq.cpp
engines/groovie/roq.h
diff --git a/engines/groovie/roq.cpp b/engines/groovie/roq.cpp
index 34689d8..1996181 100644
--- a/engines/groovie/roq.cpp
+++ b/engines/groovie/roq.cpp
@@ -77,6 +77,10 @@ uint16 ROQPlayer::loadInternal() {
debug(1, " <- 0 ");
}
+ // Flags:
+ // - 2 For overlay videos, show the whole video
+ _flagTwo = ((_flags & (1 << 2)) != 0);
+
// Begin reading the file
debugC(1, kDebugVideo, "Groovie::ROQ: Loading video");
@@ -177,8 +181,9 @@ bool ROQPlayer::playFrameInternal() {
_dirty = false;
}
- // Return whether the video has ended
- return _file->eos();
+ // Report the end of the video if we reached the end of the file or if we
+ // just wanted to play one frame.
+ return _file->eos() || (_alpha && !_flagTwo);
}
bool ROQPlayer::readBlockHeader(ROQBlockHeader &blockHeader) {
diff --git a/engines/groovie/roq.h b/engines/groovie/roq.h
index 3a85517..b720e6a 100644
--- a/engines/groovie/roq.h
+++ b/engines/groovie/roq.h
@@ -74,6 +74,9 @@ private:
uint32 _codebook2[256 * 4];
byte _codebook4[256 * 4];
+ // Flags
+ bool _flagTwo;
+
// Buffers
Graphics::Surface *_fg, *_bg;
Graphics::Surface *_currBuf, *_prevBuf;
More information about the Scummvm-git-logs
mailing list