aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorGregory Montoir2007-11-04 03:02:32 +0000
committerGregory Montoir2007-11-04 03:02:32 +0000
commit52b18c9ae6e95f96587dfb480cdce9f9d291b3ac (patch)
treeeed74084d241c5d257ae711ef413c911312f5117 /engines
parent5fb95212feaa7a5af5810fb2c46b59d5a7ab25de (diff)
downloadscummvm-rg350-52b18c9ae6e95f96587dfb480cdce9f9d291b3ac.tar.gz
scummvm-rg350-52b18c9ae6e95f96587dfb480cdce9f9d291b3ac.tar.bz2
scummvm-rg350-52b18c9ae6e95f96587dfb480cdce9f9d291b3ac.zip
simplification, increased game state filenames
svn-id: r29399
Diffstat (limited to 'engines')
-rw-r--r--engines/touche/saveload.cpp24
1 files changed, 6 insertions, 18 deletions
diff --git a/engines/touche/saveload.cpp b/engines/touche/saveload.cpp
index 90eb3665fd..eb647a1b42 100644
--- a/engines/touche/saveload.cpp
+++ b/engines/touche/saveload.cpp
@@ -36,39 +36,27 @@ enum {
kGameStateDescriptionLen = 32
};
-template <class S, class T>
-static void saveOrLoad(S &s, T &t);
-
-template <>
static void saveOrLoad(Common::WriteStream &stream, uint16 &i) {
stream.writeUint16LE(i);
}
-template <>
static void saveOrLoad(Common::ReadStream &stream, uint16 &i) {
i = stream.readUint16LE();
}
-template <>
static void saveOrLoad(Common::WriteStream &stream, int16 &i) {
stream.writeSint16LE(i);
}
-template <>
static void saveOrLoad(Common::ReadStream &stream, int16 &i) {
i = stream.readSint16LE();
}
-template <class S, class T>
-static void saveOrLoadPtr(S &s, T *&t, T *base);
-
-template <>
static void saveOrLoadPtr(Common::WriteStream &stream, int16 *&p, int16 *base) {
int32 offset = (int32)(p - base);
stream.writeSint32LE(offset);
}
-template <>
static void saveOrLoadPtr(Common::ReadStream &stream, int16 *&p, int16 *base) {
int32 offset = stream.readSint32LE();
p = base + offset;
@@ -338,8 +326,8 @@ void ToucheEngine::loadGameStateData(Common::ReadStream *stream) {
bool ToucheEngine::saveGameState(int num, const char *description) {
bool saveOk = false;
- char gameStateFileName[16];
- generateGameStateFileName(num, gameStateFileName, 15);
+ char gameStateFileName[64];
+ generateGameStateFileName(num, gameStateFileName, 63);
Common::OutSaveFile *f = _saveFileMan->openForSaving(gameStateFileName);
if (f) {
f->writeUint16LE(kCurrentGameStateVersion);
@@ -362,8 +350,8 @@ bool ToucheEngine::saveGameState(int num, const char *description) {
bool ToucheEngine::loadGameState(int num) {
bool loadOk = false;
- char gameStateFileName[16];
- generateGameStateFileName(num, gameStateFileName, 15);
+ char gameStateFileName[64];
+ generateGameStateFileName(num, gameStateFileName, 63);
Common::InSaveFile *f = _saveFileMan->openForLoading(gameStateFileName);
if (f) {
uint16 version = f->readUint16LE();
@@ -384,8 +372,8 @@ bool ToucheEngine::loadGameState(int num) {
}
void ToucheEngine::readGameStateDescription(int num, char *description, int len) {
- char gameStateFileName[16];
- generateGameStateFileName(num, gameStateFileName, 15);
+ char gameStateFileName[64];
+ generateGameStateFileName(num, gameStateFileName, 63);
Common::InSaveFile *f = _saveFileMan->openForLoading(gameStateFileName);
if (f) {
uint16 version = f->readUint16LE();