aboutsummaryrefslogtreecommitdiff
path: root/engines/macventure/sound.cpp
diff options
context:
space:
mode:
authorBorja Lorente2016-08-17 17:19:05 +0200
committerBorja Lorente2016-08-19 16:30:25 +0200
commit69f2302a1adb9ead458e38a45429477eac2b6ce4 (patch)
treef036a4071033ba945337b55455951827a25b4dd1 /engines/macventure/sound.cpp
parent97af2b6e14ab25e37aa0c3d226c0264ac2a8ec12 (diff)
downloadscummvm-rg350-69f2302a1adb9ead458e38a45429477eac2b6ce4.tar.gz
scummvm-rg350-69f2302a1adb9ead458e38a45429477eac2b6ce4.tar.bz2
scummvm-rg350-69f2302a1adb9ead458e38a45429477eac2b6ce4.zip
MACVENTURE: Remove JavaScript constructs
Diffstat (limited to 'engines/macventure/sound.cpp')
-rw-r--r--engines/macventure/sound.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/engines/macventure/sound.cpp b/engines/macventure/sound.cpp
index fd39e2bf5e..422e365790 100644
--- a/engines/macventure/sound.cpp
+++ b/engines/macventure/sound.cpp
@@ -126,7 +126,7 @@ void SoundAsset::decode10(Common::SeekableReadStream *stream) {
_length = stream->readUint32BE() * 2;
//Unused
stream->readUint16BE();
- _frequency = (stream->readUint32BE() * 22100 / 0x10000) | 0;
+ _frequency = (stream->readUint32BE() * 22100 / 0x10000);
byte ch = 0;
for (uint i = 0; i < _length; i++) {
if (i & 1) {
@@ -147,7 +147,7 @@ void SoundAsset::decode12(Common::SeekableReadStream *stream) {
stream->seek(base, SEEK_SET);
_length = stream->readUint32BE() - 6;
stream->readUint16BE();
- _frequency = (stream->readUint32BE() * 22100 / 0x10000) | 0;
+ _frequency = (stream->readUint32BE() * 22100 / 0x10000);
stream->seek(0xe2, SEEK_SET);
// TODO: Possible source of bugs, the original just assigns the seek to the scales
uint32 scales = stream->pos() + 0xe2;
@@ -191,7 +191,8 @@ void SoundAsset::decode18(Common::SeekableReadStream *stream) {
_length = stream->readUint32BE() * 2;
//Unused
stream->readUint16BE();
- _frequency = (stream->readUint32BE() * 22100 / 0x10000) | 0;
+ // TODO: It had `| 0` at the end of this line, possible source of bugs.
+ _frequency = (stream->readUint32BE() * 22100 / 0x10000);
byte ch = 0;
for (uint i = 0; i < _length; i++) {
if (i & 1) {
@@ -213,7 +214,7 @@ void SoundAsset::decode1a(Common::SeekableReadStream *stream) {
_length = stream->readUint32BE();
//Unused
stream->readUint16BE();
- _frequency = (stream->readUint32BE() * 22100 / 0x10000) | 0;
+ _frequency = (stream->readUint32BE() * 22100 / 0x10000);
byte ch = 0;
for (uint i = 0; i < _length; i++) {
if (i & 1) {
@@ -228,7 +229,7 @@ void SoundAsset::decode1a(Common::SeekableReadStream *stream) {
void SoundAsset::decode44(Common::SeekableReadStream *stream) {
stream->seek(0x5e, SEEK_SET);
_length = stream->readUint32BE();
- _frequency = (stream->readUint32BE() * 22100 / 0x10000) | 0;
+ _frequency = (stream->readUint32BE() * 22100 / 0x10000);
for (uint i = 0; i < _length; i++) {
_data.push_back(stream->readByte());
}
@@ -243,7 +244,7 @@ void SoundAsset::decode78(Common::SeekableReadStream *stream) {
//Unused
stream->readUint32BE();
_length = stream->readUint32BE();
- _frequency = (stream->readUint32BE() * 22100 / 0x10000) | 0;
+ _frequency = (stream->readUint32BE() * 22100 / 0x10000);
byte ch = 0;
for (uint i = 0; i < _length; i++) {
if (i & 1) {
@@ -264,7 +265,7 @@ void SoundAsset::decode7e(Common::SeekableReadStream *stream) {
//Unused
stream->readUint32BE();
_length = stream->readUint32BE();
- _frequency = (stream->readUint32BE() * 22100 / 0x10000) | 0;
+ _frequency = (stream->readUint32BE() * 22100 / 0x10000);
uint32 last = 0x80;
byte ch = 0;
for (uint i = 0; i < _length; i++) {