diff --git a/www/js/rpg_core.js b/www/js/rpg_core.js index 63d2d66..2abba0b 100644 --- a/www/js/rpg_core.js +++ b/www/js/rpg_core.js @@ -1883,7 +1883,10 @@ Graphics.render = function(stage) { this._skipCount--; this._rendered = false; } - this.frameCount++; + // NOTE: frameCount is intentionally NOT incremented here. Incrementing it + // per render ties it to the monitor refresh rate, which makes the playtime + // clock run fast on high-refresh-rate displays. It is now incremented once + // per fixed 60Hz logic tick in SceneManager.updateMain instead. }; /** diff --git a/www/js/rpg_managers.js b/www/js/rpg_managers.js index 51f45eb..8bcc8f8 100644 --- a/www/js/rpg_managers.js +++ b/www/js/rpg_managers.js @@ -1971,6 +1971,7 @@ SceneManager.updateMain = function() { if (Utils.isMobileSafari()) { this.changeScene(); this.updateScene(); + Graphics.frameCount++; } else { var newTime = this._getTimeInMsWithoutMobileSafari(); var fTime = (newTime - this._currentTime) / 1000; @@ -1981,6 +1982,9 @@ SceneManager.updateMain = function() { this.updateInputData(); this.changeScene(); this.updateScene(); + // Tie the playtime/animation clock to the fixed 60Hz logic step so + // it stays accurate regardless of the display's refresh rate. + Graphics.frameCount++; this._accumulator -= this._deltaTime; } }