Added MeasureInfo calculations, and loader/writer for #MEASUREINFO cache

This commit is contained in:
Michael Votaw
2024-07-23 17:33:53 -05:00
committed by teejusb
parent 200a44d8a1
commit 429fab2fbc
6 changed files with 313 additions and 2 deletions
+26
View File
@@ -383,6 +383,30 @@ void SetRadarValues(StepsTagInfo& info)
}
info.ssc_format= true;
}
void SetMeasureInfo(StepsTagInfo& info)
{
if (info.from_cache || info.for_load_edit)
{
std::vector<RString> values;
split((*info.params)[1], "|", values, true);
MeasureInfo v[NUM_PLAYERS];
FOREACH_PlayerNumber(pn)
{
v[pn].FromString(values[pn]);
}
info.steps->SetCachedMeasureInfo(v);
}
else
{
// just recalc at time.
}
info.ssc_format= true;
}
void SetCredit(StepsTagInfo& info)
{
info.steps->SetCredit((*info.params)[1]);
@@ -623,6 +647,8 @@ struct ssc_parser_helper_t
steps_tag_handlers["SCROLLS"]= &SetStepsScrolls;
steps_tag_handlers["FAKES"]= &SetStepsFakes;
steps_tag_handlers["LABELS"]= &SetStepsLabels;
steps_tag_handlers["MEASUREINFO"] = &SetMeasureInfo;
/* If this is called, the chart does not use the same attacks
* as the Song's timing. No other changes are required. */
steps_tag_handlers["ATTACKS"]= &SetStepsAttacks;