From 48d8017fa7fd189cbb33e1d10c9d83e536210e7e Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Fri, 26 Sep 2003 03:21:53 +0000 Subject: [PATCH] Move functions around. --- stepmania/src/ArrowEffects.cpp | 49 +++++++++++++++++----------------- stepmania/src/ArrowEffects.h | 13 +++++---- 2 files changed, 31 insertions(+), 31 deletions(-) diff --git a/stepmania/src/ArrowEffects.cpp b/stepmania/src/ArrowEffects.cpp index 4edad59faa..e8765108f1 100644 --- a/stepmania/src/ArrowEffects.cpp +++ b/stepmania/src/ArrowEffects.cpp @@ -84,6 +84,31 @@ float ArrowGetYOffset( PlayerNumber pn, int iCol, float fNoteBeat ) return fYOffset + fYAdjust; } +float ArrowGetYPosWithoutReverse( PlayerNumber pn, int iCol, float fYOffset ) +{ + float fYPos = fYOffset * GAMESTATE->m_CurrentPlayerOptions[pn].m_fScrollSpeed; + return fYPos; +} + +float ArrowGetYPos( PlayerNumber pn, int iCol, float fYOffset, float fYReverseOffsetPixels ) +{ + float f = ArrowGetYPosWithoutReverse(pn,iCol,fYOffset); + f *= SCALE( GAMESTATE->m_CurrentPlayerOptions[pn].GetReversePercentForColumn(iCol), 0.f, 1.f, 1.f, -1.f ); + + /* XXX: Hack: we need to scale the reverse shift by the zoom. */ + float fMiniPercent = GAMESTATE->m_CurrentPlayerOptions[pn].m_fEffects[PlayerOptions::EFFECT_MINI]; + float fZoom = 1 - fMiniPercent*0.5f; + + f += SCALE( GAMESTATE->m_CurrentPlayerOptions[pn].GetReversePercentForColumn(iCol), 0.f, 1.f, -fYReverseOffsetPixels/fZoom/2, fYReverseOffsetPixels/fZoom/2 ); + + const float* fEffects = GAMESTATE->m_CurrentPlayerOptions[pn].m_fEffects; + + if( fEffects[PlayerOptions::EFFECT_TIPSY] > 0 ) + f += fEffects[PlayerOptions::EFFECT_TIPSY] * ( cosf( RageTimer::GetTimeSinceStart()*1.2f + iCol*2.f) * ARROW_SIZE*0.4f ); + return f; +} + + float ArrowGetXPos( PlayerNumber pn, int iColNum, float fYPos ) { float fPixelOffsetFromCenter = 0; @@ -176,30 +201,6 @@ float ArrowGetRotation( PlayerNumber pn, float fNoteBeat ) return 0; } -float ArrowGetYPosWithoutReverse( PlayerNumber pn, int iCol, float fYOffset ) -{ - float fYPos = fYOffset * GAMESTATE->m_CurrentPlayerOptions[pn].m_fScrollSpeed; - return fYPos; -} - -float ArrowGetYPos( PlayerNumber pn, int iCol, float fYOffset, float fYReverseOffsetPixels ) -{ - float f = ArrowGetYPosWithoutReverse(pn,iCol,fYOffset); - f *= SCALE( GAMESTATE->m_CurrentPlayerOptions[pn].GetReversePercentForColumn(iCol), 0.f, 1.f, 1.f, -1.f ); - - /* XXX: Hack: we need to scale the reverse shift by the zoom. */ - float fMiniPercent = GAMESTATE->m_CurrentPlayerOptions[pn].m_fEffects[PlayerOptions::EFFECT_MINI]; - float fZoom = 1 - fMiniPercent*0.5f; - - f += SCALE( GAMESTATE->m_CurrentPlayerOptions[pn].GetReversePercentForColumn(iCol), 0.f, 1.f, -fYReverseOffsetPixels/fZoom/2, fYReverseOffsetPixels/fZoom/2 ); - - const float* fEffects = GAMESTATE->m_CurrentPlayerOptions[pn].m_fEffects; - - if( fEffects[PlayerOptions::EFFECT_TIPSY] > 0 ) - f += fEffects[PlayerOptions::EFFECT_TIPSY] * ( cosf( RageTimer::GetTimeSinceStart()*1.2f + iCol*2.f) * ARROW_SIZE*0.4f ); - return f; -} - const float fCenterLine = 160; // from fYPos == 0 const float fFadeDist = 100; diff --git a/stepmania/src/ArrowEffects.h b/stepmania/src/ArrowEffects.h index 8f1de72cc5..b1fa7eb10a 100644 --- a/stepmania/src/ArrowEffects.h +++ b/stepmania/src/ArrowEffects.h @@ -22,6 +22,12 @@ // The ArrowEffect is applied in this stage. float ArrowGetYOffset( PlayerNumber pn, int iCol, float fNoteBeat ); +// This value is fYOffset with fScrollSpeed factored in. +float ArrowGetYPosWithoutReverse( PlayerNumber pn, int iCol, float fYOffset ); + +// Actual display position, with reverse factored in. +float ArrowGetYPos( PlayerNumber pn, int iCol, float fYOffset, float fYReverseOffsetPixels ); + // fRotation is Z rotation of an arrow. This will depend on the column of // the arrow and possibly the Arrow effect and the fYOffset (in the case of @@ -29,13 +35,6 @@ float ArrowGetYOffset( PlayerNumber pn, int iCol, float fNoteBeat ); float ArrowGetRotation( PlayerNumber pn, float fNoteBeat ); -// fYPos is the position of the note in pixels relative to the center. -// (positive if has not yet been stepped on, negative if has already passed). -// This value is fYOffset with bReverseScroll and fScrollSpeed factored in. -float ArrowGetYPosWithoutReverse( PlayerNumber pn, int iCol, float fYOffset ); -float ArrowGetYPos( PlayerNumber pn, int iCol, float fYOffset, float fYReverseOffsetPixels ); - - // fXPos is a horizontal position in pixels relative to the center of the field. // This depends on the column of the arrow and possibly the Arrow effect and // fYPos (in the case of EFFECT_DRUNK).