fuck multithreading actually

This commit is contained in:
Yoshman29
2023-02-21 17:21:25 +01:00
parent 32a8e2708f
commit 766a49474d
2 changed files with 1 additions and 28 deletions
+1 -1
View File
@@ -1 +1 @@
2331
2355
-27
View File
@@ -105,14 +105,6 @@ class Conductor
*/
public static var bpmChangeMap:Array<BPMChangeEvent> = [];
/**
* Thread for multi-threaded audio syncing.
*/
#if ALLOW_MULTITHREADING
public static var syncThread:sys.thread.Thread;
public static var syncThreadTime:Null<Float> = null;
#end
@:dox(hide) public function new() {}
public static function reset() {
@@ -164,23 +156,6 @@ class Conductor
FlxG.signals.preUpdate.add(update);
FlxG.signals.preStateCreate.add(onStateSwitch);
reset();
#if ALLOW_MULTITHREADING
syncThread = ThreadUtil.createSafe(function() {
while(true) {
if (syncThreadTime == null)
syncThreadTime = Sys.time();
// if (FlxG.state != null && FlxG.state is MusicBeatState && cast(FlxG.state, MusicBeatState).cancelConductorUpdate) continue;
elapsed = -(syncThreadTime - (syncThreadTime = Sys.time()));
if (elapsed == 0) continue;
__updateSongPos(elapsed, syncThreadTime);
}
}, true);
#end
}
private static var __timeUntilUpdate:Float;
@@ -217,9 +192,7 @@ class Conductor
private static function update() {
if (FlxG.state != null && FlxG.state is MusicBeatState && cast(FlxG.state, MusicBeatState).cancelConductorUpdate) return;
#if !ALLOW_MULTITHREADING
__updateSongPos(FlxG.elapsed, Main.time);
#end
if (bpm > 0) {
// updates curbeat and stuff