diff options
author | Eugene Sandulenko | 2006-11-14 09:29:41 +0000 |
---|---|---|
committer | Eugene Sandulenko | 2006-11-14 09:29:41 +0000 |
commit | 53faadfdb6cc98e07cdd291c68140ed36bb8f79b (patch) | |
tree | a947a5c716f76d6a56c0163ed9e5e3da36559077 | |
parent | 2d8bd1add37835d7e0f6ebd71a57852748f3890d (diff) | |
download | scummvm-rg350-53faadfdb6cc98e07cdd291c68140ed36bb8f79b.tar.gz scummvm-rg350-53faadfdb6cc98e07cdd291c68140ed36bb8f79b.tar.bz2 scummvm-rg350-53faadfdb6cc98e07cdd291c68140ed36bb8f79b.zip |
Added per game target saves.
svn-id: r24718
-rw-r--r-- | engines/cine/cine.h | 3 | ||||
-rw-r--r-- | engines/cine/main_loop.cpp | 2 | ||||
-rw-r--r-- | engines/cine/various.cpp | 48 | ||||
-rw-r--r-- | engines/cine/various.h | 1 |
4 files changed, 24 insertions, 30 deletions
diff --git a/engines/cine/cine.h b/engines/cine/cine.h index 3a83dba7e9..e0996419ce 100644 --- a/engines/cine/cine.h +++ b/engines/cine/cine.h @@ -84,6 +84,9 @@ public: Common::Language getLanguage() const { return _gameDescription->desc.language; } Common::Platform getPlatform() const { return _gameDescription->desc.platform; } + bool loadSaveDirectory(void); + void makeSystemMenu(void); + const CINEGameDescription *_gameDescription; }; diff --git a/engines/cine/main_loop.cpp b/engines/cine/main_loop.cpp index c437033e6f..c8bc8f530d 100644 --- a/engines/cine/main_loop.cpp +++ b/engines/cine/main_loop.cpp @@ -106,7 +106,7 @@ void manageEvents(int count) { break; case 291: // F10 if (allowPlayerInput) { - makeSystemMenu(); + g_cine->makeSystemMenu(); } break; default: diff --git a/engines/cine/various.cpp b/engines/cine/various.cpp index b64ab5d7d4..f52dcc8b3b 100644 --- a/engines/cine/various.cpp +++ b/engines/cine/various.cpp @@ -301,22 +301,21 @@ int16 getObjectUnderCursor(uint16 x, uint16 y) { static commandeType currentSaveName[10]; -int16 loadSaveDirectory(void) { +bool CineEngine::loadSaveDirectory(void) { Common::InSaveFile *fHandle; + char tmp[80]; - if (g_cine->getGameType() == Cine::GType_FW) - fHandle = g_saveFileMan->openForLoading("FW.DIR"); - else - fHandle = g_saveFileMan->openForLoading("OS.DIR"); + snprintf(tmp, 80, "%s.dir", _targetName.c_str()); + fHandle = g_saveFileMan->openForLoading(tmp); if (!fHandle) { - return 0; + return false; } fHandle->read(currentSaveName, 10 * 20); delete fHandle; - return 1; + return true; } int16 currentDisk; @@ -904,7 +903,7 @@ void makeSave(char *saveFileName) { setMouseCursor(MOUSE_CURSOR_NORMAL); } -void makeSystemMenu(void) { +void CineEngine::makeSystemMenu(void) { int16 numEntry; int16 mouseButton; int16 mouseX; @@ -965,10 +964,7 @@ void makeSystemMenu(void) { if (selectedSave >= 0) { char saveNameBuffer[256]; - if (g_cine->getGameType() == Cine::GType_FW) - sprintf(saveNameBuffer, "FW.%1d", selectedSave); - else - sprintf(saveNameBuffer, "OS.%1d", selectedSave); + sprintf(saveNameBuffer, "%s.%1d", _targetName.c_str(), selectedSave); getMouseData(mouseUpdateStatus, (uint16 *)&mouseButton, (uint16 *)&mouseX, (uint16 *)&mouseY); if (!makeMenuChoice(confirmMenu, 2, mouseX, mouseY + 8, 100)) { @@ -1007,21 +1003,17 @@ void makeSystemMenu(void) { //makeTextEntryMenu(otherMessages[7], ¤tSaveName[selectedSave], 120); sprintf(currentSaveName[selectedSave], otherMessages[6]); - if (g_cine->getGameType() == Cine::GType_FW) - sprintf(saveFileName, "FW.%1d", selectedSave); - else - sprintf(saveFileName, "OS.%1d", selectedSave); + sprintf(saveFileName, "%s.%1d", _targetName.c_str(), selectedSave); getMouseData(mouseUpdateStatus, (uint16 *)&mouseButton, (uint16 *)&mouseX, (uint16 *)&mouseY); if (!makeMenuChoice(confirmMenu, 2, mouseX, mouseY + 8, 100)) { - char saveString[256]; + char saveString[256], tmp[80]; Common::OutSaveFile *fHandle; - if (g_cine->getGameType() == Cine::GType_FW) - fHandle = g_saveFileMan->openForSaving("FW.DIR"); - else - fHandle = g_saveFileMan->openForSaving("OS.DIR"); + snprintf(tmp, 80, "%s.dir", _targetName.c_str()); + + fHandle = g_saveFileMan->openForSaving(tmp); fHandle->write(currentSaveName, 200); delete fHandle; @@ -1905,7 +1897,7 @@ uint16 executePlayerInput(void) { if (playerCommand != -1) { if (mouseButton & 1) { if (mouseButton & 2) { - makeSystemMenu(); + g_cine->makeSystemMenu(); } else { int16 si; do { @@ -1954,7 +1946,7 @@ uint16 executePlayerInput(void) { } else { if (mouseButton & 2) { if (mouseButton & 1) { - makeSystemMenu(); + g_cine->makeSystemMenu(); } makeActionMenu(); @@ -1997,7 +1989,7 @@ uint16 executePlayerInput(void) { makeCommandLine(); } else { - makeSystemMenu(); + g_cine->makeSystemMenu(); } } else { if (mouseButton & 1) { @@ -2025,7 +2017,7 @@ uint16 executePlayerInput(void) { } } } else { - makeSystemMenu(); + g_cine->makeSystemMenu(); } } } @@ -2052,7 +2044,7 @@ uint16 executePlayerInput(void) { } if ((mouseButton & 1) && (mouseButton & 2)) { - makeSystemMenu(); + g_cine->makeSystemMenu(); } } @@ -2166,10 +2158,10 @@ uint16 executePlayerInput(void) { break; case 9: case 24: - makeSystemMenu(); + g_cine->makeSystemMenu(); break; default: - // printf("Unhandled case %d in last part of executePLayerInput\n",var2-59); + // printf("Unhandled case %d in last part of executePlayerInput\n",var2-59); break; } } diff --git a/engines/cine/various.h b/engines/cine/various.h index 3cbdaa96ef..bef5c55759 100644 --- a/engines/cine/various.h +++ b/engines/cine/various.h @@ -37,7 +37,6 @@ void initLanguage(Common::Language lang); int16 makeMenuChoice(const commandeType commandList[], uint16 height, uint16 X, uint16 Y, uint16 width); int16 makeMenuChoice2(const commandeType commandList[], uint16 height, uint16 X, uint16 Y, uint16 width); void makeCommandLine(void); -void makeSystemMenu(void); void makeActionMenu(void); extern int16 allowSystemMenu; |