mirror of
https://github.com/curioustorvald/tsvm.git
synced 2026-03-17 08:16:06 +09:00
fix: mp2 player would not play the very first frame
This commit is contained in:
@@ -30,10 +30,7 @@ function s16Tou8(i) {
|
||||
function u16Tos16(i) { return (i > 32767) ? i - 65536 : i }
|
||||
function randomRound(k) {
|
||||
let rnd = (Math.random() + Math.random()) / 2.0 // this produces triangular distribution
|
||||
if (rnd < (k - (k|0)))
|
||||
return Math.ceil(k)
|
||||
else
|
||||
return Math.floor(k)
|
||||
return (rnd < (k - (k|0))) ? Math.ceil(k) : Math.floor(k)
|
||||
}
|
||||
function lerp(start, end, x) {
|
||||
return (1 - x) * start + x * end
|
||||
|
||||
Reference in New Issue
Block a user