aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorColin Snover2017-01-10 12:40:31 -0600
committerColin Snover2017-01-11 11:13:44 -0600
commite00c773d9529ba7915d1ef9443df289ef8eb34a5 (patch)
treea06b6d96588c595e062a897cd274ff4fa25f66aa /engines
parent4eecd48c64792c327bb1e5e85f38b75717da0947 (diff)
downloadscummvm-rg350-e00c773d9529ba7915d1ef9443df289ef8eb34a5.tar.gz
scummvm-rg350-e00c773d9529ba7915d1ef9443df289ef8eb34a5.tar.bz2
scummvm-rg350-e00c773d9529ba7915d1ef9443df289ef8eb34a5.zip
SCI32: Remove backslashes from PQ:SWAT extra save game files
The original interpreter created subdirectories for each in-game profile, but copying this behaviour would add a lot of superfluous complexity to the save game system in ScummVM, and may not be portable to all supported platforms. Instead, when the game tries to save its files to a subdirectory, the backslash in the file name is replaced with an underscore so it can be created successfully on filesystems where backslash is an illegal file name character. This has a side-effect of causing all save games to be displayed under all profiles, instead of just the ones "belonging" to a particular profile, but this seems like a reasonable trade-off given that there is no reason to play this game with more than one profile.
Diffstat (limited to 'engines')
-rw-r--r--engines/sci/engine/kfile.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/engines/sci/engine/kfile.cpp b/engines/sci/engine/kfile.cpp
index 9d74ed174d..7bc3c2d212 100644
--- a/engines/sci/engine/kfile.cpp
+++ b/engines/sci/engine/kfile.cpp
@@ -427,6 +427,13 @@ reg_t kFileIOOpen(EngineState *s, int argc, reg_t *argv) {
return make_reg(0, handle);
}
}
+ } else if (g_sci->getGameId() == GID_PQSWAT) {
+ // PQSWAT tries to create subdirectories for each game profile
+ for (Common::String::iterator it = name.begin(); it != name.end(); ++it) {
+ if (*it == '\\') {
+ *it = '_';
+ }
+ }
}
// See kMakeSaveCatName