diff options
author | Christopher Page | 2008-06-20 20:20:46 +0000 |
---|---|---|
committer | Christopher Page | 2008-06-20 20:20:46 +0000 |
commit | 8ce5dcc8e84cbd1e58437cebabd129760a873900 (patch) | |
tree | 58e33932959aef32071ae750cd0857435f9b5e9a /engines/parallaction | |
parent | 0c6c7de3554a65a22324a0aa89b111aa7f2fa79f (diff) | |
parent | 6dce28e166865dd8c892e0e298ed6abcdc1042bd (diff) | |
download | scummvm-rg350-8ce5dcc8e84cbd1e58437cebabd129760a873900.tar.gz scummvm-rg350-8ce5dcc8e84cbd1e58437cebabd129760a873900.tar.bz2 scummvm-rg350-8ce5dcc8e84cbd1e58437cebabd129760a873900.zip |
Merged revisions 31992,32088,32094,32129,32203,32208,32219,32236,32329,32332-32333,32357,32504,32519,32525,32566,32578,32641-32642,32673,32675,32677,32679-32680,32718-32719,32721,32739 via svnmerge from
https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/branches/gsoc2008-rtl
........
r31992 | cpage88 | 2008-05-10 18:44:46 -0500 (Sat, 10 May 2008) | 1 line
Modified game loop to return to launcher, codeblocks layouts update 1.5->1.6
........
r32088 | cpage88 | 2008-05-13 11:09:57 -0500 (Tue, 13 May 2008) | 1 line
used memmove() instead of memcpy() to fix memory overlap error
........
r32094 | cpage88 | 2008-05-13 17:59:19 -0500 (Tue, 13 May 2008) | 1 line
Fixed memory leak by deallocating memory used by window->iconPtr
........
r32129 | cpage88 | 2008-05-14 18:26:32 -0500 (Wed, 14 May 2008) | 1 line
Fixed memory leak when returning to launcher in AGOS engine by properly creating and deleting midi driver pointer
........
r32203 | cpage88 | 2008-05-20 16:40:53 -0500 (Tue, 20 May 2008) | 1 line
AGOS Engine: Began implementation for a new quit event which will cleanly return to the launcher. This replaces the old shutdown() method within delay()
........
r32208 | cpage88 | 2008-05-21 13:52:27 -0500 (Wed, 21 May 2008) | 1 line
AGOS: Fixed two memory leaks when returning to the launcher (_mouseData and _zoneBuffers)
........
r32219 | cpage88 | 2008-05-22 18:40:36 -0500 (Thu, 22 May 2008) | 1 line
AGOS: Fixed a memory leak from earlier in a better way
........
r32236 | cpage88 | 2008-05-23 19:08:13 -0500 (Fri, 23 May 2008) | 1 line
AGI: Fixed two memory leaks when returning to launcher from AGI Engine
........
r32329 | cpage88 | 2008-05-27 15:15:36 -0500 (Tue, 27 May 2008) | 1 line
AGI: Modified AGI Engine to shutdown without using system->quit
........
r32332 | cpage88 | 2008-05-27 18:26:48 -0500 (Tue, 27 May 2008) | 1 line
CINE: Fixed two memory leaks when shutting down the CINE engine
........
r32333 | cpage88 | 2008-05-27 19:52:45 -0500 (Tue, 27 May 2008) | 1 line
CINE: Initialize exitEngine to 0 in mainLoop() to allow replay after returning to the launcher
........
r32357 | cpage88 | 2008-05-28 18:28:11 -0500 (Wed, 28 May 2008) | 1 line
LURE: Fixed some memory leaks when returning to the launcher from the LURE engine
........
r32504 | cpage88 | 2008-06-02 16:08:49 -0500 (Mon, 02 Jun 2008) | 1 line
PARA: Got rid of calls to system->quit() so that the Parallaction engine can return to the launcher. Also fixed a couple of memory leaks.
........
r32519 | cpage88 | 2008-06-03 13:24:54 -0500 (Tue, 03 Jun 2008) | 1 line
PARA: Fixed some memory leaks
........
r32525 | cpage88 | 2008-06-04 00:21:47 -0500 (Wed, 04 Jun 2008) | 1 line
QUEEN: Modified engine to use a quit flag instead of system->quit() in order to return to the launcher
........
r32566 | cpage88 | 2008-06-05 19:34:47 -0500 (Thu, 05 Jun 2008) | 1 line
TOUCHE: Fixed a memory leak
........
r32578 | cpage88 | 2008-06-06 11:40:39 -0500 (Fri, 06 Jun 2008) | 1 line
SKY: Fixed a memory leak in SKY engine
........
r32641 | cpage88 | 2008-06-09 17:26:05 -0500 (Mon, 09 Jun 2008) | 1 line
TOUCHE: Reverted some comments that were used for testing purposes
........
r32642 | cpage88 | 2008-06-09 18:15:17 -0500 (Mon, 09 Jun 2008) | 1 line
Implemented popAllCursors() in CursorManager to ensure that all unnecessary cursors are removed from the cursor stack when returning to the launcher
........
r32673 | cpage88 | 2008-06-12 11:58:02 -0500 (Thu, 12 Jun 2008) | 1 line
SAGA: Fixed memory leaks in the SAGA engine
........
r32675 | cpage88 | 2008-06-12 13:11:09 -0500 (Thu, 12 Jun 2008) | 1 line
LURE: Fixed memory leaks in the LURE engine
........
r32677 | cpage88 | 2008-06-12 13:52:43 -0500 (Thu, 12 Jun 2008) | 1 line
CINE: Fixed memory leaks in the CINE engine
........
r32679 | cpage88 | 2008-06-12 14:34:32 -0500 (Thu, 12 Jun 2008) | 1 line
AGOS: Fixed a memory leak in the AGOS engine
........
r32680 | cpage88 | 2008-06-12 14:43:54 -0500 (Thu, 12 Jun 2008) | 1 line
SCUMM: Fixed a memory leak in the SCUMM engine
........
r32718 | cpage88 | 2008-06-16 12:34:58 -0500 (Mon, 16 Jun 2008) | 1 line
AGOS: Found a system->quit(), changed to _quit=true
........
r32719 | cpage88 | 2008-06-16 13:47:32 -0500 (Mon, 16 Jun 2008) | 1 line
Fixed a problem where the function that I previously implemented, popAllCursors(), was causing the mouse cursor to disapear
........
r32721 | cpage88 | 2008-06-16 14:55:59 -0500 (Mon, 16 Jun 2008) | 1 line
Cleaned up some unnecessary comments
........
r32739 | cpage88 | 2008-06-20 14:38:38 -0500 (Fri, 20 Jun 2008) | 1 line
Reverting changes to codeblocks layouts made in revision 31992
........
svn-id: r32742
Diffstat (limited to 'engines/parallaction')
-rw-r--r-- | engines/parallaction/dialogue.cpp | 14 | ||||
-rw-r--r-- | engines/parallaction/exec_ns.cpp | 2 | ||||
-rw-r--r-- | engines/parallaction/graphics.h | 1 | ||||
-rw-r--r-- | engines/parallaction/input.cpp | 5 | ||||
-rw-r--r-- | engines/parallaction/parallaction.cpp | 29 | ||||
-rw-r--r-- | engines/parallaction/parallaction.h | 4 | ||||
-rw-r--r-- | engines/parallaction/parallaction_br.cpp | 3 | ||||
-rw-r--r-- | engines/parallaction/parallaction_ns.cpp | 12 | ||||
-rw-r--r-- | engines/parallaction/parser.cpp | 3 | ||||
-rw-r--r-- | engines/parallaction/parser.h | 7 | ||||
-rw-r--r-- | engines/parallaction/parser_ns.cpp | 2 |
11 files changed, 59 insertions, 23 deletions
diff --git a/engines/parallaction/dialogue.cpp b/engines/parallaction/dialogue.cpp index 70db637699..b9dea60dc0 100644 --- a/engines/parallaction/dialogue.cpp +++ b/engines/parallaction/dialogue.cpp @@ -105,10 +105,8 @@ uint16 DialogueManager::askPassword() { if (g_system->getEventManager()->pollEvent(e)) { if (e.type == Common::EVENT_QUIT) { - // TODO: don't quit() here, just have caller routines to check - // on kEngineQuit and exit gracefully to allow the engine to shut down _engineFlags |= kEngineQuit; - g_system->quit(); + break; } if ((e.type == Common::EVENT_KEYDOWN) && isdigit(e.kbd.ascii)) { @@ -231,11 +229,19 @@ void DialogueManager::run() { answer = 0; displayQuestion(); + + if (_engineFlags & kEngineQuit) + return; + if (_q->_answers[0] == NULL) break; if (scumm_stricmp(_q->_answers[0]->_text, "NULL")) { if (!displayAnswers()) break; answer = getAnswer(); + + if (_engineFlags & kEngineQuit) + return; + cmdlist = &_q->_answers[answer]->_commands; } @@ -266,7 +272,7 @@ int16 DialogueManager::selectAnswer() { uint32 event; Common::Point p; - while (true) { + while (_engineFlags & kEngineQuit == 0) { _vm->_input->readInput(); _vm->_input->getCursorPos(p); diff --git a/engines/parallaction/exec_ns.cpp b/engines/parallaction/exec_ns.cpp index a4b372f42a..bd2d54c0a0 100644 --- a/engines/parallaction/exec_ns.cpp +++ b/engines/parallaction/exec_ns.cpp @@ -519,6 +519,8 @@ uint16 Parallaction::runZone(ZonePtr z) { case kZoneSpeak: runDialogue(z->u.speak); + if (_engineFlags & kEngineQuit) + return 0; break; } diff --git a/engines/parallaction/graphics.h b/engines/parallaction/graphics.h index 894e0fd678..f03b8538b8 100644 --- a/engines/parallaction/graphics.h +++ b/engines/parallaction/graphics.h @@ -95,6 +95,7 @@ public: } ~SurfaceToFrames() { + _surf->free(); delete _surf; } diff --git a/engines/parallaction/input.cpp b/engines/parallaction/input.cpp index 28d0ad888d..e758bbd41c 100644 --- a/engines/parallaction/input.cpp +++ b/engines/parallaction/input.cpp @@ -80,11 +80,8 @@ uint16 Input::readInput() { break; case Common::EVENT_QUIT: - // TODO: don't quit() here, just have caller routines to check - // on kEngineQuit and exit gracefully to allow the engine to shut down _engineFlags |= kEngineQuit; - _vm->_system->quit(); - break; + return KeyDown; default: break; diff --git a/engines/parallaction/parallaction.cpp b/engines/parallaction/parallaction.cpp index d66b1af1f1..25ebe4263d 100644 --- a/engines/parallaction/parallaction.cpp +++ b/engines/parallaction/parallaction.cpp @@ -84,21 +84,23 @@ Parallaction::Parallaction(OSystem *syst, const PARALLACTIONGameDescription *gam Parallaction::~Parallaction() { + clearSet(_commandOpcodes); + clearSet(_instructionOpcodes); + delete _debugger; - delete _globalTable; - delete _callableNames; - delete _localFlagNames; freeLocation(); freeCharacter(); destroyInventory(); - + + delete _localFlagNames; delete _gfx; delete _soundMan; delete _disk; + delete _input; } @@ -136,9 +138,11 @@ int Parallaction::init() { } - - - +void Parallaction::clearSet(OpcodeSet &opcodes) { + for (Common::Array<const Opcode*>::iterator i = opcodes.begin(); i != opcodes.end(); ++i) + delete *i; + opcodes.clear(); +} void Parallaction::updateView() { @@ -354,12 +358,20 @@ void Parallaction::runGame() { processInput(data); } + if (_engineFlags & kEngineQuit) + return; + runPendingZones(); + if (_engineFlags & kEngineQuit) + return; + if (_engineFlags & kEngineChangeLocation) { changeLocation(_location._name); } + if (_engineFlags & kEngineQuit) + return; _gfx->beginFrame(); @@ -522,11 +534,12 @@ void Character::free() { delete _talk; delete _head; delete _objs; + delete _ani->gfxobj; - _ani->gfxobj = NULL; _talk = NULL; _head = NULL; _objs = NULL; + _ani->gfxobj = NULL; return; } diff --git a/engines/parallaction/parallaction.h b/engines/parallaction/parallaction.h index 6e5957d3cd..5ae1386378 100644 --- a/engines/parallaction/parallaction.h +++ b/engines/parallaction/parallaction.h @@ -385,6 +385,9 @@ protected: // members int16 pickupItem(ZonePtr z); + void clearSet(OpcodeSet &opcodes); + + public: virtual void callFunction(uint index, void* parm) { } @@ -401,6 +404,7 @@ public: void beep(); + public: // const char **_zoneFlagNamesRes; // const char **_zoneTypeNamesRes; diff --git a/engines/parallaction/parallaction_br.cpp b/engines/parallaction/parallaction_br.cpp index 0f5cc2a0c4..b22e1b0f2d 100644 --- a/engines/parallaction/parallaction_br.cpp +++ b/engines/parallaction/parallaction_br.cpp @@ -109,6 +109,9 @@ int Parallaction_br::go() { guiStart(); + if (_engineFlags & kEngineQuit) + return 0; + // initCharacter(); _input->_inputMode = Input::kInputModeGame; diff --git a/engines/parallaction/parallaction_ns.cpp b/engines/parallaction/parallaction_ns.cpp index 2cca3a6a4a..f346a278f7 100644 --- a/engines/parallaction/parallaction_ns.cpp +++ b/engines/parallaction/parallaction_ns.cpp @@ -156,7 +156,9 @@ int Parallaction_ns::init() { Parallaction_ns::~Parallaction_ns() { freeFonts(); - + + delete _locationParser; + delete _programParser; delete _mouseComposedArrow; _location._animations.remove(_char._ani); @@ -233,9 +235,15 @@ int Parallaction_ns::go() { _globalTable = _disk->loadTable("global"); guiStart(); - + + if (_engineFlags & kEngineQuit) + return 0; + changeLocation(_location._name); + if (_engineFlags & kEngineQuit) + return 0; + _input->_inputMode = Input::kInputModeGame; while ((_engineFlags & kEngineQuit) == 0) { runGame(); diff --git a/engines/parallaction/parser.cpp b/engines/parallaction/parser.cpp index f9de6eb4af..6de0a7d7f5 100644 --- a/engines/parallaction/parser.cpp +++ b/engines/parallaction/parser.cpp @@ -30,8 +30,7 @@ namespace Parallaction { char _tokens[20][MAX_TOKEN_LEN]; -Script::Script(Common::ReadStream *input, bool disposeSource) : _input(input), _disposeSource(disposeSource), _line(0) { -} +Script::Script(Common::ReadStream *input, bool disposeSource) : _input(input), _disposeSource(disposeSource), _line(0) {} Script::~Script() { if (_disposeSource) diff --git a/engines/parallaction/parser.h b/engines/parallaction/parser.h index d488cf9b58..1541fb89b2 100644 --- a/engines/parallaction/parser.h +++ b/engines/parallaction/parser.h @@ -221,13 +221,14 @@ public: virtual void init(); virtual ~LocationParser_ns() { + delete _parser; delete _commandsNames; delete _locationStmt; + delete _locationZoneStmt; + delete _locationAnimStmt; delete _zoneTypeNames; delete _zoneFlagNames; - delete _parser; - clearSet(_commandParsers); clearSet(_locationAnimParsers); clearSet(_locationZoneParsers); @@ -356,7 +357,9 @@ public: virtual void init(); virtual ~ProgramParser_ns() { + delete _parser; delete _instructionNames; + clearSet(_instructionParsers); } diff --git a/engines/parallaction/parser_ns.cpp b/engines/parallaction/parser_ns.cpp index 2c4601c938..c654e3008e 100644 --- a/engines/parallaction/parser_ns.cpp +++ b/engines/parallaction/parser_ns.cpp @@ -1397,7 +1397,7 @@ void LocationParser_ns::parseZone(ZoneList &list, char *name) { list.push_front(z); _parser->pushTables(&_locationZoneParsers, _locationZoneStmt); - + return; } |