[Scummvm-cvs-logs] SF.net SVN: scummvm: [27145] scummvm/trunk/engines/saga

thebluegr at users.sourceforge.net thebluegr at users.sourceforge.net
Wed Jun 6 21:46:11 CEST 2007


Revision: 27145
          http://scummvm.svn.sourceforge.net/scummvm/?rev=27145&view=rev
Author:   thebluegr
Date:     2007-06-06 12:46:10 -0700 (Wed, 06 Jun 2007)

Log Message:
-----------
Implemented the sfGetMouseClicks and sfResetMouseClicks opcodes and created the skeleton for sfScriptStartVideo, sfScriptReturnFromVideo and sfScriptEndVideo opcodes

Modified Paths:
--------------
    scummvm/trunk/engines/saga/animation.cpp
    scummvm/trunk/engines/saga/animation.h
    scummvm/trunk/engines/saga/saga.cpp
    scummvm/trunk/engines/saga/saga.h
    scummvm/trunk/engines/saga/scene.cpp
    scummvm/trunk/engines/saga/scene.h
    scummvm/trunk/engines/saga/script.cpp
    scummvm/trunk/engines/saga/sfuncs.cpp

Modified: scummvm/trunk/engines/saga/animation.cpp
===================================================================
--- scummvm/trunk/engines/saga/animation.cpp	2007-06-06 18:35:37 UTC (rev 27144)
+++ scummvm/trunk/engines/saga/animation.cpp	2007-06-06 19:46:10 UTC (rev 27145)
@@ -183,12 +183,17 @@
 		// 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) {
 				resume(i, 0);
@@ -213,6 +218,37 @@
 	}
 }
 
+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;

Modified: scummvm/trunk/engines/saga/animation.h
===================================================================
--- scummvm/trunk/engines/saga/animation.h	2007-06-06 18:35:37 UTC (rev 27144)
+++ scummvm/trunk/engines/saga/animation.h	2007-06-06 19:46:10 UTC (rev 27145)
@@ -120,6 +120,11 @@
 	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 @@
 	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 @@
 	Cutaway *_cutawayList;
 	int _cutawayListLength;
 	bool _cutawayActive;
+	bool _videoActive;
 };
 
 } // End of namespace Saga

Modified: scummvm/trunk/engines/saga/saga.cpp
===================================================================
--- scummvm/trunk/engines/saga/saga.cpp	2007-06-06 18:35:37 UTC (rev 27144)
+++ scummvm/trunk/engines/saga/saga.cpp	2007-06-06 19:46:10 UTC (rev 27145)
@@ -87,6 +87,7 @@
 
 	_frameCount = 0;
 	_globalFlags = 0;
+	_mouseClickCount = 0;
 	memset(_ethicsPoints, 0, sizeof(_ethicsPoints));
 
 	// The Linux version of Inherit the Earth puts all data files in an

Modified: scummvm/trunk/engines/saga/saga.h
===================================================================
--- scummvm/trunk/engines/saga/saga.h	2007-06-06 18:35:37 UTC (rev 27144)
+++ scummvm/trunk/engines/saga/saga.h	2007-06-06 19:46:10 UTC (rev 27145)
@@ -559,6 +559,18 @@
 	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 @@
 
 	bool _leftMouseButtonPressed;
 	bool _rightMouseButtonPressed;
+	int _mouseClickCount;
 
 	bool _quit;
 

Modified: scummvm/trunk/engines/saga/scene.cpp
===================================================================
--- scummvm/trunk/engines/saga/scene.cpp	2007-06-06 18:35:37 UTC (rev 27144)
+++ scummvm/trunk/engines/saga/scene.cpp	2007-06-06 19:46:10 UTC (rev 27145)
@@ -1209,6 +1209,11 @@
 
 }
 
+void Scene::restoreScene() {
+	// TODO
+	warning("TODO: restoreScene()");
+}
+
 void Scene::cmdSceneChange(int argc, const char **argv) {
 	int scene_num = 0;
 

Modified: scummvm/trunk/engines/saga/scene.h
===================================================================
--- scummvm/trunk/engines/saga/scene.h	2007-06-06 18:35:37 UTC (rev 27144)
+++ scummvm/trunk/engines/saga/scene.h	2007-06-06 19:46:10 UTC (rev 27145)
@@ -224,6 +224,7 @@
 	void nextScene();
 	void skipScene();
 	void endScene();
+	void restoreScene();
 	void queueScene(LoadSceneParams *sceneQueue) {
 		_sceneQueue.push_back(*sceneQueue);
 	}

Modified: scummvm/trunk/engines/saga/script.cpp
===================================================================
--- scummvm/trunk/engines/saga/script.cpp	2007-06-06 18:35:37 UTC (rev 27144)
+++ scummvm/trunk/engines/saga/script.cpp	2007-06-06 19:46:10 UTC (rev 27145)
@@ -592,6 +592,7 @@
 	const HitZone *hitZone;
 	Point specialPoint;
 
+	_vm->incrementMouseClickCount();
 	_vm->_actor->abortSpeech();
 
 	if ((_vm->_actor->_protagonist->_currentAction != kActionWait) &&

Modified: scummvm/trunk/engines/saga/sfuncs.cpp
===================================================================
--- scummvm/trunk/engines/saga/sfuncs.cpp	2007-06-06 18:35:37 UTC (rev 27144)
+++ scummvm/trunk/engines/saga/sfuncs.cpp	2007-06-06 19:46:10 UTC (rev 27145)
@@ -1887,11 +1887,11 @@
 }
 
 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::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) {


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