aboutsummaryrefslogtreecommitdiff
path: root/engines/gob/save/saveload.h
diff options
context:
space:
mode:
authorArnaud Boutonné2009-08-20 13:36:18 +0000
committerArnaud Boutonné2009-08-20 13:36:18 +0000
commite350e0b0204860db31f5c5586f443eff3e52b160 (patch)
treefa8d880539a5449ce68f9827273b37fc584220f1 /engines/gob/save/saveload.h
parentafabd2706b98253732f21227a99fdf42576ec289 (diff)
downloadscummvm-rg350-e350e0b0204860db31f5c5586f443eff3e52b160.tar.gz
scummvm-rg350-e350e0b0204860db31f5c5586f443eff3e52b160.tar.bz2
scummvm-rg350-e350e0b0204860db31f5c5586f443eff3e52b160.zip
Replace magic numbers by constants : kPropsSize and kIndexSize
svn-id: r43562
Diffstat (limited to 'engines/gob/save/saveload.h')
-rw-r--r--engines/gob/save/saveload.h42
1 files changed, 28 insertions, 14 deletions
diff --git a/engines/gob/save/saveload.h b/engines/gob/save/saveload.h
index 4779de703c..8a7d493aed 100644
--- a/engines/gob/save/saveload.h
+++ b/engines/gob/save/saveload.h
@@ -77,6 +77,9 @@ public:
static const uint32 kSlotCount = 15;
static const uint32 kSlotNameLength = 40;
+ /** The index. kSlotCount * kSlotNameLength bytes. */
+ static const uint32 kIndexSize = kSlotCount * kSlotNameLength;
+
SaveLoad_v2(GobEngine *vm, const char *targetName);
virtual ~SaveLoad_v2();
@@ -111,8 +114,7 @@ protected:
int getSlotRemainder(int32 offset) const;
};
- /** The index. kSlotCount * kSlotNameLength bytes. */
- byte _index[600];
+ byte _index[kIndexSize];
bool _hasIndex;
File *_slotFile;
@@ -139,6 +141,10 @@ public:
static const uint32 kSlotCount = 30;
static const uint32 kSlotNameLength = 40;
+ static const uint32 kPropsSize = 500;
+ /** Index. kSlotCount * kSlotNameLength bytes. */
+ static const uint32 kIndexSize = kSlotCount * kSlotNameLength;
+
enum ScreenshotType {
kScreenshotTypeGob3, //!< Goblins 3 type screenshot
kScreenshotTypeLost //!< Lost in Time type screenshot
@@ -193,9 +199,8 @@ protected:
bool _firstSize;
/** Global properties. */
- byte _props[500];
- /** Index. kSlotCount * kSlotNameLength bytes. */
- byte _index[1200];
+ byte _props[kPropsSize];
+ byte _index[kIndexSize];
bool _hasIndex;
SaveReader *_reader;
@@ -266,6 +271,10 @@ public:
static const uint32 kSlotCount = 10;
static const uint32 kSlotNameLength = 40;
+ static const uint32 kPropsSize = 500;
+ /** Index. kSlotCount * kSlotNameLength bytes + 800 bytes 0. */
+ static const uint32 kIndexSize = (kSlotCount * kSlotNameLength) + 800;
+
SaveLoad_v4(GobEngine *vm, const char *targetName);
virtual ~SaveLoad_v4();
@@ -311,9 +320,8 @@ protected:
private:
bool _firstSize;
- byte _props[500];
- /** The index. kSlotCount * kSlotNameLength bytes + 800 bytes 0. */
- byte _index[1200];
+ byte _props[kPropsSize];
+ byte _index[kIndexSize];
bool _hasIndex;
File *_slotFile;
@@ -392,6 +400,10 @@ public:
static const uint32 kSlotCount = 60;
static const uint32 kSlotNameLength = 40;
+ static const uint32 kPropsSize = 500;
+ /** Index. kSlotCount * kSlotNameLength bytes. */
+ static const uint32 kIndexSize = kSlotCount * kSlotNameLength;
+
SaveLoad_v6(GobEngine *vm, const char *targetName);
virtual ~SaveLoad_v6();
@@ -426,9 +438,8 @@ protected:
int getSlotRemainder(int32 offset) const;
};
- byte _props[500];
- /** The index. 500 bytes properties + kSlotCount * kSlotNameLength bytes. */
- byte _index[2400];
+ byte _props[kPropsSize];
+ byte _index[kIndexSize];
File *_slotFile;
@@ -454,6 +465,10 @@ public:
static const uint32 kSlotCount = 60;
static const uint32 kSlotNameLength = 40;
+ static const uint32 kPropsSize = 1642;
+ /** Index. kSlotCount * kSlotNameLength bytes. */
+ static const uint32 kIndexSize = kSlotCount * kSlotNameLength;
+
SaveLoad_Playtoons(GobEngine *vm, const char *targetName);
virtual ~SaveLoad_Playtoons();
@@ -488,9 +503,8 @@ protected:
int getSlotRemainder(int32 offset) const;
};
- byte _props[500];
- /** The index. 500 bytes properties + kSlotCount * kSlotNameLength bytes. */
- byte _index[2400];
+ byte _props[kPropsSize];
+ byte _index[kIndexSize];
File *_slotFile;