mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-24 11:36:22 +00:00
CGE: Fix thumbnails display when a game is loaded.
This commit is contained in:
parent
951dfa2be9
commit
31d4173136
@ -41,7 +41,7 @@ namespace CGE {
|
||||
class Console;
|
||||
class Sprite;
|
||||
|
||||
#define kSavegameVersion 1
|
||||
#define kSavegameVersion 2
|
||||
#define kSavegameStrSize 11
|
||||
#define kPocketX 174
|
||||
#define kPocketY 176
|
||||
|
@ -266,7 +266,7 @@ void CGEEngine::saveGame(int slotNumber, const Common::String &desc) {
|
||||
writeSavegameHeader(saveFile, header);
|
||||
|
||||
// Write out the data of the savegame
|
||||
syncGame(NULL, saveFile);
|
||||
syncGame(NULL, saveFile, false);
|
||||
|
||||
// Finish writing out game data
|
||||
saveFile->finalize();
|
||||
@ -324,7 +324,7 @@ void CGEEngine::syncGame(Common::SeekableReadStream *readStream, Common::WriteSt
|
||||
if (s.isSaving()) {
|
||||
// Loop through saving the sprite data
|
||||
for (Sprite *spr = _vga->_spareQ->first(); spr; spr = spr->_next) {
|
||||
if ((spr->_ref >= 1000) && !s.err())
|
||||
if (!s.err())
|
||||
spr->sync(s);
|
||||
}
|
||||
} else {
|
||||
|
@ -826,17 +826,26 @@ void CGEEngine::snBackPt(Sprite *spr, int stp) {
|
||||
void CGEEngine::snLevel(Sprite *spr, int lev) {
|
||||
debugC(1, kCGEDebugEngine, "CGEEngine::snLevel(spr, %d)", lev);
|
||||
|
||||
while (_lev < lev) {
|
||||
_lev++;
|
||||
spr = _vga->_spareQ->locate(100 + _lev);
|
||||
assert((lev >= 0) && (lev < 5));
|
||||
|
||||
for (int i = 0; i < 5; i++) {
|
||||
spr = _vga->_spareQ->locate(100 + i);
|
||||
if (spr) {
|
||||
spr->backShow(true);
|
||||
spr->_cave = 0;
|
||||
if (i <= lev) {
|
||||
spr->backShow(true);
|
||||
spr->_cave = 0;
|
||||
spr->_flags._hide = false;
|
||||
} else {
|
||||
spr->_flags._hide = true;
|
||||
spr->_cave = -1;
|
||||
}
|
||||
} else {
|
||||
warning("SPR not found! ref: %d", 100 + i);
|
||||
}
|
||||
}
|
||||
|
||||
_lev = lev;
|
||||
_maxCave = _maxCaveArr[_lev];
|
||||
if (spr)
|
||||
spr->_flags._hide = false;
|
||||
}
|
||||
|
||||
void CGEEngine::snFlag(int indx, bool v) {
|
||||
|
@ -99,13 +99,8 @@ BitmapPtr Sprite::shp() {
|
||||
return NULL;
|
||||
|
||||
int i = e->_seq[_seqPtr]._now;
|
||||
if (i >= _shpCnt) {
|
||||
//char s[256];
|
||||
//sprintf(s, "Seq=%p ShpCnt=%d SeqPtr=%d Now=%d Next=%d",
|
||||
// Seq, ShpCnt, SeqPtr, Seq[SeqPtr].Now, Seq[SeqPtr].Next);
|
||||
//VGA::Exit(s, File);
|
||||
if (i >= _shpCnt)
|
||||
error("Invalid PHASE in SPRITE::Shp() %s", _file);
|
||||
}
|
||||
return e->_shpList[i];
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user