aboutsummaryrefslogtreecommitdiff
path: root/engines/gob
diff options
context:
space:
mode:
authorSven Hesse2008-05-01 03:00:51 +0000
committerSven Hesse2008-05-01 03:00:51 +0000
commit455a167b9d69c5485751024fb326a3bee8a79fe9 (patch)
treea8cc6040e078dab0e44bb99aa60ae4f97f261425 /engines/gob
parent7509d66caf516d87f938f66a20f4ce81367a8305 (diff)
downloadscummvm-rg350-455a167b9d69c5485751024fb326a3bee8a79fe9.tar.gz
scummvm-rg350-455a167b9d69c5485751024fb326a3bee8a79fe9.tar.bz2
scummvm-rg350-455a167b9d69c5485751024fb326a3bee8a79fe9.zip
Fixing the object video offsets
svn-id: r31795
Diffstat (limited to 'engines/gob')
-rw-r--r--engines/gob/inter_v4.cpp12
-rw-r--r--engines/gob/videoplayer.cpp30
-rw-r--r--engines/gob/videoplayer.h6
3 files changed, 45 insertions, 3 deletions
diff --git a/engines/gob/inter_v4.cpp b/engines/gob/inter_v4.cpp
index 71c0f293ec..b24e54ffbd 100644
--- a/engines/gob/inter_v4.cpp
+++ b/engines/gob/inter_v4.cpp
@@ -739,15 +739,21 @@ void Inter_v4::o4_playVmdOrMusic() {
if (lastFrame == -1) {
close = true;
} else if (lastFrame == -3) {
- warning("Woodruff Stub: Video/Music command -3: Play background video %s, %d, %d", fileName, x, y);
+ warning("Woodruff Stub: Video/Music command -3: Play background video %s, %d, %d, %d, %d", fileName, startFrame, x, y, VAR_OFFSET(7872));
_vm->_mult->_objects[startFrame].pAnimData->animation = -startFrame - 1;
if (_vm->_mult->_objects[startFrame].videoSlot > 0)
_vm->_vidPlayer->slotClose(_vm->_mult->_objects[startFrame].videoSlot - 1);
- _vm->_mult->_objects[startFrame].videoSlot = _vm->_vidPlayer->slotOpen(fileName) + 1;
- if (x != -1) {
+ int slot = _vm->_vidPlayer->slotOpen(fileName);
+
+ _vm->_mult->_objects[startFrame].videoSlot = slot + 1;
+
+ if (x == -1) {
+ *_vm->_mult->_objects[startFrame].pPosX = _vm->_vidPlayer->getDefaultX(slot);
+ *_vm->_mult->_objects[startFrame].pPosY = _vm->_vidPlayer->getDefaultY(slot);
+ } else {
*_vm->_mult->_objects[startFrame].pPosX = x;
*_vm->_mult->_objects[startFrame].pPosY = y;
}
diff --git a/engines/gob/videoplayer.cpp b/engines/gob/videoplayer.cpp
index 25b80c89d9..d0e2090453 100644
--- a/engines/gob/videoplayer.cpp
+++ b/engines/gob/videoplayer.cpp
@@ -76,6 +76,9 @@ bool VideoPlayer::Video::open(const char *fileName, Type which) {
_fileName = new char[strlen(fileName) + 1];
strcpy(_fileName, fileName);
+ _defaultX = _video->getX();
+ _defaultY = _video->getY();
+
return true;
}
@@ -88,6 +91,7 @@ void VideoPlayer::Video::close() {
_stream = 0;
_fileName = 0;
memset(&_state, 0, sizeof(CoktelVideo::State));
+ _defaultX = _defaultY = 0;
}
bool VideoPlayer::Video::isOpen() const {
@@ -110,6 +114,14 @@ CoktelVideo::State VideoPlayer::Video::getState() const {
return _state;
}
+int16 VideoPlayer::Video::getDefaultX() const {
+ return _defaultX;
+}
+
+int16 VideoPlayer::Video::getDefaultY() const {
+ return _defaultY;
+}
+
CoktelVideo::State VideoPlayer::Video::nextFrame() {
if (_video)
_state = _video->nextFrame();
@@ -435,6 +447,24 @@ int16 VideoPlayer::getHeight(int slot) const {
return 0;
}
+int16 VideoPlayer::getDefaultX(int slot) const {
+ const Video *video = getVideoBySlot(slot);
+
+ if (video)
+ return video->getDefaultX();
+
+ return 0;
+}
+
+int16 VideoPlayer::getDefaultY(int slot) const {
+ const Video *video = getVideoBySlot(slot);
+
+ if (video)
+ return video->getDefaultY();
+
+ return 0;
+}
+
bool VideoPlayer::doPlay(int16 frame, int16 breakKey,
uint16 palCmd, int16 palStart, int16 palEnd,
int16 palFrame, int16 endFrame) {
diff --git a/engines/gob/videoplayer.h b/engines/gob/videoplayer.h
index 3a6ec0d9da..fd3c68aa1a 100644
--- a/engines/gob/videoplayer.h
+++ b/engines/gob/videoplayer.h
@@ -76,6 +76,8 @@ public:
int16 getCurrentFrame(int slot = -1) const;
int16 getWidth(int slot = -1) const;
int16 getHeight(int slot = -1) const;
+ int16 getDefaultX(int slot = -1) const;
+ int16 getDefaultY(int slot = -1) const;
void writeVideoInfo(const char *videoFile, int16 varX, int16 varY,
int16 varFrames, int16 varWidth, int16 varHeight);
@@ -96,6 +98,9 @@ private:
const CoktelVideo *getVideo() const;
CoktelVideo::State getState() const;
+ int16 getDefaultX() const;
+ int16 getDefaultY() const;
+
CoktelVideo::State nextFrame();
private:
@@ -105,6 +110,7 @@ private:
DataStream *_stream;
CoktelVideo *_video;
CoktelVideo::State _state;
+ int16 _defaultX, _defaultY;
};
static const char *_extensions[];