Mercurial > hg > dmlib
comparison jmix_post_c.h @ 49:033c660c25f5
Restructure module playing, removing 8bit sample mixing (output can still be
8bit, but samples are internally upconverted to 16bit after module loading.)
Also prepare for floating point mixing support.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Mon, 01 Oct 2012 02:51:41 +0300 |
parents | ee87513fff15 |
children |
comparison
equal
deleted
inserted
replaced
48:ee87513fff15 | 49:033c660c25f5 |
---|---|
3 * Programmed and designed by Matti 'ccr' Hamalainen | 3 * Programmed and designed by Matti 'ccr' Hamalainen |
4 * (C) Copyright 2005-2007 Tecnic Software productions (TNSP) | 4 * (C) Copyright 2005-2007 Tecnic Software productions (TNSP) |
5 */ | 5 */ |
6 | 6 |
7 #ifdef JMIXER_HEADER | 7 #ifdef JMIXER_HEADER |
8 void JMIXER_NAME (Sint32 *, void *, const int); | 8 void JMIXER_NAME (JMIXER_ADDBUF_TYPE *, void *, const int); |
9 #else | 9 #else |
10 void JMIXER_NAME (Sint32 *addBuffer, void *mixBuffer, const int mixLength) | 10 void JMIXER_NAME (JMIXER_ADDBUF_TYPE *addBuffer, void *mixBuffer, const int mixLength) |
11 { | 11 { |
12 int strideLength = mixLength; | 12 int strideLength = mixLength; |
13 Sint32 *ap = addBuffer, t; | 13 JMIXER_ADDBUF_TYPE *ap = addBuffer, t; |
14 JMIXER_TYPE *sp = (JMIXER_TYPE *) mixBuffer; | 14 JMIXER_TYPE *sp = (JMIXER_TYPE *) mixBuffer; |
15 | 15 |
16 while (strideLength--) { | 16 while (strideLength--) |
17 { | |
17 t = *(ap++); | 18 t = *(ap++); |
19 JMIXER_CLAMP | |
18 JMIXER_FUNCTION | 20 JMIXER_FUNCTION |
19 } | 21 } |
20 } | 22 } |
21 #endif | 23 #endif |
22 | 24 |