aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/gob/inter.cpp20
-rw-r--r--engines/gob/inter.h2
2 files changed, 22 insertions, 0 deletions
diff --git a/engines/gob/inter.cpp b/engines/gob/inter.cpp
index a21850aebf..9b4b06eea3 100644
--- a/engines/gob/inter.cpp
+++ b/engines/gob/inter.cpp
@@ -435,4 +435,24 @@ void Inter::storeString(const char *value) {
storeString(varIndex, type, value);
}
+uint32 Inter::readValue(uint16 index, uint16 type) {
+ switch (type) {
+ case TYPE_IMM_INT8:
+ case TYPE_VAR_INT8:
+ case TYPE_ARRAY_INT8:
+ return (uint32)(((int32)((int8)READ_VARO_UINT8(index))));
+ break;
+
+ case TYPE_VAR_INT16:
+ case TYPE_VAR_INT32_AS_INT16:
+ case TYPE_ARRAY_INT16:
+ return (uint32)(((int32)((int16)READ_VARO_UINT16(index))));
+
+ default:
+ return READ_VARO_UINT32(index);
+ }
+
+ return 0;
+}
+
} // End of namespace Gob
diff --git a/engines/gob/inter.h b/engines/gob/inter.h
index 6a403ce928..47b1cd4210 100644
--- a/engines/gob/inter.h
+++ b/engines/gob/inter.h
@@ -162,6 +162,8 @@ protected:
void storeString(uint16 index, uint16 type, const char *value);
void storeString(const char *value);
+
+ uint32 readValue(uint16 index, uint16 type);
};
class Inter_v1 : public Inter {