aboutsummaryrefslogtreecommitdiff
path: root/engines/gob/variables.h
diff options
context:
space:
mode:
authorSven Hesse2009-05-31 02:15:43 +0000
committerSven Hesse2009-05-31 02:15:43 +0000
commit896df6daf337bf83f27193918eb386321c4b0166 (patch)
treec124f8f102052cdd6207e2507d097aff4bc7f44e /engines/gob/variables.h
parentc938667d4b60005a926007376305f3da8621f7c7 (diff)
downloadscummvm-rg350-896df6daf337bf83f27193918eb386321c4b0166.tar.gz
scummvm-rg350-896df6daf337bf83f27193918eb386321c4b0166.tar.bz2
scummvm-rg350-896df6daf337bf83f27193918eb386321c4b0166.zip
- A new save system for the GobEngine, one that is not fundamentally broken and is versioned. Unfortunately, this invalidates most save games created on big-endian machines, since endian-issues was a main problem with the old system
- Removed the now superfluous variables sizes svn-id: r41056
Diffstat (limited to 'engines/gob/variables.h')
-rw-r--r--engines/gob/variables.h66
1 files changed, 28 insertions, 38 deletions
diff --git a/engines/gob/variables.h b/engines/gob/variables.h
index c2f2285b80..84a4772baa 100644
--- a/engines/gob/variables.h
+++ b/engines/gob/variables.h
@@ -67,32 +67,32 @@ public:
const uint8 *getAddressVar8(uint32 var) const;
- uint8 *getAddressVar8(uint32 var, uint32 n = 1);
+ uint8 *getAddressVar8(uint32 var);
const uint16 *getAddressVar16(uint32 var) const;
- uint16 *getAddressVar16(uint32 var, uint32 n = 1);
+ uint16 *getAddressVar16(uint32 var);
const uint32 *getAddressVar32(uint32 var) const;
- uint32 *getAddressVar32(uint32 var, uint32 n = 1);
+ uint32 *getAddressVar32(uint32 var);
const char *getAddressVarString(uint32 var) const;
- char *getAddressVarString(uint32 var, uint32 n = 0xFFFFFFFF);
+ char *getAddressVarString(uint32 var);
const uint8 *getAddressOff8(uint32 offset) const;
- uint8 *getAddressOff8(uint32 offset, uint32 n = 1);
+ uint8 *getAddressOff8(uint32 offset);
const uint16 *getAddressOff16(uint32 offset) const;
- uint16 *getAddressOff16(uint32 offset, uint32 n = 1);
+ uint16 *getAddressOff16(uint32 offset);
const uint32 *getAddressOff32(uint32 offset) const;
- uint32 *getAddressOff32(uint32 offset, uint32 n = 1);
+ uint32 *getAddressOff32(uint32 offset);
const char *getAddressOffString(uint32 offset) const;
- char *getAddressOffString(uint32 offset, uint32 n = 0xFFFFFFFF);
+ char *getAddressOffString(uint32 offset);
- bool copyTo(uint32 offset, byte *variables, byte *sizes, uint32 n) const;
- bool copyFrom(uint32 offset, const byte *variables, const byte *sizes, uint32 n);
+ bool copyTo(uint32 offset, byte *variables, uint32 n) const;
+ bool copyFrom(uint32 offset, const byte *variables, uint32 n);
protected:
virtual void write8(byte *buf, uint8 data) const = 0;
@@ -104,20 +104,10 @@ protected:
virtual uint32 read32(const byte *buf) const = 0;
private:
- // Basically the number of additional bytes occupied
- static const byte kSize8 = 0;
- static const byte kSize16 = 1;
- static const byte kSize32 = 3;
-
uint32 _size;
-
byte *_vars;
- byte *_sizes;
- void clear();
- void clearSize(uint32 offset);
- void writeSize(uint32 offset, byte n);
- void writeSizeString(uint32 offset, uint32 length);
+ void clear();
};
class VariablesLE : public Variables {
@@ -151,23 +141,23 @@ protected:
};
class VariableReference {
- public:
- VariableReference();
- VariableReference(Variables &vars, uint32 offset,
- Variables::Type type = Variables::kVariableType32);
- ~VariableReference();
-
- void set(Variables &vars, uint32 offset, Variables::Type type = Variables::kVariableType32);
-
- VariableReference &operator=(uint32 value);
- VariableReference &operator+=(uint32 value);
- VariableReference &operator*=(uint32 value);
- operator uint32();
-
- private:
- Variables *_vars;
- uint32 _offset;
- Variables::Type _type;
+public:
+ VariableReference();
+ VariableReference(Variables &vars, uint32 offset,
+ Variables::Type type = Variables::kVariableType32);
+ ~VariableReference();
+
+ void set(Variables &vars, uint32 offset, Variables::Type type = Variables::kVariableType32);
+
+ VariableReference &operator=(uint32 value);
+ VariableReference &operator+=(uint32 value);
+ VariableReference &operator*=(uint32 value);
+ operator uint32();
+
+private:
+ Variables *_vars;
+ uint32 _offset;
+ Variables::Type _type;
};
} // End of namespace Gob