Mail Archives: djgpp/1997/01/11/08:18:43
On Thu, 09 Jan 1997 13:41:31 GMT, aho450s AT nic DOT smsu DOT edu (Tony O'Bryan) wrote:
>Does anyone have any experience with getting Allegro and SB_LIB to work
>together. I was using MIDI files for my music, but MOD files are much better.
>I would really like to replace the lame MIDI stuff with the more
>powerful-sounding MOD system.
After wading through seven long C++ source files and commenting out everything
that wasn't directly related to the MOD player, I discovered why my program kept
crashing with a segmentation error. Part of the bad code went like this:
if (pointer == NULL) //This should have been a != comparison
free(pointer);
pointer = malloc(size); //A misnamed parameter made this size zero
memcpy(pointer,data); //Writing to a non-existent buffer (DUH!)
With this corrected, the MOD library works like a champ in my game. Someone had
asked a while ago for a good MOD playing library for DJGPP, so I want to highly
recomment this one. It was written by Joel H. Hunter and can be found at:
ftp://x2ftp.oulu.fi/pub/msdos/programming/djgpp2/sb05_dj2.zip
- Raw text -