From 0990a328dbd1cb17955d948a63c21beec0fc4ca5 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sun, 21 Sep 2003 18:15:31 +0000 Subject: [PATCH] Date: Sat, 13 Sep 2003 15:50:43 +0300 From: "Mike Gorchak" Subject: QNX fixes updated .qpg file and fixed error in .mod samples parsing. sdl_mixer core dumped, tried to load the us-boy.mod (included in the attachment). I saw, many mod players have a similar hack for the looping in the samples, so I added the same one to mikmod code :) --- SDL_mixer.qpg.in | 58 ++++++++++++++++++++++++++++++++---------- mikmod/virtch_common.c | 6 +++++ 2 files changed, 50 insertions(+), 14 deletions(-) diff --git a/SDL_mixer.qpg.in b/SDL_mixer.qpg.in index 1bc9e994..97eec21e 100644 --- a/SDL_mixer.qpg.in +++ b/SDL_mixer.qpg.in @@ -37,6 +37,7 @@ + Library SDL_mixer @@ -44,6 +45,7 @@ http://qnx.org.ru/repository 2.0 + SDL_mixer SDL_mixer @@ -53,17 +55,18 @@ http://www.libsdl.org slouken@libsdl.org - Sam Lantinga + Sam Lantinga, Stephane Peter and Ryan Gordon http://www.libsdl.org slouken@libsdl.org - SDL_mixer - is simple multi-channel audio mixer. The mixer can currently load Microsoft WAVE files and Creative Labs VOC files as audio samples, and can load MIDI files via Timidity and the following music formats via MikMod: .MOD .S3M .IT .XM. + SDL_mixer - is simple multi-channel audio mixer. The mixer can currently load Microsoft WAVE files and Creative Labs VOC files as audio samples, and can load MIDI files via Timidity and the various music formats via MikMod. SDL_mixer - is simple multi-channel audio mixer. The mixer can currently load Microsoft WAVE files and Creative Labs VOC files as audio samples, and can load MIDI files via Timidity and the following music formats via MikMod: .MOD .S3M .IT .XM. - http://www.libsdl.org + http://www.libsdl.org/projects/SDL_mixer + @VERSION@ High @@ -72,26 +75,53 @@ 1 - GNU General Public License + GNU Lesser General Public License + - Software Development/Libraries and Extensions/C Libraries + Software Development/Libraries and Extensions/C Libraries SDL, music, sound, WAV, VOC, MIDI, MID, MOD, S3M, XM, IT - - qnx6 - qnx6 - Console - Developer - User + none + Console + Developer + User repdata://LicenseUrl/COPYING + + + + + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/mikmod/virtch_common.c b/mikmod/virtch_common.c index ce57d2bd..6c29dae8 100644 --- a/mikmod/virtch_common.c +++ b/mikmod/virtch_common.c @@ -374,6 +374,12 @@ SWORD VC1_SampleLoad(struct SAMPLOAD* sload,int type) length = s->length; loopstart = s->loopstart; loopend = s->loopend; + + /* Fix loops */ + if (((loopend-loopstart)>2) && (loopstart > loopend) && (loopstart>length)) + { + loopstart /= 2; + } SL_SampleSigned(sload); SL_Sample8to16(sload);