[Scummvm-cvs-logs] SF.net SVN: scummvm: [31795] scummvm/trunk/engines/gob
drmccoy at users.sourceforge.net
drmccoy at users.sourceforge.net
Thu May 1 05:00:52 CEST 2008
Revision: 31795
http://scummvm.svn.sourceforge.net/scummvm/?rev=31795&view=rev
Author: drmccoy
Date: 2008-04-30 20:00:51 -0700 (Wed, 30 Apr 2008)
Log Message:
-----------
Fixing the object video offsets
Modified Paths:
--------------
scummvm/trunk/engines/gob/inter_v4.cpp
scummvm/trunk/engines/gob/videoplayer.cpp
scummvm/trunk/engines/gob/videoplayer.h
Modified: scummvm/trunk/engines/gob/inter_v4.cpp
===================================================================
--- scummvm/trunk/engines/gob/inter_v4.cpp 2008-04-30 20:36:19 UTC (rev 31794)
+++ scummvm/trunk/engines/gob/inter_v4.cpp 2008-05-01 03:00:51 UTC (rev 31795)
@@ -739,15 +739,21 @@
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;
}
Modified: scummvm/trunk/engines/gob/videoplayer.cpp
===================================================================
--- scummvm/trunk/engines/gob/videoplayer.cpp 2008-04-30 20:36:19 UTC (rev 31794)
+++ scummvm/trunk/engines/gob/videoplayer.cpp 2008-05-01 03:00:51 UTC (rev 31795)
@@ -76,6 +76,9 @@
_fileName = new char[strlen(fileName) + 1];
strcpy(_fileName, fileName);
+ _defaultX = _video->getX();
+ _defaultY = _video->getY();
+
return true;
}
@@ -88,6 +91,7 @@
_stream = 0;
_fileName = 0;
memset(&_state, 0, sizeof(CoktelVideo::State));
+ _defaultX = _defaultY = 0;
}
bool VideoPlayer::Video::isOpen() const {
@@ -110,6 +114,14 @@
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 @@
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) {
Modified: scummvm/trunk/engines/gob/videoplayer.h
===================================================================
--- scummvm/trunk/engines/gob/videoplayer.h 2008-04-30 20:36:19 UTC (rev 31794)
+++ scummvm/trunk/engines/gob/videoplayer.h 2008-05-01 03:00:51 UTC (rev 31795)
@@ -76,6 +76,8 @@
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 @@
const CoktelVideo *getVideo() const;
CoktelVideo::State getState() const;
+ int16 getDefaultX() const;
+ int16 getDefaultY() const;
+
CoktelVideo::State nextFrame();
private:
@@ -105,6 +110,7 @@
DataStream *_stream;
CoktelVideo *_video;
CoktelVideo::State _state;
+ int16 _defaultX, _defaultY;
};
static const char *_extensions[];
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list