Skip to content

Commit f54c485

Browse files
committed
Important rendering bug fix + optimizations
1 parent 3de3c3f commit f54c485

File tree

6 files changed

+10
-7
lines changed

6 files changed

+10
-7
lines changed

source/funkin/backend/system/updating/AsyncUpdater.hx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ class AsyncUpdater {
101101
progress.files = files.length;
102102
progress.step = DOWNLOADING_ASSETS;
103103
trace('starting assets download');
104-
doFile([for(e in files) e], [for(e in fileNames) e], function() {
104+
doFile(files.copy(), fileNames.copy(), function() {
105105
progress.curFile = -1;
106106
progress.curFileName = null;
107107
progress.files = 1;

source/funkin/editors/charter/Charter.hx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1657,7 +1657,7 @@ class Charter extends UIState {
16571657
changeNoteSustain(-1);
16581658

16591659
function _note_selectall(_) {
1660-
selection = [for (note in notesGroup.members) note];
1660+
selection = cast notesGroup.members.copy();
16611661
}
16621662

16631663
function _note_selectmeasure(_) {

source/funkin/editors/charter/CharterBackdropGroup.hx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ class CharterBackdropDummy extends UISprite {
253253

254254
public override function draw() {
255255
@:privateAccess
256-
__lastDrawCameras = [for(c in cameras) c];
256+
__lastDrawCameras = cameras.copy();
257257
}
258258
}
259259

source/funkin/editors/ui/UISprite.hx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ class UISprite extends FlxSprite {
6969

7070
public function drawSuper() {
7171
super.draw();
72-
__lastDrawCameras = [for(c in cameras) c];
72+
__lastDrawCameras = cameras.copy();
7373
}
7474

7575
public function drawMembers() {

source/funkin/game/Note.hx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,9 @@ class Note extends FlxSprite
9898
return __customNoteTypeExists[path];
9999
return __customNoteTypeExists[path] = Assets.exists(path);
100100
}
101+
102+
static var DEFAULT_FIELDS:Array<String> = ["time", "id", "type", "sLen"];
103+
101104
public function new(strumLine:StrumLine, noteData:ChartNote, sustain:Bool = false, sustainLength:Float = 0, sustainOffset:Float = 0, ?prev:Note)
102105
{
103106
super();
@@ -115,7 +118,7 @@ class Note extends FlxSprite
115118
this.sustainLength = sustainLength;
116119
this.strumLine = strumLine;
117120
for(field in Reflect.fields(noteData)) {
118-
if(!["time", "id", "type", "sLen"].contains(field)) {
121+
if(!DEFAULT_FIELDS.contains(field)) {
119122
this.extra.set(field, Reflect.field(noteData, field));
120123
}
121124
}
@@ -290,7 +293,7 @@ class Note extends FlxSprite
290293
setClipRect(swagRect);
291294
}
292295

293-
public function setClipRect(rect:FlxRect) {
296+
public inline function setClipRect(rect:FlxRect) {
294297
this.clipRect = rect;
295298
}
296299

source/funkin/game/Strum.hx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ class Strum extends FlxSprite {
7474
}
7575

7676
public override function draw() {
77-
lastDrawCameras = [for(c in cameras) c];
77+
lastDrawCameras = cameras.copy();
7878
super.draw();
7979
}
8080

0 commit comments

Comments
 (0)