aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Sandulenko2016-08-29 22:06:02 +0200
committerEugene Sandulenko2016-08-29 22:06:35 +0200
commit5283612a7f851d41cda3735d37504ac40df7da37 (patch)
treed910dc27391e8600339cb09542bd0eed81641b6e
parente13cee4be0b02da6fa96148f19e756318726c32e (diff)
downloadscummvm-rg350-5283612a7f851d41cda3735d37504ac40df7da37.tar.gz
scummvm-rg350-5283612a7f851d41cda3735d37504ac40df7da37.tar.bz2
scummvm-rg350-5283612a7f851d41cda3735d37504ac40df7da37.zip
FULLPIPE: Read signed values where potentially negative values could appear
-rw-r--r--engines/fullpipe/gfx.cpp4
-rw-r--r--engines/fullpipe/interaction.cpp4
-rw-r--r--engines/fullpipe/statics.cpp24
-rw-r--r--engines/fullpipe/utils.cpp2
4 files changed, 17 insertions, 17 deletions
diff --git a/engines/fullpipe/gfx.cpp b/engines/fullpipe/gfx.cpp
index 77838576f0..164190de6e 100644
--- a/engines/fullpipe/gfx.cpp
+++ b/engines/fullpipe/gfx.cpp
@@ -290,8 +290,8 @@ bool GameObject::load(MfcArchive &file) {
_id = file.readUint16LE();
_objectName = file.readPascalString();
- _ox = file.readUint32LE();
- _oy = file.readUint32LE();
+ _ox = file.readSint32LE();
+ _oy = file.readSint32LE();
_priority = file.readUint16LE();
if (g_fp->_gameProjectVersion >= 11) {
diff --git a/engines/fullpipe/interaction.cpp b/engines/fullpipe/interaction.cpp
index f0abd0d02c..dc40750fe6 100644
--- a/engines/fullpipe/interaction.cpp
+++ b/engines/fullpipe/interaction.cpp
@@ -450,8 +450,8 @@ bool Interaction::load(MfcArchive &file) {
_objectId3 = file.readUint16LE();
_objectState2 = file.readUint32LE();
_objectState1 = file.readUint32LE();
- _xOffs = file.readUint32LE();
- _yOffs = file.readUint32LE();
+ _xOffs = file.readSint32LE();
+ _yOffs = file.readSint32LE();
_sceneId = file.readUint32LE();
_flags = file.readUint32LE();
_actionName = file.readPascalString();
diff --git a/engines/fullpipe/statics.cpp b/engines/fullpipe/statics.cpp
index ff079a8b0e..1f25bfb46e 100644
--- a/engines/fullpipe/statics.cpp
+++ b/engines/fullpipe/statics.cpp
@@ -1703,8 +1703,8 @@ bool Movement::load(MfcArchive &file, StaticANIObject *ani) {
_staticsObj1 = ani->addReverseStatics(s);
}
- _mx = file.readUint32LE();
- _my = file.readUint32LE();
+ _mx = file.readSint32LE();
+ _my = file.readSint32LE();
staticsid = file.readUint16LE();
@@ -1715,8 +1715,8 @@ bool Movement::load(MfcArchive &file, StaticANIObject *ani) {
_staticsObj2 = ani->addReverseStatics(s);
}
- _m2x = file.readUint32LE();
- _m2y = file.readUint32LE();
+ _m2x = file.readSint32LE();
+ _m2y = file.readSint32LE();
if (_staticsObj2) {
_dynamicPhases.push_back(_staticsObj2);
@@ -2273,17 +2273,17 @@ bool DynamicPhase::load(MfcArchive &file) {
_field_7C = file.readUint16LE();
_rect = new Common::Rect();
- _rect->left = file.readUint32LE();
- _rect->top = file.readUint32LE();
- _rect->right = file.readUint32LE();
- _rect->bottom = file.readUint32LE();
+ _rect->left = file.readSint32LE();
+ _rect->top = file.readSint32LE();
+ _rect->right = file.readSint32LE();
+ _rect->bottom = file.readSint32LE();
- assert (g_fp->_gameProjectVersion >= 1);
+ assert(g_fp->_gameProjectVersion >= 1);
- _someX = file.readUint32LE();
- _someY = file.readUint32LE();
+ _someX = file.readSint32LE();
+ _someY = file.readSint32LE();
- assert (g_fp->_gameProjectVersion >= 12);
+ assert(g_fp->_gameProjectVersion >= 12);
_dynFlags = file.readUint32LE();
diff --git a/engines/fullpipe/utils.cpp b/engines/fullpipe/utils.cpp
index a8e00468b5..148f779d1e 100644
--- a/engines/fullpipe/utils.cpp
+++ b/engines/fullpipe/utils.cpp
@@ -84,7 +84,7 @@ bool DWordArray::load(MfcArchive &file) {
resize(count);
for (int i = 0; i < count; i++) {
- int32 t = file.readUint32LE();
+ int32 t = file.readSint32LE();
push_back(t);
}