From 83055a96b55399cc06af79d4991c53769ee56c64 Mon Sep 17 00:00:00 2001 From: Gary Talent Date: Sun, 19 Jan 2025 18:11:38 -0600 Subject: [PATCH] Squashed 'deps/nostalgia/' changes from d68e6493..6b53eaf6 6b53eaf6 [ox/std] Fix string append issues 16c32273 [nostalgia/core/studio/tilesheeteditor] Fix palette drop target to only take palettes 1567a6e2 [applib] Fix build 89d543bc Merge commit '7b7d59cf63d77cf7ab6daf6ed7122eef97954555' git-subtree-dir: deps/nostalgia git-subtree-split: 6b53eaf6b1d8f4caadea8df8ec6e4c09e37993b4 --- deps/ox/src/ox/std/string.hpp | 4 ++-- .../core/src/studio/tilesheeteditor/tilesheeteditor-imgui.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/deps/ox/src/ox/std/string.hpp b/deps/ox/src/ox/std/string.hpp index baf8f2d..25293bc 100644 --- a/deps/ox/src/ox/std/string.hpp +++ b/deps/ox/src/ox/std/string.hpp @@ -392,7 +392,7 @@ template constexpr BasicString BasicString::operator+(const char *str) const noexcept { const std::size_t strLen = ox::strlen(str); const auto currentLen = len(); - BasicString cpy(currentLen + strLen); + BasicString cpy; cpy.m_buff.resize(m_buff.size() + strLen); ox::listcpy(&cpy.m_buff[0], m_buff.data(), currentLen); ox::listcpy(&cpy.m_buff[currentLen], str, strLen); @@ -423,7 +423,7 @@ constexpr BasicString BasicString::operato const std::size_t strLen = src.len(); const auto currentLen = len(); BasicString cpy(currentLen + strLen); - cpy.m_buff.resize(m_buff.size() + strLen + 1); + cpy.m_buff.resize(m_buff.size() + strLen); ox::listcpy(&cpy.m_buff[0], m_buff.data(), currentLen); ox::listcpy(&cpy.m_buff[currentLen], src.data(), strLen); cpy.m_buff[cpy.m_buff.size() - 1] = 0; diff --git a/src/nostalgia/modules/core/src/studio/tilesheeteditor/tilesheeteditor-imgui.cpp b/src/nostalgia/modules/core/src/studio/tilesheeteditor/tilesheeteditor-imgui.cpp index 5211211..8cc7c9a 100644 --- a/src/nostalgia/modules/core/src/studio/tilesheeteditor/tilesheeteditor-imgui.cpp +++ b/src/nostalgia/modules/core/src/studio/tilesheeteditor/tilesheeteditor-imgui.cpp @@ -445,7 +445,7 @@ void TileSheetEditorImGui::drawPaletteMenu() noexcept { } if (ig::DragDropTarget const dragDropTarget; dragDropTarget) { auto const [ref, err] = ig::getDragDropPayload("FileRef"); - if (!err) { + if (!err && endsWith(ref.path, FileExt_npal)) { auto const oldVal = m_selectedPaletteIdx; std::ignore = ox::findIdx(files.begin(), files.end(), ref.path).moveTo(m_selectedPaletteIdx); if (oldVal != m_selectedPaletteIdx) {