aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/gob/demos/demoplayer.cpp17
-rw-r--r--engines/gob/demos/demoplayer.h1
-rw-r--r--engines/gob/demos/scnplayer.cpp4
-rw-r--r--engines/gob/videoplayer.cpp3
4 files changed, 18 insertions, 7 deletions
diff --git a/engines/gob/demos/demoplayer.cpp b/engines/gob/demos/demoplayer.cpp
index 10527638f6..ede90af333 100644
--- a/engines/gob/demos/demoplayer.cpp
+++ b/engines/gob/demos/demoplayer.cpp
@@ -56,6 +56,7 @@ DemoPlayer::Script DemoPlayer::_scripts[] = {
DemoPlayer::DemoPlayer(GobEngine *vm) : _vm(vm) {
_doubleMode = false;
+ _rebase0 = false;
}
DemoPlayer::~DemoPlayer() {
@@ -149,15 +150,19 @@ void DemoPlayer::playVideo(const char *fileName) {
debugC(1, kDebugDemo, "Playing video \"%s\"", file);
- if (_vm->_vidPlayer->primaryOpen(file)) {
+ int16 x = _rebase0 ? 0 : -1;
+ int16 y = _rebase0 ? 0 : -1;
+ if (_vm->_vidPlayer->primaryOpen(file, x, y)) {
bool videoSupportsDouble =
((_vm->_vidPlayer->getFeatures() & Graphics::CoktelVideo::kFeaturesSupportsDouble) != 0);
if (_autoDouble) {
- int16 width = _vm->_vidPlayer->getWidth();
- int16 height = _vm->_vidPlayer->getHeight();
+ int16 defX = _rebase0 ? 0 : _vm->_vidPlayer->getDefaultX();
+ int16 defY = _rebase0 ? 0 : _vm->_vidPlayer->getDefaultY();
+ int16 right = defX + _vm->_vidPlayer->getWidth() - 1;
+ int16 bottom = defY + _vm->_vidPlayer->getHeight() - 1;
- _doubleMode = ((width <= 320) && (height <= 200));
+ _doubleMode = ((right < 320) && (bottom < 200));
}
if (_doubleMode) {
@@ -187,7 +192,9 @@ void DemoPlayer::playVideoDoubled() {
Common::String fileNameOpened = _vm->_vidPlayer->getFileName();
_vm->_vidPlayer->primaryClose();
- if (_vm->_vidPlayer->primaryOpen(fileNameOpened.c_str(), 0, -1,
+ int16 x = _rebase0 ? 0 : -1;
+ int16 y = _rebase0 ? 0 : -1;
+ if (_vm->_vidPlayer->primaryOpen(fileNameOpened.c_str(), x, y,
VideoPlayer::kFlagScreenSurface)) {
for (int i = 0; i < _vm->_vidPlayer->getFramesCount(); i++) {
diff --git a/engines/gob/demos/demoplayer.h b/engines/gob/demos/demoplayer.h
index 9d475512fb..64c98b58c5 100644
--- a/engines/gob/demos/demoplayer.h
+++ b/engines/gob/demos/demoplayer.h
@@ -46,6 +46,7 @@ protected:
GobEngine *_vm;
bool _doubleMode;
bool _autoDouble;
+ bool _rebase0;
virtual bool playStream(Common::SeekableReadStream &stream) = 0;
diff --git a/engines/gob/demos/scnplayer.cpp b/engines/gob/demos/scnplayer.cpp
index dc86652bd2..616da3272a 100644
--- a/engines/gob/demos/scnplayer.cpp
+++ b/engines/gob/demos/scnplayer.cpp
@@ -62,6 +62,10 @@ bool SCNPlayer::playStream(Common::SeekableReadStream &scn) {
playVideo(line.c_str() + 4);
} else if (lineStartsWith(line, "GOTO ")) {
gotoLabel(scn, labels, line.c_str() + 5);
+ } else if (lineStartsWith(line, "REBASE0:ON")) {
+ _rebase0 = true;
+ } else if (lineStartsWith(line, "REBASE0:OFF")) {
+ _rebase0 = false;
}
// Mind user input
diff --git a/engines/gob/videoplayer.cpp b/engines/gob/videoplayer.cpp
index 514d4bf71b..e82805d6ac 100644
--- a/engines/gob/videoplayer.cpp
+++ b/engines/gob/videoplayer.cpp
@@ -274,8 +274,7 @@ bool VideoPlayer::primaryOpen(const char *videoFile, int16 x, int16 y,
surf = _vm->_video->initSurfDesc(_vm->_global->_videoMode,
_vm->_width, _vm->_height, 0);
- _vm->_draw->_spritesArray[x] = surf;
- x = 0;
+ _vm->_draw->_spritesArray[0] = surf;
} else {
_backSurf = ((flags & kFlagFrontSurface) == 0);
surf = _vm->_draw->_spritesArray[_backSurf ? 21 : 20];