Mercurial > sdl-ios-xcode
comparison src/audio/SDL_mixer.c @ 1985:8055185ae4ed
Added source color and alpha modulation support.
Added perl script to generate optimized render copy functions.
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Mon, 28 Aug 2006 03:17:39 +0000 |
parents | 3b4ce57c6215 |
children | 0615fa58c0be |
comparison
equal
deleted
inserted
replaced
1984:b910bcabec26 | 1985:8055185ae4ed |
---|---|
261 { | 261 { |
262 const Uint32 *src32 = (Uint32 *) src; | 262 const Uint32 *src32 = (Uint32 *) src; |
263 Uint32 *dst32 = (Uint32 *) dst; | 263 Uint32 *dst32 = (Uint32 *) dst; |
264 Sint32 src1, src2; | 264 Sint32 src1, src2; |
265 Sint64 dst_sample; | 265 Sint64 dst_sample; |
266 const Sint64 max_audioval = ((((Sint64)1) << (32 - 1)) - 1); | 266 const Sint64 max_audioval = ((((Sint64) 1) << (32 - 1)) - 1); |
267 const Sint64 min_audioval = -(((Sint64)1) << (32 - 1)); | 267 const Sint64 min_audioval = -(((Sint64) 1) << (32 - 1)); |
268 | 268 |
269 len /= 4; | 269 len /= 4; |
270 while (len--) { | 270 while (len--) { |
271 src1 = (Sint32) SDL_SwapLE32(*src32); | 271 src1 = (Sint32) SDL_SwapLE32(*src32); |
272 src32++; | 272 src32++; |
287 { | 287 { |
288 const Uint32 *src32 = (Uint32 *) src; | 288 const Uint32 *src32 = (Uint32 *) src; |
289 Uint32 *dst32 = (Uint32 *) dst; | 289 Uint32 *dst32 = (Uint32 *) dst; |
290 Sint32 src1, src2; | 290 Sint32 src1, src2; |
291 Sint64 dst_sample; | 291 Sint64 dst_sample; |
292 const Sint64 max_audioval = ((((Sint64)1) << (32 - 1)) - 1); | 292 const Sint64 max_audioval = ((((Sint64) 1) << (32 - 1)) - 1); |
293 const Sint64 min_audioval = -(((Sint64)1) << (32 - 1)); | 293 const Sint64 min_audioval = -(((Sint64) 1) << (32 - 1)); |
294 | 294 |
295 len /= 4; | 295 len /= 4; |
296 while (len--) { | 296 while (len--) { |
297 src1 = (Sint32) SDL_SwapBE32(*src32); | 297 src1 = (Sint32) SDL_SwapBE32(*src32); |
298 src32++; | 298 src32++; |
320 /* !!! FIXME: are these right? */ | 320 /* !!! FIXME: are these right? */ |
321 const double max_audioval = 3.40282347e+38F; | 321 const double max_audioval = 3.40282347e+38F; |
322 const double min_audioval = -3.40282347e+38F; | 322 const double min_audioval = -3.40282347e+38F; |
323 | 323 |
324 /* !!! FIXME: this is a little nasty. */ | 324 /* !!! FIXME: this is a little nasty. */ |
325 union { float f; Uint32 ui32; } cvt; | 325 union |
326 { | |
327 float f; | |
328 Uint32 ui32; | |
329 } cvt; | |
326 | 330 |
327 len /= 4; | 331 len /= 4; |
328 while (len--) { | 332 while (len--) { |
329 cvt.f = *(src32++); | 333 cvt.f = *(src32++); |
330 cvt.ui32 = SDL_SwapLE32(cvt.ui32); | 334 cvt.ui32 = SDL_SwapLE32(cvt.ui32); |
358 /* !!! FIXME: are these right? */ | 362 /* !!! FIXME: are these right? */ |
359 const double max_audioval = 3.40282347e+38F; | 363 const double max_audioval = 3.40282347e+38F; |
360 const double min_audioval = -3.40282347e+38F; | 364 const double min_audioval = -3.40282347e+38F; |
361 | 365 |
362 /* !!! FIXME: this is a little nasty. */ | 366 /* !!! FIXME: this is a little nasty. */ |
363 union { float f; Uint32 ui32; } cvt; | 367 union |
368 { | |
369 float f; | |
370 Uint32 ui32; | |
371 } cvt; | |
364 | 372 |
365 len /= 4; | 373 len /= 4; |
366 while (len--) { | 374 while (len--) { |
367 cvt.f = *(src32++); | 375 cvt.f = *(src32++); |
368 cvt.ui32 = SDL_SwapBE32(cvt.ui32); | 376 cvt.ui32 = SDL_SwapBE32(cvt.ui32); |