From af29d7dab238ff074d0cfeb8b51019867f869a17 Mon Sep 17 00:00:00 2001 From: Jason Felds Date: Wed, 14 Oct 2015 20:23:40 -0400 Subject: [PATCH 1/2] Bring from 5_1_0: don't use insert with RString. --- src/RageFileManager.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/RageFileManager.cpp b/src/RageFileManager.cpp index ba5293245a..7ebe688e65 100644 --- a/src/RageFileManager.cpp +++ b/src/RageFileManager.cpp @@ -376,8 +376,14 @@ static void NormalizePath( RString &sPath ) { FixSlashesInPlace( sPath ); CollapsePath( sPath, true ); - if( sPath.size() == 0 || sPath[0] != '/' ) - sPath.insert( sPath.begin(), '/' ); + if (sPath.size() == 0) + { + sPath = '/'; + } + else if (sPath[0] != '/') + { + sPath = '/' + sPath; + } } bool ilt( const RString &a, const RString &b ) { return a.CompareNoCase(b) < 0; } From d63881802ae6c096726333d5f37895b702a0b49b Mon Sep 17 00:00:00 2001 From: zardoru Date: Thu, 15 Oct 2015 21:06:23 -0300 Subject: [PATCH 2/2] Make sure kb7 is the appropiate steps type. --- src/NotesLoaderBMS.cpp | 52 ++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 50 insertions(+), 2 deletions(-) diff --git a/src/NotesLoaderBMS.cpp b/src/NotesLoaderBMS.cpp index a6cf37615d..492e647680 100644 --- a/src/NotesLoaderBMS.cpp +++ b/src/NotesLoaderBMS.cpp @@ -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.