From e350e0b0204860db31f5c5586f443eff3e52b160 Mon Sep 17 00:00:00 2001 From: Arnaud Boutonné Date: Thu, 20 Aug 2009 13:36:18 +0000 Subject: Replace magic numbers by constants : kPropsSize and kIndexSize svn-id: r43562 --- engines/gob/save/saveload.h | 42 ++++++++++++++++++++++++++++-------------- 1 file changed, 28 insertions(+), 14 deletions(-) (limited to 'engines/gob/save/saveload.h') 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; -- cgit v1.2.3 From c70a8745068095227cac1db6054d55db0a0405ad Mon Sep 17 00:00:00 2001 From: Sven Hesse Date: Sat, 22 Aug 2009 15:46:43 +0000 Subject: Properly fixing the Lost in Time temp sprite issue svn-id: r43654 --- engines/gob/save/saveload.h | 1 + 1 file changed, 1 insertion(+) (limited to 'engines/gob/save/saveload.h') diff --git a/engines/gob/save/saveload.h b/engines/gob/save/saveload.h index 8a7d493aed..8e1240daf1 100644 --- a/engines/gob/save/saveload.h +++ b/engines/gob/save/saveload.h @@ -256,6 +256,7 @@ protected: GameHandler *_gameHandler; NotesHandler *_notesHandler; + TempSpriteHandler *_tempSpriteHandler; ScreenshotHandler *_screenshotHandler; SaveHandler *getHandler(const char *fileName) const; -- cgit v1.2.3