From 2e7bb5457c9ed724911b3c13adda455e32df1ab1 Mon Sep 17 00:00:00 2001 From: Alberto Ramos Date: Sun, 22 Aug 2010 15:53:15 -0600 Subject: [PATCH] cleanup tweaks --- NoteSkins/pump/default/NoteSkin.lua | 14 ++- src/GhostArrowRow.cpp | 3 + src/NoteField.cpp | 4 +- src/NotesLoaderKSF.cpp | 147 +++++++++++++--------------- 4 files changed, 85 insertions(+), 83 deletions(-) diff --git a/NoteSkins/pump/default/NoteSkin.lua b/NoteSkins/pump/default/NoteSkin.lua index e272ae096a..d084ed4c17 100644 --- a/NoteSkins/pump/default/NoteSkin.lua +++ b/NoteSkins/pump/default/NoteSkin.lua @@ -8,6 +8,11 @@ Noteskin.bBlanks = { ["Roll Tail Inactive"] = true; ["Roll Tail Inactive"] = true; } +Noteskin.PartsToRotate = { + --["elemenu"] = true|false; + ["Roll Head Active"] = false; + ["Roll Head Inactive"] = false; +} Noteskin.ElementRedirs = { --["element"] = "redirected_element"; ["Hold Head Active"] = "Tap Note"; @@ -89,8 +94,13 @@ local function func() local t = LoadActor(path) - t.BaseRotationX=Noteskin.BaseRotX[sButton] - t.BaseRotationY=Noteskin.BaseRotY[sButton] + local bRotate = Noteskin.PartsToRotate[ElementToLoad] + --rotate by default + if bRotate == nil then bRotate = true end + if bRotate then + t.BaseRotationX=Noteskin.BaseRotX[sButton] + t.BaseRotationY=Noteskin.BaseRotY[sButton] + end return t end diff --git a/src/GhostArrowRow.cpp b/src/GhostArrowRow.cpp index f9a379bc04..8ff0c0581b 100644 --- a/src/GhostArrowRow.cpp +++ b/src/GhostArrowRow.cpp @@ -97,6 +97,8 @@ void GhostArrowRow::DidTapNote( int iCol, TapNoteScore tns, bool bBright ) Message msg("ColumnJudgment"); msg.SetParam( "TapNoteScore", tns ); + // This may be useful for popn styled judgment :) -DaisuMaster + msg.SetParam( "Column", iCol ); if( bBright ) msg.SetParam( "Bright", true ); m_Ghost[iCol]->HandleMessage( msg ); @@ -115,6 +117,7 @@ void GhostArrowRow::DidHoldNote( int iCol, HoldNoteScore hns, bool bBright ) ASSERT( iCol >= 0 && iCol < (int) m_Ghost.size() ); Message msg("ColumnJudgment"); msg.SetParam( "HoldNoteScore", hns ); + msg.SetParam( "Column", iCol ); if( bBright ) msg.SetParam( "Bright", true ); m_Ghost[iCol]->HandleMessage( msg ); diff --git a/src/NoteField.cpp b/src/NoteField.cpp index bc1f942b11..06b3f44790 100644 --- a/src/NoteField.cpp +++ b/src/NoteField.cpp @@ -942,9 +942,7 @@ void NoteField::FadeToFail() // don't fade all over again if this is called twice } void NoteField::Step( int iCol, TapNoteScore score ) { m_pCurDisplay->m_ReceptorArrowRow.Step( iCol, score ); } -void NoteField::SetPressed( int iCol ) { - m_pCurDisplay->m_ReceptorArrowRow.SetPressed( iCol ); -} +void NoteField::SetPressed( int iCol ) { m_pCurDisplay->m_ReceptorArrowRow.SetPressed( iCol ); } void NoteField::DidTapNote( int iCol, TapNoteScore score, bool bBright ) { m_pCurDisplay->m_GhostArrowRow.DidTapNote( iCol, score, bBright ); } void NoteField::DidHoldNote( int iCol, HoldNoteScore score, bool bBright ) { m_pCurDisplay->m_GhostArrowRow.DidHoldNote( iCol, score, bBright ); } diff --git a/src/NotesLoaderKSF.cpp b/src/NotesLoaderKSF.cpp index 0b13f5717e..e5ae61d747 100644 --- a/src/NotesLoaderKSF.cpp +++ b/src/NotesLoaderKSF.cpp @@ -220,36 +220,34 @@ static bool LoadFromKSFFile( const RString &sPath, Steps &out, const Song &song, } // Why do this? Rows made with precise DM05 tags can go up to 13 too -DaisuMaster - if( sRowString.size() != 13 ) + //if( sRowString.size() != 13 ) + if( bKIUCompliant ) { - if( bKIUCompliant ) - { - LOG->UserLog( "Song file", sPath, "has illegal syntax \"%s\" which can't be in KIU complient files.", - sRowString.c_str() ); - return false; - //In other words: you can't mix ksf's with DM05 tags and ksf's without any DM05 tags - //Either one set or another will be read... - } - if( BeginsWith(sRowString, "|B") || BeginsWith(sRowString, "|D") || BeginsWith(sRowString, "|E") ) - { - // These don't have to be worried about here: the changes and stops were already added. - continue; - } - else if ( BeginsWith(sRowString, "|T") ) - { - RString temp = sRowString.substr(2,sRowString.size()-3); - newTick = atoi(temp); - bTickChangeNeeded = true; - continue; - } - else - { - // Is this why improper ksf or some kiucompilant ksf mixed with dm05 ksf are ignored?? -DaisuMaster - //LOG->UserLog( "Song file", sPath, "has a RowString with an improper length \"%s\"; corrupt notes ignored.", - // sRowString.c_str() ); - //return false; - continue; - } + LOG->UserLog( "Song file", sPath, "has illegal syntax \"%s\" which can't be in KIU complient files.", + sRowString.c_str() ); + return false; + //In other words: you can't mix ksf's with DM05 tags and ksf's without any DM05 tags + //Either one set or another will be read... + } + if( BeginsWith(sRowString, "|B") || BeginsWith(sRowString, "|D") || BeginsWith(sRowString, "|E") ) + { + // These don't have to be worried about here: the changes and stops were already added. + continue; + } + else if ( BeginsWith(sRowString, "|T") ) + { + RString temp = sRowString.substr(2,sRowString.size()-3); + newTick = atoi(temp); + bTickChangeNeeded = true; + continue; + } + else + { + // Is this why improper ksf or some kiucompilant ksf mixed with dm05 ksf are ignored?? -DaisuMaster + //LOG->UserLog( "Song file", sPath, "has a RowString with an improper length \"%s\"; corrupt notes ignored.", + // sRowString.c_str() ); + //return false; + continue; } // Half-doubles is offset; "0011111100000". @@ -555,59 +553,52 @@ static bool LoadGlobalData( const RString &sPath, Song &out, bool &bKIUCompliant } // This is where the DMRequired test will take place. - if( NoteRowString.size() != 13) + if (BeginsWith(NoteRowString, "|T") || BeginsWith(NoteRowString, "|B") || + BeginsWith(NoteRowString, "|D") || BeginsWith(NoteRowString, "|E") ) { - if (BeginsWith(NoteRowString, "|T") || BeginsWith(NoteRowString, "|B") || - BeginsWith(NoteRowString, "|D") || BeginsWith(NoteRowString, "|E") ) + bDMRequired = true; + RString temp = NoteRowString.substr(2,NoteRowString.size()-3); + float numTemp = StringToFloat(temp); + if (BeginsWith(NoteRowString, "|T")) { - bDMRequired = true; - RString temp = NoteRowString.substr(2,NoteRowString.size()-3); - float numTemp = StringToFloat(temp); - if (BeginsWith(NoteRowString, "|T")) - { - iTickCount = (int)numTemp; - TimeSignatureSegment seg; - seg.m_iStartRow = BeatToNoteRow(fCurBeat); - seg.m_iNumerator = iTickCount > ROWS_PER_BEAT ? ROWS_PER_BEAT : iTickCount; - seg.m_iDenominator = 4; - out.m_Timing.AddTimeSignatureSegment( seg ); - - continue; - } - else if (BeginsWith(NoteRowString, "|B")) - { - float fCurBpm = (float)numTemp; - //out.m_Timing.AddBPMSegment( BPMSegment( BeatToNoteRow(fCurBeat), (float)numTemp ) ); - out.m_Timing.SetBPMAtBeat( fCurBeat, fCurBpm ); - continue; - } - else if (BeginsWith(NoteRowString, "|E")) - { - //Finally! the |E| tag is working as it should. I can die happy now -DaisuMaster - bool bDelay = true; - float fCurDelay = 60 / out.m_Timing.GetBPMAtBeat(fCurBeat) * (float)numTemp / iTickCount; - fCurDelay += out.m_Timing.GetStopAtRow(BeatToNoteRow(fCurBeat), bDelay); - out.m_Timing.SetStopAtBeat( fCurBeat, fCurDelay, true ); - continue; - } - else if (BeginsWith(NoteRowString, "|D")) - { - bool bDelay = true; - float fCurDelay = out.m_Timing.GetStopAtRow(BeatToNoteRow(fCurBeat), bDelay); - fCurDelay += (float)numTemp / 1000; - out.m_Timing.SetStopAtBeat( fCurBeat, fCurDelay, true ); - continue; - } - } - else - { - // Quit while we're ahead if any bad syntax is spotted. - //LOG->UserLog( "Song file", sPath, "has an invalid RowString \"%s\".", - // NoteRowString.c_str() ); - //return false; - //how about no? :D -DaisuMaster + iTickCount = (int)numTemp; + TimeSignatureSegment seg; + seg.m_iStartRow = BeatToNoteRow(fCurBeat); + seg.m_iNumerator = iTickCount > ROWS_PER_BEAT ? ROWS_PER_BEAT : iTickCount; + seg.m_iDenominator = 4; + out.m_Timing.AddTimeSignatureSegment( seg ); + continue; } + else if (BeginsWith(NoteRowString, "|B")) + { + float fCurBpm = (float)numTemp; + //out.m_Timing.AddBPMSegment( BPMSegment( BeatToNoteRow(fCurBeat), (float)numTemp ) ); + out.m_Timing.SetBPMAtBeat( fCurBeat, fCurBpm ); + continue; + } + else if (BeginsWith(NoteRowString, "|E")) + { + //Finally! the |E| tag is working as it should. I can die happy now -DaisuMaster + bool bDelay = true; + float fCurDelay = 60 / out.m_Timing.GetBPMAtBeat(fCurBeat) * (float)numTemp / iTickCount; + fCurDelay += out.m_Timing.GetStopAtRow(BeatToNoteRow(fCurBeat), bDelay); + out.m_Timing.SetStopAtBeat( fCurBeat, fCurDelay, true ); + continue; + } + else if (BeginsWith(NoteRowString, "|D")) + { + bool bDelay = true; + float fCurDelay = out.m_Timing.GetStopAtRow(BeatToNoteRow(fCurBeat), bDelay); + fCurDelay += (float)numTemp / 1000; + out.m_Timing.SetStopAtBeat( fCurBeat, fCurDelay, true ); + continue; + } + } + else + { + //ignore whatever else... + continue; } fCurBeat += 1.0f / iTickCount;