CVS code

I’m getting ready to release new versions of the SDL libraries.
If you’re feeling experimental, I’d like to hear if the new versions
work or if there are any new (or old) bugs in them.

SDL 1.2.3 PRERELEASE:
http://www.libsdl.org/cvs/SDL-1.2.tar.gz

SDL_image 1.2.1 PRERELEASE:
http://www.libsdl.org/cvs/SDL_image-1.2.1.tar.gz

SDL_mixer 1.2.1 PRERELEASE:
(anybody want to work on native Linux MIDI support?)
http://www.libsdl.org/cvs/SDL_mixer-1.2.1.tar.gz

SDL_net 1.2.3 PRERELEASE:
http://www.libsdl.org/cvs/SDL_net-1.2.3.tar.gz

I’m working on a couple bugs in SDL_ttf and that will be up when
I’m done.

Thanks for the feedback,
-Sam Lantinga, Software Engineer, Blizzard Entertainment

Sam Lantinga wrote:

I’m getting ready to release new versions of the SDL libraries.

Oh dear, now I’m getting all worried that the last SDL_mixer patch I
sent you was wrong. :slight_smile:

In that patch, I suggested that mixer.c’s should use this to recognize
a WAV file:

    switch (magic) {
            case WAVE:
            case RIFF:       <-- This is the line I added
                    loaded = SDL_LoadWAV_RW( ... )

As I understand it now (I didn’t understand it then), RIFF is the
magic number and WAVE is just the name of one of the WAV file’s
chunks. So the WAVE case should be removed.

Torbj?rn Andersson

Sam Lantinga wrote:

I’m working on a couple bugs in SDL_ttf and that will be up when
I’m done.

you may want to fix the cheesy composition of glyphs by ORing pixels
together. Last time I checked, the SDL_ttf code had stuff like

  *dst++ |= *src++;

The right way is probably to use the composition

Cres = Csrc * min(Asrc, 1 - Adst) + Cdst   for R, G, B
Ares = Asrc + Adst

in other words, (GL_SRC_ALPHA_SATURATE, GL_ONE), clamped to the (0…1)
interval as usual.

Fortunately this is not quite easy since glyphs just have an alpha channel,
no RGB, so this boils down to

Ares = min(Asrc + Adst, 1)

which can be implemented as

#define SAT_ADD8(a, b)
((Uint8)(((a) + (b)) | (((Sint32)((a) + (b)) << 23) >> 31)))

, just one add and two shifts more than the original (broken) code

I wrote:

Fortunately this is not quite easy since glyphs just have an alpha channel,

s/not //, sorry