Firework demo does not display output
After building with Emscripten 1.35.0 on Mac OS 10.11.6, the firework demo does not display any output. Instead it displays a terminal screen full of blanks with the cursor in the bottom right corner. This happens both in Firefox 52.0 and in Safari 10.0.3 (11602.4.8.0.1).
The problem is that the browser only updates the page when the Emscripten main loop returns. The firework demo only returns when each explosion is finished, and the screen is blank. It draws the first phase, calls erase(), draws the next phase, calls erase() and so on, and what gets displayed at the end is just the result of the last erase(). The demo would either have to use Emterpreter and emscripten_sleep() or it would have to be restructured. It could draw one phase of the explosion, return from the main loop, then erase and draw the next phase in the next iteration.
I'm not asking this to be fixed; I mainly want to explain so others don't waste time trying to figure out what is wrong, or thinking that it is a sign of curses problems.
Hello Boris! Quite possibly this example never worked. EMcurses was only a quick hack to port SciTECO to the browser. I probably skipped the firework example when I couldn't get it to work easily. From what I see, the problem is probably the napms() in myrefresh(). The example would have to be refactored radically (compared to the original PDCurses sources) to run asynchronously.