From 2ea025fcc9503b847958b7b72d5b5a10632cceff Mon Sep 17 00:00:00 2001 From: KadeDeveloper Date: Wed, 11 Aug 2021 18:22:58 -0700 Subject: [PATCH] optimization to note rendering and sm fixes --- source/PlayState.hx | 63 ++++++++++++++++++++++------------------ source/smTools/SMFile.hx | 9 ++++-- 2 files changed, 40 insertions(+), 32 deletions(-) diff --git a/source/PlayState.hx b/source/PlayState.hx index c94b853..013c3b6 100644 --- a/source/PlayState.hx +++ b/source/PlayState.hx @@ -1051,6 +1051,23 @@ class PlayState extends MusicBeatState generateSong(SONG.song); + for(i in unspawnNotes) + { + var dunceNote:Note = i; + notes.add(dunceNote); + if (executeModchart) + { + if (!dunceNote.isSustainNote) + dunceNote.cameras = [camNotes]; + else + dunceNote.cameras = [camSustains]; + } + else + { + dunceNote.cameras = [camHUD]; + } + } + trace('generated'); // add(strumLine); @@ -2195,7 +2212,23 @@ class PlayState extends MusicBeatState perfectMode = false; #end - + if (generatedMusic) + { + for(i in notes) + { + var diff = i.strumTime - Conductor.songPosition; + if (diff < 8000 && diff >= -8000) + { + i.active = true; + i.visible = true; + } + else + { + i.active = false; + i.visible = false; + } + } + } if (updateFrame == 4) { @@ -2517,13 +2550,6 @@ class PlayState extends MusicBeatState daNote.destroy(); } }); - for (i in 0...unspawnNotes.length) { - var daNote:Note = unspawnNotes[0]; - if(daNote.strumTime - 500 >= Conductor.songPosition) { - break; - } - unspawnNotes.splice(unspawnNotes.indexOf(daNote), 1); - } FlxG.sound.music.time = Conductor.songPosition; FlxG.sound.music.play(); @@ -2899,27 +2925,6 @@ class PlayState extends MusicBeatState } } - if (unspawnNotes[0] != null) - { - if (unspawnNotes[0].strumTime - Conductor.songPosition < 3500) - { - var dunceNote:Note = unspawnNotes[0]; - notes.add(dunceNote); - if (executeModchart) - { - if (!dunceNote.isSustainNote) - dunceNote.cameras = [camNotes]; - else - dunceNote.cameras = [camSustains]; - } - else - { - dunceNote.cameras = [camHUD]; - } - var index:Int = unspawnNotes.indexOf(dunceNote); - unspawnNotes.splice(index, 1); - } - } if (generatedMusic) { diff --git a/source/smTools/SMFile.hx b/source/smTools/SMFile.hx index 72111eb..1fbf360 100644 --- a/source/smTools/SMFile.hx +++ b/source/smTools/SMFile.hx @@ -201,6 +201,8 @@ class SMFile changeBPM: false, altAnim: false }; + if (!isDouble) + section.mustHitSection = true; } var seg = TimingStruct.getTimingAtBeat(currentBeat); @@ -283,7 +285,7 @@ class SMFile song.eventObjects = header.changeEvents; } - var newSections = []; + /*var newSections = []; for(s in 0...song.notes.length) // lets go ahead and make sure each note is actually in their own section haha { @@ -307,10 +309,11 @@ class SMFile } } newSections.push(sec); - } + }*/ + // WE ALREADY DO THIS - song.notes = newSections; + //song.notes = newSections; // save da song