remove compression stuff; unused
This commit is contained in:
@@ -31,7 +31,6 @@ NoteData::NoteData()
|
|||||||
void NoteData::Init()
|
void NoteData::Init()
|
||||||
{
|
{
|
||||||
m_iNumTracks = 0;
|
m_iNumTracks = 0;
|
||||||
TapRowDivisor = 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
NoteData::~NoteData()
|
NoteData::~NoteData()
|
||||||
@@ -87,7 +86,6 @@ void NoteData::CopyRange( NoteData* pFrom, int iFromIndexBegin, int iFromIndexEn
|
|||||||
void NoteData::Config( const NoteData &From )
|
void NoteData::Config( const NoteData &From )
|
||||||
{
|
{
|
||||||
m_iNumTracks = From.m_iNumTracks;
|
m_iNumTracks = From.m_iNumTracks;
|
||||||
TapRowDivisor = From.TapRowDivisor;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void NoteData::CopyAll( NoteData* pFrom )
|
void NoteData::CopyAll( NoteData* pFrom )
|
||||||
@@ -214,7 +212,7 @@ float NoteData::GetLastBeat() const
|
|||||||
|
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for( i = TapRowDivisor * int(m_TapNotes[0].size()); i>=0; i-- ) // iterate back to front
|
for( i = int(m_TapNotes[0].size()); i>=0; i-- ) // iterate back to front
|
||||||
{
|
{
|
||||||
if( !IsRowEmpty(i) )
|
if( !IsRowEmpty(i) )
|
||||||
{
|
{
|
||||||
@@ -532,47 +530,10 @@ void NoteData::SetTapNote(int track, int row, TapNote t)
|
|||||||
{
|
{
|
||||||
if(row < 0) return;
|
if(row < 0) return;
|
||||||
|
|
||||||
/* Decompress if needed. */
|
|
||||||
if((row % TapRowDivisor) != 0)
|
|
||||||
SetDivisor(1);
|
|
||||||
|
|
||||||
PadTapNotes(row);
|
PadTapNotes(row);
|
||||||
row /= TapRowDivisor;
|
|
||||||
m_TapNotes[track][row]=t;
|
m_TapNotes[track][row]=t;
|
||||||
}
|
}
|
||||||
|
|
||||||
void NoteData::SetDivisor(int div)
|
|
||||||
{
|
|
||||||
if(div == TapRowDivisor)
|
|
||||||
return;
|
|
||||||
|
|
||||||
int src_step = div,
|
|
||||||
dst_step = TapRowDivisor;
|
|
||||||
|
|
||||||
/* I think this should work to go from one divisor to another, but
|
|
||||||
* I havn't tested it and don't see a need. */
|
|
||||||
ASSERT(src_step == 1 || dst_step == 1);
|
|
||||||
|
|
||||||
for(int t=0; t < m_iNumTracks; t++)
|
|
||||||
{
|
|
||||||
vector<TapNote> TapNotes = m_TapNotes[t];
|
|
||||||
/* Try to make sure the memory is actually released. */
|
|
||||||
int dst_size = m_TapNotes[0].size() * dst_step / src_step;
|
|
||||||
m_TapNotes[t].clear();
|
|
||||||
m_TapNotes[t] = vector<TapNote>(dst_size, TAP_EMPTY);
|
|
||||||
|
|
||||||
unsigned src_row = 0, dst_row = 0;
|
|
||||||
while(src_row < TapNotes.size() && dst_row < m_TapNotes[t].size())
|
|
||||||
{
|
|
||||||
m_TapNotes[t][dst_row] = TapNotes[src_row];
|
|
||||||
dst_row += dst_step;
|
|
||||||
src_row += src_step;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
TapRowDivisor = div;
|
|
||||||
}
|
|
||||||
|
|
||||||
NoteType NoteDataUtil::GetSmallestNoteTypeForMeasure( const NoteData &n, int iMeasureIndex )
|
NoteType NoteDataUtil::GetSmallestNoteTypeForMeasure( const NoteData &n, int iMeasureIndex )
|
||||||
{
|
{
|
||||||
const int iMeasureStartIndex = iMeasureIndex * ROWS_PER_MEASURE;
|
const int iMeasureStartIndex = iMeasureIndex * ROWS_PER_MEASURE;
|
||||||
|
|||||||
@@ -27,9 +27,6 @@ class NoteData
|
|||||||
{
|
{
|
||||||
/* Keep this aligned, so that they all have the same size. */
|
/* Keep this aligned, so that they all have the same size. */
|
||||||
vector<TapNote> m_TapNotes[MAX_NOTE_TRACKS];
|
vector<TapNote> m_TapNotes[MAX_NOTE_TRACKS];
|
||||||
int TapRowDivisor;
|
|
||||||
void SetDivisor(int div);
|
|
||||||
|
|
||||||
vector<HoldNote> m_HoldNotes;
|
vector<HoldNote> m_HoldNotes;
|
||||||
|
|
||||||
/* Pad m_TapNotes so it includes the row "rows". */
|
/* Pad m_TapNotes so it includes the row "rows". */
|
||||||
@@ -50,12 +47,9 @@ public:
|
|||||||
* range; pretend the song goes on with TAP_EMPTYs indefinitely. */
|
* range; pretend the song goes on with TAP_EMPTYs indefinitely. */
|
||||||
inline TapNote GetTapNote(unsigned track, unsigned row) const
|
inline TapNote GetTapNote(unsigned track, unsigned row) const
|
||||||
{
|
{
|
||||||
if((row % TapRowDivisor) != 0) return TapNote(TAP_EMPTY);
|
|
||||||
row /= TapRowDivisor;
|
|
||||||
if(row < 0 || row >= m_TapNotes[track].size()) return TapNote(TAP_EMPTY);
|
if(row < 0 || row >= m_TapNotes[track].size()) return TapNote(TAP_EMPTY);
|
||||||
return m_TapNotes[track][row];
|
return m_TapNotes[track][row];
|
||||||
}
|
}
|
||||||
int GetTapNoteIncrement() const { return TapRowDivisor; }
|
|
||||||
void MoveTapNoteTrack(int dest, int src);
|
void MoveTapNoteTrack(int dest, int src);
|
||||||
void SetTapNote(int track, int row, TapNote t);
|
void SetTapNote(int track, int row, TapNote t);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user