diff options
author | Johannes Schickel | 2008-05-06 22:05:26 +0000 |
---|---|---|
committer | Johannes Schickel | 2008-05-06 22:05:26 +0000 |
commit | 10b73b474f5618b91456db91f3e5e18a18fa0f97 (patch) | |
tree | 666b58ebce629ec4fb4e12a4e1d4d452761d6ad3 /engines/kyra/kyra_hof.cpp | |
parent | 9be06ad9e82226bad6c70fc37dcc7db390ce3778 (diff) | |
download | scummvm-rg350-10b73b474f5618b91456db91f3e5e18a18fa0f97.tar.gz scummvm-rg350-10b73b474f5618b91456db91f3e5e18a18fa0f97.tar.bz2 scummvm-rg350-10b73b474f5618b91456db91f3e5e18a18fa0f97.zip |
Fixed crash when qutting kyra2 main menu.
svn-id: r31909
Diffstat (limited to 'engines/kyra/kyra_hof.cpp')
-rw-r--r-- | engines/kyra/kyra_hof.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/engines/kyra/kyra_hof.cpp b/engines/kyra/kyra_hof.cpp index 693ae36d69..4ca695542c 100644 --- a/engines/kyra/kyra_hof.cpp +++ b/engines/kyra/kyra_hof.cpp @@ -56,7 +56,6 @@ const KyraEngine_v2::EngineDesc KyraEngine_HoF::_hofEngineDesc = { }; KyraEngine_HoF::KyraEngine_HoF(OSystem *system, const GameFlags &flags) : KyraEngine_v2(system, flags, _hofEngineDesc), _updateFunctor(this, &KyraEngine_HoF::update) { - _mouseSHPBuf = 0; _screen = 0; _text = 0; @@ -151,7 +150,6 @@ KyraEngine_HoF::~KyraEngine_HoF() { cleanup(); seq_uninit(); - delete [] _mouseSHPBuf; delete _screen; delete _text; delete _gui; @@ -223,11 +221,14 @@ int KyraEngine_HoF::init() { if (_flags.isDemo && !_flags.isTalkie) return 0; - _mouseSHPBuf = _res->fileData("PWGMOUSE.SHP", 0); - assert(_mouseSHPBuf); + _res->exists("PWGMOUSE.SHP", true); + uint8 *shapes = _res->fileData("PWGMOUSE.SHP", 0); + assert(shapes); for (int i = 0; i < 2; i++) - addShapeToPool(_screen->getPtrToShape(_mouseSHPBuf, i), i); + addShapeToPool(shapes, i, i); + + delete[] shapes; _screen->setMouseCursor(0, 0, getShapePtr(0)); return 0; @@ -285,10 +286,7 @@ void KyraEngine_HoF::startup() { allocAnimObjects(1, 10, 30); _screen->_curPage = 0; - delete [] _mouseSHPBuf; - _mouseSHPBuf = 0; - _gameShapes.clear(); memset(_sceneShapeTable, 0, sizeof(_sceneShapeTable)); _gamePlayBuffer = new uint8[46080]; _unkBuf500Bytes = new uint8[500]; |