fix tweening when switching receptor note skins

This commit is contained in:
Glenn Maynard
2003-11-28 23:27:12 +00:00
parent c38d156a5b
commit a1a68b5beb
8 changed files with 46 additions and 1 deletions
+7
View File
@@ -952,3 +952,10 @@ void Actor::SetBlendMode( CString s )
else ASSERT(0);
}
void Actor::CopyTweening( const Actor &from )
{
m_current = from.m_current;
m_start = from.m_start;
m_TweenStates = from.m_TweenStates;
m_TweenInfo = from.m_TweenInfo;
}
+1 -1
View File
@@ -63,7 +63,7 @@ public:
bool IsFirstUpdate();
virtual void Update( float fDeltaTime );
virtual void UpdateTweening( float fDeltaTime );
virtual void CopyTweening( const Actor &from );
CString m_sName, m_sID;
+13
View File
@@ -125,3 +125,16 @@ void GhostArrowRow::DidTapMine( int iCol, TapNoteScore score )
{
m_GhostMine[iCol].Step( score );
}
void GhostArrowRow::CopyTweening( const GhostArrowRow &from )
{
for( int c=0; c<m_iNumCols; c++ )
{
m_GhostDim[c].CopyTweening( from.m_GhostDim[c] );
m_GhostBright[c].CopyTweening( from.m_GhostBright[c] );
m_GhostMine[c].CopyTweening( from.m_GhostMine[c] );
m_HoldGhost[c].CopyTweening( from.m_HoldGhost[c] );
}
ActorFrame::CopyTweening( from );
}
+1
View File
@@ -25,6 +25,7 @@ public:
GhostArrowRow();
virtual void Update( float fDeltaTime );
virtual void DrawPrimitives();
virtual void CopyTweening( const GhostArrowRow &from );
void Load( PlayerNumber pn, CString NoteSkin, float fYReverseOffset );
+6
View File
@@ -77,3 +77,9 @@ void GrayArrowRow::UpdateBars( int iCol )
m_GrayArrow[iCol].UpdateBars();
}
void GrayArrowRow::CopyTweening( const GrayArrowRow &from )
{
for( int c=0; c<m_iNumCols; c++ )
m_GrayArrow[c].CopyTweening( from.m_GrayArrow[c] );
ActorFrame::CopyTweening( from );
}
+1
View File
@@ -26,6 +26,7 @@ public:
virtual void Update( float fDeltaTime );
virtual void DrawPrimitives();
virtual void CopyTweening( const GrayArrowRow &from );
void Step( int iCol );
void UpdateBars( int iCol );
+15
View File
@@ -41,6 +41,7 @@ NoteField::NoteField()
m_fBeginMarker = m_fEndMarker = -1;
m_fPercentFadeToFail = -1;
LastDisplay = NULL;
}
NoteField::~NoteField()
@@ -147,6 +148,20 @@ void NoteField::Update( float fDeltaTime )
m_rectMarkerBar.Update( fDeltaTime );
NoteDisplayCols *cur = SearchForSongBeat();
if( cur != LastDisplay )
{
/* The display has changed. We might be in the middle of a step; copy any
* tweens. */
if( LastDisplay )
{
cur->m_GhostArrowRow.CopyTweening( LastDisplay->m_GhostArrowRow );
cur->m_GrayArrowRow.CopyTweening( LastDisplay->m_GrayArrowRow );
}
LastDisplay = cur;
}
cur->m_GrayArrowRow.Update( fDeltaTime );
cur->m_GhostArrowRow.Update( fDeltaTime );
+2
View File
@@ -93,6 +93,8 @@ protected:
NDMap m_BeatToNoteDisplays;
NoteDisplayCols *LastDisplay;
// used in MODE_EDIT
Sprite m_sprBars; // 4 frames: Measure, 4th, 8th, 16th
BitmapText m_textMeasureNumber;