mirror of
https://github.com/J-D-K/JKSV.git
synced 2026-09-12 20:45:11 -05:00
Add DataContext for data cleanup, add cache invalidation at boot.
This commit is contained in:
@@ -1,19 +1,26 @@
|
||||
#include "appstates/DataLoadingState.hpp"
|
||||
|
||||
#include "appstates/FadeState.hpp"
|
||||
#include "colors.hpp"
|
||||
#include "logger.hpp"
|
||||
|
||||
namespace
|
||||
{
|
||||
constexpr int SCREEN_CENTER = 640;
|
||||
}
|
||||
|
||||
DataLoadingState::~DataLoadingState() { DataLoadingState::execute_destructs(); }
|
||||
DataLoadingState::~DataLoadingState()
|
||||
{
|
||||
// This is to catch stragglers.
|
||||
m_context.process_icon_queue();
|
||||
if (m_destructFunction) { m_destructFunction(); }
|
||||
}
|
||||
|
||||
void DataLoadingState::update()
|
||||
{
|
||||
static constexpr int SCREEN_CENTER = 640;
|
||||
|
||||
m_context.process_icon_queue();
|
||||
|
||||
BaseTask::update();
|
||||
const std::string status = m_task->get_status();
|
||||
const int statusWidth = sdl::text::get_width(22, status);
|
||||
@@ -32,16 +39,6 @@ void DataLoadingState::render()
|
||||
BaseTask::render_loading_glyph();
|
||||
}
|
||||
|
||||
void DataLoadingState::execute_destructs()
|
||||
{
|
||||
for (auto &function : m_destructFunctions) { function(); }
|
||||
}
|
||||
|
||||
void DataLoadingState::add_destruct_function(DataLoadingState::DestructFunction function)
|
||||
{
|
||||
m_destructFunctions.push_back(function);
|
||||
}
|
||||
|
||||
void DataLoadingState::initialize_static_members()
|
||||
{
|
||||
if (sm_jksvIcon) { return; }
|
||||
|
||||
Reference in New Issue
Block a user