//-------------------------------------------------------------------------- // Create a new area // 1) A rectangular area is located staring from the row and column of the region // 2) Two new candidate areas are pushed down to the stack: One from // the horizontal end and one from the top row, provide the slots are not // already done. // //-------------------------------------------------------------------------- void CImport::OpenArea(CRectArea *zon) { char row = zon->row; char col = zon->col; zon->lgx = 1; zon->lgz = 1; zon->iden = ridx; zon->end = 0; int No = (row << TC_BY32) + col; zon->type = Spot[No].GetType(); zon->elv = Spot[No].GetValue(); GetBaseRow(zon); GetLastRow(zon); AreaDone(zon); //---Add right and top area ---------------- if (zon->OpenToX()) { CRectArea *rzn = Stack + widx; rzn->col = zon->col + zon->lgx; rzn->row = zon->row; if (FreeSpot(rzn)) widx++; if (widx == AREA_STAK) gtfo ("too much areas"); } if (zon->OpenToZ()) { CRectArea *tzn = Stack + widx; tzn->col = zon->col; tzn->row = zon->row + zon->lgz; if (FreeSpot(tzn)) widx++; if (widx == AREA_STAK) gtfo ("too much areas"); } }
void NoteData::Convert2sAnd3sToHoldNotes() { // Any note will end a hold (not just a TAP_HOLD_TAIL). This makes parsing DWIs much easier. // Plus, allowing tap notes in the middle of a hold doesn't make sense! int rows = GetLastRow(); for( int col=0; col<m_iNumTracks; col++ ) // foreach column { for( int i=0; i<=rows; i++ ) // foreach TapNote element { if( GetTapNote(col,i).type != TapNote::hold_head ) // this is a HoldNote begin marker continue; SetTapNote(col, i, TAP_EMPTY); // clear the hold head marker for( int j=i+1; j<=rows; j++ ) // search for end of HoldNote { // End hold on the next note we see. This should be a hold_tail if the // data is in a consistent state, but doesn't have to be. if( GetTapNote(col, j).type == TapNote::empty ) continue; SetTapNote(col, j, TAP_EMPTY); AddHoldNote( HoldNote(col, i, j) ); break; // done searching for the end of this hold } } } }
/* "104444001" == * "102000301" * * "4441" basically means "hold for three rows then hold for another tap"; * since taps don't really have a length, it's equivalent to "4440". * So, make sure the character after a 4 is always a 0. */ void NoteData::Convert4sToHoldNotes() { int rows = GetLastRow(); for( int col=0; col<m_iNumTracks; col++ ) // foreach column { for( int i=0; i<=rows; i++ ) // foreach TapNote element { if( GetTapNote(col, i).type == TapNote::hold ) // this is a HoldNote body { HoldNote hn( col, i, 0 ); // search for end of HoldNote do { SetTapNote(col, i, TAP_EMPTY); i++; } while( GetTapNote(col, i).type == TapNote::hold ); SetTapNote(col, i, TAP_EMPTY); hn.iEndRow = i; AddHoldNote( hn ); } } } }
float NoteData::GetLastBeat() const { return NoteRowToBeat( GetLastRow() ); }