diff options
author | Johannes Schickel | 2010-03-08 00:34:29 +0000 |
---|---|---|
committer | Johannes Schickel | 2010-03-08 00:34:29 +0000 |
commit | e941780d39c6f12f7bb2622d39b46b8c3350aded (patch) | |
tree | a5416ab5e91c57d4a8bf25947691a972d41f3467 /sound/softsynth | |
parent | f67f7d36f1f3bba5b571aef261e3be61dbd1fab9 (diff) | |
download | scummvm-rg350-e941780d39c6f12f7bb2622d39b46b8c3350aded.tar.gz scummvm-rg350-e941780d39c6f12f7bb2622d39b46b8c3350aded.tar.bz2 scummvm-rg350-e941780d39c6f12f7bb2622d39b46b8c3350aded.zip |
Use memset instead of a custom loop for zeroing the sample buffer.
svn-id: r48181
Diffstat (limited to 'sound/softsynth')
-rw-r--r-- | sound/softsynth/opl/dbopl.cpp | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/sound/softsynth/opl/dbopl.cpp b/sound/softsynth/opl/dbopl.cpp index 3e0ef7bfb1..785f2105e5 100644 --- a/sound/softsynth/opl/dbopl.cpp +++ b/sound/softsynth/opl/dbopl.cpp @@ -1196,9 +1196,7 @@ Bit32u Chip::WriteAddr( Bit32u port, Bit8u val ) { void Chip::GenerateBlock2( Bitu total, Bit32s* output ) { while ( total > 0 ) { Bit32u samples = ForwardLFO( total ); - for ( Bitu i = 0; i < samples; i++ ) { - output[i] = 0; - } + memset(output, 0, sizeof(Bit32s) * samples); int count = 0; for( Channel* ch = chan; ch < chan + 9; ) { count++; @@ -1212,10 +1210,7 @@ void Chip::GenerateBlock2( Bitu total, Bit32s* output ) { void Chip::GenerateBlock3( Bitu total, Bit32s* output ) { while ( total > 0 ) { Bit32u samples = ForwardLFO( total ); - for ( Bitu i = 0; i < samples; i++ ) { - output[i * 2 + 0 ] = 0; - output[i * 2 + 1 ] = 0; - } + memset(output, 0, sizeof(Bit32s) * 2 * samples); int count = 0; for( Channel* ch = chan; ch < chan + 18; ) { count++; |