throttle framerate to < 67 fps

snap8
Jens Mönig 2022-07-23 13:33:59 +02:00
rodzic 7123338e22
commit 883ceed25f
2 zmienionych plików z 12 dodań i 2 usunięć

Wyświetl plik

@ -53,6 +53,7 @@
* fixed variadic AND/OR reporters library, thanks, Brian! * fixed variadic AND/OR reporters library, thanks, Brian!
* fixed a pen-size issue in the frequency distribution analysis' graph-plot block, thanks, Brian! * fixed a pen-size issue in the frequency distribution analysis' graph-plot block, thanks, Brian!
* fixed block label color when expanding or inserting variadic infix slots * fixed block label color when expanding or inserting variadic infix slots
* framerate is throttled to < 67 fps
* **Documentation Updates:** * **Documentation Updates:**
* updated contribution guidelines, thanks, Peter! * updated contribution guidelines, thanks, Peter!
* updated help screens for NUMBERS and FIND FIRST, thanks, Brian, Peter and WarpedWartWars! * updated help screens for NUMBERS and FIND FIRST, thanks, Brian, Peter and WarpedWartWars!
@ -60,6 +61,9 @@
* **Translation Updates:** * **Translation Updates:**
* German * German
### 2022-07-23
* throttle framerate to < 67 fps
### 2022-07-22 ### 2022-07-22
* v8.0.0 release candidate * v8.0.0 release candidate

Wyświetl plik

@ -37,7 +37,9 @@
<script src="src/sha512.js?version=2019-06-27"></script> <script src="src/sha512.js?version=2019-06-27"></script>
<script src="src/FileSaver.min.js?version=2019-06-27"></script> <script src="src/FileSaver.min.js?version=2019-06-27"></script>
<script> <script>
var world; var world,
FPS = 67,
lastTime = 0;
window.onload = function () { window.onload = function () {
if ('serviceWorker' in navigator) { if ('serviceWorker' in navigator) {
navigator.serviceWorker.register('sw.js'); navigator.serviceWorker.register('sw.js');
@ -46,9 +48,13 @@
new IDE_Morph().openIn(world); new IDE_Morph().openIn(world);
loop(); loop();
}; };
function loop() { function loop(timestamp) {
requestAnimationFrame(loop); requestAnimationFrame(loop);
if (timestamp - lastTime < 1000 / FPS) {
return;
}
world.doOneCycle(); world.doOneCycle();
lastTime = timestamp;
} }
</script> </script>
</head> </head>