diff options
author | countingpine | 2013-07-16 16:16:08 +0100 |
---|---|---|
committer | countingpine | 2013-07-16 16:16:08 +0100 |
commit | 96c4ebe77fff9f23e085bb80a4907e6f857a96c2 (patch) | |
tree | 789a1a0ef419d812b9868dde1383e976b7abe83e /engines/kyra/items_hof.cpp | |
parent | 3d373281b440d5d139fbb01ef1ffa0ad0a76b3e8 (diff) | |
download | scummvm-rg350-96c4ebe77fff9f23e085bb80a4907e6f857a96c2.tar.gz scummvm-rg350-96c4ebe77fff9f23e085bb80a4907e6f857a96c2.tar.bz2 scummvm-rg350-96c4ebe77fff9f23e085bb80a4907e6f857a96c2.zip |
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.
Diffstat (limited to 'engines/kyra/items_hof.cpp')
0 files changed, 0 insertions, 0 deletions