[Scummvm-git-logs] scummvm master -> b78b30cc75f9d666562fb532f464102fb535e14d

dreammaster dreammaster at scummvm.org
Sat Feb 4 21:38:02 CET 2017


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
b78b30cc75 TITANIC: Fix CMusicObject initialization


Commit: b78b30cc75f9d666562fb532f464102fb535e14d
    https://github.com/scummvm/scummvm/commit/b78b30cc75f9d666562fb532f464102fb535e14d
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2017-02-04T15:37:58-05:00

Commit Message:
TITANIC: Fix CMusicObject initialization

Changed paths:
    engines/titanic/sound/music_object.cpp
    engines/titanic/sound/music_object.h


diff --git a/engines/titanic/sound/music_object.cpp b/engines/titanic/sound/music_object.cpp
index 0b6951b..3e8d887 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 67fef67..aef826b 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();





More information about the Scummvm-git-logs mailing list