@@ -176,6 +176,16 @@ class Replay
176
176
void SetUseReprioritizedNoteRows (bool b)
177
177
{
178
178
if (b != useReprioritizedNoterows) {
179
+ if (isOnlineScore ()) {
180
+ if (vOnlineNoteRowVector.empty () &&
181
+ GenerateNoterowsFromTimestamps ()) {
182
+ // initial backup
183
+ vOnlineOffsetVector = GetCopyOfOffsetVector ();
184
+ vOnlineNoteRowVector = GetCopyOfNoteRowVector ();
185
+ vOnlineTrackVector = GetCopyOfTrackVector ();
186
+ vOnlineTapNoteTypeVector = GetCopyOfTapNoteTypeVector ();
187
+ }
188
+ }
179
189
ClearPrimitiveVectors ();
180
190
if (b) {
181
191
vReprioritizedMissData.clear ();
@@ -385,6 +395,16 @@ class Replay
385
395
vMissReplayDataVector.shrink_to_fit ();
386
396
vHoldReplayDataVector.shrink_to_fit ();
387
397
vMineReplayDataVector.shrink_to_fit ();
398
+
399
+ // extra online data "backups"
400
+ vOnlineOffsetVector.clear ();
401
+ vOnlineNoteRowVector.clear ();
402
+ vOnlineTrackVector.clear ();
403
+ vOnlineTapNoteTypeVector.clear ();
404
+ vOnlineOffsetVector.shrink_to_fit ();
405
+ vOnlineNoteRowVector.shrink_to_fit ();
406
+ vOnlineTrackVector.shrink_to_fit ();
407
+ vOnlineTapNoteTypeVector.shrink_to_fit ();
388
408
}
389
409
390
410
// / Lua
@@ -397,6 +417,8 @@ class Replay
397
417
-> bool;
398
418
auto LoadInputData (const std::string& replayDir = INPUT_DATA_DIR) -> bool;
399
419
420
+ auto LoadStoredOnlineData () -> bool;
421
+
400
422
// / For V1 or earlier replays lacking column data, we need to assume
401
423
// / information. Make it all up. This fills in the column data using
402
424
// / NoteData. This also provides TapNoteTypes
@@ -420,6 +442,10 @@ class Replay
420
442
vOnlineReplayTimestampVector.shrink_to_fit ();
421
443
}
422
444
445
+ bool isOnlineScore () const {
446
+ return scoreKey.find (" Online_" ) != std::string::npos;
447
+ }
448
+
423
449
std::map<int , ReplaySnapshot> m_ReplaySnapshotMap{};
424
450
JudgeInfo judgeInfo{};
425
451
@@ -459,6 +485,14 @@ class Replay
459
485
// and reloading that v2 data generates wrong input data
460
486
// so this just refreshes the whole process
461
487
bool generatedInputData = false ;
488
+
489
+ // ///
490
+ // storage of vectors temporarily for online scores only
491
+ std::vector<float > vOnlineOffsetVector{};
492
+ std::vector<int > vOnlineNoteRowVector{};
493
+ std::vector<int > vOnlineTrackVector{};
494
+ std::vector<TapNoteType> vOnlineTapNoteTypeVector{};
495
+ // ///
462
496
};
463
497
464
498
#endif
0 commit comments