comparison src/audio/SDL_audiocvt.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 14717b52abc0
comparison
equal deleted inserted replaced
1427:5f5a74d29d18 1428:5f52867ba65c
45 for ( i=cvt->len_cvt/2; i; --i ) { 45 for ( i=cvt->len_cvt/2; i; --i ) {
46 sample = src[0] + src[1]; 46 sample = src[0] + src[1];
47 if ( sample > 255 ) { 47 if ( sample > 255 ) {
48 *dst = 255; 48 *dst = 255;
49 } else { 49 } else {
50 *dst = sample; 50 *dst = (Uint8)sample;
51 } 51 }
52 src += 2; 52 src += 2;
53 dst += 1; 53 dst += 1;
54 } 54 }
55 } 55 }
66 *dst = 127; 66 *dst = 127;
67 } else 67 } else
68 if ( sample < -128 ) { 68 if ( sample < -128 ) {
69 *dst = -128; 69 *dst = -128;
70 } else { 70 } else {
71 *dst = sample; 71 *dst = (Sint8)sample;
72 } 72 }
73 src += 2; 73 src += 2;
74 dst += 1; 74 dst += 1;
75 } 75 }
76 } 76 }
183 Uint8 *src, *dst; 183 Uint8 *src, *dst;
184 184
185 src = cvt->buf; 185 src = cvt->buf;
186 dst = cvt->buf; 186 dst = cvt->buf;
187 for ( i=cvt->len_cvt/6; i; --i ) { 187 for ( i=cvt->len_cvt/6; i; --i ) {
188 lsample = src[0]; 188 dst[0] = src[0];
189 rsample = src[1]; 189 dst[1] = src[1];
190 dst[0] = lsample;
191 dst[1] = rsample;
192 src += 6; 190 src += 6;
193 dst += 2; 191 dst += 2;
194 } 192 }
195 } 193 }
196 break; 194 break;
199 Sint8 *src, *dst; 197 Sint8 *src, *dst;
200 198
201 src = (Sint8 *)cvt->buf; 199 src = (Sint8 *)cvt->buf;
202 dst = (Sint8 *)cvt->buf; 200 dst = (Sint8 *)cvt->buf;
203 for ( i=cvt->len_cvt/6; i; --i ) { 201 for ( i=cvt->len_cvt/6; i; --i ) {
204 lsample = src[0]; 202 dst[0] = src[0];
205 rsample = src[1]; 203 dst[1] = src[1];
206 dst[0] = lsample;
207 dst[1] = rsample;
208 src += 6; 204 src += 6;
209 dst += 2; 205 dst += 2;
210 } 206 }
211 } 207 }
212 break; 208 break;
303 Uint8 *src, *dst; 299 Uint8 *src, *dst;
304 300
305 src = cvt->buf; 301 src = cvt->buf;
306 dst = cvt->buf; 302 dst = cvt->buf;
307 for ( i=cvt->len_cvt/4; i; --i ) { 303 for ( i=cvt->len_cvt/4; i; --i ) {
308 lsample = src[0]; 304 dst[0] = src[0];
309 rsample = src[1]; 305 dst[1] = src[1];
310 dst[0] = lsample;
311 dst[1] = rsample;
312 src += 4; 306 src += 4;
313 dst += 2; 307 dst += 2;
314 } 308 }
315 } 309 }
316 break; 310 break;
319 Sint8 *src, *dst; 313 Sint8 *src, *dst;
320 314
321 src = (Sint8 *)cvt->buf; 315 src = (Sint8 *)cvt->buf;
322 dst = (Sint8 *)cvt->buf; 316 dst = (Sint8 *)cvt->buf;
323 for ( i=cvt->len_cvt/4; i; --i ) { 317 for ( i=cvt->len_cvt/4; i; --i ) {
324 lsample = src[0]; 318 dst[0] = src[0];
325 rsample = src[1]; 319 dst[1] = src[1];
326 dst[0] = lsample;
327 dst[1] = rsample;
328 src += 4; 320 src += 4;
329 dst += 2; 321 dst += 2;
330 } 322 }
331 } 323 }
332 break; 324 break;