[Scummvm-cvs-logs] scummvm master -> 2c161796c5688a1f76dcf66f1e66eb9bcd1e0f23
bluegr
md5 at scummvm.org
Sun Jul 1 20:08:44 CEST 2012
This automated email contains information about 7 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
e10e412bba COMMON: Allow the savefile manager to create uncompressed saves
4c4a127ca2 COMMON: Add documentation regarding the new parameter in openForSaving()
c9ace6426e COMMON: Add a detailed explanation on when to create uncompressed saves
eb8230988a SCI: Don't compress exported heroes in the Quest for Glory games
16adcb5145 COMMON: Simplify the documentation in openForSaving()
659d0cfcc3 COMMON: Also adapt openForSaving() in the DC and N64 backends
2c161796c5 Merge pull request #239 from bluegr/skipsavecompression
Commit: e10e412bba99090b67a99cd7fddd5405172452f1
https://github.com/scummvm/scummvm/commit/e10e412bba99090b67a99cd7fddd5405172452f1
Author: Filippos Karapetis (md5 at scummvm.org)
Date: 2012-06-21T00:48:03-07:00
Commit Message:
COMMON: Allow the savefile manager to create uncompressed saves
These are useful in cases where the files can be used in the original
interpreters (such as the exported characters from QFG), in order to avoid
confusion in cases where the users are unaware that these saves are
compressed and are trying to load them in the original interpreters.
Changed paths:
backends/platform/ds/arm9/source/gbampsave.cpp
backends/platform/ds/arm9/source/gbampsave.h
backends/platform/ps2/savefilemgr.cpp
backends/platform/ps2/savefilemgr.h
backends/saves/default/default-saves.cpp
backends/saves/default/default-saves.h
common/savefile.h
diff --git a/backends/platform/ds/arm9/source/gbampsave.cpp b/backends/platform/ds/arm9/source/gbampsave.cpp
index 03729c5..3192e2d 100644
--- a/backends/platform/ds/arm9/source/gbampsave.cpp
+++ b/backends/platform/ds/arm9/source/gbampsave.cpp
@@ -45,7 +45,7 @@ static Common::String getSavePath() {
// GBAMP Save File Manager
//////////////////////////
-Common::OutSaveFile *GBAMPSaveFileManager::openForSaving(const Common::String &filename) {
+Common::OutSaveFile *GBAMPSaveFileManager::openForSaving(const Common::String &filename, bool compress) {
Common::String fileSpec = getSavePath();
if (fileSpec.lastChar() != '/')
fileSpec += '/';
diff --git a/backends/platform/ds/arm9/source/gbampsave.h b/backends/platform/ds/arm9/source/gbampsave.h
index 492054d..0d9d9ac 100644
--- a/backends/platform/ds/arm9/source/gbampsave.h
+++ b/backends/platform/ds/arm9/source/gbampsave.h
@@ -27,7 +27,7 @@
class GBAMPSaveFileManager : public Common::SaveFileManager {
public:
- virtual Common::OutSaveFile *openForSaving(const Common::String &filename);
+ virtual Common::OutSaveFile *openForSaving(const Common::String &filename, bool compress = true);
virtual Common::InSaveFile *openForLoading(const Common::String &filename);
virtual bool removeSavefile(const Common::String &filename);
diff --git a/backends/platform/ps2/savefilemgr.cpp b/backends/platform/ps2/savefilemgr.cpp
index 421edc3..46af42e 100644
--- a/backends/platform/ps2/savefilemgr.cpp
+++ b/backends/platform/ps2/savefilemgr.cpp
@@ -145,7 +145,7 @@ Common::InSaveFile *Ps2SaveFileManager::openForLoading(const Common::String &fil
return Common::wrapCompressedReadStream(sf);
}
-Common::OutSaveFile *Ps2SaveFileManager::openForSaving(const Common::String &filename) {
+Common::OutSaveFile *Ps2SaveFileManager::openForSaving(const Common::String &filename, bool compress) {
Common::FSNode savePath(ConfMan.get("savepath")); // TODO: is this fast?
Common::WriteStream *sf;
@@ -193,7 +193,7 @@ Common::OutSaveFile *Ps2SaveFileManager::openForSaving(const Common::String &fil
}
_screen->wantAnim(false);
- return Common::wrapCompressedWriteStream(sf);
+ return compress ? Common::wrapCompressedWriteStream(sf) : sf;
}
bool Ps2SaveFileManager::removeSavefile(const Common::String &filename) {
diff --git a/backends/platform/ps2/savefilemgr.h b/backends/platform/ps2/savefilemgr.h
index a25fb06..163706e 100644
--- a/backends/platform/ps2/savefilemgr.h
+++ b/backends/platform/ps2/savefilemgr.h
@@ -35,7 +35,7 @@ public:
virtual ~Ps2SaveFileManager();
virtual Common::InSaveFile *openForLoading(const Common::String &filename);
- virtual Common::OutSaveFile *openForSaving(const Common::String &filename);
+ virtual Common::OutSaveFile *openForSaving(const Common::String &filename, bool compress = true);
virtual Common::StringArray listSavefiles(const Common::String &pattern);
virtual bool removeSavefile(const Common::String &filename);
diff --git a/backends/saves/default/default-saves.cpp b/backends/saves/default/default-saves.cpp
index 237c50a..64e7e77 100644
--- a/backends/saves/default/default-saves.cpp
+++ b/backends/saves/default/default-saves.cpp
@@ -97,7 +97,7 @@ Common::InSaveFile *DefaultSaveFileManager::openForLoading(const Common::String
return Common::wrapCompressedReadStream(sf);
}
-Common::OutSaveFile *DefaultSaveFileManager::openForSaving(const Common::String &filename) {
+Common::OutSaveFile *DefaultSaveFileManager::openForSaving(const Common::String &filename, bool compress) {
// Ensure that the savepath is valid. If not, generate an appropriate error.
Common::String savePathName = getSavePath();
checkPath(Common::FSNode(savePathName));
@@ -112,7 +112,7 @@ Common::OutSaveFile *DefaultSaveFileManager::openForSaving(const Common::String
// Open the file for saving
Common::WriteStream *sf = file.createWriteStream();
- return Common::wrapCompressedWriteStream(sf);
+ return compress ? Common::wrapCompressedWriteStream(sf) : sf;
}
bool DefaultSaveFileManager::removeSavefile(const Common::String &filename) {
diff --git a/backends/saves/default/default-saves.h b/backends/saves/default/default-saves.h
index 1ea87ef..c7fca27 100644
--- a/backends/saves/default/default-saves.h
+++ b/backends/saves/default/default-saves.h
@@ -38,7 +38,7 @@ public:
virtual Common::StringArray listSavefiles(const Common::String &pattern);
virtual Common::InSaveFile *openForLoading(const Common::String &filename);
- virtual Common::OutSaveFile *openForSaving(const Common::String &filename);
+ virtual Common::OutSaveFile *openForSaving(const Common::String &filename, bool compress = true);
virtual bool removeSavefile(const Common::String &filename);
protected:
diff --git a/common/savefile.h b/common/savefile.h
index 03a7b52..3aa0f42 100644
--- a/common/savefile.h
+++ b/common/savefile.h
@@ -108,7 +108,7 @@ public:
* @param name the name of the savefile
* @return pointer to an OutSaveFile, or NULL if an error occurred.
*/
- virtual OutSaveFile *openForSaving(const String &name) = 0;
+ virtual OutSaveFile *openForSaving(const String &name, bool compress = true) = 0;
/**
* Open the file with the specified name in the given directory for loading.
Commit: 4c4a127ca23ca55ec4f3348b40553ac5f72a3892
https://github.com/scummvm/scummvm/commit/4c4a127ca23ca55ec4f3348b40553ac5f72a3892
Author: Filippos Karapetis (md5 at scummvm.org)
Date: 2012-06-21T00:48:04-07:00
Commit Message:
COMMON: Add documentation regarding the new parameter in openForSaving()
Changed paths:
common/savefile.h
diff --git a/common/savefile.h b/common/savefile.h
index 3aa0f42..2f4b8a2 100644
--- a/common/savefile.h
+++ b/common/savefile.h
@@ -105,7 +105,8 @@ public:
/**
* Open the savefile with the specified name in the given directory for saving.
- * @param name the name of the savefile
+ * @param name the name of the savefile
+ * @param compress toggles whether to compress the resulting save file (default) or not.
* @return pointer to an OutSaveFile, or NULL if an error occurred.
*/
virtual OutSaveFile *openForSaving(const String &name, bool compress = true) = 0;
Commit: c9ace6426ebd4cac2777f199848dcfa5770b65ca
https://github.com/scummvm/scummvm/commit/c9ace6426ebd4cac2777f199848dcfa5770b65ca
Author: Filippos Karapetis (md5 at scummvm.org)
Date: 2012-06-21T00:48:06-07:00
Commit Message:
COMMON: Add a detailed explanation on when to create uncompressed saves
Changed paths:
common/savefile.h
diff --git a/common/savefile.h b/common/savefile.h
index 2f4b8a2..abe0df2 100644
--- a/common/savefile.h
+++ b/common/savefile.h
@@ -104,9 +104,32 @@ public:
virtual String popErrorDesc();
/**
- * Open the savefile with the specified name in the given directory for saving.
+ * Open the savefile with the specified name in the given directory for
+ * saving.
+ *
+ * Saved games are always compressed using ZIP compression on platforms
+ * where the zlib library is included (i.e. almost all platforms except the
+ * NDS). Engines are expected to always create compressed saved games.
+ * A notable exception is when the created saved games are compatible with
+ * the ones that the original interpreters create, and they are then used
+ * with later game versions in a game series which are not supported by
+ * ScummVM. An example is the characters exported in the Quest for Glory
+ * games: these saved states actually contain simple text strings with
+ * character attributes, which can then be used with later games in the
+ * Quest for Glory Series. Currently, ScummVM supports Quest for Glory
+ * 1, 2 and 3. These exported heroes can also be read by the AGS VGA fan
+ * made version of Quest for Glory 2 and the SCI32 game Quest for Glory IV,
+ * none of which is supported by ScummVM yet. Moreover, these heroes can
+ * also be imported into Quest for Glory V, which is a 3D game and thus
+ * outside of ScummVM's scope. For these reasons, in such cases engines can
+ * create uncompressed saved games to help users import them in other games
+ * not supported by ScummVM. Users only need to know that such saved games
+ * exported by ScummVM are compatible with later unsupported games, without
+ * needing to explain how to uncompress them.
+ *
* @param name the name of the savefile
- * @param compress toggles whether to compress the resulting save file (default) or not.
+ * @param compress toggles whether to compress the resulting save file
+ * (default) or not.
* @return pointer to an OutSaveFile, or NULL if an error occurred.
*/
virtual OutSaveFile *openForSaving(const String &name, bool compress = true) = 0;
Commit: eb8230988a413ffff3458f0cfade5a94c95940b1
https://github.com/scummvm/scummvm/commit/eb8230988a413ffff3458f0cfade5a94c95940b1
Author: Filippos Karapetis (md5 at scummvm.org)
Date: 2012-06-21T02:15:25-07:00
Commit Message:
SCI: Don't compress exported heroes in the Quest for Glory games
This allows them to be used by other games in the series not supported
by ScummVM (i.e. QFG4, QFG5 and the fanmade AGS version of QFG2)
Changed paths:
engines/sci/engine/file.cpp
diff --git a/engines/sci/engine/file.cpp b/engines/sci/engine/file.cpp
index 0d575f9..a0f7ebf 100644
--- a/engines/sci/engine/file.cpp
+++ b/engines/sci/engine/file.cpp
@@ -57,11 +57,24 @@ namespace Sci {
reg_t file_open(EngineState *s, const Common::String &filename, int mode, bool unwrapFilename) {
Common::String englishName = g_sci->getSciLanguageString(filename, K_LANG_ENGLISH);
+ englishName.toLowercase();
+
Common::String wrappedName = unwrapFilename ? g_sci->wrapFilename(englishName) : englishName;
Common::SeekableReadStream *inFile = 0;
Common::WriteStream *outFile = 0;
Common::SaveFileManager *saveFileMan = g_sci->getSaveFileManager();
+ bool isCompressed = true;
+ const SciGameId gameId = g_sci->getGameId();
+ if ((gameId == GID_QFG1 || gameId == GID_QFG1VGA || gameId == GID_QFG2 || gameId == GID_QFG3)
+ && englishName.hasSuffix(".sav")) {
+ // QFG Characters are saved via the CharSave object.
+ // We leave them uncompressed so that they can be imported in later QFG
+ // games.
+ // Rooms/Scripts: QFG1: 601, QFG2: 840, QFG3/4: 52
+ isCompressed = false;
+ }
+
if (mode == _K_FILE_MODE_OPEN_OR_FAIL) {
// Try to open file, abort if not possible
inFile = saveFileMan->openForLoading(wrappedName);
@@ -74,12 +87,12 @@ reg_t file_open(EngineState *s, const Common::String &filename, int mode, bool u
debugC(kDebugLevelFile, " -> file_open(_K_FILE_MODE_OPEN_OR_FAIL): failed to open file '%s'", englishName.c_str());
} else if (mode == _K_FILE_MODE_CREATE) {
// Create the file, destroying any content it might have had
- outFile = saveFileMan->openForSaving(wrappedName);
+ outFile = saveFileMan->openForSaving(wrappedName, isCompressed);
if (!outFile)
debugC(kDebugLevelFile, " -> file_open(_K_FILE_MODE_CREATE): failed to create file '%s'", englishName.c_str());
} else if (mode == _K_FILE_MODE_OPEN_OR_CREATE) {
// Try to open file, create it if it doesn't exist
- outFile = saveFileMan->openForSaving(wrappedName);
+ outFile = saveFileMan->openForSaving(wrappedName, isCompressed);
if (!outFile)
debugC(kDebugLevelFile, " -> file_open(_K_FILE_MODE_CREATE): failed to create file '%s'", englishName.c_str());
Commit: 16adcb5145ce293af120b7cc828a08166da310e2
https://github.com/scummvm/scummvm/commit/16adcb5145ce293af120b7cc828a08166da310e2
Author: Filippos Karapetis (md5 at scummvm.org)
Date: 2012-06-25T12:32:00-07:00
Commit Message:
COMMON: Simplify the documentation in openForSaving()
The new more concise description is courtesy of wjp.
Changed paths:
common/savefile.h
diff --git a/common/savefile.h b/common/savefile.h
index abe0df2..da78728 100644
--- a/common/savefile.h
+++ b/common/savefile.h
@@ -107,25 +107,13 @@ public:
* Open the savefile with the specified name in the given directory for
* saving.
*
- * Saved games are always compressed using ZIP compression on platforms
- * where the zlib library is included (i.e. almost all platforms except the
- * NDS). Engines are expected to always create compressed saved games.
- * A notable exception is when the created saved games are compatible with
- * the ones that the original interpreters create, and they are then used
- * with later game versions in a game series which are not supported by
- * ScummVM. An example is the characters exported in the Quest for Glory
- * games: these saved states actually contain simple text strings with
- * character attributes, which can then be used with later games in the
- * Quest for Glory Series. Currently, ScummVM supports Quest for Glory
- * 1, 2 and 3. These exported heroes can also be read by the AGS VGA fan
- * made version of Quest for Glory 2 and the SCI32 game Quest for Glory IV,
- * none of which is supported by ScummVM yet. Moreover, these heroes can
- * also be imported into Quest for Glory V, which is a 3D game and thus
- * outside of ScummVM's scope. For these reasons, in such cases engines can
- * create uncompressed saved games to help users import them in other games
- * not supported by ScummVM. Users only need to know that such saved games
- * exported by ScummVM are compatible with later unsupported games, without
- * needing to explain how to uncompress them.
+ * Saved games are compressed by default, and engines are expected to
+ * always write compressed saves.
+ *
+ * A notable exception is if uncompressed files are needed for
+ * compatibility with games not supported by ScummVM, such as character
+ * exports from the Quest for Glory series. QfG5 is a 3D game and won't be
+ * supported by ScummVM.
*
* @param name the name of the savefile
* @param compress toggles whether to compress the resulting save file
Commit: 659d0cfcc39721001f607e4ca51b8eb477708404
https://github.com/scummvm/scummvm/commit/659d0cfcc39721001f607e4ca51b8eb477708404
Author: Filippos Karapetis (md5 at scummvm.org)
Date: 2012-06-25T12:39:28-07:00
Commit Message:
COMMON: Also adapt openForSaving() in the DC and N64 backends
Changed paths:
backends/platform/dc/vmsave.cpp
backends/platform/n64/framfs_save_manager.h
backends/platform/n64/pakfs_save_manager.h
diff --git a/backends/platform/dc/vmsave.cpp b/backends/platform/dc/vmsave.cpp
index e06dd7f..ba3b787 100644
--- a/backends/platform/dc/vmsave.cpp
+++ b/backends/platform/dc/vmsave.cpp
@@ -316,8 +316,9 @@ public:
class VMSaveManager : public Common::SaveFileManager {
public:
- virtual Common::OutSaveFile *openForSaving(const Common::String &filename) {
- return Common::wrapCompressedWriteStream(new OutVMSave(filename.c_str()));
+ virtual Common::OutSaveFile *openForSaving(const Common::String &filename, bool compress = true) {
+ OutVMSave *s = new OutVMSave(filename.c_str());
+ return compress ? Common::wrapCompressedWriteStream(s) : s;
}
virtual Common::InSaveFile *openForLoading(const Common::String &filename) {
diff --git a/backends/platform/n64/framfs_save_manager.h b/backends/platform/n64/framfs_save_manager.h
index da553e4..0a88c86 100644
--- a/backends/platform/n64/framfs_save_manager.h
+++ b/backends/platform/n64/framfs_save_manager.h
@@ -100,10 +100,10 @@ public:
class FRAMSaveManager : public Common::SaveFileManager {
public:
- virtual Common::OutSaveFile *openForSaving(const Common::String &filename) {
+ virtual Common::OutSaveFile *openForSaving(const Common::String &filename, bool compress = true) {
OutFRAMSave *s = new OutFRAMSave(filename.c_str());
if (!s->err()) {
- return Common::wrapCompressedWriteStream(s);
+ return compress ? Common::wrapCompressedWriteStream(s) : s;
} else {
delete s;
return 0;
diff --git a/backends/platform/n64/pakfs_save_manager.h b/backends/platform/n64/pakfs_save_manager.h
index e0fcbc1..6e67fb0 100644
--- a/backends/platform/n64/pakfs_save_manager.h
+++ b/backends/platform/n64/pakfs_save_manager.h
@@ -101,10 +101,10 @@ public:
class PAKSaveManager : public Common::SaveFileManager {
public:
- virtual Common::OutSaveFile *openForSaving(const Common::String &filename) {
+ virtual Common::OutSaveFile *openForSaving(const Common::String &filename, bool compress = true) {
OutPAKSave *s = new OutPAKSave(filename.c_str());
if (!s->err()) {
- return Common::wrapCompressedWriteStream(s);
+ return compress ? Common::wrapCompressedWriteStream(s) : s;
} else {
delete s;
return NULL;
Commit: 2c161796c5688a1f76dcf66f1e66eb9bcd1e0f23
https://github.com/scummvm/scummvm/commit/2c161796c5688a1f76dcf66f1e66eb9bcd1e0f23
Author: Filippos Karapetis (md5 at scummvm.org)
Date: 2012-07-01T11:08:08-07:00
Commit Message:
Merge pull request #239 from bluegr/skipsavecompression
COMMON: Allow the savefile manager to create uncompressed saves
Changed paths:
backends/platform/dc/vmsave.cpp
backends/platform/ds/arm9/source/gbampsave.cpp
backends/platform/ds/arm9/source/gbampsave.h
backends/platform/n64/framfs_save_manager.h
backends/platform/n64/pakfs_save_manager.h
backends/platform/ps2/savefilemgr.cpp
backends/platform/ps2/savefilemgr.h
backends/saves/default/default-saves.cpp
backends/saves/default/default-saves.h
common/savefile.h
engines/sci/engine/file.cpp
More information about the Scummvm-git-logs
mailing list