aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorFilippos Karapetis2007-06-06 19:46:10 +0000
committerFilippos Karapetis2007-06-06 19:46:10 +0000
commit9b14f5faedef513be2f17da57b7fb9182a751150 (patch)
treeaa8c1da730cf2361c21f870996a6274e0d8d1587 /engines
parent9e651592ec9d58d8f5c0d2dea0e351bf048d2743 (diff)
downloadscummvm-rg350-9b14f5faedef513be2f17da57b7fb9182a751150.tar.gz
scummvm-rg350-9b14f5faedef513be2f17da57b7fb9182a751150.tar.bz2
scummvm-rg350-9b14f5faedef513be2f17da57b7fb9182a751150.zip
Implemented the sfGetMouseClicks and sfResetMouseClicks opcodes and created the skeleton for sfScriptStartVideo, sfScriptReturnFromVideo and sfScriptEndVideo opcodes
svn-id: r27145
Diffstat (limited to 'engines')
-rw-r--r--engines/saga/animation.cpp42
-rw-r--r--engines/saga/animation.h9
-rw-r--r--engines/saga/saga.cpp1
-rw-r--r--engines/saga/saga.h13
-rw-r--r--engines/saga/scene.cpp5
-rw-r--r--engines/saga/scene.h1
-rw-r--r--engines/saga/script.cpp1
-rw-r--r--engines/saga/sfuncs.cpp20
8 files changed, 84 insertions, 8 deletions
diff --git a/engines/saga/animation.cpp b/engines/saga/animation.cpp
index f9bfe89765..e038213d5c 100644
--- a/engines/saga/animation.cpp
+++ b/engines/saga/animation.cpp
@@ -183,11 +183,16 @@ void Anim::returnFromCutaway(void) {
// Note that clearCutaway() sets _cutawayActive to false.
clearCutaway();
- // TODO: Handle fade up, if we previously faded down
+ warning("TODO: Implement the rest of returnFromCutaway()");
- // TODO: Restore the scene
+ // Handle fade up, if we previously faded down
+ // TODO
- // TODO: Restore the animations
+ // Restore the scene
+ _vm->_scene->restoreScene();
+
+ // Restore the animations
+ // TODO
for (int i = 0; i < MAX_ANIMATIONS; i++) {
if (_animations[i] && _animations[i]->state == ANIM_PLAYING) {
@@ -213,6 +218,37 @@ void Anim::clearCutaway(void) {
}
}
+void Anim::startVideo(int vid, bool fade) {
+ debug(0, "startVideo(%d, %d)", vid, fade);
+
+ // TODO
+ warning(0, "TODO: Anim::startVideo(%d, %d)", vid, fade);
+
+ _videoActive = true;
+}
+
+void Anim::endVideo(void) {
+ debug(0, "endVideo()");
+
+ // TODO
+ warning("TODO: Anim::endVideo()");
+
+ _videoActive = false;
+}
+
+void Anim::returnFromVideo(void) {
+ debug(0, "returnFromVideo()");
+
+ // TODO
+ warning("TODO: Anim::returnFromVideo");
+
+ _videoActive = false;
+}
+
+void Anim::nextVideoFrame(void) {
+ // TODO
+}
+
void Anim::load(uint16 animId, const byte *animResourceData, size_t animResourceLength) {
AnimationData *anim;
uint16 temp;
diff --git a/engines/saga/animation.h b/engines/saga/animation.h
index c850fdec83..4aa813c765 100644
--- a/engines/saga/animation.h
+++ b/engines/saga/animation.h
@@ -120,6 +120,11 @@ public:
void returnFromCutaway(void);
void clearCutaway(void);
+ void startVideo(int vid, bool fade);
+ void endVideo(void);
+ void returnFromVideo(void);
+ void nextVideoFrame(void);
+
void load(uint16 animId, const byte *animResourceData, size_t animResourceLength);
void freeId(uint16 animId);
void play(uint16 animId, int vectorTime, bool playing = true);
@@ -137,6 +142,9 @@ public:
bool hasCutaway(void) {
return _cutawayActive;
}
+ bool hasVideo(void) {
+ return _videoActive;
+ }
bool hasAnimation(uint16 animId) {
if (animId >= MAX_ANIMATIONS) {
if (animId < MAX_ANIMATIONS + ARRAYSIZE(_cutawayAnimations))
@@ -192,6 +200,7 @@ private:
Cutaway *_cutawayList;
int _cutawayListLength;
bool _cutawayActive;
+ bool _videoActive;
};
} // End of namespace Saga
diff --git a/engines/saga/saga.cpp b/engines/saga/saga.cpp
index 7573988a8d..23f5b51de7 100644
--- a/engines/saga/saga.cpp
+++ b/engines/saga/saga.cpp
@@ -87,6 +87,7 @@ SagaEngine::SagaEngine(OSystem *syst)
_frameCount = 0;
_globalFlags = 0;
+ _mouseClickCount = 0;
memset(_ethicsPoints, 0, sizeof(_ethicsPoints));
// The Linux version of Inherit the Earth puts all data files in an
diff --git a/engines/saga/saga.h b/engines/saga/saga.h
index 1a8da5533a..b596d2c2a1 100644
--- a/engines/saga/saga.h
+++ b/engines/saga/saga.h
@@ -559,6 +559,18 @@ public:
int processInput(void);
Point mousePos() const;
+ int getMouseClickCount() {
+ return _mouseClickCount;
+ }
+
+ void incrementMouseClickCount() {
+ _mouseClickCount++;
+ }
+
+ void resetMouseClickCount() {
+ _mouseClickCount = 0;
+ }
+
const bool leftMouseButtonPressed() const {
return _leftMouseButtonPressed;
}
@@ -580,6 +592,7 @@ public:
bool _leftMouseButtonPressed;
bool _rightMouseButtonPressed;
+ int _mouseClickCount;
bool _quit;
diff --git a/engines/saga/scene.cpp b/engines/saga/scene.cpp
index 9b7e7fb331..d59c0bb987 100644
--- a/engines/saga/scene.cpp
+++ b/engines/saga/scene.cpp
@@ -1209,6 +1209,11 @@ void Scene::endScene() {
}
+void Scene::restoreScene() {
+ // TODO
+ warning("TODO: restoreScene()");
+}
+
void Scene::cmdSceneChange(int argc, const char **argv) {
int scene_num = 0;
diff --git a/engines/saga/scene.h b/engines/saga/scene.h
index 2410f672e5..9f2305cfc5 100644
--- a/engines/saga/scene.h
+++ b/engines/saga/scene.h
@@ -224,6 +224,7 @@ class Scene {
void nextScene();
void skipScene();
void endScene();
+ void restoreScene();
void queueScene(LoadSceneParams *sceneQueue) {
_sceneQueue.push_back(*sceneQueue);
}
diff --git a/engines/saga/script.cpp b/engines/saga/script.cpp
index 578a42c5c8..b62e9aacf5 100644
--- a/engines/saga/script.cpp
+++ b/engines/saga/script.cpp
@@ -592,6 +592,7 @@ void Script::playfieldClick(const Point& mousePoint, bool leftButton) {
const HitZone *hitZone;
Point specialPoint;
+ _vm->incrementMouseClickCount();
_vm->_actor->abortSpeech();
if ((_vm->_actor->_protagonist->_currentAction != kActionWait) &&
diff --git a/engines/saga/sfuncs.cpp b/engines/saga/sfuncs.cpp
index 560bf10b5a..1dddba5fcc 100644
--- a/engines/saga/sfuncs.cpp
+++ b/engines/saga/sfuncs.cpp
@@ -1887,11 +1887,11 @@ void Script::sfEndCutAway(SCRIPTFUNC_PARAMS) {
}
void Script::sfGetMouseClicks(SCRIPTFUNC_PARAMS) {
- SF_stub("sfGetMouseClicks", thread, nArgs);
+ thread->_returnValue = _vm->getMouseClickCount();
}
void Script::sfResetMouseClicks(SCRIPTFUNC_PARAMS) {
- SF_stub("sfResetMouseClicks", thread, nArgs);
+ _vm->resetMouseClickCount();
}
// Used in IHNM only
@@ -1927,15 +1927,25 @@ void Script::sfScriptFade(SCRIPTFUNC_PARAMS) {
}
void Script::sfScriptStartVideo(SCRIPTFUNC_PARAMS) {
- SF_stub("sfScriptStartVideo", thread, nArgs);
+ int16 vid;
+ int16 fade;
+ vid = thread->pop();
+ fade = thread->pop();
+
+ _vm->_interface->setStatusText("");
+ _vm->_anim->startVideo(vid, fade != 0);
+ _vm->_interface->rememberMode();
+ _vm->_interface->setMode(kPanelVideo);
}
void Script::sfScriptReturnFromVideo(SCRIPTFUNC_PARAMS) {
- SF_stub("sfScriptReturnFromVideo", thread, nArgs);
+ _vm->_anim->returnFromVideo();
+ _vm->_interface->restoreMode();
}
void Script::sfScriptEndVideo(SCRIPTFUNC_PARAMS) {
- SF_stub("sfScriptEndVideo", thread, nArgs);
+ _vm->_anim->endVideo();
+ _vm->_interface->restoreMode();
}
void Script::sf87(SCRIPTFUNC_PARAMS) {