[Scummvm-cvs-logs] SF.net SVN: scummvm: [30748] scummvm/trunk/engines/parallaction

peres001 at users.sourceforge.net peres001 at users.sourceforge.net
Sat Feb 2 23:45:31 CET 2008


Revision: 30748
          http://scummvm.svn.sourceforge.net/scummvm/?rev=30748&view=rev
Author:   peres001
Date:     2008-02-02 14:45:31 -0800 (Sat, 02 Feb 2008)

Log Message:
-----------
Enabled rudimentary location switch in BRA.

Modified Paths:
--------------
    scummvm/trunk/engines/parallaction/disk_br.cpp
    scummvm/trunk/engines/parallaction/exec_br.cpp
    scummvm/trunk/engines/parallaction/parallaction.cpp
    scummvm/trunk/engines/parallaction/parallaction.h
    scummvm/trunk/engines/parallaction/parallaction_br.cpp
    scummvm/trunk/engines/parallaction/parallaction_ns.cpp

Modified: scummvm/trunk/engines/parallaction/disk_br.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/disk_br.cpp	2008-02-02 21:22:05 UTC (rev 30747)
+++ scummvm/trunk/engines/parallaction/disk_br.cpp	2008-02-02 22:45:31 UTC (rev 30748)
@@ -255,7 +255,7 @@
 	debugC(5, kDebugDisk, "DosDisk_br::loadFrames");
 
 	char path[PATH_LEN];
-	sprintf(path, "%s/ani/%s.ani", _partPath, name);
+	sprintf(path, "%s/ani/%s", _partPath, name);
 
 	return createSprites(path);
 }

Modified: scummvm/trunk/engines/parallaction/exec_br.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/exec_br.cpp	2008-02-02 21:22:05 UTC (rev 30747)
+++ scummvm/trunk/engines/parallaction/exec_br.cpp	2008-02-02 22:45:31 UTC (rev 30748)
@@ -72,8 +72,7 @@
 void Parallaction_br::setupSubtitles(char *s, char *s2, int y) {
 	debugC(5, kDebugExec, "setupSubtitles(%s, %s, %i)", s, s2, y);
 
-	_gfx->freeLabels();
-	_subtitle[0] = _subtitle[1] = -1;
+	clearSubtitles();
 
 	if (!scumm_stricmp("clear", s)) {
 		return;
@@ -95,10 +94,17 @@
 	_subtitleLipSync = 0;
 }
 
+void Parallaction_br::clearSubtitles() {
+	_gfx->freeLabels();
+	_subtitle[0] = _subtitle[1] = -1;
+}
 
 
 DECLARE_COMMAND_OPCODE(location) {
 	warning("Parallaction_br::cmdOp_location command not yet implemented");
+
+	// TODO: handle startPos and startPos2
+	scheduleLocationSwitch(_cmdRunCtxt.cmd->u._string);
 }
 
 
@@ -545,12 +551,6 @@
 
 }
 
-
-void Parallaction_br::jobWaitRemoveSubtitleJob(void *parm, Job *job) {
-
-}
-
-
 void Parallaction_br::jobPauseSfx(void *parm, Job *job) {
 
 }

Modified: scummvm/trunk/engines/parallaction/parallaction.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/parallaction.cpp	2008-02-02 21:22:05 UTC (rev 30747)
+++ scummvm/trunk/engines/parallaction/parallaction.cpp	2008-02-02 22:45:31 UTC (rev 30748)
@@ -265,7 +265,6 @@
 	return;
 }
 
