aboutsummaryrefslogtreecommitdiff
path: root/engines/parallaction/parallaction_br.cpp
diff options
context:
space:
mode:
authorNicola Mettifogo2007-08-12 19:11:37 +0000
committerNicola Mettifogo2007-08-12 19:11:37 +0000
commit3465571b121fdcaba1b97f0a52b1aa16a25390a5 (patch)
treece450e7d458ed4eda0de1e5bb68bac95a94d2430 /engines/parallaction/parallaction_br.cpp
parentd7b6f0ecc849ec4dbd6916f2ce466caae7343dc0 (diff)
downloadscummvm-rg350-3465571b121fdcaba1b97f0a52b1aa16a25390a5.tar.gz
scummvm-rg350-3465571b121fdcaba1b97f0a52b1aa16a25390a5.tar.bz2
scummvm-rg350-3465571b121fdcaba1b97f0a52b1aa16a25390a5.zip
Added preliminary support for loading locations in BRA:
- changed parseLocation to invoke subclasses for version-specific keywords. - implemented loading of background resources (backgrounds should be visible) svn-id: r28568
Diffstat (limited to 'engines/parallaction/parallaction_br.cpp')
-rw-r--r--engines/parallaction/parallaction_br.cpp78
1 files changed, 78 insertions, 0 deletions
diff --git a/engines/parallaction/parallaction_br.cpp b/engines/parallaction/parallaction_br.cpp
index f6dd1aee45..82dfd96f54 100644
--- a/engines/parallaction/parallaction_br.cpp
+++ b/engines/parallaction/parallaction_br.cpp
@@ -343,5 +343,83 @@ void Parallaction_br::startPart() {
}
+void skip(Script* script, const char* endToken) {
+
+ while (scumm_stricmp(_tokens[0], endToken)) {
+ fillBuffers(*script, true);
+ }
+
+}
+
+bool Parallaction_br::parseLocationLine(const char *filename, Script *script) {
+
+ bool parsed = true;
+ bool flip = false;
+ int nextToken = 0;
+
+ if (!scumm_stricmp(_tokens[0], "LOCATION")) {
+
+ strcpy(_location._name, _tokens[1]);
+ _disk->loadScenery(*_backgroundInfo, _location._name, NULL, NULL);
+ _gfx->setBackground(&_backgroundInfo->bg);
+ _gfx->_palette.clone(_backgroundInfo->palette);
+ _gfx->setPalette(_backgroundInfo->palette);
+
+ if (!scumm_stricmp("flip", _tokens[2])) {
+ flip = true;
+ nextToken = 3;
+ } else {
+ nextToken = 2;
+ }
+
+ if (_tokens[nextToken][0] != '\0') {
+ _char._ani._left = atoi(_tokens[nextToken]);
+ nextToken++;
+ _char._ani._top = atoi(_tokens[nextToken]);
+ nextToken++;
+ }
+
+ if (_tokens[nextToken][0] != '\0') {
+ _char._ani._frame = atoi(_tokens[nextToken]);
+ }
+ } else
+ if (!scumm_stricmp(_tokens[0], "IFCHAR")) {
+ skip(script, "ENDIF");
+ } else
+ if (!scumm_stricmp(_tokens[0], "CHARACTER")) {
+
+ } else
+ if (!scumm_stricmp(_tokens[0], "MASK")) {
+ _disk->loadScenery(*_backgroundInfo, NULL, _tokens[1], NULL);
+ _gfx->setMask(&_backgroundInfo->mask);
+
+ _gfx->_bgLayers[0] = atoi(_tokens[2]);
+ _gfx->_bgLayers[1] = atoi(_tokens[3]);
+ _gfx->_bgLayers[2] = atoi(_tokens[4]);
+ } else
+ if (!scumm_stricmp(_tokens[0], "PATH")) {
+ _disk->loadScenery(*_backgroundInfo, NULL, NULL, _tokens[1]);
+ _pathBuffer = &_backgroundInfo->path;
+ } else
+ if (!scumm_stricmp(_tokens[0], "DISK")) {
+ //
+ } else
+ if (!scumm_stricmp(_tokens[0], "ESCAPE")) {
+ skip(script, "endcommands");
+ } else
+ if (!scumm_stricmp(_tokens[0], "ZETA")) {
+ //
+ } else
+ if (!scumm_stricmp(_tokens[0], "ZONE")) {
+ skip(script, "endzone");
+ } else
+ if (!scumm_stricmp(_tokens[0], "ANIMATION")) {
+ skip(script, "endanimation");
+ } else
+ parsed = false;
+
+ return parsed;
+}
+
} // namespace Parallaction