Squashed 'deps/nostalgia/' changes from 430cae16..5e90f8d4

5e90f8d4 [studio] Move task runner to draw call
fd4619bc [studio,turbine] Fix Turbine sleep logic, tweak Studio default sleep values
128ddb2c [turbine/gba] Fix ticksMs function signature
f34704d8 [nostalgia/core/studio] Fix AddSubsheetCommand::undo to undo ID idx change
fb5d3545 [nostalgia/core/studio] Cleanup
2180f7bf [nostalgia/core] Fix validateSubSheetIdx
dcad4440 [keel] Make GBA AssetRef changeable

git-subtree-dir: deps/nostalgia
git-subtree-split: 5e90f8d45434fa36b6e113357cf05a6cf53bfae5
This commit is contained in:
2024-06-02 11:33:36 -05:00
parent a0d6019480
commit fc2dec6438
13 changed files with 48 additions and 51 deletions

View File

@@ -28,12 +28,6 @@ class StudioUIDrawer: public turbine::gl::Drawer {
}
};
static int updateHandler(turbine::Context &ctx) noexcept {
auto sctx = turbine::applicationData<studio::StudioContext>(ctx);
sctx->ui.update();
return 16;
}
static void keyEventHandler(turbine::Context &ctx, turbine::Key key, bool down) noexcept {
auto sctx = turbine::applicationData<studio::StudioContext>(ctx);
sctx->ui.handleKeyEvent(key, down);
@@ -45,9 +39,8 @@ static ox::Error runApp(
ox::UPtr<ox::FileSystem> &&fs) noexcept {
oxRequireM(ctx, turbine::init(std::move(fs), appName));
turbine::setWindowTitle(*ctx, keelCtx(*ctx).appName);
turbine::setUpdateHandler(*ctx, updateHandler);
turbine::setKeyEventHandler(*ctx, keyEventHandler);
turbine::setConstantRefresh(*ctx, false);
turbine::setRefreshWithin(*ctx, 0);
StudioUI ui(*ctx, projectDataDir);
StudioUIDrawer drawer(ui);
turbine::gl::addDrawer(*ctx, &drawer);
@@ -68,7 +61,7 @@ static ox::Error run(
static_cast<uint64_t>(time << 1)
});
// run app
auto const err = runApp(appName, projectDataDir, ox::UPtr<ox::FileSystem>(nullptr));
auto const err = runApp(appName, projectDataDir, ox::UPtr<ox::FileSystem>{});
oxAssert(err, "Something went wrong...");
return err;
}

View File

@@ -78,10 +78,6 @@ StudioUI::StudioUI(turbine::Context &ctx, ox::StringView projectDataDir) noexcep
}
}
void StudioUI::update() noexcept {
m_taskRunner.update(m_ctx);
}
void StudioUI::handleKeyEvent(turbine::Key key, bool down) noexcept {
for (auto p : m_popups) {
if (p->isOpen()) {
@@ -124,6 +120,7 @@ void StudioUI::draw() noexcept {
}
ImGui::End();
handleKeyInput();
m_taskRunner.update(m_ctx);
}
void StudioUI::drawMenu() noexcept {
@@ -212,7 +209,6 @@ void StudioUI::drawTabs() noexcept {
}
if (m_activeEditorOnLastDraw != e.get()) [[unlikely]] {
m_activeEditor->onActivated();
turbine::setConstantRefresh(m_ctx, m_activeEditor->requiresConstantRefresh());
}
e->draw(m_sctx);
m_activeEditorOnLastDraw = e.get();

View File

@@ -50,8 +50,6 @@ class StudioUI: public ox::SignalHandler {
public:
explicit StudioUI(turbine::Context &ctx, ox::StringView projectDataDir) noexcept;
void update() noexcept;
void handleKeyEvent(turbine::Key, bool down) noexcept;
[[nodiscard]]