-
 void Parallaction::runGame() {
 
 	_inputMode = kInputModeGame;
@@ -273,11 +272,7 @@
 	while ((_engineFlags & kEngineQuit) == 0) {
 		updateInput();
 
-		if (_activeZone) {
-			Zone *z = _activeZone;	// speak Zone or sound
-			_activeZone = NULL;
-			runZone(z);
-		}
+		runPendingZones();
 
 		if (_engineFlags & kEngineChangeLocation) {
 			changeLocation(_location._name);

Modified: scummvm/trunk/engines/parallaction/parallaction.h
===================================================================
--- scummvm/trunk/engines/parallaction/parallaction.h	2008-02-02 21:22:05 UTC (rev 30747)
+++ scummvm/trunk/engines/parallaction/parallaction.h	2008-02-02 22:45:31 UTC (rev 30748)
@@ -465,6 +465,7 @@
 	void		doLocationEnterTransition();
 	virtual void changeLocation(char *location) = 0;
 	virtual void changeCharacter(const char *name) = 0;
+	virtual void runPendingZones() = 0;
 	void		allocateLocationSlot(const char *name);
 	void		finalizeLocationParsing();
 	void		freeLocation();
@@ -595,6 +596,7 @@
 private:
 	void changeLocation(char *location);
 	void changeCharacter(const char *name);
+	void runPendingZones();
 	void cleanupGame();
 
 	void setArrowCursor();
@@ -894,6 +896,7 @@
 
 	void		changeLocation(char *location);
 	void		changeCharacter(const char *name);
+	void 		runPendingZones();
 
 	void		initPart();
 	void		freePart();
@@ -1038,11 +1041,9 @@
 	DECLARE_UNQUALIFIED_INSTRUCTION_OPCODE(endscript);
 
 	void setupSubtitles(char *s, char *s2, int y);
+	void clearSubtitles();
 #if 0
 	void jobWaitRemoveLabelJob(void *parm, Job *job);
-	void jobDisplaySubtitle(void *parm, Job *job);
-	void jobEraseSubtitle(void *parm, Job *job);
-	void jobWaitRemoveSubtitleJob(void *parm, Job *job);
 	void jobPauseSfx(void *parm, Job *job);
 	void jobStopFollower(void *parm, Job *job);
 	void jobScroll(void *parm, Job *job);

Modified: scummvm/trunk/engines/parallaction/parallaction_br.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/parallaction_br.cpp	2008-02-02 21:22:05 UTC (rev 30747)
+++ scummvm/trunk/engines/parallaction/parallaction_br.cpp	2008-02-02 22:45:31 UTC (rev 30748)
@@ -181,20 +181,41 @@
 	strcpy(_location._name, partFirstLocation[_part]);
 
 	parseLocation("common");
-	parseLocation(_location._name);
-
 	changeLocation(_location._name);
 
 }
 
+void Parallaction_br::runPendingZones() {
+	Zone *z;
+
+	if (_activeZone) {
+		z = _activeZone;	// speak Zone or sound
+		_activeZone = NULL;
+		runZone(z);
+	}
+
+	if (_activeZone2) {
+		z = _activeZone2;	// speak Zone or sound
+		_activeZone2 = NULL;
+		runZone(z);
+	}
+}
+
+
 void Parallaction_br::changeLocation(char *location) {
 
+	// free open location stuff
+	clearSubtitles();
+
+	freeLocation();
+
+	// load new location
+	parseLocation(location);
 	runCommands(_location._commands);
-
 //	doLocationEnterTransition();
-
 	runCommands(_location._aCommands);
 
+	_engineFlags &= ~kEngineChangeLocation;
 }
 
 void Parallaction_br::changeCharacter(const char *name) {

Modified: scummvm/trunk/engines/parallaction/parallaction_ns.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/parallaction_ns.cpp	2008-02-02 21:22:05 UTC (rev 30747)
+++ scummvm/trunk/engines/parallaction/parallaction_ns.cpp	2008-02-02 22:45:31 UTC (rev 30748)
@@ -269,6 +269,14 @@
 	_gfx->setBackground(kBackgroundSlide, name, 0, 0);
 }
 
+void Parallaction_ns::runPendingZones() {
+	if (_activeZone) {
+		Zone *z = _activeZone;	// speak Zone or sound
+		_activeZone = NULL;
+		runZone(z);
+	}
+}
+
 //	changeLocation handles transitions between locations, and is able to display slides
 //	between one and the other.
 //


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