diff options
author | Travis Howell | 2008-02-12 09:34:38 +0000 |
---|---|---|
committer | Travis Howell | 2008-02-12 09:34:38 +0000 |
commit | d178604838fee587810d40c78606570659667200 (patch) | |
tree | 9b17f49cf09783377ee8eeda51a82abf9206f8d9 | |
parent | ba717bc5155c896b0376d23c374d4dc801794dac (diff) | |
download | scummvm-rg350-d178604838fee587810d40c78606570659667200.tar.gz scummvm-rg350-d178604838fee587810d40c78606570659667200.tar.bz2 scummvm-rg350-d178604838fee587810d40c78606570659667200.zip |
Alter last changes, for code formatting.
svn-id: r30850
-rw-r--r-- | engines/scumm/player_mod.cpp | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/engines/scumm/player_mod.cpp b/engines/scumm/player_mod.cpp index e50e116c83..61cc181128 100644 --- a/engines/scumm/player_mod.cpp +++ b/engines/scumm/player_mod.cpp @@ -171,13 +171,11 @@ void Player_MOD::do_mix(int16 *data, uint len) { dlen = len; len = 0; } - for (i = 0; i < MOD_MAXCHANS; i++) - { + for (i = 0; i < MOD_MAXCHANS; i++) { if (_channels[i].id) { Audio::st_volume_t vol_l = (127 - _channels[i].pan) * _channels[i].vol / 127; Audio::st_volume_t vol_r = (127 + _channels[i].pan) * _channels[i].vol / 127; - for (uint j = 0; j < dlen; j++) - { + for (uint j = 0; j < dlen; j++) { // simple linear resample, unbuffered int delta = (uint32)(_channels[i].freq * 0x10000) / _samplerate; uint16 cfrac = ~_channels[i].ctr & 0xFFFF; @@ -185,28 +183,25 @@ void Player_MOD::do_mix(int16 *data, uint len) { cfrac = delta; _channels[i].ctr += delta; int32 cpos = _channels[i].pos * cfrac / 0x10000; - while (_channels[i].ctr >= 0x10000) - { - if (_channels[i].input->readBuffer(&_channels[i].pos, 1) != 1) - { // out of data + while (_channels[i].ctr >= 0x10000) { + if (_channels[i].input->readBuffer(&_channels[i].pos, 1) != 1) { // out of data stopChannel(_channels[i].id); goto skipchan; // exit 2 loops at once } _channels[i].ctr -= 0x10000; if (_channels[i].ctr > 0x10000) cpos += _channels[i].pos; - else cpos += (int32)(_channels[i].pos * (_channels[i].ctr & 0xFFFF)) / 0x10000; + else + cpos += (int32)(_channels[i].pos * (_channels[i].ctr & 0xFFFF)) / 0x10000; } int16 pos = 0; // if too many samples play in a row, the calculation below will overflow and clip // so try and split it up into pieces it can manage comfortably - while (cpos < -0x8000) - { + while (cpos < -0x8000) { pos -= 0x80000000 / delta; cpos += 0x8000; } - while (cpos > 0x7FFF) - { + while (cpos > 0x7FFF) { pos += 0x7FFF0000 / delta; cpos -= 0x7FFF; } |