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

peres001 at users.sourceforge.net peres001 at users.sourceforge.net
Sun Mar 11 14:01:12 CET 2007


Revision: 26083
          http://scummvm.svn.sourceforge.net/scummvm/?rev=26083&view=rev
Author:   peres001
Date:     2007-03-11 06:01:11 -0700 (Sun, 11 Mar 2007)

Log Message:
-----------
some simplification for changeLocation

Modified Paths:
--------------
    scummvm/trunk/engines/parallaction/location.cpp
    scummvm/trunk/engines/parallaction/parallaction.cpp
    scummvm/trunk/engines/parallaction/parallaction.h

Modified: scummvm/trunk/engines/parallaction/location.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/location.cpp	2007-03-11 11:23:40 UTC (rev 26082)
+++ scummvm/trunk/engines/parallaction/location.cpp	2007-03-11 13:01:11 UTC (rev 26083)
@@ -279,6 +279,29 @@
 extern Job     *_jDrawLabel;
 extern Job     *_jEraseLabel;
 
+void Parallaction::showSlide(const char *name) {
+
+	_disk->loadSlide(name);
+	_graphics->palUnk0(_palette);
+	_graphics->copyScreen(Graphics::kBitBack, Graphics::kBitFront);
+
+	debugC(1, kDebugLocation, "changeLocation: new background set");
+
+	_graphics->_proportionalFont = false;
+	_graphics->setFont("slide");
+
+	uint16 _ax = strlen(_slideText[0]);
+	_ax <<= 3;	// text width
+	uint16 _dx = (SCREEN_WIDTH - _ax) >> 1; // center text
+	_graphics->displayString(_dx, 14, _slideText[0]); // displays text on screen
+
+	waitUntilLeftClick();
+
+	debugC(2, kDebugLocation, "changeLocation: intro text shown");
+
+	return;
+}
+
 /*
 	changeLocation handles transitions between locations, and is able to display slides
 	between one and the other. The input parameter 'location' exists in some flavours:
@@ -319,41 +342,25 @@
 		debugC(2, kDebugLocation, "changeLocation: changed cursor");
 	}
 
-	strcpy(_newLocation, location);
-
 	removeNode(&_yourself._zone._node);
 	debugC(2, kDebugLocation, "changeLocation: removed character from the animation list");
 
 	freeLocation();
 	debugC(1, kDebugLocation, "changeLocation: old location free'd");
 
+	char buf[100];
+	strcpy(buf, location);
 
-	char *tmp = strchr(_newLocation, '.');
+	char *tmp = strchr(buf, '.');	// tmp = ".slide.[L].[C]" or tmp = ".[C]" or tmp = NULL
 	if (tmp) {
 		*tmp = '\0';
 
 		if (!scumm_strnicmp(tmp+1, "slide", 5)) {
-			_disk->loadSlide(_newLocation);
-			_graphics->palUnk0(_palette);
-			_graphics->copyScreen(Graphics::kBitBack, Graphics::kBitFront);
+			showSlide(buf);
 
-			debugC(1, kDebugLocation, "changeLocation: new background set");
-
-			_graphics->_proportionalFont = false;
-			_graphics->setFont("slide");
-
-			uint16 _ax = strlen(_slideText[0]);
-			_ax <<= 3;	// text width
-			uint16 _dx = (SCREEN_WIDTH - _ax) >> 1; // center text
-			_graphics->displayString(_dx, 14, _slideText[0]); // displays text on screen
-
-			waitUntilLeftClick();
-
-			debugC(2, kDebugLocation, "changeLocation: intro text shown");
-
 			tmp = strchr(tmp+1, '.');
-			strcpy(_newLocation, tmp+1);
-			tmp = strchr(_newLocation, '.');
+			strcpy(buf, tmp+1);
+			tmp = strchr(buf, '.');
 
 			if (tmp) {
 				*tmp = '\0';
@@ -372,11 +379,11 @@
 	addNode(&_animations, &_yourself._zone._node);
 	debugC(2, kDebugLocation, "changeLocation: new character added to the animation list");
 
-	strcpy(_saveData1, _newLocation);
+	strcpy(_saveData1, buf);
 
-	parseLocation(_newLocation);
+	parseLocation(buf);
 	_graphics->copyScreen(Graphics::kBitBack, Graphics::kBit2);
-	debugC(1, kDebugLocation, "changeLocation: new location '%s' parsed", _newLocation);
+	debugC(1, kDebugLocation, "changeLocation: new location '%s' parsed", buf);
 
 	_yourself._zone.pos._oldposition._x = -1000;
 	_yourself._zone.pos._oldposition._y = -1000;

Modified: scummvm/trunk/engines/parallaction/parallaction.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/parallaction.cpp	2007-03-11 11:23:40 UTC (rev 26082)
+++ scummvm/trunk/engines/parallaction/parallaction.cpp	2007-03-11 13:01:11 UTC (rev 26083)
@@ -135,7 +135,7 @@
 char		_soundFile[20];
 char		_slideText[2][40];
 Point		_firstPosition = { -1000, -1000 };
-char		_newLocation[100];
+
 char	   *_globalTable[32];
 uint16		_firstFrame = 0;
 byte		_mouseHidden = 0;

Modified: scummvm/trunk/engines/parallaction/parallaction.h
===================================================================
--- scummvm/trunk/engines/parallaction/parallaction.h	2007-03-11 11:23:40 UTC (rev 26082)
+++ scummvm/trunk/engines/parallaction/parallaction.h	2007-03-11 13:01:11 UTC (rev 26083)
@@ -114,7 +114,7 @@
 extern char _slideText[][40];
 extern uint16 _introSarcData3;		 // sarcophagus stuff to be saved
 extern uint16 _introSarcData2;		 // sarcophagus stuff to be saved
-extern char _newLocation[];
+
 extern char *_globalTable[];
 extern char _saveData1[];
 extern Point _firstPosition;		 // starting position after load game??
@@ -353,6 +353,7 @@
 	void		parseZoneTypeBlock(Script &script, Zone *z);
 	void		loadProgram(Animation *a, char *filename);
 	void		changeLocation(char *location);
+	void 		showSlide(const char *name);
 
 	void 		pickMusic(const char *location);
 	void		selectCharacterMusic(const char *name);


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