mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-16 14:50:17 +00:00
CGE: Cleaned up room preview handling code and fixed memory leak
This commit is contained in:
parent
453fbb7454
commit
c3f3120194
@ -60,6 +60,9 @@ void CGEEngine::setup() {
|
||||
_lastFrame = 0;
|
||||
_hero = NULL;
|
||||
_shadow = NULL;
|
||||
_miniCave = NULL;
|
||||
_miniShp = NULL;
|
||||
_miniShpList = NULL;
|
||||
|
||||
// Create debugger console
|
||||
_console = new CGEConsole(this);
|
||||
@ -82,8 +85,6 @@ void CGEEngine::setup() {
|
||||
_pocket[i]->_flags._kill = false;
|
||||
}
|
||||
_sprite = new Sprite(this, NULL);
|
||||
_miniCave = new Sprite(this, NULL);
|
||||
_miniCave->_flags._kill = false;
|
||||
_horzLine = new HorizLine(this);
|
||||
_infoLine = new InfoLine(this, INFO_W);
|
||||
_cavLight = new CavLight(this);
|
||||
|
@ -85,7 +85,9 @@ public:
|
||||
int _lev;
|
||||
|
||||
Common::RandomSource _randomSource;
|
||||
byte * _mini;
|
||||
byte * _mini;
|
||||
BMP_PTR * _miniShp;
|
||||
BMP_PTR * _miniShpList;
|
||||
|
||||
virtual Common::Error run();
|
||||
GUI::Debugger *getDebugger() {
|
||||
|
@ -90,8 +90,6 @@ static char _usrFnam[15] = "\0ɱ%^
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
static BMP_PTR *_miniShpList = NULL;
|
||||
static BMP_PTR _miniShp[] = { NULL, NULL };
|
||||
static bool _finis = false;
|
||||
int _offUseCount;
|
||||
uint16 *_intStackPtr = false;
|
||||
@ -1364,11 +1362,15 @@ void CGEEngine::runGame() {
|
||||
killMidi();
|
||||
|
||||
if (_mini && INI_FILE::exist("MINI.SPR")) {
|
||||
_miniShp = new BMP_PTR[2];
|
||||
_miniShp[0] = _miniShp[1] = NULL;
|
||||
|
||||
uint8 *ptr = (uint8 *) &*_mini;
|
||||
if (ptr != NULL) {
|
||||
loadSprite("MINI", -1, 0, MINI_X, MINI_Y);
|
||||
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());
|
||||
|
@ -1378,4 +1378,4 @@ PocLight::PocLight(CGEEngine *vm): Sprite(vm, NULL) {
|
||||
_flags._kill = false;
|
||||
}
|
||||
|
||||
} // End of namespace CGE
|
||||
} // End of namespace CGE
|
Loading…
Reference in New Issue
Block a user