diff options
author | Nicola Mettifogo | 2007-11-18 13:22:38 +0000 |
---|---|---|
committer | Nicola Mettifogo | 2007-11-18 13:22:38 +0000 |
commit | 6471eb84f25d156a98bcf0447862e4839f8cc24d (patch) | |
tree | 19d23a9a923a5733db332957a1019b6b65299618 /engines/parallaction/parallaction.cpp | |
parent | ade0b5a21222c705a8fe3a3e67d6c783904c6d5e (diff) | |
download | scummvm-rg350-6471eb84f25d156a98bcf0447862e4839f8cc24d.tar.gz scummvm-rg350-6471eb84f25d156a98bcf0447862e4839f8cc24d.tar.bz2 scummvm-rg350-6471eb84f25d156a98bcf0447862e4839f8cc24d.zip |
Cleanup.
svn-id: r29556
Diffstat (limited to 'engines/parallaction/parallaction.cpp')
-rw-r--r-- | engines/parallaction/parallaction.cpp | 44 |
1 files changed, 18 insertions, 26 deletions
diff --git a/engines/parallaction/parallaction.cpp b/engines/parallaction/parallaction.cpp index 0174474f39..54bf992dcd 100644 --- a/engines/parallaction/parallaction.cpp +++ b/engines/parallaction/parallaction.cpp @@ -278,8 +278,7 @@ void Parallaction::runGame() { if (_activeZone) { Zone *z = _activeZone; // speak Zone or sound _activeZone = NULL; - if (runZone( z ) == 0) - runCommands( z->_commands, z ); + runZone(z); } if (_engineFlags & kEngineChangeLocation) { @@ -332,7 +331,6 @@ void Parallaction::hideLabel(uint priority) { void Parallaction::processInput(InputData *data) { - Zone *z; switch (data->_event) { case kEvEnterZone: @@ -350,10 +348,7 @@ void Parallaction::processInput(InputData *data) { _procCurrentHoverItem = -1; _hoverZone = NULL; pauseJobs(); - z = data->_zone; - if (runZone(z) == 0) { - runCommands( z->_commands, z ); - } + runZone(data->_zone); resumeJobs(); break; @@ -421,7 +416,7 @@ void Parallaction::processInput(InputData *data) { void Parallaction::updateInput() { - _keyDown = readInput(); + int16 keyDown = readInput(); debugC(3, kDebugInput, "translateInput: input flags (%i, %i, %i, %i)", !_mouseHidden, @@ -438,13 +433,13 @@ void Parallaction::updateInput() { return; } - if (_keyDown == kEvQuitGame) { + if (keyDown == kEvQuitGame) { _input._event = kEvQuitGame; } else - if (_keyDown == kEvSaveGame) { + if (keyDown == kEvSaveGame) { _input._event = kEvSaveGame; } else - if (_keyDown == kEvLoadGame) { + if (keyDown == kEvLoadGame) { _input._event = kEvLoadGame; } else { _input._mousePos = _mousePos; @@ -618,9 +613,8 @@ void Parallaction::showCursor(bool visible) { void Parallaction::freeCharacter() { debugC(1, kDebugExec, "freeCharacter()"); - if (_objectsNames) - delete _objectsNames; - _objectsNames = NULL; + delete _objectsNames; + _objectsNames = 0; _char.free(); @@ -803,10 +797,8 @@ void Parallaction::freeLocation() { freeZones(); freeAnimations(); - if (_location._comment) { - free(_location._comment); - } - _location._comment = NULL; + free(_location._comment); + _location._comment = 0; _location._commands.clear(); _location._aCommands.clear(); @@ -881,6 +873,10 @@ void Parallaction::showLocationComment(const char *text, bool end) { void Parallaction::doLocationEnterTransition() { debugC(2, kDebugExec, "doLocationEnterTransition"); + if (!_location._comment) { + return; + } + if (_localFlags[_currentLocationIndex] & kFlagsVisited) { debugC(2, kDebugExec, "skipping location transition"); return; // visited @@ -996,14 +992,10 @@ void Character::scheduleWalk(int16 x, int16 y) { void Character::free() { - if (_ani._cnv) - delete _ani._cnv; - if (_talk) - delete _talk; - if (_head) - delete _head; - if (_objs) - delete _objs; + delete _ani._cnv; + delete _talk; + delete _head; + delete _objs; _ani._cnv = NULL; _talk = NULL; |