diff options
author | Nicola Mettifogo | 2008-05-09 01:35:43 +0000 |
---|---|---|
committer | Nicola Mettifogo | 2008-05-09 01:35:43 +0000 |
commit | 1d025957caad81aef5504b8e505b835ce106cf1b (patch) | |
tree | 9c30c5ca606fb96edcc568655464ab488f88542e /engines/parallaction/parallaction_ns.cpp | |
parent | bdadf34f16cc0f271151e6e7f0438bf5ed48df8d (diff) | |
download | scummvm-rg350-1d025957caad81aef5504b8e505b835ce106cf1b.tar.gz scummvm-rg350-1d025957caad81aef5504b8e505b835ce106cf1b.tar.bz2 scummvm-rg350-1d025957caad81aef5504b8e505b835ce106cf1b.zip |
Moved location parsing out of the engines, to LocationParser_ns and LocationParser_br.
svn-id: r31958
Diffstat (limited to 'engines/parallaction/parallaction_ns.cpp')
-rw-r--r-- | engines/parallaction/parallaction_ns.cpp | 32 |
1 files changed, 29 insertions, 3 deletions
diff --git a/engines/parallaction/parallaction_ns.cpp b/engines/parallaction/parallaction_ns.cpp index 7a476f7d24..071fa262a8 100644 --- a/engines/parallaction/parallaction_ns.cpp +++ b/engines/parallaction/parallaction_ns.cpp @@ -155,9 +155,7 @@ Parallaction_ns::~Parallaction_ns() { delete _mouseComposedArrow; - delete _commandsNames; delete _instructionNames; - delete _locationStmt; _location._animations.remove(_char._ani); @@ -315,7 +313,7 @@ void Parallaction_ns::changeLocation(char *location) { if (locname.hasSlide()) { showSlide(locname.slide()); - uint id = _gfx->createLabel(_menuFont, _slideText[0], 1); + uint id = _gfx->createLabel(_menuFont, _location._slideText[0], 1); _gfx->showLabel(id, CENTER_LABEL_HORIZONTAL, 14); waitUntilLeftClick(); _gfx->freeLabels(); @@ -367,6 +365,34 @@ void Parallaction_ns::changeLocation(char *location) { } +void Parallaction_ns::parseLocation(const char *filename) { + debugC(1, kDebugParser, "parseLocation('%s')", filename); + + allocateLocationSlot(filename); + Script *script = _disk->loadLocation(filename); + + // TODO: the following two lines are specific to Nippon Safes + // and should be moved into something like 'initializeParsing()' + _vm->_location._hasSound = false; + + _locationParser->parse(script); + + delete script; + + // this loads animation scripts + AnimationList::iterator it = _vm->_location._animations.begin(); + for ( ; it != _vm->_location._animations.end(); it++) { + if ((*it)->_scriptName) { + loadProgram(*it, (*it)->_scriptName); + } + } + + debugC(1, kDebugParser, "parseLocation('%s') done", filename); + return; +} + + + void Parallaction_ns::changeCharacter(const char *name) { debugC(1, kDebugExec, "changeCharacter(%s)", name); |