aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic
diff options
context:
space:
mode:
authorPaul Gilbert2017-02-04 15:37:58 -0500
committerPaul Gilbert2017-02-04 15:37:58 -0500
commitb78b30cc75f9d666562fb532f464102fb535e14d (patch)
tree3dc3ad22300a0aa7906de236dbb05c4ad379af9d /engines/titanic
parentc6f4da19ceb061a2834daddd558ced63f5c3add4 (diff)
downloadscummvm-rg350-b78b30cc75f9d666562fb532f464102fb535e14d.tar.gz
scummvm-rg350-b78b30cc75f9d666562fb532f464102fb535e14d.tar.bz2
scummvm-rg350-b78b30cc75f9d666562fb532f464102fb535e14d.zip
TITANIC: Fix CMusicObject initialization
Diffstat (limited to 'engines/titanic')
-rw-r--r--engines/titanic/sound/music_object.cpp15
-rw-r--r--engines/titanic/sound/music_object.h8
2 files changed, 11 insertions, 12 deletions
diff --git a/engines/titanic/sound/music_object.cpp b/engines/titanic/sound/music_object.cpp
index 0b6951b2d9..3e8d887412 100644
--- a/engines/titanic/sound/music_object.cpp
+++ b/engines/titanic/sound/music_object.cpp
@@ -73,21 +73,20 @@ CMusicObject::CMusicObject(int index) {
for (int idx = 0; idx < count; ++idx)
parser.parse(_data[idx]);
- _field8 = 0x7FFFFFFF;
- uint val = 0x80000000;
+ _minVal = 0x7FFFFFFF;
+ int maxVal = -0x7FFFFFFF;
for (int idx = 0; idx < count; ++idx) {
CValuePair &vp = _data[idx];
if (vp._field0 != 0x7FFFFFFF) {
- if (vp._field0 < _field8)
- _field8 = vp._field0;
- if (vp._field0 > val)
- val = vp._field0;
+ if (vp._field0 < _minVal)
+ _minVal = vp._field0;
+ if (vp._field0 > maxVal)
+ maxVal = vp._field0;
}
}
- val -= _field8;
- _fieldC = val;
+ _range = maxVal - _minVal;
}
CMusicObject::~CMusicObject() {
diff --git a/engines/titanic/sound/music_object.h b/engines/titanic/sound/music_object.h
index 67fef67b85..aef826bdb0 100644
--- a/engines/titanic/sound/music_object.h
+++ b/engines/titanic/sound/music_object.h
@@ -29,16 +29,16 @@
namespace Titanic {
struct CValuePair {
- uint _field0;
- uint _field4;
+ int _field0;
+ int _field4;
CValuePair() : _field0(0), _field4(0) {}
};
class CMusicObject {
public:
Common::Array<CValuePair> _data;
- uint _field8;
- uint _fieldC;
+ int _minVal;
+ int _range;
public:
CMusicObject(int index);
~CMusicObject();