- 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
This commit is contained in:
Nicola Mettifogo 2008-02-03 16:02:21 +00:00
parent 85171eadaa
commit a53d87791d
4 changed files with 8 additions and 31 deletions

View File

@ -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);

View File

@ -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;

View File

@ -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);
}

View File

@ -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;