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

peres001 at users.sourceforge.net peres001 at users.sourceforge.net
Wed Mar 18 11:55:05 CET 2009


Revision: 39512
          http://scummvm.svn.sourceforge.net/scummvm/?rev=39512&view=rev
Author:   peres001
Date:     2009-03-18 10:55:05 +0000 (Wed, 18 Mar 2009)

Log Message:
-----------
Postpone loading of mask and path data on BRA. This fixed locations in which mask and path are defined before the screen bitmap.

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

Modified: scummvm/trunk/engines/parallaction/parser.h
===================================================================
--- scummvm/trunk/engines/parallaction/parser.h	2009-03-18 10:34:57 UTC (rev 39511)
+++ scummvm/trunk/engines/parallaction/parser.h	2009-03-18 10:55:05 UTC (rev 39512)
@@ -133,6 +133,8 @@
 		int numZones;
 		BackgroundInfo	*info;
 		char *characterName;
+		Common::String _maskName;
+		Common::String _pathName;
 	} ctxt;
 
 	void warning_unexpected();
@@ -244,23 +246,7 @@
 
 };
 
-/*
-	TODO: adapt the parser to effectively use the
-	statement list provided by preprocessor as its
-	input, instead of relying on the current Script
-	class.
 
-	This would need a major rewrite of the parsing
-	system!
-
-	parseNextToken could then be sealed into the
-	PreProcessor class forever, together with the
-	_tokens[] and _numTokens stuff, now dangling as
-	global objects.
-
-	NS balloons code should be dealt with before,
-	though.
-*/
 class LocationParser_br : public LocationParser_ns {
 
 protected:

Modified: scummvm/trunk/engines/parallaction/parser_br.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/parser_br.cpp	2009-03-18 10:34:57 UTC (rev 39511)
+++ scummvm/trunk/engines/parallaction/parser_br.cpp	2009-03-18 10:55:05 UTC (rev 39512)
@@ -466,14 +466,16 @@
 	ctxt.info->layers[2] = atoi(_tokens[3]);
 	ctxt.info->layers[3] = atoi(_tokens[4]);
 
-	_vm->_disk->loadScenery(*ctxt.info, 0, _tokens[1], 0);
+	// postpone loading of screen mask data, because background must be loaded first
+	ctxt._maskName = _tokens[1];
 }
 
 
 DECLARE_LOCATION_PARSER(path)  {
 	debugC(7, kDebugParser, "LOCATION_PARSER(path) ");
 
-	_vm->_disk->loadScenery(*ctxt.info, 0, 0, _tokens[1]);
+	// postpone loading of screen path data, because background must be loaded first
+	ctxt._pathName = _tokens[1];
 }
 
 
@@ -1297,9 +1299,16 @@
 	ctxt.numZones = 0;
 	ctxt.characterName = 0;
 	ctxt.info = new BackgroundInfo;
+	ctxt._pathName.clear();
+	ctxt._maskName.clear();
 
 	LocationParser_ns::parse(script);
 
+	// finally load mask and path, if any
+	_vm->_disk->loadScenery(*ctxt.info, 0,
+		ctxt._maskName.empty() ? 0 : ctxt._maskName.c_str(),
+		ctxt._pathName.empty() ? 0 : ctxt._pathName.c_str());
+
 	_vm->_gfx->setBackground(kBackgroundLocation, ctxt.info);
 
 	ZoneList::iterator it = _vm->_location._zones.begin();


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