diff options
-rw-r--r-- | engines/cge/cge.cpp | 5 | ||||
-rw-r--r-- | engines/cge/cge.h | 1 | ||||
-rw-r--r-- | engines/cge/cge_main.cpp | 22 |
3 files changed, 11 insertions, 17 deletions
diff --git a/engines/cge/cge.cpp b/engines/cge/cge.cpp index 2a4ea6bea2..b38b6d392f 100644 --- a/engines/cge/cge.cpp +++ b/engines/cge/cge.cpp @@ -58,13 +58,11 @@ CGEEngine::CGEEngine(OSystem *syst, const ADGameDescription *gameDescription) void CGEEngine::initCaveValues() { if (_isDemo) { - _mini = new byte[16384]; _caveDx = 23; _caveDy = 29; _caveNx = 3; _caveNy = 1; } else { - _mini = new byte[65536]; _caveDx = 9; _caveDy = 10; _caveNx = 8; @@ -100,7 +98,6 @@ void CGEEngine::initCaveValues() { } void CGEEngine::freeCaveValues() { - delete[] _mini; free(_heroXY); free(_barriers); } @@ -216,6 +213,8 @@ CGEEngine::~CGEEngine() { delete _snail_; delete _hero; + delete[] _miniShpList; + freeCaveValues(); } diff --git a/engines/cge/cge.h b/engines/cge/cge.h index 54bbadfef7..23509bbf49 100644 --- a/engines/cge/cge.h +++ b/engines/cge/cge.h @@ -142,7 +142,6 @@ public: Bar *_barriers; Common::RandomSource _randomSource; - byte *_mini; BitmapPtr *_miniShp; BitmapPtr *_miniShpList; int _startGameSlot; diff --git a/engines/cge/cge_main.cpp b/engines/cge/cge_main.cpp index b17f40b863..6b6f4ff971 100644 --- a/engines/cge/cge_main.cpp +++ b/engines/cge/cge_main.cpp @@ -1525,22 +1525,18 @@ void CGEEngine::runGame() { if (!_music) killMidi(); - if (_mini && INI_FILE::exist("MINI.SPR")) { + if (INI_FILE::exist("MINI.SPR")) { _miniShp = new BitmapPtr[2]; _miniShp[0] = _miniShp[1] = NULL; - uint8 *ptr = (uint8 *) &*_mini; - if (ptr != NULL) { - loadSprite("MINI", -1, 0, kMiniX, kMiniY); - expandSprite(_miniCave = _sprite); // NULL is ok - if (_miniCave) { - _miniCave->_flags._kill = false; - _miniCave->_flags._hide = true; - _miniCave->moveShapes(ptr); - _miniShp[0] = new Bitmap(*_miniCave->shp()); - _miniShpList = _miniCave->setShapeList(_miniShp); - postMiniStep(-1); - } + loadSprite("MINI", -1, 0, kMiniX, kMiniY); + expandSprite(_miniCave = _sprite); // NULL is ok + if (_miniCave) { + _miniCave->_flags._kill = false; + _miniCave->_flags._hide = true; + _miniShp[0] = new Bitmap(*_miniCave->shp()); + _miniShpList = _miniCave->setShapeList(_miniShp); + postMiniStep(-1); } } |