fuck multithreading actually
This commit is contained in:
+1
-1
@@ -1 +1 @@
|
||||
2331
|
||||
2355
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user