aboutsummaryrefslogtreecommitdiff
path: root/engines/gob/variables.h
diff options
context:
space:
mode:
authorSven Hesse2011-01-17 13:37:14 +0000
committerSven Hesse2011-01-17 13:37:14 +0000
commitdb13af5337e06472c82684cbf362598598d158d3 (patch)
treecfc6fec7fe251bb8591c321127aeca8f4da9f249 /engines/gob/variables.h
parent6c6d85908fd475eb6c32031f3fdfa16bd5bae3d9 (diff)
downloadscummvm-rg350-db13af5337e06472c82684cbf362598598d158d3.tar.gz
scummvm-rg350-db13af5337e06472c82684cbf362598598d158d3.tar.bz2
scummvm-rg350-db13af5337e06472c82684cbf362598598d158d3.zip
GOB: Make the variable stack endianness-independent
Since Urban Runner casts int16s to uint32 before pushing them onto the stack and after popping assumes it's little endian, we have explicitely preserve the variable space endianness while pushing/popping. svn-id: r55277
Diffstat (limited to 'engines/gob/variables.h')
-rw-r--r--engines/gob/variables.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/engines/gob/variables.h b/engines/gob/variables.h
index c3724bc118..d092a8bc4c 100644
--- a/engines/gob/variables.h
+++ b/engines/gob/variables.h
@@ -148,6 +148,23 @@ private:
Variables::Type _type;
};
+class VariableStack {
+public:
+ VariableStack(uint32 size);
+ ~VariableStack();
+
+ void pushData(const Variables &vars, uint32 offset, uint32 size);
+ void pushInt(uint32 value);
+
+ void pop(Variables &vars, uint32 offset);
+
+private:
+ byte *_stack;
+
+ uint32 _size;
+ uint32 _position;
+};
+
} // End of namespace Gob
#endif // GOB_VARIABLES_H