Small optimizations
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
<libraries>
|
||||
<!-- OpenFL & Lime (Required for Flixel) -->
|
||||
<lib name="openfl" />
|
||||
<lib name="lime" version="8.0.2"/>
|
||||
<lib name="lime" />
|
||||
|
||||
<!-- Flixel -->
|
||||
<git name="flixel" url="https://github.com/FNF-CNE-Devs/flixel" />
|
||||
|
||||
@@ -116,7 +116,8 @@ class SystemInfo extends FramerateCategory {
|
||||
}
|
||||
|
||||
static function formatSysInfo() {
|
||||
if (osInfo != "Unknown") __formattedSysText = 'System: $osInfo';
|
||||
__formattedSysText = "";
|
||||
if (osInfo != "Unknown") __formattedSysText += 'System: $osInfo';
|
||||
if (cpuName != "Unknown") __formattedSysText += '\nCPU: $cpuName ${openfl.system.Capabilities.cpuArchitecture} ${(openfl.system.Capabilities.supports64BitProcesses ? '64-Bit' : '32-Bit')}';
|
||||
if (gpuName != cpuName || vRAM != "Unknown") {
|
||||
var gpuNameKnown = gpuName != "Unknown" && gpuName != cpuName;
|
||||
|
||||
@@ -29,10 +29,10 @@ import openfl.Vector;
|
||||
|
||||
class HudCamera extends FlxCamera {
|
||||
public var downscroll:Bool = false;
|
||||
public override function update(elapsed:Float) {
|
||||
super.update(elapsed);
|
||||
// flipY = downscroll;
|
||||
}
|
||||
//public override function update(elapsed:Float) {
|
||||
// super.update(elapsed);
|
||||
// // flipY = downscroll;
|
||||
//}
|
||||
|
||||
|
||||
// public override function drawPixels(?frame:FlxFrame, ?pixels:BitmapData, matrix:FlxMatrix, ?transform:ColorTransform, ?blend:BlendMode, ?smoothing:Bool = false,
|
||||
|
||||
@@ -7,6 +7,7 @@ class NoteGroup extends FlxTypedGroup<Note> {
|
||||
var __loopSprite:Note;
|
||||
var i:Int = 0;
|
||||
var __currentlyLooping:Bool = false;
|
||||
var __time:Float = -1.0;
|
||||
|
||||
/**
|
||||
* How many ms it should show a note before it should be hit
|
||||
@@ -36,12 +37,13 @@ class NoteGroup extends FlxTypedGroup<Note> {
|
||||
public override function update(elapsed:Float) {
|
||||
i = length-1;
|
||||
__loopSprite = null;
|
||||
__time = Conductor.songPosition;
|
||||
while(i >= 0) {
|
||||
__loopSprite = members[i--];
|
||||
if (__loopSprite == null || !__loopSprite.exists || !__loopSprite.active) {
|
||||
continue;
|
||||
}
|
||||
if (__loopSprite.strumTime - Conductor.songPosition > limit)
|
||||
if (__loopSprite.strumTime - __time > limit)
|
||||
break;
|
||||
__loopSprite.update(elapsed);
|
||||
}
|
||||
@@ -56,11 +58,12 @@ class NoteGroup extends FlxTypedGroup<Note> {
|
||||
|
||||
i = length-1;
|
||||
__loopSprite = null;
|
||||
__time = Conductor.songPosition;
|
||||
while(i >= 0) {
|
||||
__loopSprite = members[i--];
|
||||
if (__loopSprite == null || !__loopSprite.exists || !__loopSprite.visible)
|
||||
continue;
|
||||
if (__loopSprite.strumTime - Conductor.songPosition > limit) break;
|
||||
if (__loopSprite.strumTime - __time > limit) break;
|
||||
__loopSprite.draw();
|
||||
}
|
||||
__currentlyLooping = oldCur;
|
||||
@@ -71,6 +74,7 @@ class NoteGroup extends FlxTypedGroup<Note> {
|
||||
public override function forEach(noteFunc:Note->Void, recursive:Bool = false) {
|
||||
i = length-1;
|
||||
__loopSprite = null;
|
||||
__time = Conductor.songPosition;
|
||||
|
||||
var oldCur = __currentlyLooping;
|
||||
__currentlyLooping = true;
|
||||
@@ -79,7 +83,7 @@ class NoteGroup extends FlxTypedGroup<Note> {
|
||||
__loopSprite = members[i--];
|
||||
if (__loopSprite == null || !__loopSprite.exists)
|
||||
continue;
|
||||
if (__loopSprite.strumTime - Conductor.songPosition > limit) break;
|
||||
if (__loopSprite.strumTime - __time > limit) break;
|
||||
noteFunc(__loopSprite);
|
||||
}
|
||||
__currentlyLooping = oldCur;
|
||||
|
||||
@@ -175,17 +175,19 @@ class StrumLine extends FlxTypedGroup<Strum> {
|
||||
onNoteUpdate.dispatch(PlayState.instance.__updateNote_event);
|
||||
if (PlayState.instance.__updateNote_event.cancelled) return;
|
||||
|
||||
if (PlayState.instance.__updateNote_event.__updateHitWindow) {
|
||||
daNote.canBeHit = (daNote.strumTime > Conductor.songPosition - (PlayState.instance.hitWindow * daNote.latePressWindow)
|
||||
&& daNote.strumTime < Conductor.songPosition + (PlayState.instance.hitWindow * daNote.earlyPressWindow));
|
||||
var songPosition = Conductor.songPosition;
|
||||
|
||||
if (daNote.strumTime < Conductor.songPosition - PlayState.instance.hitWindow && !daNote.wasGoodHit)
|
||||
if (PlayState.instance.__updateNote_event.__updateHitWindow) {
|
||||
daNote.canBeHit = (daNote.strumTime > songPosition - (PlayState.instance.hitWindow * daNote.latePressWindow)
|
||||
&& daNote.strumTime < songPosition + (PlayState.instance.hitWindow * daNote.earlyPressWindow));
|
||||
|
||||
if (daNote.strumTime < songPosition - PlayState.instance.hitWindow && !daNote.wasGoodHit)
|
||||
daNote.tooLate = true;
|
||||
}
|
||||
|
||||
if (cpu && PlayState.instance.__updateNote_event.__autoCPUHit && !daNote.wasGoodHit && daNote.strumTime < Conductor.songPosition) PlayState.instance.goodNoteHit(this, daNote);
|
||||
if (cpu && PlayState.instance.__updateNote_event.__autoCPUHit && !daNote.wasGoodHit && daNote.strumTime < songPosition) PlayState.instance.goodNoteHit(this, daNote);
|
||||
|
||||
if (daNote.wasGoodHit && daNote.isSustainNote && daNote.strumTime + (daNote.sustainLength) < Conductor.songPosition) {
|
||||
if (daNote.wasGoodHit && daNote.isSustainNote && daNote.strumTime + (daNote.sustainLength) < songPosition) {
|
||||
deleteNote(daNote);
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user