mirror of
https://github.com/J-D-K/JKSV.git
synced 2026-03-22 01:34:13 -05:00
38 lines
841 B
C++
38 lines
841 B
C++
#include "appstates/BaseTask.hpp"
|
|
#include "colors.hpp"
|
|
|
|
namespace
|
|
{
|
|
/// @brief This is the time in milliseconds between changing glyphs.
|
|
constexpr uint64_t TICKS_GLYPH_TRIGGER = 50;
|
|
} // namespace
|
|
|
|
BaseTask::BaseTask(void) : AppState(false)
|
|
{
|
|
m_frameTimer.start(TICKS_GLYPH_TRIGGER);
|
|
}
|
|
|
|
void BaseTask::update(void)
|
|
{
|
|
// Just bail if the timer wasn't triggered yet.
|
|
if (!m_frameTimer.is_triggered())
|
|
{
|
|
return;
|
|
}
|
|
|
|
// Reset to 0 here.
|
|
if (++m_currentFrame >= 8)
|
|
{
|
|
m_currentFrame = 0;
|
|
}
|
|
|
|
// Update the color pulse.
|
|
m_colorMod.update();
|
|
}
|
|
|
|
void BaseTask::render_loading_glyph(void)
|
|
{
|
|
// This assumes it's being called after the background was dimmed.
|
|
sdl::text::render(NULL, 56, 673, 32, sdl::text::NO_TEXT_WRAP, m_colorMod, sm_glyphArray.at(m_currentFrame).data());
|
|
}
|