This commit is contained in:
Yoshman29
2022-12-08 16:08:58 +01:00
parent 8e016c28da
commit 65dc05d3c3
4 changed files with 22 additions and 69 deletions
+6
View File
@@ -88,6 +88,12 @@ class Conductor
bpmChangeMap = [];
changeBPM(0);
}
public static function setupSong(SONG:SwagSong) {
reset();
mapBPMChanges(SONG);
changeBPM(SONG.bpm);
}
/**
* Maps BPM changes from a song.
* @param song Song to map BPM changes from.
-40
View File
@@ -148,47 +148,7 @@ class MusicBeatState extends FlxUIState implements IBeatReceiver
}
call("update", [elapsed]);
#if sys
// 4 threads
var partLength = Math.ceil(members.length / 4);
var done = [for(i in 0...Main.gameThreads.length) false];
for(part=>thread in Main.gameThreads) {
thread.events.run(function() {
var p:Int = part;
try {
var i:Int = partLength * p;
var num:Int = partLength * (p+1);
var basic:FlxBasic = null;
while (i < num)
{
basic = members[i++];
if (basic != null && basic.exists && basic.active)
basic.update(elapsed);
}
done[p] = true;
} catch(e) {
trace(e);
done[p] = true;
}
});
}
while(done.contains(false))
Thread.current().events.wait(0.0001);
if (tooltips != null)
tooltips.update(elapsed);
if (_reload && _reload_countdown > 0)
{
_reload_countdown--;
if (_reload_countdown == 0)
reloadUI();
}
#else
super.update(elapsed);
#end
}
@:dox(hide) public function stepHit(curStep:Int):Void