[studio,turbine] Fix Turbine sleep logic, tweak Studio default sleep values
All checks were successful
Build / build (push) Successful in 2m34s

This commit is contained in:
2024-06-01 01:20:01 -05:00
parent 128ddb2ca6
commit fd4619bc25
6 changed files with 18 additions and 12 deletions

View File

@ -31,7 +31,7 @@ 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;
return 1000;
}
static void keyEventHandler(turbine::Context &ctx, turbine::Key key, bool down) noexcept {
@ -47,7 +47,7 @@ static ox::Error runApp(
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 +68,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

@ -212,7 +212,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();