countingpine 96c4ebe77f SCUMM: Better Player_Mac::durationToSamples
Uses the fact that 4*480*480 == 225 << 12, and the identity
(a*b)>>n == (a>>n)*b + ((a%(1<<n))*b)>>n (assuming non-overflowing math),
except the rhs uses smaller intermediate values and does not overflow(*).
Compared to the original code, this uses 1 fewer division and eliminates
the rounding error.

(*) Technical note: In some cases the right hand side of the above
identity still has possibilities of intermediate overflow, but only if
b > (1 << n), or if (b << n) overflows, neither of which are true here.
2013-07-16 16:16:08 +01:00
..
2013-06-02 09:43:59 +02:00
2013-05-11 19:18:11 +03:00
2012-05-28 14:29:44 -04:00
2012-02-11 08:30:02 +01:00
2011-11-03 01:34:53 +00:00
2011-05-25 11:17:11 -04:00
2012-02-13 13:38:25 +11:00
2012-02-13 20:26:43 +01:00
2012-02-11 08:30:00 +01:00