diff --git a/Makefile b/Makefile index 7890a08..90c6529 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,6 @@ BC_VAR_PROJECT_NAME=nostalgia BC_VAR_PROJECT_NAME_CAP=Nostalgia +BC_VAR_DEVENV_ROOT=util BUILDCORE_PATH=deps/buildcore include ${BUILDCORE_PATH}/base.mk @@ -13,7 +14,7 @@ endif .PHONY: pkg-gba pkg-gba: build - ${BC_CMD_ENVRUN} ${BC_PY3} ./scripts/pkg-gba.py sample_project ${BC_VAR_PROJECT_NAME} + ${BC_CMD_ENVRUN} ${BC_PY3} ./util/scripts/pkg-gba.py sample_project ${BC_VAR_PROJECT_NAME} .PHONY: run run: build diff --git a/deps/glad/CMakeLists.txt b/deps/glad/CMakeLists.txt index 740bd51..ea904c9 100644 --- a/deps/glad/CMakeLists.txt +++ b/deps/glad/CMakeLists.txt @@ -1,2 +1,11 @@ -add_library(glad OBJECT src/glad.c) -target_include_directories(glad PUBLIC include) \ No newline at end of file +add_library(glad src/glad.c) + +target_include_directories(glad PUBLIC include) + +install( + TARGETS + glad + DESTINATION + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib +) diff --git a/deps/imgui/CMakeLists.txt b/deps/imgui/CMakeLists.txt index 3fbdb9e..9fab8c0 100644 --- a/deps/imgui/CMakeLists.txt +++ b/deps/imgui/CMakeLists.txt @@ -6,7 +6,7 @@ endif() # DrinkingTea: end add_library( - imgui OBJECT + imgui imgui.cpp imgui_demo.cpp imgui_draw.cpp @@ -19,4 +19,12 @@ add_library( target_include_directories( imgui SYSTEM PUBLIC . -) \ No newline at end of file +) + +install( + TARGETS + imgui + DESTINATION + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib +) diff --git a/src/nostalgia/modules/core/include/nostalgia/core/gfx.hpp b/src/nostalgia/modules/core/include/nostalgia/core/gfx.hpp index a22461a..db6f013 100644 --- a/src/nostalgia/modules/core/include/nostalgia/core/gfx.hpp +++ b/src/nostalgia/modules/core/include/nostalgia/core/gfx.hpp @@ -102,8 +102,6 @@ OX_MODEL_BEGIN(TileSheetSet) OX_MODEL_FIELD(entries) OX_MODEL_END() -void addEntry(TileSheetSet &set, ox::FileAddress path, int32_t begin = 0, int32_t size = -1) noexcept; - [[nodiscard]] int tileColumns(Context&) noexcept; diff --git a/src/olympic/studio/applib/src/studioapp.cpp b/src/olympic/studio/applib/src/studioapp.cpp index 6e55154..204bfbf 100644 --- a/src/olympic/studio/applib/src/studioapp.cpp +++ b/src/olympic/studio/applib/src/studioapp.cpp @@ -66,7 +66,9 @@ StudioUI::StudioUI(turbine::Context &ctx, ox::StringParam projectDataDir) noexce auto openFileErr = openFileActiveTab(f, config.activeTabItemName == f); if (openFileErr) { oxErrorf("\nCould not open editor for file:\n\t{}\nReason:\n\t{}\n", f, toStr(openFileErr)); + continue; } + m_activeEditor = m_editors.back().value->get(); } } } else { @@ -194,26 +196,27 @@ void StudioUI::drawTabBar() noexcept { void StudioUI::drawTabs() noexcept { for (auto it = m_editors.begin(); it != m_editors.end();) { - auto const &e = *it; + auto const&e = *it; auto open = true; auto const unsavedChanges = e->unsavedChanges() ? ImGuiTabItemFlags_UnsavedDocument : 0; auto const selected = m_activeEditorUpdatePending == e.get() ? ImGuiTabItemFlags_SetSelected : 0; auto const flags = unsavedChanges | selected; if (ImGui::BeginTabItem(e->itemDisplayName().c_str(), &open, flags)) { - if (m_activeEditor != e.get()) { + if (m_activeEditor != e.get()) [[unlikely]] { m_activeEditor = e.get(); studio::editConfig(keelCtx(m_ctx), [&](StudioConfig &config) { config.activeTabItemName = m_activeEditor->itemPath(); }); + } else [[likely]] { + if (m_activeEditorUpdatePending == e.get()) [[unlikely]] { + m_activeEditorUpdatePending = nullptr; + } + if (m_activeEditorOnLastDraw != e.get()) [[unlikely]] { + m_activeEditor->onActivated(); + } + e->draw(m_sctx); + m_activeEditorOnLastDraw = e.get(); } - if (m_activeEditorUpdatePending == e.get()) { - m_activeEditorUpdatePending = nullptr; - } - if (m_activeEditorOnLastDraw != e.get()) [[unlikely]] { - m_activeEditor->onActivated(); - } - e->draw(m_sctx); - m_activeEditorOnLastDraw = e.get(); ImGui::EndTabItem(); } if (!open) { diff --git a/src/olympic/turbine/src/glfw/turbine.cpp b/src/olympic/turbine/src/glfw/turbine.cpp index 91147c2..d814823 100644 --- a/src/olympic/turbine/src/glfw/turbine.cpp +++ b/src/olympic/turbine/src/glfw/turbine.cpp @@ -50,6 +50,7 @@ ox::Result init( glfwInit(); OX_RETURN_ERROR(initGfx(*ctx)); glfwSetWindowSizeCallback(ctx->window, draw); + ctx->mandatoryRefreshPeriodEnd = ticksMs(*ctx) + config::MandatoryRefreshPeriod; return ox::UPtr(ctx.release()); } diff --git a/Dockerfile b/util/Dockerfile similarity index 99% rename from Dockerfile rename to util/Dockerfile index 702ff5e..2681785 100644 --- a/Dockerfile +++ b/util/Dockerfile @@ -1,4 +1,4 @@ -FROM fedora:36 +FROM fedora:41 RUN dnf update -y diff --git a/devenv/entrypoint.sh b/util/devenv/entrypoint.sh similarity index 100% rename from devenv/entrypoint.sh rename to util/devenv/entrypoint.sh diff --git a/devenv/pacman.conf b/util/devenv/pacman.conf similarity index 100% rename from devenv/pacman.conf rename to util/devenv/pacman.conf diff --git a/devenv/sudoers b/util/devenv/sudoers similarity index 100% rename from devenv/sudoers rename to util/devenv/sudoers diff --git a/scripts/pkg-gba.py b/util/scripts/pkg-gba.py similarity index 100% rename from scripts/pkg-gba.py rename to util/scripts/pkg-gba.py