Re-fix Autogen (I'll shoot the person who forgot about TAP_EMPTY)

fix misc. errors with the BMS loader
finish support for 48th/64th notes in code
This commit is contained in:
Matt Denham
2003-11-13 07:35:58 +00:00
parent 755a3167ff
commit 686f0656bd
6 changed files with 27 additions and 9 deletions
+12 -6
View File
@@ -293,8 +293,9 @@ Actor * NoteDisplay::GetTapNoteActor( float fNoteBeat )
NoteType nt = NoteType(0);
if( cache->m_bTapNoteAnimationIsNoteColor )
nt = BeatToNoteType( fNoteBeat );
// NOTE_TYPE_INVALID is 192nds at this point.
if( nt == NOTE_TYPE_INVALID )
nt = NOTE_TYPE_32ND;
nt = NOTE_TYPE_192ND;
nt = min( nt, (NoteType) (NOTE_COLOR_IMAGES-1) );
Actor *pActorOut = m_pTapNote[nt];
@@ -338,8 +339,9 @@ Sprite * NoteDisplay::GetHoldTopCapSprite( float fNoteBeat, bool bActive )
NoteType nt = NoteType(0);
if( cache->m_bHoldTopCapAnimationIsNoteColor )
nt = BeatToNoteType( fNoteBeat );
// NOTE_TYPE_INVALID is 192nds at this point.
if( nt == NOTE_TYPE_INVALID )
nt = NOTE_TYPE_32ND;
nt = NOTE_TYPE_192ND;
nt = min( nt, (NoteType) (NOTE_COLOR_IMAGES-1) );
Sprite *pSpriteOut = bActive ? &m_sprHoldTopCapActive[nt] : &m_sprHoldTopCapInactive[nt];
@@ -359,8 +361,9 @@ Sprite * NoteDisplay::GetHoldBottomCapSprite( float fNoteBeat, bool bActive )
NoteType nt = NoteType(0);
if( cache->m_bHoldBottomCapAnimationIsNoteColor )
nt = BeatToNoteType( fNoteBeat );
// NOTE_TYPE_INVALID is 192nds at this point.
if( nt == NOTE_TYPE_INVALID )
nt = NOTE_TYPE_32ND;
nt = NOTE_TYPE_192ND;
nt = min( nt, (NoteType) (NOTE_COLOR_IMAGES-1) );
Sprite *pSpriteOut = bActive ? &m_sprHoldBottomCapActive[nt] : &m_sprHoldBottomCapInactive[nt];
@@ -381,8 +384,9 @@ Actor* NoteDisplay::GetHoldHeadActor( float fNoteBeat, bool bActive )
NoteType nt = NoteType(0);
if( cache->m_bHoldHeadAnimationIsNoteColor )
nt = BeatToNoteType( fNoteBeat );
// NOTE_TYPE_INVALID is 192nds at this point.
if( nt == NOTE_TYPE_INVALID )
nt = NOTE_TYPE_32ND;
nt = NOTE_TYPE_192ND;
nt = min( nt, (NoteType) (NOTE_COLOR_IMAGES-1) );
Actor *pActorOut = bActive ? m_pHoldHeadActive[nt] : m_pHoldHeadInactive[nt];
@@ -402,8 +406,9 @@ Sprite *NoteDisplay::GetHoldBodySprite( float fNoteBeat, bool bActive )
NoteType nt = NoteType(0);
if( cache->m_bHoldBodyAnimationIsNoteColor )
nt = BeatToNoteType( fNoteBeat );
// NOTE_TYPE_INVALID is 192nds at this point.
if( nt == NOTE_TYPE_INVALID )
nt = NOTE_TYPE_32ND;
nt = NOTE_TYPE_192ND;
nt = min( nt, (NoteType) (NOTE_COLOR_IMAGES-1) );
Sprite *pSpriteOut = bActive ? &m_sprHoldBodyActive[nt] : &m_sprHoldBodyInactive[nt];
@@ -423,8 +428,9 @@ Actor* NoteDisplay::GetHoldTailActor( float fNoteBeat, bool bActive )
NoteType nt = NoteType(0);
if( cache->m_bHoldTailAnimationIsNoteColor )
nt = BeatToNoteType( fNoteBeat );
// NOTE_TYPE_INVALID is 192nds at this point.
if( nt == NOTE_TYPE_INVALID )
nt = NOTE_TYPE_32ND;
nt = NOTE_TYPE_192ND;
nt = min( nt, (NoteType) (NOTE_COLOR_IMAGES-1) );
Actor *pActorOut = bActive ? m_pHoldTailActive[nt] : m_pHoldTailInactive[nt];
+1 -1
View File
@@ -53,7 +53,7 @@ protected:
struct NoteMetricCache_t *cache;
#define NOTE_COLOR_IMAGES 6
#define NOTE_COLOR_IMAGES 9
Actor* m_pTapNote[NOTE_COLOR_IMAGES];
Actor* m_pTapAddition;
+6 -1
View File
@@ -26,8 +26,12 @@ float NoteTypeToBeat( NoteType nt )
case NOTE_TYPE_64TH: return 1.0f/16;
// MD 11/03/03 - NOTE_TYPE_INVALID should be treated as equivalent to
// NOTE_TYPE_192ND; NOTE_TYPE_96TH should not exist.
// MD 11/12/03 - And, really, since NOTE_TYPE_192ND had to be added, we'll
// keep the behavior of NOTE_TYPE_INVALID being the same, but
// it shouldn't ever come up anyway.
case NOTE_TYPE_192ND: return 1.0f/48;
default: ASSERT(0); // and fall through
case NOTE_TYPE_INVALID: return 1.0f/48;
default: ASSERT(0); return 0;
}
}
@@ -56,6 +60,7 @@ CString NoteTypeToString( NoteType nt )
case NOTE_TYPE_32ND: return "32nd";
case NOTE_TYPE_48TH: return "48th";
case NOTE_TYPE_64TH: return "64th";
case NOTE_TYPE_192ND: // fall through
case NOTE_TYPE_INVALID: return "192nd";
default: ASSERT(0); return "";
}
+4
View File
@@ -49,6 +49,9 @@
int iTracks[MAX_NOTE_TRACKS];
void BMSLoader::ResetTracksMagic( void ) {
for (int ix = 0; ix<MAX_NOTE_TRACKS; ix++) iTracks[ix] = 0;
}
void BMSLoader::PushTrackNumForMagic( int iTrackNum ) {
int ix = (iTrackNum < 20) ? (iTrackNum - 11) : (iTrackNum - 12);
iTracks[ix]++;
@@ -150,6 +153,7 @@ bool BMSLoader::LoadFromBMSFile( const CString &sPath, Steps &out )
NoteData* pNoteData = new NoteData;
pNoteData->SetNumTracks( MAX_NOTE_TRACKS );
ResetTracksMagic();
ifstream file(sPath);
if( file.bad() )
+1
View File
@@ -10,6 +10,7 @@ class BMSLoader: public NotesLoader {
void mapBMSTrackToDanceNote( int iBMSTrack, int &iDanceColOut, char &cNoteCharOut );
void PushTrackNumForMagic( int iTrackNum );
StepsType CheckTracksMagic( void );
void ResetTracksMagic( void );
public:
void GetApplicableFiles( CString sPath, CStringArray &out );
+3 -1
View File
@@ -25,7 +25,9 @@ SnapDisplay::SnapDisplay()
for( i=0; i<2; i++ )
{
m_sprIndicators[i].Load( THEME->GetPathToG("SnapDisplay icon 8x1") );
ASSERT( m_sprIndicators[i].GetNumStates() == NUM_NOTE_TYPES );
// MD 11/12/03 - this assert doesn't allow us to set the editor's maximum
// resolution to less than the maximum one we have available. Meh.
// ASSERT( m_sprIndicators[i].GetNumStates() == NUM_NOTE_TYPES );
m_sprIndicators[i].StopAnimating();
this->AddChild( &m_sprIndicators[i] );
}