aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic/sound
diff options
context:
space:
mode:
Diffstat (limited to 'engines/titanic/sound')
-rw-r--r--engines/titanic/sound/music_wave.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/engines/titanic/sound/music_wave.cpp b/engines/titanic/sound/music_wave.cpp
index 5a1ae73884..a1dd460d0f 100644
--- a/engines/titanic/sound/music_wave.cpp
+++ b/engines/titanic/sound/music_wave.cpp
@@ -322,14 +322,14 @@ void CMusicWave::processArray(int index, int size) {
}
void CMusicWave::setupArray(int minVal, int maxVal) {
+ // Delete any prior array and recreate it
delete[] _array;
- // TODO: Figure out if the weird shift can be represented as a simpler equation
- uint32 arrSize = ((uint32)minVal << 29) - (uint32)minVal + maxVal;
-
- _array = new double[arrSize / 8];
- _arrayIndex = maxVal;
+ int arrSize = maxVal - minVal + 1;
+ _array = new double[arrSize];
+ _arrayIndex = ABS(minVal);
+ // Setup array contents
_array[_arrayIndex] = 1.0;
double val = 1.0594634;