diff --git a/main_sdl.c b/main_sdl.c index f184212..4feb898 100644 --- a/main_sdl.c +++ b/main_sdl.c @@ -244,9 +244,7 @@ void SFG_enableMusic(uint8_t enable) void SFG_playSound(uint8_t soundIndex, uint8_t volume) { uint16_t pos = audioPos; - uint8_t volumeShift = 15 - volume / 16; - uint16_t baseLevel = AUDIO_ZERO - (0x8000 >> volumeShift); for (int i = 0; i < SFG_SFX_SAMPLE_COUNT; ++i) @@ -256,22 +254,6 @@ void SFG_playSound(uint8_t soundIndex, uint8_t volume) pos = (pos < SFG_SFX_SAMPLE_COUNT - 1) ? (pos + 1) : 0; } - -/* - int8_t volumeShift = volume / 16 - 7; // -7 to 8 - - uint16_t baseLevel = AUDIO_ZERO - (0x0001 << (volumeShift + 7)); - - for (int i = 0; i < SFG_SFX_SAMPLE_COUNT; ++i) - { - audioBuff[pos] = mixSamples(audioBuff[pos],baseLevel + - ((volumeShift >= 0) ? - (SFG_GET_SFX_SAMPLE(soundIndex,i) << volumeShift) : - (SFG_GET_SFX_SAMPLE(soundIndex,i) >> (-1 * volumeShift)))); - - pos = (pos < SFG_SFX_SAMPLE_COUNT - 1) ? (pos + 1) : 0; - } -*/ } int main(int argc, char *argv[])