aboutsummaryrefslogtreecommitdiff
path: root/engines/parallaction
diff options
context:
space:
mode:
authorNicola Mettifogo2009-03-18 10:55:05 +0000
committerNicola Mettifogo2009-03-18 10:55:05 +0000
commit739181c3b7bdc9dac18c696e0928819a836e1bf0 (patch)
tree57fc0f734428e9f9ff0ad543d1d1ac67741f309c /engines/parallaction
parente5a640b0976c29e5c62ff4316c988234f85fc838 (diff)
downloadscummvm-rg350-739181c3b7bdc9dac18c696e0928819a836e1bf0.tar.gz
scummvm-rg350-739181c3b7bdc9dac18c696e0928819a836e1bf0.tar.bz2
scummvm-rg350-739181c3b7bdc9dac18c696e0928819a836e1bf0.zip
Postpone loading of mask and path data on BRA. This fixed locations in which mask and path are defined before the screen bitmap.
svn-id: r39512
Diffstat (limited to 'engines/parallaction')
-rw-r--r--engines/parallaction/parser.h18
-rw-r--r--engines/parallaction/parser_br.cpp13
2 files changed, 13 insertions, 18 deletions
diff --git a/engines/parallaction/parser.h b/engines/parallaction/parser.h
index 2af2ec856d..8385961ce3 100644
--- a/engines/parallaction/parser.h
+++ b/engines/parallaction/parser.h
@@ -133,6 +133,8 @@ protected:
int numZones;
BackgroundInfo *info;
char *characterName;
+ Common::String _maskName;
+ Common::String _pathName;
} ctxt;
void warning_unexpected();
@@ -244,23 +246,7 @@ public:
};
-/*
- 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:
diff --git a/engines/parallaction/parser_br.cpp b/engines/parallaction/parser_br.cpp
index 141048caa5..001906c2e5 100644
--- a/engines/parallaction/parser_br.cpp
+++ b/engines/parallaction/parser_br.cpp
@@ -466,14 +466,16 @@ DECLARE_LOCATION_PARSER(mask) {
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 @@ void LocationParser_br::parse(Script *script) {
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();