Skip to content

Commit 9e07e84

Browse files
committed
Fix for GX to prevent calculated FPS from being set before a full sample timeframe has elapsed
1 parent 0523bff commit 9e07e84

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

gx/gx.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,9 @@ var GX = new function() {
465465
await GX.sceneUpdate();
466466
GX.sceneDraw();
467467
if (_scene.frame % 10 == 0) {
468-
_framerate = Math.round(10 / (timestamp - fpsSnapshot) * 1000);
468+
if (_scene.frame > 10) {
469+
_framerate = Math.round(10 / (timestamp - fpsSnapshot) * 1000);
470+
}
469471
fpsSnapshot = timestamp;
470472
}
471473
lastTimestamp = timestamp

service-worker.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
// Names of the two caches used in this version of the service worker.
1515
// Change to v2, etc. when you update any of the local resources, which will
1616
// in turn trigger the install event again.
17-
const PRECACHE = 'precache-v64';
18-
const RUNTIME = 'runtime-v5';
17+
const PRECACHE = 'precache-v65';
18+
const RUNTIME = 'runtime-v6';
1919
const PREFIX = (self.location.origin.indexOf("github.io") == -1) ? "/" : "/qbjs/";
2020

2121
// A list of local resources we always want to be cached.

0 commit comments

Comments
 (0)