mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-15 06:08:35 +00:00
ASYLUM: fix Quick Load/Quick Save
This commit is contained in:
parent
b7130bab21
commit
ba2ccee701
@ -47,7 +47,7 @@ namespace Asylum {
|
||||
|
||||
#define SAVEGAME_NAME "asylum"
|
||||
|
||||
#define SAVEGAME_QUICKSLOT 25
|
||||
#define SAVEGAME_QUICKSLOT 24
|
||||
|
||||
#define SAVEGAME_MOVIES "asylum.movies"
|
||||
|
||||
@ -129,7 +129,7 @@ bool Savegame::quickLoad() {
|
||||
return false;
|
||||
|
||||
_index = SAVEGAME_QUICKSLOT;
|
||||
_vm->startGame((ResourcePackId)(getSharedData()->cdNumber + 4), AsylumEngine::kStartGameLoad);
|
||||
_vm->startGame(getScenePack(), AsylumEngine::kStartGameLoad);
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -157,7 +157,7 @@ bool Savegame::quickSave() {
|
||||
_index = 24;
|
||||
|
||||
// Check if there is a quick save already
|
||||
if (isSavegamePresent(getFilename(SAVEGAME_QUICKSLOT))) {
|
||||
if (!isSavegamePresent(getFilename(SAVEGAME_QUICKSLOT))) {
|
||||
_names[_index] = getText()->get(MAKE_RESOURCE(kResourcePackText, 1342));
|
||||
|
||||
save();
|
||||
@ -214,7 +214,7 @@ bool Savegame::check() {
|
||||
|
||||
Common::String Savegame::getFilename(uint32 index) const {
|
||||
if (index > SAVEGAME_COUNT - 1)
|
||||
error("[Savegame::getFilename] Invalid savegame index (was:%d, valid: [0-25])", index);
|
||||
error("[Savegame::getFilename] Invalid savegame index (was:%d, valid: [0-24])", index);
|
||||
|
||||
return Common::String::format("%s%02d.sav", SAVEGAME_NAME, index);
|
||||
}
|
||||
@ -491,21 +491,21 @@ void Savegame::loadMoviesViewed() {
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void Savegame::setName(uint32 index, Common::String name) {
|
||||
if (index >= ARRAYSIZE(_names))
|
||||
error("[Savegame::setName] Invalid index (was: %d, max: %d)", index, ARRAYSIZE(_names));
|
||||
error("[Savegame::setName] Invalid index (was: %d, max: %d)", index, ARRAYSIZE(_names) - 1);
|
||||
|
||||
_names[index] = name;
|
||||
}
|
||||
|
||||
Common::String Savegame::getName(uint32 index) const {
|
||||
if (index >= ARRAYSIZE(_names))
|
||||
error("[Savegame::getName] Invalid index (was: %d, max: %d)", index, ARRAYSIZE(_names));
|
||||
error("[Savegame::getName] Invalid index (was: %d, max: %d)", index, ARRAYSIZE(_names) - 1);
|
||||
|
||||
return _names[index];
|
||||
}
|
||||
|
||||
bool Savegame::hasSavegame(uint32 index) const {
|
||||
if (index >= ARRAYSIZE(_savegames))
|
||||
error("[Savegame::hasSavegame] Invalid index (was: %d, max: %d)", index, ARRAYSIZE(_savegames));
|
||||
error("[Savegame::hasSavegame] Invalid index (was: %d, max: %d)", index, ARRAYSIZE(_savegames) - 1);
|
||||
|
||||
return _savegames[index];
|
||||
}
|
||||
|
@ -832,7 +832,7 @@ void Menu::updateLoadGame() {
|
||||
else
|
||||
getText()->loadFont(kFontBlue);
|
||||
|
||||
getText()->setPosition(Common::Point(550, 347));
|
||||
getText()->setPosition(Common::Point(550, 340));
|
||||
getText()->draw(MAKE_RESOURCE(kResourcePackText, 1327));
|
||||
}
|
||||
|
||||
@ -992,7 +992,7 @@ void Menu::updateSaveGame() {
|
||||
else
|
||||
getText()->loadFont(kFontBlue);
|
||||
|
||||
getText()->setPosition(Common::Point(550, 347));
|
||||
getText()->setPosition(Common::Point(550, 340));
|
||||
getText()->draw(MAKE_RESOURCE(kResourcePackText, 1337));
|
||||
}
|
||||
|
||||
@ -1102,7 +1102,7 @@ void Menu::updateDeleteGame() {
|
||||
else
|
||||
getText()->loadFont(kFontBlue);
|
||||
|
||||
getText()->setPosition(Common::Point(550, 347));
|
||||
getText()->setPosition(Common::Point(550, 340));
|
||||
getText()->draw(MAKE_RESOURCE(kResourcePackText, 1347));
|
||||
}
|
||||
|
||||
@ -1651,6 +1651,7 @@ void Menu::clickLoadGame() {
|
||||
getSaveLoad()->setIndex(saveIndex);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
} else if (cursor.x >= 30) {
|
||||
snprintf((char *)&text, sizeof(text), "%d. %s ", index + _startIndex + 1, getSaveLoad()->getName((uint32)(index + _startIndex)).c_str());
|
||||
@ -1658,13 +1659,14 @@ void Menu::clickLoadGame() {
|
||||
if (cursor.x <= (30 + getText()->getWidth((char *)&text))
|
||||
&& cursor.y >= y
|
||||
&& cursor.y <= (y + 24)) {
|
||||
uint32 saveIndex = (uint32)(index + _startIndex);
|
||||
uint32 saveIndex = (uint32)(index + _startIndex);
|
||||
if (saveIndex < 25) {
|
||||
if (getSaveLoad()->hasSavegame(saveIndex)) {
|
||||
_dword_455C80 = true;
|
||||
getSaveLoad()->setIndex(saveIndex);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1738,6 +1740,7 @@ void Menu::clickSaveGame() {
|
||||
if (cursor.x <= (350 + getText()->getWidth((char *)&text))
|
||||
&& cursor.y >= y
|
||||
&& cursor.y <= (y + 24)
|
||||
&& getScene()
|
||||
&& getWorld()->chapter != kChapterNone) {
|
||||
if (index + _startIndex < 25) {
|
||||
uint32 saveIndex = (uint32)(index + _startIndex + 6);
|
||||
@ -1752,6 +1755,7 @@ void Menu::clickSaveGame() {
|
||||
getCursor()->hide();
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
} else if (cursor.x >= 30) {
|
||||
snprintf((char *)&text, sizeof(text), "%d. %s ", index + _startIndex + 1, getSaveLoad()->getName((uint32)(index + _startIndex)).c_str());
|
||||
@ -1774,6 +1778,7 @@ void Menu::clickSaveGame() {
|
||||
getCursor()->hide();
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1850,20 +1855,22 @@ void Menu::clickDeleteGame() {
|
||||
getSaveLoad()->setIndex(saveIndex + 6);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
} else if (cursor.x >= 30) {
|
||||
snprintf((char *)&text, sizeof(text), "%d. %s ", index + _startIndex + 1, getSaveLoad()->getName((uint32)(index + _startIndex)).c_str());
|
||||
|
||||
if (cursor.x <= (30 + getText()->getWidth((char *)&text))
|
||||
&& cursor.y >= y
|
||||
&& cursor.y <= (y + 24)) {
|
||||
uint32 saveIndex = (uint32)(index + _startIndex);
|
||||
if (saveIndex < 25) {
|
||||
if (getSaveLoad()->hasSavegame(saveIndex)) {
|
||||
_dword_455C80 = true;
|
||||
getSaveLoad()->setIndex(saveIndex);
|
||||
}
|
||||
&& cursor.y >= y
|
||||
&& cursor.y <= (y + 24)) {
|
||||
uint32 saveIndex = (uint32)(index + _startIndex);
|
||||
if (saveIndex < 25) {
|
||||
if (getSaveLoad()->hasSavegame(saveIndex)) {
|
||||
_dword_455C80 = true;
|
||||
getSaveLoad()->setIndex(saveIndex);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user