From db13af5337e06472c82684cbf362598598d158d3 Mon Sep 17 00:00:00 2001 From: Sven Hesse Date: Mon, 17 Jan 2011 13:37:14 +0000 Subject: 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 --- engines/gob/variables.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'engines/gob/variables.h') 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 -- cgit v1.2.3