Move functions around.
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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).
|
||||
|
||||
Reference in New Issue
Block a user