@@ -191,7 +191,6 @@ static void notesCallback(GLFWwindow* wind, int key, int scancode, int action, i
191
191
!curNote.hit ) {
192
192
for (int lane = 0 ; lane < 5 ; lane++) {
193
193
int chordLane = curChart.findNoteIdx (curNote.time , lane);
194
- std::cout << " lane " << lane << " at " << chordLane << std::endl;
195
194
if (chordLane != -1 ) {
196
195
Note& chordNote = curChart.notes [chordLane];
197
196
if ((chordNote.time ) - (goodBackend)+InputOffset < eventTime &&
@@ -245,8 +244,23 @@ static void notesCallback(GLFWwindow* wind, int key, int scancode, int action, i
245
244
}
246
245
}
247
246
overdriveLiftAvailable = false ;
247
+ }
248
+ }
249
+ if (action == GLFW_RELEASE && curNote.held && (curNote.len ) > 0 ) {
250
+ for (int lane = 0 ; lane < 5 ; lane++) {
251
+ if (overdriveLanesHit[lane]) {
252
+ int chordLane = curChart.findNoteIdx (curNote.time , lane);
253
+ if (chordLane != -1 ) {
254
+ Note& chordNote = curChart.notes [chordLane];
255
+ if (chordNote.held && chordNote.len > 0 ) {
256
+ chordNote.held = false ;
257
+ score += sustainScoreBuffer[chordNote.lane ];
258
+ sustainScoreBuffer[chordNote.lane ] = 0 ;
259
+ mute = true ;
260
+ }
261
+ }
262
+ }
248
263
}
249
-
250
264
}
251
265
}
252
266
@@ -302,8 +316,8 @@ int main(int argc, char* argv[])
302
316
float timeCounter = 0 .0f ;
303
317
304
318
int targetFPS = targetFPSArg == 0 ? GetMonitorRefreshRate (GetCurrentMonitor ()) : targetFPSArg;
305
- std::vector<string> songPartsList{ " Drums" ," Bass" ," Guitar" ," Vocals" };
306
- std::vector<string> diffList{ " Easy" ," Medium" ," Hard" ," Expert" };
319
+ std::vector<std:: string> songPartsList{ " Drums" ," Bass" ," Guitar" ," Vocals" };
320
+ std::vector<std:: string> diffList{ " Easy" ," Medium" ," Hard" ," Expert" };
307
321
TraceLog (LOG_INFO, " Target FPS: %d" , targetFPS);
308
322
309
323
InitAudioDevice ();
@@ -563,13 +577,14 @@ int main(int argc, char* argv[])
563
577
}
564
578
else {
565
579
if (songPart != SongParts::Invalid) {
566
- songList.songs [curPlayingSong].parts [(int )songPart]->hasPart = true ;
567
580
for (int diff = 0 ; diff < 4 ; diff++) {
568
581
Chart newChart;
569
- newChart.parseNotes (midiFile, i, midiFile[i], diff);
570
- std::sort (newChart.notes .begin (), newChart.notes .end (), compareNotes);
571
- std::vector<BPM>& bpms = songList.songs [curPlayingSong].bpms ;
572
- songList.songs [curPlayingSong].parts [(int )songPart]->charts .push_back (newChart);
582
+ newChart.parseNotes (midiFile, i, midiFile[i], diff,(int )songPart);
583
+ if (newChart.notes .size () > 0 ) {
584
+ songList.songs [curPlayingSong].parts [(int )songPart]->hasPart = true ;
585
+ std::sort (newChart.notes .begin (), newChart.notes .end (), compareNotes);
586
+ songList.songs [curPlayingSong].parts [(int )songPart]->charts .push_back (newChart);
587
+ }
573
588
}
574
589
}
575
590
}
@@ -622,7 +637,7 @@ int main(int argc, char* argv[])
622
637
}
623
638
}
624
639
else if (selectStage == 4 ) {
625
- int starsval = stars ();
640
+ int starsval = stars (songList. songs [curPlayingSong]. parts [instrument]-> charts [diff]. baseScore );
626
641
char * starsDisplay = (char *) " " ;
627
642
if (starsval == 5 ) {
628
643
starsDisplay = (char *) " *****" ;
@@ -655,7 +670,7 @@ int main(int argc, char* argv[])
655
670
}
656
671
else {
657
672
char * starsDisplay = (char *) " " ;
658
- int starsval = stars ();
673
+ int starsval = stars (songList. songs [curPlayingSong]. parts [instrument]-> charts [diff]. baseScore );
659
674
if (starsval == 5 ) {
660
675
starsDisplay = (char *) " *****" ;
661
676
} else if (starsval == 4 ) {
@@ -898,7 +913,7 @@ int main(int argc, char* argv[])
898
913
}
899
914
for (int i = curNoteIdx; i < curChart.notes .size (); i++) {
900
915
Note& curNote = curChart.notes [i];
901
- bool od = false ;
916
+
902
917
if (curChart.odPhrases .size () > 0 ) {
903
918
if (curNote.time >= curChart.odPhrases [curODPhrase].start && curNote.time <= curChart.odPhrases [curODPhrase].end && !curChart.odPhrases [curODPhrase].missed ) {
904
919
if (curNote.miss ) {
@@ -910,7 +925,7 @@ int main(int argc, char* argv[])
910
925
curNote.countedForODPhrase = true ;
911
926
}
912
927
}
913
- od = true ;
928
+ curNote. renderAsOD = true ;
914
929
}
915
930
if (curChart.odPhrases [curODPhrase].notesHit == curChart.odPhrases [curODPhrase].noteCount && !curChart.odPhrases [curODPhrase].added && overdriveFill < 1 .0f ) {
916
931
overdriveFill += 0 .25f ;
@@ -937,7 +952,7 @@ int main(int argc, char* argv[])
937
952
if (curNote.lift && !curNote.hit ) {
938
953
// lifts // distance between notes
939
954
// (furthest left - lane distance)
940
- if (od ) // 1.6f 0.8
955
+ if (curNote. renderAsOD ) // 1.6f 0.8
941
956
DrawModel (assets.liftModelOD , Vector3{ diffDistance - (1 .0f * curNote.lane ),0 ,smasherPos + (highwayLength * (float )relTime) }, 1 .1f , WHITE);
942
957
// energy phrase
943
958
else
@@ -972,17 +987,17 @@ int main(int argc, char* argv[])
972
987
Color SustainColor = Color{ 172,82,217,255 };
973
988
}*/
974
989
975
- if (curNote.held && !od ) {
990
+ if (curNote.held && !curNote. renderAsOD ) {
976
991
DrawCylinderEx (Vector3{ diffDistance - (1 .0f * curNote.lane ), 0 .05f , smasherPos + (highwayLength * (float )relTime) }, Vector3{ diffDistance - (1 .0f * curNote.lane ),0 .05f , smasherPos + (highwayLength * (float )relEnd) }, 0 .1f , 0 .1f , 15 , Color{ 230 ,100 ,230 ,255 });
977
992
}
978
- if (od && curNote.held ) {
993
+ if (curNote. renderAsOD && curNote.held ) {
979
994
DrawCylinderEx (Vector3{ diffDistance - (1 .0f * curNote.lane ), 0 .05f , smasherPos + (highwayLength * (float )relTime) }, Vector3{ diffDistance - (1 .0f * curNote.lane ),0 .05f , smasherPos + (highwayLength * (float )relEnd) }, 0 .1f , 0 .1f , 15 , Color{ 255 , 255 , 180 ,255 });
980
995
}
981
996
if (!curNote.held && curNote.hit || curNote.miss ) {
982
997
DrawCylinderEx (Vector3{ diffDistance - (1 .0f * curNote.lane ), 0 .05f , smasherPos + (highwayLength * (float )relTime) }, Vector3{ diffDistance - (1 .0f * curNote.lane ),0 .05f , smasherPos + (highwayLength * (float )relEnd) }, 0 .1f , 0 .1f , 15 , Color{ 69 ,69 ,69 ,255 });
983
998
}
984
999
if (!curNote.hit && !curNote.accounted && !curNote.miss ) {
985
- if (od ) {
1000
+ if (curNote. renderAsOD ) {
986
1001
DrawCylinderEx (Vector3{ diffDistance - (1 .0f * curNote.lane ), 0 .05f , smasherPos + (highwayLength * (float )relTime) }, Vector3{ diffDistance - (1 .0f * curNote.lane ),0 .05f , smasherPos + (highwayLength * (float )relEnd) }, 0 .1f , 0 .1f , 15 , Color{ 200 , 170 , 70 ,255 });
987
1002
}
988
1003
else {
@@ -999,7 +1014,7 @@ int main(int argc, char* argv[])
999
1014
}
1000
1015
// regular notes
1001
1016
if (((curNote.len ) > 0 && (curNote.held || !curNote.hit )) || ((curNote.len ) == 0 && !curNote.hit )) {
1002
- if (od ) {
1017
+ if (curNote. renderAsOD ) {
1003
1018
if ((!curNote.held && !curNote.miss ) || !curNote.hit ) {
1004
1019
DrawModel (assets.noteModelOD , Vector3{ diffDistance - (1 .0f * curNote.lane ),0 ,smasherPos + (highwayLength * (float )relTime) }, 1 .1f , WHITE);
1005
1020
};
0 commit comments