diff --git a/src/nostalgia/modules/gfx/include/nostalgia/gfx/gfx.hpp b/src/nostalgia/modules/gfx/include/nostalgia/gfx/gfx.hpp index e80d3ba9..978c0a96 100644 --- a/src/nostalgia/modules/gfx/include/nostalgia/gfx/gfx.hpp +++ b/src/nostalgia/modules/gfx/include/nostalgia/gfx/gfx.hpp @@ -114,10 +114,10 @@ struct InitParams { ox::Result> init(turbine::Context &tctx, InitParams const ¶ms = {}) noexcept; [[nodiscard]] -int tileColumns(Context&) noexcept; +int tileColumns(Context const&) noexcept; [[nodiscard]] -int tileRows(Context&) noexcept; +int tileRows(Context const&) noexcept; ox::Error loadBgPalette( Context &ctx, diff --git a/src/nostalgia/modules/gfx/src/gfx.cpp b/src/nostalgia/modules/gfx/src/gfx.cpp index ac429b77..e52ac87b 100644 --- a/src/nostalgia/modules/gfx/src/gfx.cpp +++ b/src/nostalgia/modules/gfx/src/gfx.cpp @@ -10,11 +10,11 @@ namespace nostalgia::gfx { constexpr auto GbaTileColumns = 32; constexpr auto GbaTileRows = 32; -int tileColumns(Context&) noexcept { +int tileColumns(Context const&) noexcept { return GbaTileColumns; } -int tileRows(Context&) noexcept { +int tileRows(Context const&) noexcept { return GbaTileRows; } diff --git a/src/olympic/studio/applib/src/clawviewer.cpp b/src/olympic/studio/applib/src/clawviewer.cpp index 5689ff20..0bb859e9 100644 --- a/src/olympic/studio/applib/src/clawviewer.cpp +++ b/src/olympic/studio/applib/src/clawviewer.cpp @@ -28,7 +28,7 @@ void ClawEditor::draw(Context&) noexcept { ImGui::EndChild(); } -void ClawEditor::drawRow(ox::ModelValue const&value) noexcept { +void ClawEditor::drawRow(ox::ModelValue const &value) noexcept { using Str = ox::BasicString<100>; Str val, type; switch (value.type()) { @@ -93,13 +93,13 @@ void ClawEditor::drawRow(ox::ModelValue const&value) noexcept { ImGui::Text("%s", val.c_str()); } -void ClawEditor::drawVar(ObjPath &path, ox::StringViewCR name, ox::ModelValue const&value) noexcept { +void ClawEditor::drawVar(ObjPath &path, ox::StringViewCR name, ox::ModelValue const &value) noexcept { using Str = ox::BasicString<100>; path.push_back(name); if (value.type() == ox::ModelValue::Type::Object) { drawTree(path, value.get()); } else if (value.type() == ox::ModelValue::Type::Vector) { - auto const&vec = value.get(); + auto const &vec = value.get(); auto const pathStr = ox::join("##", path).unwrap(); auto const lbl = ox::sfmt("{}##{}", name, pathStr); auto const flags = ImGuiTreeNodeFlags_SpanFullWidth @@ -110,7 +110,7 @@ void ClawEditor::drawVar(ObjPath &path, ox::StringViewCR name, ox::ModelValue co ImGui::SameLine(); drawRow(value); if (open) { - for (auto i = 0lu; auto const&e: vec) { + for (auto i = 0lu; auto const &e: vec) { auto const iStr = ox::sfmt("{}", i); path.push_back(iStr); ImGui::TableNextRow(0, 5); @@ -138,7 +138,7 @@ void ClawEditor::drawVar(ObjPath &path, ox::StringViewCR name, ox::ModelValue co path.pop_back(); } -void ClawEditor::drawTree(ObjPath &path, ox::ModelObject const&obj) noexcept { +void ClawEditor::drawTree(ObjPath &path, ox::ModelObject const &obj) noexcept { using Str = ox::BasicString<100>; for (auto const &c : obj) { ImGui::TableNextRow(0, 5); diff --git a/src/olympic/studio/applib/src/clawviewer.hpp b/src/olympic/studio/applib/src/clawviewer.hpp index 19d0a16a..7bbd92ed 100644 --- a/src/olympic/studio/applib/src/clawviewer.hpp +++ b/src/olympic/studio/applib/src/clawviewer.hpp @@ -21,11 +21,11 @@ class ClawEditor: public Editor { void draw(Context&) noexcept final; private: - static void drawRow(ox::ModelValue const&value) noexcept; + static void drawRow(ox::ModelValue const &value) noexcept; - void drawVar(ObjPath &path, ox::StringViewCR name, ox::ModelValue const&value) noexcept; + void drawVar(ObjPath &path, ox::StringViewCR name, ox::ModelValue const &value) noexcept; - void drawTree(ObjPath &path, ox::ModelObject const&obj) noexcept; + void drawTree(ObjPath &path, ox::ModelObject const &obj) noexcept; }; } diff --git a/src/olympic/studio/applib/src/popups/newmenu.cpp b/src/olympic/studio/applib/src/popups/newmenu.cpp index e0b42a2f..ded8fd78 100644 --- a/src/olympic/studio/applib/src/popups/newmenu.cpp +++ b/src/olympic/studio/applib/src/popups/newmenu.cpp @@ -24,7 +24,7 @@ void NewMenu::open() noexcept { m_useDefaultPath = true; m_explorer.setModel(buildFileTreeModel( m_explorer, - [](ox::StringViewCR, ox::FileStat const&s) { + [](ox::StringViewCR, ox::FileStat const &s) { return s.fileType == ox::FileType::Directory; }).or_value(ox::UPtr{})); } @@ -75,26 +75,26 @@ void NewMenu::addItemMaker(ox::UPtr &&im) noexcept { m_types.emplace_back(std::move(im)); std::sort( m_types.begin(), m_types.end(), - [](ox::UPtr const&im1, ox::UPtr const&im2) { + [](ox::UPtr const &im1, ox::UPtr const &im2) { return im1->typeDisplayName() < im2->typeDisplayName(); }); } void NewMenu::installItemTemplate(ox::UPtr &&tmplt) noexcept { - for (auto const&im : m_types) { + for (auto const &im : m_types) { if (im->installTemplate(std::move(tmplt))) { break; } } } -void NewMenu::drawNewItemType(Context const&sctx) noexcept { +void NewMenu::drawNewItemType(Context const &sctx) noexcept { setSize({280, 180}); drawWindow(sctx.tctx, m_open, [this] { ig::ListBox("Item Type", [&](size_t const i) -> ox::CStringView { return m_types[i]->typeDisplayName(); }, m_types.size(), m_selectedType, {200, 100}); - auto const&im = *m_types[m_selectedType]; + auto const &im = *m_types[m_selectedType]; drawFirstPageButtons(im.itemTemplates().size() == 1 ? Stage::NewItemTransitioningToPath : Stage::NewItemTemplate); if (m_stage == Stage::NewItemTransitioningToPath || m_stage == Stage::NewItemTemplate) { @@ -105,10 +105,10 @@ void NewMenu::drawNewItemType(Context const&sctx) noexcept { }); } -void NewMenu::drawNewItemTemplate(Context const&sctx) noexcept { +void NewMenu::drawNewItemTemplate(Context const &sctx) noexcept { setSize({280, 180}); drawWindow(sctx.tctx, m_open, [this] { - auto const&templates = + auto const &templates = m_types[m_selectedType]->itemTemplates(); ig::ListBox("Template", [&](size_t const i) -> ox::CStringView { return templates[i]->name(); diff --git a/src/olympic/studio/applib/src/popups/newmenu.hpp b/src/olympic/studio/applib/src/popups/newmenu.hpp index 12991511..0128c402 100644 --- a/src/olympic/studio/applib/src/popups/newmenu.hpp +++ b/src/olympic/studio/applib/src/popups/newmenu.hpp @@ -75,7 +75,7 @@ class NewMenu final: public Popup { void installItemTemplate(ox::UPtr &&tmplt) noexcept; private: - void drawNewItemType(Context const&sctx) noexcept; + void drawNewItemType(Context const &sctx) noexcept; void drawNewItemPath(Context &sctx) noexcept; diff --git a/src/olympic/studio/applib/src/popups/newproject.hpp b/src/olympic/studio/applib/src/popups/newproject.hpp index ee802493..317ef05e 100644 --- a/src/olympic/studio/applib/src/popups/newproject.hpp +++ b/src/olympic/studio/applib/src/popups/newproject.hpp @@ -13,7 +13,7 @@ namespace studio { -class NewProject: public studio::Popup { +class NewProject: public Popup { public: enum class Stage { Closed, diff --git a/src/olympic/studio/modlib/include/studio/editor.hpp b/src/olympic/studio/modlib/include/studio/editor.hpp index 341fa2f0..81610e9c 100644 --- a/src/olympic/studio/modlib/include/studio/editor.hpp +++ b/src/olympic/studio/modlib/include/studio/editor.hpp @@ -140,7 +140,7 @@ class Editor: public studio::BaseEditor { ox::Error pushCommand(Args&&... args) noexcept { try { return m_undoStack.push(ox::make_unique(ox::forward(args)...)); - } catch (ox::Exception const&ex) { + } catch (ox::Exception const &ex) { return ex.toError(); } } @@ -148,7 +148,7 @@ class Editor: public studio::BaseEditor { private: ox::Error markUnsavedChanges(UndoCommand const*) noexcept; - ox::Error handleRename(ox::StringViewCR oldPath, ox::StringViewCR newPath, ox::UUID const&id) noexcept; + ox::Error handleRename(ox::StringViewCR oldPath, ox::StringViewCR newPath, ox::UUID const &id) noexcept; }; diff --git a/src/olympic/studio/modlib/include/studio/filedialog.hpp b/src/olympic/studio/modlib/include/studio/filedialog.hpp index c1a491ff..6ca1f2b1 100644 --- a/src/olympic/studio/modlib/include/studio/filedialog.hpp +++ b/src/olympic/studio/modlib/include/studio/filedialog.hpp @@ -21,7 +21,7 @@ struct FDFilterItem { FDFilterItem(ox::StringViewCR pName, ox::StringViewCR pSpec) noexcept; }; -ox::Result saveFile(ox::Vector const&exts) noexcept; +ox::Result saveFile(ox::Vector const &exts) noexcept; ox::Result chooseDirectory() noexcept; diff --git a/src/olympic/studio/modlib/include/studio/filetreemodel.hpp b/src/olympic/studio/modlib/include/studio/filetreemodel.hpp index 74bd69df..75e62aa5 100644 --- a/src/olympic/studio/modlib/include/studio/filetreemodel.hpp +++ b/src/olympic/studio/modlib/include/studio/filetreemodel.hpp @@ -78,7 +78,7 @@ class FileExplorer: public ox::SignalHandler { } private: - ox::Result setSelectedPath(ox::StringViewCR path, FileTreeModel const&node) noexcept; + ox::Result setSelectedPath(ox::StringViewCR path, FileTreeModel const &node) noexcept; }; @@ -106,7 +106,7 @@ class FileTreeModel { void setChildren(ox::Vector> children) noexcept; [[nodiscard]] - ox::Vector> const&children() const noexcept { + ox::Vector> const &children() const noexcept { return m_children; } @@ -129,13 +129,13 @@ ox::Result> buildFileTreeModel( ox::StringParam name, ox::StringViewCR path, FileTreeModel *parent = nullptr, - std::function const&filter = + std::function const &filter = [](ox::StringViewCR, ox::FileStat const&) {return true;}, bool showEmptyDirs = true) noexcept; ox::Result> buildFileTreeModel( FileExplorer &explorer, - std::function const&filter = + std::function const &filter = [](ox::StringViewCR, ox::FileStat const&) {return true;}, bool showEmptyDirs = true) noexcept; diff --git a/src/olympic/studio/modlib/include/studio/itemmaker.hpp b/src/olympic/studio/modlib/include/studio/itemmaker.hpp index ecd7be21..e4ad2eeb 100644 --- a/src/olympic/studio/modlib/include/studio/itemmaker.hpp +++ b/src/olympic/studio/modlib/include/studio/itemmaker.hpp @@ -27,11 +27,11 @@ class ItemTemplate { virtual ~ItemTemplate() = default; [[nodiscard]] - constexpr ox::String const&name() const noexcept { + constexpr ox::String const &name() const noexcept { return m_name; } - constexpr bool operator<=>(ItemTemplate const&other) const noexcept { + constexpr bool operator<=>(ItemTemplate const &other) const noexcept { return m_name != other.name() ? (m_name < other.name() ? -1 : 1) : 0; } @@ -105,7 +105,7 @@ class ItemMaker { virtual ~ItemMaker() noexcept = default; [[nodiscard]] - ox::String const&typeDisplayName() const noexcept { + ox::String const &typeDisplayName() const noexcept { return m_typeDisplayName; } @@ -120,17 +120,17 @@ class ItemMaker { return false; } - constexpr ox::Vector> const&itemTemplates() const noexcept { + constexpr ox::Vector> const &itemTemplates() const noexcept { return m_templates; } [[nodiscard]] - ox::String const&fileExt() const noexcept { + ox::String const &fileExt() const noexcept { return m_fileExt; } [[nodiscard]] - ox::String const&defaultPath() const noexcept { + ox::String const &defaultPath() const noexcept { return m_parentDir; } @@ -212,7 +212,7 @@ class ItemMakerT final: public ItemMaker { ox::StringParam pDisplayName, ox::StringViewCR pParentDir, ox::StringParam fileExt, - T const&pItem, + T const &pItem, ox::ClawFormat const pFmt) noexcept: ItemMaker( std::move(pDisplayName), @@ -249,7 +249,7 @@ class ItemMakerT final: public ItemMaker { ox::StringViewCR pPath, size_t const pTemplateIdx) const noexcept override { createUuidMapping(keelCtx(ctx.tctx), pPath, ox::UUID::generate().unwrap()); - auto const&templates = itemTemplates(); + auto const &templates = itemTemplates(); auto const tmplIdx = pTemplateIdx < templates.size() ? pTemplateIdx : 0; OX_REQUIRE_M(tmpl, templates[tmplIdx]->getItem( keelCtx(ctx), typeName(), typeVersion())); diff --git a/src/olympic/studio/modlib/include/studio/popup.hpp b/src/olympic/studio/modlib/include/studio/popup.hpp index 0695a7a6..eb9f0648 100644 --- a/src/olympic/studio/modlib/include/studio/popup.hpp +++ b/src/olympic/studio/modlib/include/studio/popup.hpp @@ -43,11 +43,11 @@ class Popup: public Widget { m_title = std::move(title); } - constexpr ox::String const&title() const noexcept { + constexpr ox::String const &title() const noexcept { return m_title; } - void drawWindow(turbine::Context &ctx, bool &open, std::function const&drawContents); + void drawWindow(turbine::Context &ctx, bool &open, std::function const &drawContents); }; diff --git a/src/olympic/studio/modlib/include/studio/project.hpp b/src/olympic/studio/modlib/include/studio/project.hpp index 204f67e9..dda1eabf 100644 --- a/src/olympic/studio/modlib/include/studio/project.hpp +++ b/src/olympic/studio/modlib/include/studio/project.hpp @@ -64,7 +64,7 @@ class Project: public ox::SignalHandler { ox::Error create() noexcept; [[nodiscard]] - ox::String const&projectPath() const noexcept; + ox::String const &projectPath() const noexcept; [[nodiscard]] ox::FileSystem &romFs() noexcept; @@ -77,7 +77,7 @@ class Project: public ox::SignalHandler { template ox::Error writeObj( ox::StringViewCR path, - T const&obj, + T const &obj, ox::ClawFormat fmt) noexcept; /** @@ -86,7 +86,7 @@ class Project: public ox::SignalHandler { template ox::Error writeObj( ox::StringViewCR path, - T const&obj) noexcept; + T const &obj) noexcept; template ox::Result loadObj(ox::StringViewCR path) const noexcept; @@ -108,7 +108,7 @@ class Project: public ox::SignalHandler { ox::Error subscribe(ProjectEvent e, ox::SignalHandler *tgt, Functor &&slot) const noexcept; [[nodiscard]] - ox::Vector const&fileList(ox::StringViewCR ext) noexcept; + ox::Vector const &fileList(ox::StringViewCR ext) noexcept; ox::Error writeTypeStore() noexcept; @@ -117,7 +117,7 @@ class Project: public ox::SignalHandler { void indexFile(ox::StringViewCR path) noexcept; - ox::Error writeBuff(ox::StringViewCR path, ox::BufferView const&buff) noexcept; + ox::Error writeBuff(ox::StringViewCR path, ox::BufferView const &buff) noexcept; ox::Result loadBuff(ox::StringViewCR path) const noexcept; @@ -136,13 +136,13 @@ class Project: public ox::SignalHandler { ox::Signal fileRecognized; ox::Signal fileDeleted; ox::Signal dirDeleted; - ox::Signal fileUpdated; - ox::Signal fileMoved; + ox::Signal fileUpdated; + ox::Signal fileMoved; }; template -ox::Error Project::writeObj(ox::StringViewCR path, T const&obj, ox::ClawFormat fmt) noexcept { +ox::Error Project::writeObj(ox::StringViewCR path, T const &obj, ox::ClawFormat fmt) noexcept { OX_REQUIRE_M(buff, ox::writeClaw(obj, fmt)); if (fmt == ox::ClawFormat::Organic) { buff.pop_back(); @@ -167,7 +167,7 @@ ox::Error Project::writeObj(ox::StringViewCR path, T const&obj, ox::ClawFormat f } template -ox::Error Project::writeObj(ox::StringViewCR path, T const&obj) noexcept { +ox::Error Project::writeObj(ox::StringViewCR path, T const &obj) noexcept { OX_REQUIRE(ext, fileExt(path)); auto const fmt = m_typeFmt[ext].or_value(ox::ClawFormat::Metal); return writeObj(path, obj, fmt); @@ -197,7 +197,7 @@ ox::Error Project::subscribe(ProjectEvent e, ox::SignalHandler *tgt, Functor &&s case ProjectEvent::FileRecognized: { OX_REQUIRE(files, listFiles()); - for (auto const&f : files) { + for (auto const &f : files) { slot(f); } connect(this, &Project::fileRecognized, tgt, slot); diff --git a/src/olympic/studio/modlib/include/studio/selectiontracker.hpp b/src/olympic/studio/modlib/include/studio/selectiontracker.hpp index aa07b1a2..0838eaf8 100644 --- a/src/olympic/studio/modlib/include/studio/selectiontracker.hpp +++ b/src/olympic/studio/modlib/include/studio/selectiontracker.hpp @@ -16,19 +16,19 @@ namespace studio { struct Selection { ox::Point a, b; constexpr Selection() noexcept = default; - constexpr Selection(ox::Point const&pA, ox::Point const&pB) noexcept: a(pA), b(pB) {} + constexpr Selection(ox::Point const &pA, ox::Point const &pB) noexcept: a(pA), b(pB) {} [[nodiscard]] constexpr ox::Size size() const noexcept { return {b.x - a.x, b.y - a.y}; } [[nodiscard]] - constexpr bool contains(ox::Point const&pt) const noexcept { + constexpr bool contains(ox::Point const &pt) const noexcept { return a.x <= pt.x && a.y <= pt.y && b.x >= pt.x && b.y >= pt.y; } }; -constexpr auto iterateSelection(studio::Selection const&sel, auto const&cb) { +constexpr auto iterateSelection(Selection const &sel, auto const &cb) { constexpr auto retErr = ox::is_same_v; for (auto x = sel.a.x; x <= sel.b.x; ++x) { for (auto y = sel.a.y; y <= sel.b.y; ++y) { @@ -44,7 +44,7 @@ constexpr auto iterateSelection(studio::Selection const&sel, auto const&cb) { } }; -constexpr auto iterateSelectionRows(studio::Selection const&sel, auto const&cb) { +constexpr auto iterateSelectionRows(Selection const &sel, auto const &cb) { constexpr auto retErr = ox::is_same_v; for (auto y = sel.a.y; y <= sel.b.y; ++y) { for (auto x = sel.a.x; x <= sel.b.x; ++x) { diff --git a/src/olympic/studio/modlib/include/studio/undocommand.hpp b/src/olympic/studio/modlib/include/studio/undocommand.hpp index c7271b24..cb6df729 100644 --- a/src/olympic/studio/modlib/include/studio/undocommand.hpp +++ b/src/olympic/studio/modlib/include/studio/undocommand.hpp @@ -12,7 +12,7 @@ namespace studio { class NoChangesException: public ox::Exception { public: - inline NoChangesException(std::source_location sloc = std::source_location::current()): + explicit NoChangesException(std::source_location sloc = std::source_location::current()): ox::Exception(1, "Command makes no changes.", sloc) {} }; diff --git a/src/olympic/studio/modlib/src/filedialog_nfd.cpp b/src/olympic/studio/modlib/src/filedialog_nfd.cpp index 0869761f..f298621e 100644 --- a/src/olympic/studio/modlib/src/filedialog_nfd.cpp +++ b/src/olympic/studio/modlib/src/filedialog_nfd.cpp @@ -20,7 +20,7 @@ FDFilterItem::FDFilterItem(ox::StringViewCR pName, ox::StringViewCR pSpec) noexc OX_ALLOW_UNSAFE_BUFFERS_END } -static ox::Result toResult(nfdresult_t r, NFD::UniquePathN const&path) noexcept { +static ox::Result toResult(nfdresult_t r, NFD::UniquePathN const &path) noexcept { switch (r) { case NFD_OKAY: { ox::String out; @@ -39,11 +39,11 @@ OX_ALLOW_UNSAFE_BUFFERS_END } } -ox::Result saveFile(ox::Vector const&exts) noexcept { +ox::Result saveFile(ox::Vector const &exts) noexcept { NFD::Guard const guard; NFD::UniquePathN path; ox::Vector filterItems(exts.size()); - for (auto i = 0u; auto const&f : exts) { + for (auto i = 0u; auto const &f : exts) { filterItems[i].name = f.name.data(); filterItems[i].spec = f.spec.data(); ++i; diff --git a/src/olympic/studio/modlib/src/filetreemodel.cpp b/src/olympic/studio/modlib/src/filetreemodel.cpp index a32e1196..2ec08c61 100644 --- a/src/olympic/studio/modlib/src/filetreemodel.cpp +++ b/src/olympic/studio/modlib/src/filetreemodel.cpp @@ -60,7 +60,7 @@ void FileExplorer::fileContextMenu(ox::StringViewCR) const noexcept {} void FileExplorer::dirContextMenu(ox::StringViewCR) const noexcept {} ox::Result FileExplorer::setSelectedPath( - ox::StringViewCR path, FileTreeModel const&node) noexcept { + ox::StringViewCR path, FileTreeModel const &node) noexcept { if (path == node.path()) { m_selected = &node; return {}; @@ -117,7 +117,7 @@ void FileTreeModel::draw(turbine::Context &tctx) const noexcept { } } if (nodeOpen) { - for (auto const&child : m_children) { + for (auto const &child : m_children) { child->draw(tctx); } ImGui::TreePop(); @@ -160,16 +160,16 @@ ox::Result> buildFileTreeModel( ox::StringParam name, ox::StringViewCR path, FileTreeModel *parent, - std::function const &filter, + std::function const &filter, bool const showEmptyDirs) noexcept { - auto const&fs = explorer.romFs(); + auto const &fs = explorer.romFs(); OX_REQUIRE(stat, fs.stat(path)); auto out = ox::make_unique(explorer, std::move(name), stat.fileType, parent); if (stat.fileType == ox::FileType::Directory) { OX_REQUIRE_M(children, fs.ls(path)); std::sort(children.begin(), children.end()); ox::Vector> outChildren; - for (auto const&childName : children) { + for (auto const &childName : children) { if (childName[0] != '.') { auto const childPath = ox::sfmt("{}/{}", path, childName); OX_REQUIRE(childStat, fs.stat(childPath)); @@ -195,7 +195,7 @@ ox::Result> buildFileTreeModel( ox::Result> buildFileTreeModel( FileExplorer &explorer, - std::function const&filter, + std::function const &filter, bool const showEmptyDirs) noexcept { return buildFileTreeModel(explorer, "Project", "/", nullptr, filter, showEmptyDirs); } diff --git a/src/olympic/studio/modlib/src/popup.cpp b/src/olympic/studio/modlib/src/popup.cpp index 04e7ba13..8868a560 100644 --- a/src/olympic/studio/modlib/src/popup.cpp +++ b/src/olympic/studio/modlib/src/popup.cpp @@ -7,8 +7,8 @@ namespace studio { -void Popup::drawWindow(turbine::Context &ctx, bool &open, std::function const&drawContents) { - studio::ig::centerNextWindow(ctx); +void Popup::drawWindow(turbine::Context &ctx, bool &open, std::function const &drawContents) { + ig::centerNextWindow(ctx); ImGui::SetNextWindowSize(static_cast(m_size)); constexpr auto modalFlags = ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoResize; if (ImGui::BeginPopupModal(m_title.c_str(), &open, modalFlags)) { diff --git a/src/olympic/studio/modlib/src/project.cpp b/src/olympic/studio/modlib/src/project.cpp index 214902eb..0ccb2f48 100644 --- a/src/olympic/studio/modlib/src/project.cpp +++ b/src/olympic/studio/modlib/src/project.cpp @@ -75,7 +75,7 @@ ox::Error Project::create() noexcept { return ox::Error(static_cast(ec.value()), "PassThroughFS: mkdir failed"); } -ox::String const&Project::projectPath() const noexcept { +ox::String const &Project::projectPath() const noexcept { return m_path; } @@ -137,7 +137,7 @@ ox::Error Project::deleteItem(ox::StringViewCR path) noexcept { if (stat.fileType == ox::FileType::Directory) { bool partialRemoval{}; OX_REQUIRE(members, m_fs.ls(path)); - for (auto const&p : members) { + for (auto const &p : members) { partialRemoval = m_fs.remove(ox::sfmt("{}/{}", path, p)) || partialRemoval; } if (partialRemoval) { @@ -161,7 +161,7 @@ bool Project::exists(ox::StringViewCR path) const noexcept { return m_fs.stat(path).error == 0; } -ox::Vector const&Project::fileList(ox::StringViewCR ext) noexcept { +ox::Vector const &Project::fileList(ox::StringViewCR ext) noexcept { return m_fileExtFileMap[ext]; } @@ -185,7 +185,7 @@ void Project::buildFileIndex() noexcept { } m_fileExtFileMap.clear(); std::sort(files.begin(), files.end()); - for (auto const&file : files) { + for (auto const &file : files) { if (!beginsWith(file, ox::sfmt("/.{}/", m_projectDataDir))) { indexFile(file); } @@ -200,7 +200,7 @@ void Project::indexFile(ox::StringViewCR path) noexcept { m_fileExtFileMap[ext].emplace_back(path); } -ox::Error Project::writeBuff(ox::StringViewCR path, ox::BufferView const&buff) noexcept { +ox::Error Project::writeBuff(ox::StringViewCR path, ox::BufferView const &buff) noexcept { constexpr auto HdrSz = 40; ox::Buffer outBuff; outBuff.reserve(buff.size() + HdrSz); @@ -227,7 +227,7 @@ ox::Result Project::loadBuff(ox::StringViewCR path) const noexcept { ox::Error Project::lsProcDir(ox::Vector &paths, ox::StringViewCR path) const noexcept { OX_REQUIRE(files, m_fs.ls(path)); - for (auto const&name : files) { + for (auto const &name : files) { auto fullPath = ox::sfmt("{}/{}", path, name); OX_REQUIRE(stat, m_fs.stat(ox::StringView(fullPath))); switch (stat.fileType) { diff --git a/src/olympic/turbine/include/turbine/clipboard.hpp b/src/olympic/turbine/include/turbine/clipboard.hpp index 7e895482..56857632 100644 --- a/src/olympic/turbine/include/turbine/clipboard.hpp +++ b/src/olympic/turbine/include/turbine/clipboard.hpp @@ -28,7 +28,7 @@ class ClipboardObject: public BaseClipboardObject { } }; -ox::String getClipboardText(Context &ctx) noexcept; +ox::String getClipboardText(Context const &ctx) noexcept; void setClipboardText(Context &ctx, ox::StringViewCR text) noexcept; diff --git a/src/olympic/turbine/include/turbine/context.hpp b/src/olympic/turbine/include/turbine/context.hpp index bc8a8e0f..31fe9f45 100644 --- a/src/olympic/turbine/include/turbine/context.hpp +++ b/src/olympic/turbine/include/turbine/context.hpp @@ -15,11 +15,11 @@ class Context; void safeDelete(Context *p); -keel::Context const&keelCtx(Context const&ctx) noexcept; +keel::Context const &keelCtx(Context const &ctx) noexcept; keel::Context &keelCtx(Context &ctx) noexcept; -inline ox::FileSystem const*rom(Context const&ctx) noexcept { +inline ox::FileSystem const*rom(Context const &ctx) noexcept { return keelCtx(ctx).rom.get(); } @@ -27,7 +27,7 @@ inline ox::FileSystem *rom(Context &ctx) noexcept { return keelCtx(ctx).rom.get(); } -void setApplicationDataRaw(Context &ctx, ox::AnyPtr const&applicationData) noexcept; +void setApplicationDataRaw(Context &ctx, ox::AnyPtr const &applicationData) noexcept; template void setApplicationData(Context &ctx, T *applicationData) noexcept { @@ -35,7 +35,7 @@ void setApplicationData(Context &ctx, T *applicationData) noexcept { } [[nodiscard]] -ox::AnyPtr const&applicationDataRaw(Context &ctx) noexcept; +ox::AnyPtr const &applicationDataRaw(Context &ctx) noexcept; template [[nodiscard]] diff --git a/src/olympic/turbine/include/turbine/gfx.hpp b/src/olympic/turbine/include/turbine/gfx.hpp index 1b2a55c3..1dab7e2a 100644 --- a/src/olympic/turbine/include/turbine/gfx.hpp +++ b/src/olympic/turbine/include/turbine/gfx.hpp @@ -41,7 +41,7 @@ ox::Size getScreenSize(Context const &ctx) noexcept; ox::Bounds getWindowBounds(Context const &ctx) noexcept; -ox::Error setWindowBounds(Context &ctx, ox::Bounds const&bnds) noexcept; +ox::Error setWindowBounds(Context &ctx, ox::Bounds const &bnds) noexcept; /** * Tells Turbine to refresh the screen within the specified period of time. diff --git a/src/olympic/turbine/include/turbine/turbine.hpp b/src/olympic/turbine/include/turbine/turbine.hpp index 65cce5d1..ed98b85f 100644 --- a/src/olympic/turbine/include/turbine/turbine.hpp +++ b/src/olympic/turbine/include/turbine/turbine.hpp @@ -89,7 +89,7 @@ void setMouseButtonEventHandler(Context &ctx, MouseButtonEventHandler h) noexcep KeyEventHandler keyEventHandler(Context const &ctx) noexcept; [[nodiscard]] -bool buttonDown(Context const&ctx, Key) noexcept; +bool buttonDown(Context const &ctx, Key) noexcept; ox::Result> init(ox::UPtr &&fs, ox::StringViewCR appName) noexcept; @@ -100,7 +100,7 @@ ox::Error run(Context &ctx) noexcept; // Returns the number of milliseconds that have passed since the start of the // program. [[nodiscard]] -TimeMs ticksMs(Context const&ctx) noexcept; +TimeMs ticksMs(Context const &ctx) noexcept; void requestShutdown(Context &ctx, bool force = false) noexcept; diff --git a/src/olympic/turbine/src/gba/clipboard.cpp b/src/olympic/turbine/src/gba/clipboard.cpp index 92cdd8a1..f91b0da5 100644 --- a/src/olympic/turbine/src/gba/clipboard.cpp +++ b/src/olympic/turbine/src/gba/clipboard.cpp @@ -9,7 +9,7 @@ namespace turbine { -ox::String getClipboardText(Context&) noexcept { +ox::String getClipboardText(Context const &) noexcept { return {}; } diff --git a/src/olympic/turbine/src/gba/context.cpp b/src/olympic/turbine/src/gba/context.cpp index 2d005120..d87101a5 100644 --- a/src/olympic/turbine/src/gba/context.cpp +++ b/src/olympic/turbine/src/gba/context.cpp @@ -10,7 +10,7 @@ void safeDelete(Context *p) { delete p; } -keel::Context const&keelCtx(Context const&ctx) noexcept { +keel::Context const &keelCtx(Context const &ctx) noexcept { return ctx.keelCtx; } @@ -18,11 +18,11 @@ keel::Context &keelCtx(Context &ctx) noexcept { return ctx.keelCtx; } -void setApplicationDataRaw(Context &ctx, ox::AnyPtr const&applicationData) noexcept { +void setApplicationDataRaw(Context &ctx, ox::AnyPtr const &applicationData) noexcept { ctx.applicationData = applicationData; } -ox::AnyPtr const&applicationDataRaw(Context &ctx) noexcept { +ox::AnyPtr const &applicationDataRaw(Context &ctx) noexcept { return ctx.applicationData; } diff --git a/src/olympic/turbine/src/gba/context.hpp b/src/olympic/turbine/src/gba/context.hpp index e59eb399..2675db76 100644 --- a/src/olympic/turbine/src/gba/context.hpp +++ b/src/olympic/turbine/src/gba/context.hpp @@ -23,8 +23,8 @@ class Context final { Context() noexcept = default; Context(Context &other) noexcept = delete; - Context(Context const&other) noexcept = delete; - Context(Context const&&other) noexcept = delete; + Context(Context const &other) noexcept = delete; + Context(Context const &&other) noexcept = delete; }; diff --git a/src/olympic/turbine/src/glfw/clipboard.cpp b/src/olympic/turbine/src/glfw/clipboard.cpp index 7e45cf8e..14026b4f 100644 --- a/src/olympic/turbine/src/glfw/clipboard.cpp +++ b/src/olympic/turbine/src/glfw/clipboard.cpp @@ -12,7 +12,7 @@ namespace turbine { -ox::String getClipboardText(Context &ctx) noexcept { +ox::String getClipboardText(Context const &ctx) noexcept { return ox::String(glfwGetClipboardString(ctx.window)); } diff --git a/src/olympic/turbine/src/glfw/context.cpp b/src/olympic/turbine/src/glfw/context.cpp index 1aa34a24..83011fc5 100644 --- a/src/olympic/turbine/src/glfw/context.cpp +++ b/src/olympic/turbine/src/glfw/context.cpp @@ -12,7 +12,7 @@ void safeDelete(Context *p) { delete p; } -keel::Context const&keelCtx(Context const&ctx) noexcept { +keel::Context const &keelCtx(Context const &ctx) noexcept { return ctx.keelCtx; } @@ -20,11 +20,11 @@ keel::Context &keelCtx(Context &ctx) noexcept { return ctx.keelCtx; } -void setApplicationDataRaw(Context &ctx, ox::AnyPtr const&applicationData) noexcept { +void setApplicationDataRaw(Context &ctx, ox::AnyPtr const &applicationData) noexcept { ctx.applicationData = applicationData; } -ox::AnyPtr const&applicationDataRaw(Context &ctx) noexcept { +ox::AnyPtr const &applicationDataRaw(Context &ctx) noexcept { return ctx.applicationData; } diff --git a/src/olympic/turbine/src/glfw/context.hpp b/src/olympic/turbine/src/glfw/context.hpp index a9e1d318..44909468 100644 --- a/src/olympic/turbine/src/glfw/context.hpp +++ b/src/olympic/turbine/src/glfw/context.hpp @@ -35,8 +35,8 @@ class Context { Context() noexcept = default; - Context(Context const&other) noexcept = delete; - Context(Context const&&other) noexcept = delete; + Context(Context const &other) noexcept = delete; + Context(Context const &&other) noexcept = delete; }; diff --git a/src/olympic/turbine/src/glfw/turbine.cpp b/src/olympic/turbine/src/glfw/turbine.cpp index 716e7030..6efb6dd6 100644 --- a/src/olympic/turbine/src/glfw/turbine.cpp +++ b/src/olympic/turbine/src/glfw/turbine.cpp @@ -214,7 +214,7 @@ ox::Bounds getWindowBounds(Context const &ctx) noexcept { return bnds; } -ox::Error setWindowBounds(Context &ctx, ox::Bounds const&bnds) noexcept { +ox::Error setWindowBounds(Context &ctx, ox::Bounds const &bnds) noexcept { glfwSetWindowPos(ctx.window, bnds.x, bnds.y); glfwSetWindowSize(ctx.window, bnds.width, bnds.height); return {}; @@ -430,13 +430,13 @@ ox::Error run(Context &ctx) noexcept { return {}; } -TimeMs ticksMs(Context const&ctx) noexcept { +TimeMs ticksMs(Context const &ctx) noexcept { using namespace std::chrono; auto const now = duration_cast(system_clock::now().time_since_epoch()).count(); return static_cast(now) - ctx.startTime; } -bool buttonDown(Context const&ctx, Key const key) noexcept { +bool buttonDown(Context const &ctx, Key const key) noexcept { return (ctx.keysDown >> static_cast(key)) & 1; }