[AD] Modified color.c and mixer.c

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


A while ago I pointed out a bug in create_rgb_table() on the [AL] mailing
list. I now have a modified version of color.c with the bug corrected (I
hope!). Well, it seems to work anyway.

I have also modified mixer.c in three ways:

1. When voices have volume 0, the sample position is updated properly,
rather than stopping. It does not waste time mixing the samples though. This
also means that voice_get_position() doesn't return -1 for silent voices,
and silent non-looping waves will stop when they should.

2. Bi-directional loops are implemented slightly differently. The old
algorithm meant that as soon as the position went outside the loop points,
it was moved back by 2*diff, where diff is the increment, and then the
mixing loop was restarted. Now it reflects off the loop point perfectly (I
hope!), as many times as necessary (if the loop points are really close
together), before doing the mixing. This could have been an opportunity for
programs to freeze when the loop section was really small. (I think! :-) Now
it could only crash if loop_start == loop_end, and that would cause the
sample to play without looping anyway.

3. The number of voices reserved does not affect the volume of each
individual voice. Voices are now at the volume they would have been for 8
voices in the old version. *** NOTE: If anyone has a good reason why this
should not be the case, SPEAK NOW! ***

Slight problem: I don't seem to be able to obtain a version of DIFF.EXE for
DOS. If anyone can direct me to a website where I can get one, I will make
patch files myself - otherwise, is it all right if I post the entire files
somewhere? Where?

Ben Davis



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/