aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorNicola Mettifogo2008-02-03 16:02:21 +0000
committerNicola Mettifogo2008-02-03 16:02:21 +0000
commita53d87791d25687f4cf730374fbcd21673cfbeeb (patch)
tree28e589d9ba3f1fdb5bd1fb0d98c9e13393e471bd /engines
parent85171eadaae2f54581239b2723a02eab87a50f88 (diff)
downloadscummvm-rg350-a53d87791d25687f4cf730374fbcd21673cfbeeb.tar.gz
scummvm-rg350-a53d87791d25687f4cf730374fbcd21673cfbeeb.tar.bz2
scummvm-rg350-a53d87791d25687f4cf730374fbcd21673cfbeeb.zip
- Character is now initialized when needed (for the moment only by NS)
- Forward lists are now bigger since BRA scripts are larger svn-id: r30769
Diffstat (limited to 'engines')
-rw-r--r--engines/parallaction/parallaction.cpp26
-rw-r--r--engines/parallaction/parallaction.h1
-rw-r--r--engines/parallaction/parallaction_ns.cpp4
-rw-r--r--engines/parallaction/parser_br.cpp8
4 files changed, 8 insertions, 31 deletions
diff --git a/engines/parallaction/parallaction.cpp b/engines/parallaction/parallaction.cpp
index ac916f8d8b..d22981b37d 100644
--- a/engines/parallaction/parallaction.cpp
+++ b/engines/parallaction/parallaction.cpp
@@ -55,30 +55,11 @@ uint32 _engineFlags = 0;
uint16 _score = 1;
char _password[8];
-Command * _forwardedCommands[20] = {
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
+Command * _forwardedCommands[MAX_FORWARDS] = {
NULL
};
-char _forwardedAnimationNames[20][20];
+char _forwardedAnimationNames[MAX_FORWARDS][20];
uint16 _numForwards = 0;
uint32 _commandFlags = 0;
@@ -125,8 +106,6 @@ Parallaction::~Parallaction() {
delete _zoneTypeNames;
delete _zoneFlagNames;
- _animations.remove(&_char._ani);
-
freeLocation();
freeCharacter();
@@ -170,7 +149,6 @@ int Parallaction::init() {
_hoverZone = NULL;
- _animations.push_front(&_char._ani);
_gfx = new Gfx(this);
_debugger = new Debugger(this);
diff --git a/engines/parallaction/parallaction.h b/engines/parallaction/parallaction.h
index 6d5f319a29..a4979a5583 100644
--- a/engines/parallaction/parallaction.h
+++ b/engines/parallaction/parallaction.h
@@ -146,6 +146,7 @@ extern char _password[8];
extern uint16 _score;
extern uint16 _language;
extern uint32 _engineFlags;
+#define MAX_FORWARDS 50
extern Command *_forwardedCommands[];
extern char _forwardedAnimationNames[][20];
extern uint16 _numForwards;
diff --git a/engines/parallaction/parallaction_ns.cpp b/engines/parallaction/parallaction_ns.cpp
index dabc20db00..945702bd25 100644
--- a/engines/parallaction/parallaction_ns.cpp
+++ b/engines/parallaction/parallaction_ns.cpp
@@ -137,6 +137,8 @@ int Parallaction_ns::init() {
initOpcodes();
initParsers();
+ _animations.push_front(&_char._ani);
+
Parallaction::init();
return 0;
@@ -151,6 +153,8 @@ Parallaction_ns::~Parallaction_ns() {
delete _instructionNames;
delete _locationStmt;
+ _animations.remove(&_char._ani);
+
}
diff --git a/engines/parallaction/parser_br.cpp b/engines/parallaction/parser_br.cpp
index b9a7093819..6ad08e0dc8 100644
--- a/engines/parallaction/parser_br.cpp
+++ b/engines/parallaction/parser_br.cpp
@@ -427,6 +427,7 @@ DECLARE_COMMAND_PARSER(zone) {
_locParseCtxt.nextToken++;
if (_locParseCtxt.cmd->u._zone == NULL) {
+ assert(_numForwards < MAX_FORWARDS);
strcpy(_forwardedAnimationNames[_numForwards], _tokens[_locParseCtxt.nextToken-1]);
_forwardedCommands[_numForwards] = _locParseCtxt.cmd;
_numForwards++;
@@ -947,13 +948,6 @@ void Parallaction_br::parseLocation(const char* filename) {
free(_locParseCtxt.maskName);
free(_locParseCtxt.pathName);
- AnimationList::iterator it = _animations.begin();
- for ( ; it != _animations.end(); it++) {
- if ((*it)->_scriptName) {
- loadProgram(*it, (*it)->_scriptName);
- }
- }
-
// drawZones();
return;