void DrawPrimitives() { if( GAMESTATE->IsPlayerEnabled(m_PlayerNumber) ) { DrawMask( m_fPercent ); // this is the "right endcap" to the life const float fChamberWidthInPercent = 1.0f/NUM_CHAMBERS; float fPercentBetweenStrips = 1.0f/NUM_STRIPS; // round this so that the chamber overflows align if( NUM_CHAMBERS > 10 ) fPercentBetweenStrips = froundf( fPercentBetweenStrips, fChamberWidthInPercent ); float fPercentOffset = fmodf( GAMESTATE->m_fSongBeat/4+1000, fPercentBetweenStrips ); ASSERT( fPercentOffset >= 0 && fPercentOffset <= fPercentBetweenStrips ); for( float f=fPercentOffset+1; f>=0; f-=fPercentBetweenStrips ) { DrawMask( f ); DrawStrip( f ); } } m_sprFrame.Draw(); }
// used by ArrowGetAlpha and ArrowGetGlow below static float ArrowGetPercentVisible( PlayerNumber pn, int iCol, float fYOffset, float fYReverseOffsetPixels ) { /* Get the YPos without reverse (that is, factor in EFFECT_TIPSY). */ float fYPos = ArrowGetYPos( pn, iCol, fYOffset, fYReverseOffsetPixels, false ); const float fDistFromCenterLine = fYPos - GetCenterLine( pn ); if( fYPos < 0 ) // past Gray Arrows return 1; // totally visible const float* fAppearances = GAMESTATE->m_CurrentPlayerOptions[pn].m_fAppearances; float fVisibleAdjust = 0; if( fAppearances[PlayerOptions::APPEARANCE_HIDDEN] > 0 ) { float fHiddenVisibleAdjust = SCALE( fYPos, GetHiddenStartLine(pn), GetHiddenEndLine(pn), 0, -1 ); CLAMP( fHiddenVisibleAdjust, -1, 0 ); fVisibleAdjust += fAppearances[PlayerOptions::APPEARANCE_HIDDEN] * fHiddenVisibleAdjust; } if( fAppearances[PlayerOptions::APPEARANCE_SUDDEN] > 0 ) { float fSuddenVisibleAdjust = SCALE( fYPos, GetSuddenStartLine(pn), GetSuddenEndLine(pn), -1, 0 ); CLAMP( fSuddenVisibleAdjust, -1, 0 ); fVisibleAdjust += fAppearances[PlayerOptions::APPEARANCE_SUDDEN] * fSuddenVisibleAdjust; } if( fAppearances[PlayerOptions::APPEARANCE_STEALTH] > 0 ) fVisibleAdjust -= fAppearances[PlayerOptions::APPEARANCE_STEALTH]; if( fAppearances[PlayerOptions::APPEARANCE_BLINK] > 0 ) { float f = sinf(RageTimer::GetTimeSinceStart()*10); f = froundf( f, 0.3333f ); fVisibleAdjust += SCALE( f, 0, 1, -1, 0 ); } if( fAppearances[PlayerOptions::APPEARANCE_RANDOMVANISH] > 0) { const float fRealFadeDist = 80; fVisibleAdjust += SCALE( fabsf(fDistFromCenterLine), fRealFadeDist, 2*fRealFadeDist, -1, 0 ) * fAppearances[PlayerOptions::APPEARANCE_RANDOMVANISH]; } return clamp( 1+fVisibleAdjust, 0, 1 ); }