From f058edf860b33086f473720dc790280c563bebcb Mon Sep 17 00:00:00 2001 From: Max Horn Date: Thu, 28 Jun 2007 22:21:32 +0000 Subject: 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 --- common/frac.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'common') 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; } -- cgit v1.2.3