Reimplement Wii loading glyph for tasks.

This commit is contained in:
J-D-K
2025-06-13 11:23:59 -04:00
parent 5c0333c704
commit 5cab0d505b
10 changed files with 111 additions and 20 deletions

View File

@@ -0,0 +1,37 @@
#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());
}