Closed illegalinstruction closed 2 years ago
...and now I see why:
setInterval(render_next_frame, (FRAME_RATE/1000.0));
should be
setInterval(render_next_frame, (1000.0/FRAME_RATE));
...embarrassingly, it's been like that for weeks.
Change this to setTimeout() - Chrome and Edge blithely ignore setInterval() 🙄
This is still a problem, thanks to another odd quirk of Twine: drawNextFrame() gets registered as a a callback once for every passage load. (You can see it if you carefully watch the anxiety bar - it starts scrolling like mad, even when your anxiety is in the green).
The fix is probably to just have a bool somewhere that tracks the first time we called setInterval(), and if it's already been done, don't do it a second time.
Steps to reproduce:
Notice that the fans go berzerk, even though we're really only painting at most six images, an operation that'll be accelerated in most browsers.