Add preview point and fix offset support, and linear solo bms layout.
This commit is contained in:
+33
-8
@@ -216,7 +216,7 @@ struct bmsCommandTree
|
|||||||
{
|
{
|
||||||
|
|
||||||
struct bmsNodeS { // Each of these imply one branching level.
|
struct bmsNodeS { // Each of these imply one branching level.
|
||||||
int branchHeight;
|
unsigned int branchHeight;
|
||||||
enum {
|
enum {
|
||||||
CT_NULL,
|
CT_NULL,
|
||||||
CT_CONDITIONALCHAIN,
|
CT_CONDITIONALCHAIN,
|
||||||
@@ -772,10 +772,11 @@ struct BMSChartInfo {
|
|||||||
RString backgroundFile;
|
RString backgroundFile;
|
||||||
RString stageFile;
|
RString stageFile;
|
||||||
RString musicFile;
|
RString musicFile;
|
||||||
RString overrideMusicFile;
|
|
||||||
RString previewFile;
|
RString previewFile;
|
||||||
|
|
||||||
map<int, RString> backgroundChanges;
|
map<int, RString> backgroundChanges;
|
||||||
|
float previewStart;
|
||||||
|
BMSChartInfo() { previewStart = 0; }
|
||||||
};
|
};
|
||||||
|
|
||||||
class BMSChartReader {
|
class BMSChartReader {
|
||||||
@@ -865,10 +866,6 @@ void BMSChartReader::ReadHeaders()
|
|||||||
{
|
{
|
||||||
info.stageFile = it->second;
|
info.stageFile = it->second;
|
||||||
}
|
}
|
||||||
else if( it->first == "#wav" )
|
|
||||||
{
|
|
||||||
info.musicFile = it->second;
|
|
||||||
}
|
|
||||||
else if( it->first == "#bpm" )
|
else if( it->first == "#bpm" )
|
||||||
{
|
{
|
||||||
initialBPM = StringToFloat(it->second);
|
initialBPM = StringToFloat(it->second);
|
||||||
@@ -901,7 +898,8 @@ void BMSChartReader::ReadHeaders()
|
|||||||
}
|
}
|
||||||
else if (it->first == "#music")
|
else if (it->first == "#music")
|
||||||
{
|
{
|
||||||
info.overrideMusicFile = it->second;
|
info.musicFile = it->second;
|
||||||
|
out->SetMusicFile(it->second);
|
||||||
}
|
}
|
||||||
else if (it->first == "#preview")
|
else if (it->first == "#preview")
|
||||||
{
|
{
|
||||||
@@ -909,12 +907,15 @@ void BMSChartReader::ReadHeaders()
|
|||||||
}
|
}
|
||||||
else if (it->first == "#offset")
|
else if (it->first == "#offset")
|
||||||
{
|
{
|
||||||
|
// This gets copied into the real timing data later.
|
||||||
out->m_Timing.m_fBeat0OffsetInSeconds = -StringToFloat(it->second);
|
out->m_Timing.m_fBeat0OffsetInSeconds = -StringToFloat(it->second);
|
||||||
}
|
}
|
||||||
else if (it->first == "#maker")
|
else if (it->first == "#maker")
|
||||||
{
|
{
|
||||||
out->SetCredit(it->second);
|
out->SetCredit(it->second);
|
||||||
}
|
}
|
||||||
|
else if (it->first == "#previewpoint")
|
||||||
|
info.previewStart = StringToFloat(it->second);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1061,6 +1062,8 @@ bool BMSChartReader::ReadNoteData()
|
|||||||
NoteData nd;
|
NoteData nd;
|
||||||
TimingData td;
|
TimingData td;
|
||||||
|
|
||||||
|
td.m_fBeat0OffsetInSeconds = out->m_Timing.m_fBeat0OffsetInSeconds;
|
||||||
|
|
||||||
nd.SetNumTracks( tracks );
|
nd.SetNumTracks( tracks );
|
||||||
td.SetBPMAtRow( 0, currentBPM = initialBPM );
|
td.SetBPMAtRow( 0, currentBPM = initialBPM );
|
||||||
|
|
||||||
@@ -1103,12 +1106,22 @@ bool BMSChartReader::ReadNoteData()
|
|||||||
case StepsType_dance_solo:
|
case StepsType_dance_solo:
|
||||||
case StepsType_beat_single5:
|
case StepsType_beat_single5:
|
||||||
// Hey! Why are these exactly the same? :-)
|
// Hey! Why are these exactly the same? :-)
|
||||||
|
if (nonEmptyTracks.find(BMS_RAW_P1_TURN) != nonEmptyTracks.end()) { // Linear beat-5 layout
|
||||||
transform[0] = BMS_RAW_P1_KEY1;
|
transform[0] = BMS_RAW_P1_KEY1;
|
||||||
transform[1] = BMS_RAW_P1_KEY2;
|
transform[1] = BMS_RAW_P1_KEY2;
|
||||||
transform[2] = BMS_RAW_P1_KEY3;
|
transform[2] = BMS_RAW_P1_KEY3;
|
||||||
transform[3] = BMS_RAW_P1_KEY4;
|
transform[3] = BMS_RAW_P1_KEY4;
|
||||||
transform[4] = BMS_RAW_P1_KEY5;
|
transform[4] = BMS_RAW_P1_KEY5;
|
||||||
transform[5] = BMS_RAW_P1_TURN;
|
transform[5] = BMS_RAW_P1_TURN;
|
||||||
|
} else // Linear solo layout
|
||||||
|
{
|
||||||
|
transform[0] = BMS_RAW_P1_KEY1;
|
||||||
|
transform[1] = BMS_RAW_P1_KEY2;
|
||||||
|
transform[2] = BMS_RAW_P1_KEY3;
|
||||||
|
transform[3] = BMS_RAW_P1_KEY4;
|
||||||
|
transform[4] = BMS_RAW_P1_KEY5;
|
||||||
|
transform[5] = BMS_RAW_P1_KEY6;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case StepsType_popn_five:
|
case StepsType_popn_five:
|
||||||
transform[0] = BMS_RAW_P1_KEY3;
|
transform[0] = BMS_RAW_P1_KEY3;
|
||||||
@@ -1158,6 +1171,8 @@ bool BMSChartReader::ReadNoteData()
|
|||||||
transform[4] = BMS_RAW_P1_KEY4;
|
transform[4] = BMS_RAW_P1_KEY4;
|
||||||
transform[5] = BMS_RAW_P1_KEY5;
|
transform[5] = BMS_RAW_P1_KEY5;
|
||||||
transform[6] = BMS_RAW_P1_KEY6;
|
transform[6] = BMS_RAW_P1_KEY6;
|
||||||
|
|
||||||
|
if (tracks != 7)
|
||||||
transform[7] = BMS_RAW_P1_KEY7;
|
transform[7] = BMS_RAW_P1_KEY7;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -1169,6 +1184,8 @@ bool BMSChartReader::ReadNoteData()
|
|||||||
transform[4] = BMS_RAW_P1_KEY5;
|
transform[4] = BMS_RAW_P1_KEY5;
|
||||||
transform[5] = BMS_RAW_P1_KEY6;
|
transform[5] = BMS_RAW_P1_KEY6;
|
||||||
transform[6] = BMS_RAW_P1_KEY7;
|
transform[6] = BMS_RAW_P1_KEY7;
|
||||||
|
|
||||||
|
if (tracks != 7)
|
||||||
transform[7] = BMS_RAW_P1_TURN;
|
transform[7] = BMS_RAW_P1_TURN;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -1559,6 +1576,7 @@ void BMSSongLoader::AddToSong()
|
|||||||
|
|
||||||
{
|
{
|
||||||
const BMSStepsInfo &main = loadedSteps[mainIndex];
|
const BMSStepsInfo &main = loadedSteps[mainIndex];
|
||||||
|
|
||||||
out->m_sSongFileName = main.steps->GetFilename();
|
out->m_sSongFileName = main.steps->GetFilename();
|
||||||
if( main.info.title != "" )
|
if( main.info.title != "" )
|
||||||
NotesLoader::GetMainAndSubTitlesFromFullTitle( main.info.title, out->m_sMainTitle, out->m_sSubTitle );
|
NotesLoader::GetMainAndSubTitlesFromFullTitle( main.info.title, out->m_sMainTitle, out->m_sSubTitle );
|
||||||
@@ -1597,8 +1615,15 @@ void BMSSongLoader::AddToSong()
|
|||||||
}
|
}
|
||||||
|
|
||||||
out->m_sMusicFile = main.info.musicFile;
|
out->m_sMusicFile = main.info.musicFile;
|
||||||
out->m_PreviewFile= main.info.previewFile;
|
|
||||||
|
// Preview file only if it's different from one specified on #MUSIC so that previewStart is valid. -az
|
||||||
|
if (main.info.previewFile.length() && main.info.previewFile != main.info.musicFile)
|
||||||
|
{
|
||||||
|
out->m_PreviewFile = main.info.previewFile;
|
||||||
out->m_fMusicSampleLengthSeconds = 0.00f; // to ensure whole preview file is heard
|
out->m_fMusicSampleLengthSeconds = 0.00f; // to ensure whole preview file is heard
|
||||||
|
}
|
||||||
|
|
||||||
|
out->m_fMusicSampleStartSeconds = main.info.previewStart;
|
||||||
out->m_SongTiming = main.steps->m_Timing;
|
out->m_SongTiming = main.steps->m_Timing;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user