Remove timer from text_glow math
text_glow is part of DrawPrimitives(), and is used just about everywhere, so it is a huge burden taken off the timer to instead increment a counter.
This commit is contained in:
+9
-1
@@ -867,7 +867,15 @@ void NoteField::DrawPrimitives()
|
||||
ASSERT(GAMESTATE->m_pCurSong != nullptr);
|
||||
|
||||
const TimingData &timing = *pTiming;
|
||||
const RageColor text_glow= RageColor(1,1,1,std::cos(RageTimer::GetTimeSinceStartFast()*2)/2+0.5f);
|
||||
|
||||
// Create an oscillating / pulsing glow effect.
|
||||
// Converts a counter to radians and uses the cosine for a cyclic appearance.
|
||||
static std::uint_fast16_t iGlowCounter;
|
||||
static constexpr float fCyclical = 2.0f * 3.14159265f / 360.0f;
|
||||
iGlowCounter = (iGlowCounter + 1) % 360;
|
||||
float phase = iGlowCounter * fCyclical;
|
||||
float glow = std::cos(phase) * 0.5f + 0.5f;
|
||||
const RageColor text_glow = RageColor(1.0f, 1.0f, 1.0f, glow);
|
||||
|
||||
float horiz_align= align_right;
|
||||
float side_sign= 1;
|
||||
|
||||
Reference in New Issue
Block a user