mirror of
https://github.com/J-D-K/JKSV.git
synced 2026-09-09 11:05:12 -05:00
Initial commit. Needs debugging.
This commit is contained in:
@@ -15,41 +15,45 @@ class DataLoadingState final : public BaseTask
|
||||
using DestructFunction = std::function<void()>;
|
||||
|
||||
DataLoadingState(data::DataContext &context,
|
||||
sdl2::Renderer &renderer,
|
||||
DestructFunction destructFunction,
|
||||
sys::threadpool::JobFunction function,
|
||||
sys::Task::TaskData taskData);
|
||||
|
||||
static inline std::shared_ptr<DataLoadingState> create(data::DataContext &context,
|
||||
sdl2::Renderer &renderer,
|
||||
DestructFunction destructFunction,
|
||||
sys::threadpool::JobFunction function,
|
||||
sys::Task::TaskData taskData)
|
||||
{
|
||||
return std::make_shared<DataLoadingState>(context, destructFunction, function, taskData);
|
||||
}
|
||||
{ return std::make_shared<DataLoadingState>(context, renderer, destructFunction, function, taskData); }
|
||||
|
||||
static inline std::shared_ptr<DataLoadingState> create_and_push(data::DataContext &context,
|
||||
sdl2::Renderer &renderer,
|
||||
DestructFunction destructFunction,
|
||||
sys::threadpool::JobFunction function,
|
||||
sys::Task::TaskData taskData)
|
||||
{
|
||||
auto newState = DataLoadingState::create(context, destructFunction, function, taskData);
|
||||
auto newState = DataLoadingState::create(context, renderer, destructFunction, function, taskData);
|
||||
StateManager::push_state(newState);
|
||||
return newState;
|
||||
}
|
||||
|
||||
/// @brief Update override.
|
||||
void update() override;
|
||||
void update(const sdl2::Input &input) override;
|
||||
|
||||
/// @brief Updates the loading glyph.
|
||||
void sub_update() override;
|
||||
|
||||
/// @brief Render override.
|
||||
void render() override;
|
||||
void render(sdl2::Renderer &renderer) override;
|
||||
|
||||
private:
|
||||
/// @brief Reference to the data context to run post-init operations.
|
||||
data::DataContext &m_context;
|
||||
|
||||
/// @brief Reference to SDL2 renderer for loading icons.
|
||||
sdl2::Renderer &m_renderer;
|
||||
|
||||
/// @brief X coord of the status text.
|
||||
int m_statusX{};
|
||||
|
||||
@@ -57,7 +61,10 @@ class DataLoadingState final : public BaseTask
|
||||
DestructFunction m_destructFunction{};
|
||||
|
||||
/// @brief Icon displayed in the center of the screen.
|
||||
static inline sdl::SharedTexture sm_jksvIcon{};
|
||||
static inline sdl2::SharedTexture sm_jksvIcon{};
|
||||
|
||||
/// @brief Font used for rendering the status.
|
||||
static inline sdl2::SharedFont sm_font{};
|
||||
|
||||
/// @brief Loads the icon if it hasn't been already.
|
||||
void initialize_static_members();
|
||||
|
||||
Reference in New Issue
Block a user