aboutsummaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorMax Horn2007-06-28 22:21:32 +0000
committerMax Horn2007-06-28 22:21:32 +0000
commitf058edf860b33086f473720dc790280c563bebcb (patch)
tree8c577a80555a4cdf130ff58f91e2481660d66d55 /common
parent1a3724b59b4c89411c748fd3b645a627b4f599cd (diff)
downloadscummvm-rg350-f058edf860b33086f473720dc790280c563bebcb.tar.gz
scummvm-rg350-f058edf860b33086f473720dc790280c563bebcb.tar.bz2
scummvm-rg350-f058edf860b33086f473720dc790280c563bebcb.zip
Switched Paula (Amiga MOD) code to use fixed point math instead of doubles (caveat: this only works for samples < 32k right now; if this ever turns out to be a problem, I can fix it, though)
svn-id: r27767
Diffstat (limited to 'common')
-rw-r--r--common/frac.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/common/frac.h b/common/frac.h
index 1c2c622a2c..b1e6c518d1 100644
--- a/common/frac.h
+++ b/common/frac.h
@@ -46,6 +46,9 @@ enum {
*/
typedef int32 frac_t;
+inline frac_t doubleToFrac(double value) { return (frac_t)(value * FRAC_ONE); }
+inline double fracToDouble(frac_t value) { return ((double)value) / FRAC_ONE; }
+
inline frac_t intToFrac(int16 value) { return value << FRAC_BITS; }
inline int16 fracToInt(frac_t value) { return value >> FRAC_BITS; }