From eac471b21b50e7296e8d56d5bef6ab94033d7bc4 Mon Sep 17 00:00:00 2001 From: Gary Talent Date: Sun, 10 Apr 2022 03:04:24 -0500 Subject: [PATCH] [nostalgia] Add constructors needed by construct_at --- src/nostalgia/core/studio/tilesheeteditormodel.cpp | 13 +++++++++++++ src/nostalgia/tools/pack/pack.cpp | 4 ++++ 2 files changed, 17 insertions(+) diff --git a/src/nostalgia/core/studio/tilesheeteditormodel.cpp b/src/nostalgia/core/studio/tilesheeteditormodel.cpp index 399b7d5f..bb1bd7cf 100644 --- a/src/nostalgia/core/studio/tilesheeteditormodel.cpp +++ b/src/nostalgia/core/studio/tilesheeteditormodel.cpp @@ -25,6 +25,10 @@ class TileSheetClipboard: public ClipboardObject { static constexpr auto TypeVersion = 1; uint16_t colorIdx = 0; geo::Point pt; + constexpr Pixel(uint16_t pColorIdx, geo::Point pPt) noexcept { + colorIdx = pColorIdx; + pt = pPt; + } }; protected: ox::Vector m_pixels; @@ -74,6 +78,10 @@ class DrawCommand: public studio::UndoCommand { struct Change { uint32_t idx = 0; uint16_t oldPalIdx = 0; + constexpr Change(uint32_t pIdx, uint16_t pOldPalIdx) noexcept { + idx = pIdx; + oldPalIdx = pOldPalIdx; + } }; TileSheet *m_img = nullptr; TileSheet::SubSheetIdx m_subSheetIdx; @@ -151,6 +159,11 @@ class CutPasteCommand: public studio::UndoCommand { uint32_t idx = 0; uint16_t newPalIdx = 0; uint16_t oldPalIdx = 0; + constexpr Change(uint32_t pIdx, uint16_t pNewPalIdx, uint16_t pOldPalIdx) noexcept { + idx = pIdx; + newPalIdx = pNewPalIdx; + oldPalIdx = pOldPalIdx; + } }; TileSheet *m_img = nullptr; TileSheet::SubSheetIdx m_subSheetIdx; diff --git a/src/nostalgia/tools/pack/pack.cpp b/src/nostalgia/tools/pack/pack.cpp index c7d8883e..a14dee3e 100644 --- a/src/nostalgia/tools/pack/pack.cpp +++ b/src/nostalgia/tools/pack/pack.cpp @@ -75,6 +75,10 @@ static ox::Error verifyFile(ox::FileSystem *fs, const ox::String &path, const ox struct VerificationPair { ox::String path; ox::Buffer buff; + VerificationPair(const ox::String &pPath, const ox::Buffer &pBuff) noexcept { + path = pPath; + buff = pBuff; + } }; static ox::Error copy(ox::FileSystem *src, ox::FileSystem *dest, const ox::String &path) noexcept {