From 3db96f455fab4209872446aec4a94dd48164a5ea Mon Sep 17 00:00:00 2001
From: Yoshman29 <81191621+YoshiCrafter29@users.noreply.github.com>
Date: Wed, 4 Jan 2023 23:55:30 +0100
Subject: [PATCH] added nothing ha fuck you!
---
Project.xml | 1 +
buildnumber.txt | 2 +-
source/funkin/system/Conductor.hx | 10 +++++-----
source/funkin/system/CoolUtil.hx | 8 ++++++++
source/funkin/system/FramerateField.hx | 2 +-
5 files changed, 16 insertions(+), 7 deletions(-)
diff --git a/Project.xml b/Project.xml
index ce38208f..c79e888b 100644
--- a/Project.xml
+++ b/Project.xml
@@ -145,6 +145,7 @@
+
diff --git a/buildnumber.txt b/buildnumber.txt
index 4a36de63..888fb860 100644
--- a/buildnumber.txt
+++ b/buildnumber.txt
@@ -1 +1 @@
-1881
\ No newline at end of file
+1897
\ No newline at end of file
diff --git a/source/funkin/system/Conductor.hx b/source/funkin/system/Conductor.hx
index 66205ecb..03054a42 100644
--- a/source/funkin/system/Conductor.hx
+++ b/source/funkin/system/Conductor.hx
@@ -156,7 +156,7 @@ class Conductor
if (elapsed == 0) continue;
- __updateSongPos(elapsed);
+ __updateSongPos(elapsed, syncThreadTime);
}
}, true);
#end
@@ -164,18 +164,18 @@ class Conductor
private static var __timeUntilUpdate:Float;
private static var __elapsedAL:Float;
- private static function __updateSongPos(elapsed:Float) {
+ private static function __updateSongPos(elapsed:Float, mainTime:Float) {
if (FlxG.sound.music == null || !FlxG.sound.music.playing) {
speed = destSpeed = 1;
lastSongPos = FlxG.sound.music != null ? FlxG.sound.music.time : 0;
- lastSongPosTime = Main.time;
+ lastSongPosTime = mainTime;
return;
}
var lastPos = lastSongPos;
if (lastSongPos != (lastSongPos = FlxG.sound.music.time)) {
// update conductor
- __timeUntilUpdate = -(lastSongPosTime - (lastSongPosTime = Main.time));
+ __timeUntilUpdate = -(lastSongPosTime - (lastSongPosTime = mainTime));
__elapsedAL = (lastSongPos - lastPos);
destSpeed = FlxMath.bound(__elapsedAL / __timeUntilUpdate, 0.925, 1.075);
songPosition = lastSongPos;
@@ -193,7 +193,7 @@ class Conductor
if (FlxG.state != null && FlxG.state is MusicBeatState && cast(FlxG.state, MusicBeatState).cancelConductorUpdate) return;
#if !ALLOW_MULTITHREADING
- __updateSongPos(FlxG.elapsed);
+ __updateSongPos(FlxG.elapsed, Main.time);
#end
if (bpm > 0) {
diff --git a/source/funkin/system/CoolUtil.hx b/source/funkin/system/CoolUtil.hx
index 55e38549..faa22f33 100644
--- a/source/funkin/system/CoolUtil.hx
+++ b/source/funkin/system/CoolUtil.hx
@@ -150,6 +150,14 @@ class CoolUtil
}
}
+ public static function preloadCharacter(name:String, ?spriteName:String) {
+ if (name == null) return;
+ if (spriteName == null)
+ spriteName = name;
+ Assets.getText(Paths.xml('characters/$name'));
+ Paths.getFrames('characters/$spriteName');
+ }
+
public static function playMusic(path:String, DefaultBPM:Int = 102, Volume:Int = 1, Looped:Bool = true, ?Group:FlxSoundGroup) {
Conductor.reset();
FlxG.sound.playMusic(path, Volume, Looped, Group);
diff --git a/source/funkin/system/FramerateField.hx b/source/funkin/system/FramerateField.hx
index 078896f4..74e5d41d 100644
--- a/source/funkin/system/FramerateField.hx
+++ b/source/funkin/system/FramerateField.hx
@@ -60,7 +60,7 @@ class FramerateField extends TextField {
}
#if !web
if (showMemory || debugMode) {
- text.push('RAM: ${CoolUtil.getSizeString(System.totalMemory)}');
+ text.push('RAM: ${CoolUtil.getSizeString(cast(System.totalMemory, UInt))}');
}
if (showMemoryPeak || debugMode) {
if (peak < System.totalMemory)