File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change 12
12
#endif
13
13
#include "ft2_replayer.h"
14
14
15
- #define PROG_VER_STR "1.90 "
15
+ #define PROG_VER_STR "1.91 "
16
16
17
17
// do NOT change these! It will only mess things up...
18
18
Original file line number Diff line number Diff line change 6
6
7
7
void silenceMixRoutine (voice_t * v , int32_t numSamples )
8
8
{
9
- assert ( (uint32_t )numSamples <= UINT16_MAX );
9
+ const uint64_t samplesToMix = ( uint64_t ) v -> delta * (uint32_t )numSamples ; // fixed-point
10
10
11
- const uint32_t samplesInt = (uint32_t )(v -> delta >> MIXER_FRAC_BITS ) * ( uint32_t ) numSamples ;
12
- const uint64_t samplesFrac = (uint64_t )( v -> delta & MIXER_FRAC_SCALE ) * ( uint32_t ) numSamples ;
11
+ const uint32_t samples = (uint32_t )(samplesToMix >> MIXER_FRAC_BITS );
12
+ const uint64_t samplesFrac = (samplesToMix & MIXER_FRAC_MASK ) + v -> positionFrac ;
13
13
14
- uint32_t position = v -> position + samplesInt + (uint32_t )(samplesFrac >> MIXER_FRAC_BITS );
15
- uint32_t positionFrac = samplesFrac & MIXER_FRAC_MASK ;
14
+ uint32_t position = v -> position + samples + (uint32_t )(samplesFrac >> MIXER_FRAC_BITS );
15
+ uint64_t positionFrac = samplesFrac & MIXER_FRAC_MASK ;
16
16
17
17
if (position < (uint32_t )v -> sampleEnd ) // we haven't reached the sample's end yet
18
18
{
You can’t perform that action at this time.
0 commit comments