comparison src/audio/SDL_wave.c @ 1428:5f52867ba65c

Update for Visual C++ 6.0
author Sam Lantinga <slouken@libsdl.org>
date Fri, 24 Feb 2006 18:24:57 +0000
parents d910939febfa
children 8dfa9a6d69a5
comparison
equal deleted inserted replaced
1427:5f5a74d29d18 1428:5f52867ba65c
106 } 106 }
107 delta = ((Sint32)state->iDelta * adaptive[nybble])/256; 107 delta = ((Sint32)state->iDelta * adaptive[nybble])/256;
108 if ( delta < 16 ) { 108 if ( delta < 16 ) {
109 delta = 16; 109 delta = 16;
110 } 110 }
111 state->iDelta = delta; 111 state->iDelta = (Uint16)delta;
112 state->iSamp2 = state->iSamp1; 112 state->iSamp2 = state->iSamp1;
113 state->iSamp1 = new_sample; 113 state->iSamp1 = (Sint16)new_sample;
114 return(new_sample); 114 return(new_sample);
115 } 115 }
116 116
117 static int MS_ADPCM_decode(Uint8 **audio_buf, Uint32 *audio_len) 117 static int MS_ADPCM_decode(Uint8 **audio_buf, Uint32 *audio_len)
118 { 118 {
369 if ( *encoded++ != 0 ) { 369 if ( *encoded++ != 0 ) {
370 /* Uh oh, corrupt data? Buggy code? */; 370 /* Uh oh, corrupt data? Buggy code? */;
371 } 371 }
372 372
373 /* Store the initial sample we start with */ 373 /* Store the initial sample we start with */
374 decoded[0] = state[c].sample&0xFF; 374 decoded[0] = (Uint8)(state[c].sample&0xFF);
375 decoded[1] = state[c].sample>>8; 375 decoded[1] = (Uint8)(state[c].sample>>8);
376 decoded += 2; 376 decoded += 2;
377 } 377 }
378 378
379 /* Decode and store the other samples in this block */ 379 /* Decode and store the other samples in this block */
380 samplesleft = (IMA_ADPCM_state.wSamplesPerBlock-1)*channels; 380 samplesleft = (IMA_ADPCM_state.wSamplesPerBlock-1)*channels;