aboutsummaryrefslogtreecommitdiff
path: root/engines/gob/scnplayer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/gob/scnplayer.cpp')
-rw-r--r--engines/gob/scnplayer.cpp52
1 files changed, 6 insertions, 46 deletions
diff --git a/engines/gob/scnplayer.cpp b/engines/gob/scnplayer.cpp
index b37f8f6fe5..573243c768 100644
--- a/engines/gob/scnplayer.cpp
+++ b/engines/gob/scnplayer.cpp
@@ -35,28 +35,17 @@
namespace Gob {
-SCNPlayer::SCNPlayer(GobEngine *vm) : _vm(vm) {
+SCNPlayer::SCNPlayer(GobEngine *vm) : DemoPlayer(vm) {
_doubleMode = false;
}
SCNPlayer::~SCNPlayer() {
}
-inline bool SCNPlayer::lineStartsWith(const Common::String &line, const char *start) {
- return (strstr(line.c_str(), start) == line.c_str());
-}
-
bool SCNPlayer::play(const char *fileName) {
- debugC(1, kDebugSCN, "Playing SCN \"%s\"", fileName);
-
- // The video player needs some fake variables
- _vm->_inter->allocateVars(32);
-
- // Init the screen
- _vm->_draw->initScreen();
- _vm->_draw->_cursorIndex = -1;
+ debugC(1, kDebugDemo, "Playing SCN \"%s\"", fileName);
- _vm->_util->longDelay(200); // Letting everything settle
+ init();
Common::File scn;
@@ -102,7 +91,7 @@ bool SCNPlayer::play(Common::File &scn) {
}
bool SCNPlayer::readLabels(Common::File &scn, LabelMap &labels) {
- debugC(1, kDebugSCN, "Reading SCN labels");
+ debugC(1, kDebugDemo, "Reading SCN labels");
int32 startPos = scn.pos();
@@ -113,7 +102,7 @@ bool SCNPlayer::readLabels(Common::File &scn, LabelMap &labels) {
if (lineStartsWith(line, "LABEL ")) {
// Label => Add to the hashmap
labels.setVal(line.c_str() + 6, scn.pos());
- debugC(2, kDebugSCN, "Found label \"%s\" (%d)", line.c_str() + 6, scn.pos());
+ debugC(2, kDebugDemo, "Found label \"%s\" (%d)", line.c_str() + 6, scn.pos());
}
}
@@ -128,7 +117,7 @@ bool SCNPlayer::readLabels(Common::File &scn, LabelMap &labels) {
}
void SCNPlayer::gotoLabel(Common::File &scn, const LabelMap &labels, const char *label) {
- debugC(2, kDebugSCN, "Jumping to label \"%s\"", label);
+ debugC(2, kDebugDemo, "Jumping to label \"%s\"", label);
if (!labels.contains(label))
return;
@@ -136,33 +125,4 @@ void SCNPlayer::gotoLabel(Common::File &scn, const LabelMap &labels, const char
scn.seek(labels.getVal(label));
}
-void SCNPlayer::clearScreen() {
- debugC(1, kDebugSCN, "Clearing the screen");
- _vm->_video->clearScreen();
-}
-
-void SCNPlayer::playVideo(const char *fileName) {
- // Trimming spaces
- while (*fileName == ' ')
- fileName++;
-
- debugC(1, kDebugSCN, "Playing video \"%s\"", fileName);
-
- // Playing the video
- if (_vm->_vidPlayer->primaryOpen(fileName)) {
- _vm->_vidPlayer->slotSetDoubleMode(-1, _doubleMode);
- _vm->_vidPlayer->primaryPlay();
- _vm->_vidPlayer->primaryClose();
- }
-}
-
-void SCNPlayer::evaluateVideoMode(const char *mode) {
- debugC(2, kDebugSCN, "Video mode \"%s\"", mode);
-
- if (!scumm_strnicmp(mode, "VESA", 4))
- _doubleMode = false;
- else if (!scumm_strnicmp(mode, "VGA", 3) && _vm->is640())
- _doubleMode = true;
-}
-
} // End of namespace Gob