aboutsummaryrefslogtreecommitdiff
path: root/engines/gob/demos
diff options
context:
space:
mode:
authorSven Hesse2009-06-06 21:45:47 +0000
committerSven Hesse2009-06-06 21:45:47 +0000
commit9f3a628ad5197602ed8f2c2f94b549d45d10591d (patch)
tree525cce225bc199e18774de3d4425f9f3326c9f56 /engines/gob/demos
parentebc9e38ed04a344e8b4438b120916f7dba809ef5 (diff)
downloadscummvm-rg350-9f3a628ad5197602ed8f2c2f94b549d45d10591d.tar.gz
scummvm-rg350-9f3a628ad5197602ed8f2c2f94b549d45d10591d.tar.bz2
scummvm-rg350-9f3a628ad5197602ed8f2c2f94b549d45d10591d.zip
Fixing the demoplayer's auto double mode and added a REBASE0 option that sets the video's X and Y coordinates to 0,0
svn-id: r41307
Diffstat (limited to 'engines/gob/demos')
-rw-r--r--engines/gob/demos/demoplayer.cpp17
-rw-r--r--engines/gob/demos/demoplayer.h1
-rw-r--r--engines/gob/demos/scnplayer.cpp4
3 files changed, 17 insertions, 5 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