From 2fefdc884fac78597606fdff4813174e6fc512be Mon Sep 17 00:00:00 2001 From: Yoshman29 <81191621+YoshiCrafter29@users.noreply.github.com> Date: Mon, 26 Dec 2022 22:21:08 +0100 Subject: [PATCH 1/2] possible lag fix --- buildnumber.txt | 2 +- source/funkin/game/PlayState.hx | 3 +-- source/funkin/system/Conductor.hx | 2 +- source/funkin/system/Main.hx | 10 +++++++++- 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/buildnumber.txt b/buildnumber.txt index c7ecf224..91917fa8 100644 --- a/buildnumber.txt +++ b/buildnumber.txt @@ -1 +1 @@ -1796 \ No newline at end of file +1799 \ No newline at end of file diff --git a/source/funkin/game/PlayState.hx b/source/funkin/game/PlayState.hx index fb8ce94c..66666854 100644 --- a/source/funkin/game/PlayState.hx +++ b/source/funkin/game/PlayState.hx @@ -524,9 +524,8 @@ class PlayState extends MusicBeatState Paths.getFolderContent('data/charts/', false, true, !fromMods)]) { for(file in content) { var ext = Path.extension(file).toLowerCase(); - if (Script.scriptExtensions.contains(ext)) { + if (Script.scriptExtensions.contains(ext)) scripts.add(Script.create(file)); - } } } } diff --git a/source/funkin/system/Conductor.hx b/source/funkin/system/Conductor.hx index 3bcfd211..180e3dab 100644 --- a/source/funkin/system/Conductor.hx +++ b/source/funkin/system/Conductor.hx @@ -152,7 +152,7 @@ class Conductor var lastPos = lastSongPos; if (lastSongPos != (lastSongPos = FlxG.sound.music.time)) { // update conductor - var timeUntilUpdate = -(lastSongPosTime - (lastSongPosTime = Lib.getTimer())); + var timeUntilUpdate = -(lastSongPosTime - (lastSongPosTime = Main.time)); var elapsedAL = (lastSongPos - lastPos); speed = FlxMath.bound(FlxMath.lerp(speed, timeUntilUpdate / elapsedAL, timeUntilUpdate / 1000), 0.85, 1.15); songPosition = lastSongPos; diff --git a/source/funkin/system/Main.hx b/source/funkin/system/Main.hx index 7aaacdd2..7236f89f 100644 --- a/source/funkin/system/Main.hx +++ b/source/funkin/system/Main.hx @@ -12,7 +12,7 @@ import funkin.options.Options; import flixel.FlxGame; import flixel.FlxState; import openfl.Assets; -import openfl.Lib; +import flash.Lib; import openfl.display.FPS; import openfl.display.Sprite; import openfl.events.Event; @@ -47,6 +47,8 @@ class Main extends Sprite var skipSplash:Bool = true; // Whether to skip the flixel splash screen that appears in release mode. var startFullscreen:Bool = false; // Whether to start the game in fullscreen on desktop targets + public static var time:Int = 0; + // You can pretty much ignore everything from here on - your code should go in your states. #if sys @@ -126,7 +128,13 @@ class Main extends Sprite #end } + private static function getTimer():Int { + return time = Lib.getTimer(); + } + public function loadGameSettings() { + @:privateAccess + FlxG.game.getTimer = getTimer; #if sys for(i in 0...4) gameThreads.push(Thread.createWithEventLoop(function() {Thread.current().events.promise();})); From f3ae0e3c519fabe07eaeed5d47b5d49b781ddc1f Mon Sep 17 00:00:00 2001 From: YoshiCrafter29 <81191621+YoshiCrafter29@users.noreply.github.com> Date: Mon, 26 Dec 2022 23:13:58 +0100 Subject: [PATCH 2/2] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0c35ee6e..d28e38a0 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Friday Night Funkin' - Codename Engine (WIP) -## PLEASE NOTE - THIS IS STILL IN AN ALPHA STATE +## PLEASE NOTE - THIS IS STILL IN A BETA STATE Early alpha of Codename Engine, known issues: - Some options are missing