mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-15 22:28:10 +00:00
HDB: Complete Map::restartSystem()
This commit is contained in:
parent
5fa5f6fb39
commit
62a6a36463
@ -406,7 +406,7 @@ Tile *Gfx::getTile(int index) {
|
||||
}
|
||||
|
||||
void Gfx::emptyGfxCaches() {
|
||||
warning("STUB: mptyGfxCaches()");
|
||||
// We have plenty of memory, so do not do it
|
||||
}
|
||||
|
||||
void Gfx::cacheTileSequence(int tileIndex, int count) {
|
||||
@ -510,6 +510,15 @@ Tile *Gfx::getTileGfx(const char *name, int32 size) {
|
||||
return gc->tileGfx;
|
||||
}
|
||||
|
||||
void Gfx::markGfxCacheFreeable() {
|
||||
for (Common::Array<GfxCache *>::iterator it = _gfxCache->begin(); it != _gfxCache->end(); it++)
|
||||
(*it)->loaded = -1;
|
||||
}
|
||||
|
||||
void Gfx::markTileCacheFreeable() {
|
||||
// we have plenty of memory, so do not do it
|
||||
}
|
||||
|
||||
Picture *Gfx::getPicGfx(const char *name, int32 size) {
|
||||
// Try to find graphic
|
||||
for (Common::Array<GfxCache *>::iterator it = _gfxCache->begin(); it != _gfxCache->end(); it++) {
|
||||
|
@ -122,6 +122,8 @@ public:
|
||||
Picture *getPicture(const char *name);
|
||||
|
||||
void emptyGfxCaches();
|
||||
void markTileCacheFreeable();
|
||||
void markGfxCacheFreeable();
|
||||
|
||||
// Returns: true->Tile, false->Pic
|
||||
bool selectGfxType(const char *name);
|
||||
|
@ -217,7 +217,22 @@ int Map::loadTiles() {
|
||||
}
|
||||
|
||||
void Map::restartSystem() {
|
||||
warning("STUB: Map::restartSystem()");
|
||||
_listBGAnimFast.clear();
|
||||
_listBGAnimMedium.clear();
|
||||
_listBGAnimSlow.clear();
|
||||
_listFGAnimFast.clear();
|
||||
_listFGAnimMedium.clear();
|
||||
_listFGAnimSlow.clear();
|
||||
|
||||
delete _background;
|
||||
_background = NULL;
|
||||
delete _foreground;
|
||||
_foreground = NULL;
|
||||
delete _iconList;
|
||||
_iconList = NULL;
|
||||
|
||||
_width = _height = 0;
|
||||
_animCycle = 0;
|
||||
|
||||
free(_mapExplosions);
|
||||
free(_mapExpBarrels);
|
||||
@ -227,6 +242,10 @@ void Map::restartSystem() {
|
||||
_mapExpBarrels = NULL;
|
||||
_mapLaserBeams = NULL;
|
||||
|
||||
// mark all in-memory tiles as being in memory, but able to be freed
|
||||
g_hdb->_gfx->markTileCacheFreeable();
|
||||
g_hdb->_gfx->markGfxCacheFreeable();
|
||||
|
||||
_mapLoaded = false;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user