Mercurial > sdl-ios-xcode
comparison test/loopwave.c @ 2145:5c14978b1e97
Merged r3140:3141 from branches/SDL-1.2: loopwave fix.
author | Ryan C. Gordon <icculus@icculus.org> |
---|---|
date | Thu, 05 Jul 2007 02:45:47 +0000 |
parents | 5f6550e5184f |
children | 8b76cc268771 |
comparison
equal
deleted
inserted
replaced
2144:665c2669e6a3 | 2145:5c14978b1e97 |
---|---|
44 waveptr = wave.sound + wave.soundpos; | 44 waveptr = wave.sound + wave.soundpos; |
45 waveleft = wave.soundlen - wave.soundpos; | 45 waveleft = wave.soundlen - wave.soundpos; |
46 | 46 |
47 /* Go! */ | 47 /* Go! */ |
48 while (waveleft <= len) { | 48 while (waveleft <= len) { |
49 SDL_MixAudio(stream, waveptr, waveleft, SDL_MIX_MAXVOLUME); | 49 SDL_memcpy(stream, waveptr, waveleft); |
50 stream += waveleft; | 50 stream += waveleft; |
51 len -= waveleft; | 51 len -= waveleft; |
52 waveptr = wave.sound; | 52 waveptr = wave.sound; |
53 waveleft = wave.soundlen; | 53 waveleft = wave.soundlen; |
54 wave.soundpos = 0; | 54 wave.soundpos = 0; |
55 } | 55 } |
56 SDL_MixAudio(stream, waveptr, len, SDL_MIX_MAXVOLUME); | 56 SDL_memcpy(stream, waveptr, len); |
57 wave.soundpos += len; | 57 wave.soundpos += len; |
58 } | 58 } |
59 | 59 |
60 static int done = 0; | 60 static int done = 0; |
61 void | 61 void |