Merge pull request #875 from zardoru/bms-stuff

Make sure kb7 is the appropiate steps type.
This commit is contained in:
Kyzentun
2015-10-16 00:27:52 -06:00
+50 -2
View File
@@ -962,8 +962,56 @@ StepsType BMSChartReader::DetermineStepsType()
// type, since they are more common.
//return StepsType_dance_solo;
return StepsType_beat_single5;
// az: Allow kb7 style charts
case 7: return StepsType_kb7_single;
// az: Allow kb7 style charts
case 7:
{
// az (for nixtrix): kb7 layouts do not leave any gaps using either of these layouts.
// if we find a compatible layout that doesn't have gaps, we've stumbled upon a real
// kb7 file.
BmsRawChannel layoutA[] = {
BMS_RAW_P1_TURN,
BMS_RAW_P1_KEY1,
BMS_RAW_P1_KEY2,
BMS_RAW_P1_KEY3,
BMS_RAW_P1_KEY4,
BMS_RAW_P1_KEY5,
BMS_RAW_P1_KEY6,
};
BmsRawChannel layoutB[] = {
BMS_RAW_P1_KEY1,
BMS_RAW_P1_KEY2,
BMS_RAW_P1_KEY3,
BMS_RAW_P1_KEY4,
BMS_RAW_P1_KEY5,
BMS_RAW_P1_KEY6,
BMS_RAW_P1_KEY7,
};
int gaps = 0;
for (int i = 0; i < 7; i++)
{
if (nonEmptyTracks.find(layoutA[i]) == nonEmptyTracks.end())
gaps++;
}
if (gaps == 0) // kb7 file is a layout A file
return StepsType_kb7_single;
gaps = 0;
for (int i = 0; i < 7; i++)
{
if (nonEmptyTracks.find(layoutB[i]) == nonEmptyTracks.end())
gaps++;
}
if (gaps == 0) // kb7 file is a layout B file
return StepsType_kb7_single;
// neither huh, then it's a beatmania file that for some reason
// um, chose to not fill in a lane.
return StepsType_beat_single7;
}
case 8: return StepsType_beat_single7;
case 9: return StepsType_popn_nine;
// XXX: Some double files doesn't have #player.