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 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
* framerate is throttled to < 67 fps
* **Documentation Updates:**
* updated contribution guidelines, thanks, Peter!
* updated help screens for NUMBERS and FIND FIRST, thanks, Brian, Peter and WarpedWartWars!
@ -60,6 +61,9 @@
* **Translation Updates:**
* German
### 2022-07-23
* throttle framerate to < 67 fps
### 2022-07-22
* 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/FileSaver.min.js?version=2019-06-27"></script>
<script>
var world;
var world,
FPS = 67,
lastTime = 0;
window.onload = function () {
if ('serviceWorker' in navigator) {
navigator.serviceWorker.register('sw.js');
@ -46,9 +48,13 @@
new IDE_Morph().openIn(world);
loop();
};
function loop() {
function loop(timestamp) {
requestAnimationFrame(loop);
if (timestamp - lastTime < 1000 / FPS) {
return;
}
world.doOneCycle();
lastTime = timestamp;
}
</script>
</head>