diff --git a/deps/nostalgia/release-notes.md b/deps/nostalgia/release-notes.md index 5b72b78..b0c4b38 100644 --- a/deps/nostalgia/release-notes.md +++ b/deps/nostalgia/release-notes.md @@ -3,6 +3,11 @@ * Add ability to remember recent projects in config * PaletteEditor: Add RGB key shortcuts for focusing color channels +# d2025.05.2 + +* TileSheetEditor: Fix manual redo of draw actions, fix drawing to pixel 0, 0 as first action (cce5f52f96511694afd98f0b9b6b1f19c06ecd20) +* TileSheetEditor: Fix draw command to work on same pixel after switching subsheets (514cb978351ee4b0a5335c22a506a6d9f608f0a7) + # d2025.05.1 * TileSheetEditor: Fix overrun errors when switching subsheets, clear selection diff --git a/deps/nostalgia/src/nostalgia/modules/gfx/src/gfx-gba.cpp b/deps/nostalgia/src/nostalgia/modules/gfx/src/gfx-gba.cpp index 169933d..d264c02 100644 --- a/deps/nostalgia/src/nostalgia/modules/gfx/src/gfx-gba.cpp +++ b/deps/nostalgia/src/nostalgia/modules/gfx/src/gfx-gba.cpp @@ -350,7 +350,7 @@ void panic(const char *file, int line, const char *panicMsg, ox::Error const&err const auto heapEnd = reinterpret_cast(MEM_EWRAM_BEGIN + heapSz); ox::heapmgr::initHeap(heapBegin, heapEnd); OX_ALLOW_UNSAFE_BUFFERS_END - auto tctx = turbine::init(keel::loadRomFs("").unwrap(), "Nostalgia").unwrap(); + auto tctx = turbine::init(keel::loadRomFs("").unwrap(), "Nostalgia").unwrap(); auto ctx = init(*tctx).unwrap(); std::ignore = initGfx(); std::ignore = initConsole(*ctx); diff --git a/deps/nostalgia/src/nostalgia/modules/gfx/src/studio/tilesheeteditor/tilesheeteditormodel.cpp b/deps/nostalgia/src/nostalgia/modules/gfx/src/studio/tilesheeteditor/tilesheeteditormodel.cpp index 18b2955..89bdf29 100644 --- a/deps/nostalgia/src/nostalgia/modules/gfx/src/studio/tilesheeteditor/tilesheeteditormodel.cpp +++ b/deps/nostalgia/src/nostalgia/modules/gfx/src/studio/tilesheeteditor/tilesheeteditormodel.cpp @@ -126,7 +126,7 @@ void TileSheetEditorModel::paste() { auto const pt1 = m_selection->a; auto const pt2 = ox::Point{s.columns * TileWidth, s.rows * TileHeight}; if (auto const cmd = ox::makeCatch( - CommandId::Paste, m_img, m_activeSubsSheetIdx, pt1, pt2, *cb); cmd.ok()) { + CommandId::Paste, m_img, m_activeSubsSheetIdx, pt1, pt2, *cb); cmd.value) { std::ignore = pushCommand(cmd.value); } } @@ -198,41 +198,43 @@ void TileSheetEditorModel::endDrawCommand() noexcept { if (m_ongoingDrawCommand) { m_ongoingDrawCommand->finish(); m_ongoingDrawCommand = nullptr; + m_lastDrawUpdatePt = {-1, -1}; } } -void TileSheetEditorModel::addSubsheet(TileSheet::SubSheetIdx const&parentIdx) noexcept { +void TileSheetEditorModel::addSubsheet(TileSheet::SubSheetIdx const &parentIdx) noexcept { std::ignore = pushCommand(ox::make(m_img, parentIdx)); } -void TileSheetEditorModel::rmSubsheet(TileSheet::SubSheetIdx const&idx) noexcept { +void TileSheetEditorModel::rmSubsheet(TileSheet::SubSheetIdx const &idx) noexcept { std::ignore = pushCommand(ox::make(m_img, idx)); } void TileSheetEditorModel::insertTiles( - TileSheet::SubSheetIdx const&idx, std::size_t const tileIdx, std::size_t const tileCnt) noexcept { + TileSheet::SubSheetIdx const &idx, std::size_t const tileIdx, std::size_t const tileCnt) noexcept { std::ignore = pushCommand(ox::make(m_img, idx, tileIdx, tileCnt)); } void TileSheetEditorModel::deleteTiles( - TileSheet::SubSheetIdx const&idx, std::size_t const tileIdx, std::size_t const tileCnt) noexcept { + TileSheet::SubSheetIdx const &idx, std::size_t const tileIdx, std::size_t const tileCnt) noexcept { std::ignore = pushCommand(ox::make(m_img, idx, tileIdx, tileCnt)); } ox::Error TileSheetEditorModel::updateSubsheet( - TileSheet::SubSheetIdx const&idx, ox::StringViewCR name, int const cols, int const rows) noexcept { + TileSheet::SubSheetIdx const &idx, ox::StringViewCR name, int const cols, int const rows) noexcept { OX_REQUIRE(cmd, ox::makeCatch(m_img, idx, name, cols, rows)); std::ignore = pushCommand(cmd); return {}; } -void TileSheetEditorModel::setActiveSubsheet(TileSheet::SubSheetIdx const&idx) noexcept { +void TileSheetEditorModel::setActiveSubsheet(TileSheet::SubSheetIdx const &idx) noexcept { m_activeSubsSheetIdx = idx; this->activeSubsheetChanged.emit(m_activeSubsSheetIdx); clearSelection(); + m_lastDrawUpdatePt = {-1, -1}; } -void TileSheetEditorModel::fill(ox::Point const&pt, int const palIdx) noexcept { +void TileSheetEditorModel::fill(ox::Point const &pt, uint8_t const palIdx) noexcept { auto const&activeSubSheet = getSubSheet(m_img, m_activeSubsSheetIdx); // build idx list if (pt.x >= activeSubSheet.columns * TileWidth || pt.y >= activeSubSheet.rows * TileHeight) { @@ -279,7 +281,7 @@ ox::Error TileSheetEditorModel::rotateRight() noexcept { m_img, m_activeSubsSheetIdx, pt1, pt2, RotateCommand::Direction::Right)); } -void TileSheetEditorModel::setSelection(studio::Selection const&sel) noexcept { +void TileSheetEditorModel::setSelection(studio::Selection const &sel) noexcept { auto const &ss = activeSubSheet(); if (sel.a.x < ss.columns * TileWidth && sel.a.y < ss.rows * TileHeight) { m_selection.emplace(sel); @@ -290,7 +292,7 @@ void TileSheetEditorModel::setSelection(studio::Selection const&sel) noexcept { m_updated = true; } -void TileSheetEditorModel::select(ox::Point const&pt) noexcept { +void TileSheetEditorModel::select(ox::Point const &pt) noexcept { if (m_selTracker.updateCursorPoint(pt)) { setSelection(m_selTracker.selection()); } @@ -317,7 +319,7 @@ bool TileSheetEditorModel::updated() const noexcept { return m_updated; } -ox::Error TileSheetEditorModel::markUpdatedCmdId(studio::UndoCommand const*cmd) noexcept { +ox::Error TileSheetEditorModel::markUpdatedCmdId(studio::UndoCommand const *cmd) noexcept { m_updated = true; auto const cmdId = cmd->commandId(); if (static_cast(cmdId) == CommandId::PaletteChange) { @@ -393,9 +395,9 @@ ox::Error TileSheetEditorModel::moveSubSheet(TileSheet::SubSheetIdx src, TileShe void TileSheetEditorModel::getFillPixels( TileSheet::SubSheet const&activeSubSheet, - ox::Span pixels, - ox::Point const&pt, - int const oldColor) const noexcept { + ox::Span const pixels, + ox::Point const &pt, + uint8_t const oldColor) noexcept { auto const idx = ptToIdx(pt, activeSubSheet.columns); auto const relIdx = idx % PixelsPerTile; if (pixels[relIdx] || activeSubSheet.pixels[idx] != oldColor) { diff --git a/deps/nostalgia/src/nostalgia/modules/gfx/src/studio/tilesheeteditor/tilesheeteditormodel.hpp b/deps/nostalgia/src/nostalgia/modules/gfx/src/studio/tilesheeteditor/tilesheeteditormodel.hpp index 4663306..fae6401 100644 --- a/deps/nostalgia/src/nostalgia/modules/gfx/src/studio/tilesheeteditor/tilesheeteditormodel.hpp +++ b/deps/nostalgia/src/nostalgia/modules/gfx/src/studio/tilesheeteditor/tilesheeteditormodel.hpp @@ -14,7 +14,7 @@ namespace nostalgia::gfx { -class TileSheetEditorModel: public ox::SignalHandler { +class TileSheetEditorModel final: public ox::SignalHandler { public: ox::Signal activeSubsheetChanged; @@ -35,7 +35,7 @@ class TileSheetEditorModel: public ox::SignalHandler { studio::SelectionTracker m_selTracker; ox::Optional m_selection; ox::Point m_lineStartPt; - ox::Point m_lastDrawUpdatePt; + ox::Point m_lastDrawUpdatePt{-1, -1}; bool m_updated = false; public: @@ -53,13 +53,13 @@ class TileSheetEditorModel: public ox::SignalHandler { bool acceptsClipboardPayload() const noexcept; [[nodiscard]] - constexpr TileSheet const&img() const noexcept; + constexpr TileSheet const &img() const noexcept; [[nodiscard]] constexpr TileSheet &img() noexcept; [[nodiscard]] - constexpr Palette const&pal() const noexcept; + constexpr Palette const &pal() const noexcept; [[nodiscard]] ox::String const &palPath() const & noexcept; @@ -71,26 +71,26 @@ class TileSheetEditorModel: public ox::SignalHandler { [[nodiscard]] size_t palettePage() const noexcept; - void drawCommand(ox::Point const&pt, std::size_t palIdx) noexcept; + void drawCommand(ox::Point const &pt, std::size_t palIdx) noexcept; - void drawLineCommand(ox::Point const&pt, std::size_t palIdx) noexcept; + void drawLineCommand(ox::Point const &pt, std::size_t palIdx) noexcept; void endDrawCommand() noexcept; - void addSubsheet(TileSheet::SubSheetIdx const&parentIdx) noexcept; + void addSubsheet(TileSheet::SubSheetIdx const &parentIdx) noexcept; - void rmSubsheet(TileSheet::SubSheetIdx const&idx) noexcept; + void rmSubsheet(TileSheet::SubSheetIdx const &idx) noexcept; - void insertTiles(TileSheet::SubSheetIdx const&idx, std::size_t tileIdx, std::size_t tileCnt) noexcept; + void insertTiles(TileSheet::SubSheetIdx const &idx, std::size_t tileIdx, std::size_t tileCnt) noexcept; - void deleteTiles(TileSheet::SubSheetIdx const&idx, std::size_t tileIdx, std::size_t tileCnt) noexcept; + void deleteTiles(TileSheet::SubSheetIdx const &idx, std::size_t tileIdx, std::size_t tileCnt) noexcept; - ox::Error updateSubsheet(TileSheet::SubSheetIdx const&idx, ox::StringView const&name, int cols, int rows) noexcept; + ox::Error updateSubsheet(TileSheet::SubSheetIdx const &idx, ox::StringView const &name, int cols, int rows) noexcept; - void setActiveSubsheet(TileSheet::SubSheetIdx const&) noexcept; + void setActiveSubsheet(TileSheet::SubSheetIdx const &) noexcept; [[nodiscard]] - TileSheet::SubSheet const&activeSubSheet() const noexcept { + TileSheet::SubSheet const &activeSubSheet() const noexcept { return getSubSheet(m_img, m_activeSubsSheetIdx); } @@ -100,19 +100,19 @@ class TileSheetEditorModel: public ox::SignalHandler { } [[nodiscard]] - constexpr TileSheet::SubSheetIdx const&activeSubSheetIdx() const noexcept { + constexpr TileSheet::SubSheetIdx const &activeSubSheetIdx() const noexcept { return m_activeSubsSheetIdx; } - void fill(ox::Point const&pt, int palIdx) noexcept; + void fill(ox::Point const &pt, uint8_t palIdx) noexcept; ox::Error rotateLeft() noexcept; ox::Error rotateRight() noexcept; - void setSelection(studio::Selection const&sel) noexcept; + void setSelection(studio::Selection const &sel) noexcept; - void select(ox::Point const&pt) noexcept; + void select(ox::Point const &pt) noexcept; void completeSelection() noexcept; @@ -121,7 +121,7 @@ class TileSheetEditorModel: public ox::SignalHandler { [[nodiscard]] bool updated() const noexcept; - ox::Error markUpdatedCmdId(studio::UndoCommand const*cmd) noexcept; + ox::Error markUpdatedCmdId(studio::UndoCommand const *cmd) noexcept; ox::Error markUpdated() noexcept; @@ -144,21 +144,21 @@ class TileSheetEditorModel: public ox::SignalHandler { ox::Error moveSubSheet(TileSheet::SubSheetIdx src, TileSheet::SubSheetIdx dst) noexcept; private: - void getFillPixels( - TileSheet::SubSheet const&activeSubSheet, + static void getFillPixels( + TileSheet::SubSheet const &activeSubSheet, ox::Span pixels, - ox::Point const&pt, - int oldColor) const noexcept; + ox::Point const &pt, + uint8_t oldColor) noexcept; void setPalPath() noexcept; ox::Error pushCommand(studio::UndoCommand *cmd) noexcept; - ox::Error handleFileRename(ox::StringViewCR, ox::StringViewCR newPath, ox::UUID const&id) noexcept; + ox::Error handleFileRename(ox::StringViewCR, ox::StringViewCR newPath, ox::UUID const &id) noexcept; }; -constexpr TileSheet const&TileSheetEditorModel::img() const noexcept { +constexpr TileSheet const &TileSheetEditorModel::img() const noexcept { return m_img; } @@ -166,7 +166,7 @@ constexpr TileSheet &TileSheetEditorModel::img() noexcept { return m_img; } -constexpr Palette const&TileSheetEditorModel::pal() const noexcept { +constexpr Palette const &TileSheetEditorModel::pal() const noexcept { if (m_pal) { return *m_pal; } diff --git a/deps/nostalgia/src/nostalgia/modules/gfx/src/studio/tilesheeteditor/tilesheeteditorview.cpp b/deps/nostalgia/src/nostalgia/modules/gfx/src/studio/tilesheeteditor/tilesheeteditorview.cpp index 6e555e6..1190db3 100644 --- a/deps/nostalgia/src/nostalgia/modules/gfx/src/studio/tilesheeteditor/tilesheeteditorview.cpp +++ b/deps/nostalgia/src/nostalgia/modules/gfx/src/studio/tilesheeteditor/tilesheeteditorview.cpp @@ -89,7 +89,7 @@ void TileSheetEditorView::clickSelect(ox::Vec2 const&paneSize, ox::Vec2 const&cl void TileSheetEditorView::clickFill(ox::Vec2 const&paneSize, ox::Vec2 const&clickPos) noexcept { auto const pt = clickPoint(paneSize, clickPos); - m_model.fill(pt, static_cast(m_palIdx)); + m_model.fill(pt, static_cast(m_palIdx)); } void TileSheetEditorView::releaseMouseButton(TileSheetTool tool) noexcept { diff --git a/deps/nostalgia/src/olympic/keel/include/keel/media.hpp b/deps/nostalgia/src/olympic/keel/include/keel/media.hpp index cc72538..4f6fd20 100644 --- a/deps/nostalgia/src/olympic/keel/include/keel/media.hpp +++ b/deps/nostalgia/src/olympic/keel/include/keel/media.hpp @@ -60,6 +60,11 @@ ox::Result uuidToPath(Context &ctx, ox::StringViewCR uuid) noex ox::Result uuidToPath(Context &ctx, ox::UUID const&uuid) noexcept; +[[nodiscard]] +constexpr bool isUuidUrl(ox::StringViewCR path) noexcept { + return ox::beginsWith(path, "uuid://"); +} + #ifndef OX_BARE_METAL namespace detail { diff --git a/deps/nostalgia/src/olympic/studio/applib/include/studioapp/studioapp.hpp b/deps/nostalgia/src/olympic/studio/applib/include/studioapp/studioapp.hpp index 53ad491..8defebe 100644 --- a/deps/nostalgia/src/olympic/studio/applib/include/studioapp/studioapp.hpp +++ b/deps/nostalgia/src/olympic/studio/applib/include/studioapp/studioapp.hpp @@ -10,6 +10,6 @@ namespace studio { -void registerModule(studio::Module const*) noexcept; +void registerModule(Module const*) noexcept; } diff --git a/deps/nostalgia/src/olympic/studio/applib/src/CMakeLists.txt b/deps/nostalgia/src/olympic/studio/applib/src/CMakeLists.txt index 79fa52d..555550e 100644 --- a/deps/nostalgia/src/olympic/studio/applib/src/CMakeLists.txt +++ b/deps/nostalgia/src/olympic/studio/applib/src/CMakeLists.txt @@ -1,17 +1,17 @@ add_library( StudioAppLib - aboutpopup.cpp app.cpp clawviewer.cpp - deleteconfirmation.cpp filedialogmanager.cpp font.cpp - makecopypopup.cpp - newdir.cpp - newmenu.cpp - newproject.cpp + popups/about.cpp + popups/deleteconfirmation.cpp + popups/makecopy.cpp + popups/newdir.cpp + popups/newmenu.cpp + popups/newproject.cpp + popups/renamefile.cpp projectexplorer.cpp - renamefile.cpp studioui.cpp ) target_compile_definitions( diff --git a/deps/nostalgia/src/olympic/studio/applib/src/aboutpopup.cpp b/deps/nostalgia/src/olympic/studio/applib/src/popups/about.cpp similarity index 97% rename from deps/nostalgia/src/olympic/studio/applib/src/aboutpopup.cpp rename to deps/nostalgia/src/olympic/studio/applib/src/popups/about.cpp index 65844bf..4b7dc1f 100644 --- a/deps/nostalgia/src/olympic/studio/applib/src/aboutpopup.cpp +++ b/deps/nostalgia/src/olympic/studio/applib/src/popups/about.cpp @@ -5,7 +5,7 @@ #include #include -#include "aboutpopup.hpp" +#include "about.hpp" namespace olympic { extern ox::String appVersion; diff --git a/deps/nostalgia/src/olympic/studio/applib/src/aboutpopup.hpp b/deps/nostalgia/src/olympic/studio/applib/src/popups/about.hpp similarity index 100% rename from deps/nostalgia/src/olympic/studio/applib/src/aboutpopup.hpp rename to deps/nostalgia/src/olympic/studio/applib/src/popups/about.hpp diff --git a/deps/nostalgia/src/olympic/studio/applib/src/deleteconfirmation.cpp b/deps/nostalgia/src/olympic/studio/applib/src/popups/deleteconfirmation.cpp similarity index 100% rename from deps/nostalgia/src/olympic/studio/applib/src/deleteconfirmation.cpp rename to deps/nostalgia/src/olympic/studio/applib/src/popups/deleteconfirmation.cpp diff --git a/deps/nostalgia/src/olympic/studio/applib/src/deleteconfirmation.hpp b/deps/nostalgia/src/olympic/studio/applib/src/popups/deleteconfirmation.hpp similarity index 100% rename from deps/nostalgia/src/olympic/studio/applib/src/deleteconfirmation.hpp rename to deps/nostalgia/src/olympic/studio/applib/src/popups/deleteconfirmation.hpp diff --git a/deps/nostalgia/src/olympic/studio/applib/src/makecopypopup.cpp b/deps/nostalgia/src/olympic/studio/applib/src/popups/makecopy.cpp similarity index 98% rename from deps/nostalgia/src/olympic/studio/applib/src/makecopypopup.cpp rename to deps/nostalgia/src/olympic/studio/applib/src/popups/makecopy.cpp index becc713..fa99817 100644 --- a/deps/nostalgia/src/olympic/studio/applib/src/makecopypopup.cpp +++ b/deps/nostalgia/src/olympic/studio/applib/src/popups/makecopy.cpp @@ -4,7 +4,7 @@ #include -#include "makecopypopup.hpp" +#include "makecopy.hpp" namespace studio { diff --git a/deps/nostalgia/src/olympic/studio/applib/src/makecopypopup.hpp b/deps/nostalgia/src/olympic/studio/applib/src/popups/makecopy.hpp similarity index 100% rename from deps/nostalgia/src/olympic/studio/applib/src/makecopypopup.hpp rename to deps/nostalgia/src/olympic/studio/applib/src/popups/makecopy.hpp diff --git a/deps/nostalgia/src/olympic/studio/applib/src/newdir.cpp b/deps/nostalgia/src/olympic/studio/applib/src/popups/newdir.cpp similarity index 100% rename from deps/nostalgia/src/olympic/studio/applib/src/newdir.cpp rename to deps/nostalgia/src/olympic/studio/applib/src/popups/newdir.cpp diff --git a/deps/nostalgia/src/olympic/studio/applib/src/newdir.hpp b/deps/nostalgia/src/olympic/studio/applib/src/popups/newdir.hpp similarity index 100% rename from deps/nostalgia/src/olympic/studio/applib/src/newdir.hpp rename to deps/nostalgia/src/olympic/studio/applib/src/popups/newdir.hpp diff --git a/deps/nostalgia/src/olympic/studio/applib/src/newmenu.cpp b/deps/nostalgia/src/olympic/studio/applib/src/popups/newmenu.cpp similarity index 100% rename from deps/nostalgia/src/olympic/studio/applib/src/newmenu.cpp rename to deps/nostalgia/src/olympic/studio/applib/src/popups/newmenu.cpp diff --git a/deps/nostalgia/src/olympic/studio/applib/src/newmenu.hpp b/deps/nostalgia/src/olympic/studio/applib/src/popups/newmenu.hpp similarity index 100% rename from deps/nostalgia/src/olympic/studio/applib/src/newmenu.hpp rename to deps/nostalgia/src/olympic/studio/applib/src/popups/newmenu.hpp diff --git a/deps/nostalgia/src/olympic/studio/applib/src/newproject.cpp b/deps/nostalgia/src/olympic/studio/applib/src/popups/newproject.cpp similarity index 98% rename from deps/nostalgia/src/olympic/studio/applib/src/newproject.cpp rename to deps/nostalgia/src/olympic/studio/applib/src/popups/newproject.cpp index b458809..2e2038a 100644 --- a/deps/nostalgia/src/olympic/studio/applib/src/newproject.cpp +++ b/deps/nostalgia/src/olympic/studio/applib/src/popups/newproject.cpp @@ -7,7 +7,7 @@ #include #include -#include "filedialogmanager.hpp" +#include "../filedialogmanager.hpp" #include "newproject.hpp" namespace studio { diff --git a/deps/nostalgia/src/olympic/studio/applib/src/newproject.hpp b/deps/nostalgia/src/olympic/studio/applib/src/popups/newproject.hpp similarity index 100% rename from deps/nostalgia/src/olympic/studio/applib/src/newproject.hpp rename to deps/nostalgia/src/olympic/studio/applib/src/popups/newproject.hpp diff --git a/deps/nostalgia/src/olympic/studio/applib/src/renamefile.cpp b/deps/nostalgia/src/olympic/studio/applib/src/popups/renamefile.cpp similarity index 100% rename from deps/nostalgia/src/olympic/studio/applib/src/renamefile.cpp rename to deps/nostalgia/src/olympic/studio/applib/src/popups/renamefile.cpp diff --git a/deps/nostalgia/src/olympic/studio/applib/src/renamefile.hpp b/deps/nostalgia/src/olympic/studio/applib/src/popups/renamefile.hpp similarity index 100% rename from deps/nostalgia/src/olympic/studio/applib/src/renamefile.hpp rename to deps/nostalgia/src/olympic/studio/applib/src/popups/renamefile.hpp diff --git a/deps/nostalgia/src/olympic/studio/applib/src/studioui.hpp b/deps/nostalgia/src/olympic/studio/applib/src/studioui.hpp index b56fe9a..d1bf8e8 100644 --- a/deps/nostalgia/src/olympic/studio/applib/src/studioui.hpp +++ b/deps/nostalgia/src/olympic/studio/applib/src/studioui.hpp @@ -14,14 +14,14 @@ #include #include -#include "aboutpopup.hpp" -#include "deleteconfirmation.hpp" -#include "makecopypopup.hpp" -#include "newdir.hpp" -#include "newmenu.hpp" -#include "newproject.hpp" +#include "popups/about.hpp" +#include "popups/deleteconfirmation.hpp" +#include "popups/makecopy.hpp" +#include "popups/newdir.hpp" +#include "popups/newmenu.hpp" +#include "popups/newproject.hpp" #include "projectexplorer.hpp" -#include "renamefile.hpp" +#include "popups/renamefile.hpp" namespace studio { diff --git a/deps/nostalgia/src/olympic/studio/modlib/include/studio/configio.hpp b/deps/nostalgia/src/olympic/studio/modlib/include/studio/configio.hpp index b155b3a..e0b79fd 100644 --- a/deps/nostalgia/src/olympic/studio/modlib/include/studio/configio.hpp +++ b/deps/nostalgia/src/olympic/studio/modlib/include/studio/configio.hpp @@ -30,7 +30,7 @@ inline ox::String slashesToPct(ox::StringViewCR str) noexcept { } [[nodiscard]] -ox::String configPath(keel::Context const&kctx) noexcept; +ox::String configPath(keel::Context const &kctx) noexcept; template ox::Result readConfig(keel::Context &kctx, ox::StringViewCR name) noexcept { @@ -61,7 +61,7 @@ ox::Result readConfig(keel::Context &kctx) noexcept { } template -ox::Error writeConfig(keel::Context &kctx, ox::StringViewCR name, T const&data) noexcept { +ox::Error writeConfig(keel::Context &kctx, ox::StringViewCR name, T const &data) noexcept { oxAssert(name != "", "Config type has no TypeName"); auto const path = ox::sfmt("/{}.json", detail::slashesToPct(name)); ox::PassThroughFS fs(configPath(kctx)); @@ -79,7 +79,7 @@ ox::Error writeConfig(keel::Context &kctx, ox::StringViewCR name, T const&data) } template -ox::Error writeConfig(keel::Context &kctx, T const&data) noexcept { +ox::Error writeConfig(keel::Context &kctx, T const &data) noexcept { constexpr auto TypeName = ox::requireModelTypeName(); return writeConfig(kctx, TypeName, data); } @@ -120,7 +120,7 @@ void editConfig(keel::Context &kctx, Func f) noexcept { */ template ox::Error headerizeConfigFile(keel::Context &kctx, ox::StringViewCR name = ox::ModelTypeName_v) noexcept { - auto const path = ox::sfmt("/{}.json", name); + auto const path = ox::sfmt("/{}.json", detail::slashesToPct(name)); ox::PassThroughFS fs(configPath(kctx)); OX_REQUIRE_M(buff, fs.read(path)); OX_REQUIRE_M(cv1, ox::readOC(buff)); diff --git a/deps/nostalgia/src/olympic/studio/modlib/src/configio.cpp b/deps/nostalgia/src/olympic/studio/modlib/src/configio.cpp index af3b59c..a136298 100644 --- a/deps/nostalgia/src/olympic/studio/modlib/src/configio.cpp +++ b/deps/nostalgia/src/olympic/studio/modlib/src/configio.cpp @@ -23,7 +23,7 @@ constexpr auto ConfigDir = [] { } }(); -ox::String configPath(keel::Context const&ctx) noexcept { +ox::String configPath(keel::Context const &ctx) noexcept { auto const homeDir = std::getenv(ox::defines::OS == ox::OS::Windows ? "USERPROFILE" : "HOME"); return ox::sfmt(ConfigDir, homeDir, ctx.appName); }