Squashed 'deps/nostalgia/' changes from 8419b137..e1cfcc8b
e1cfcc8b [nostalgia] Update release notes 514cb978 [nostalgia/gfx/studio/tilesheet] Fix draw command to work on same pixel after switching subsheets 4b5218c4 [nostalgia/gfx] Cleanup 2ca77173 [keel] Add isUuidUrl function cce5f52f [nostalgia/gfx/studio/tilesheet] Fix manual redo of draw actions, fix drawing to pixel 0, 0 as first action b5599329 [studio/modlib] Fix headerizeConfigFile to handle slashes in file name d8f847d7 [studio/applib] Move popup types into their own directory git-subtree-dir: deps/nostalgia git-subtree-split: e1cfcc8b5fec39173fe9608099cae29a441ddb51
This commit is contained in:
parent
08236fc790
commit
47eee1d56d
@ -3,6 +3,11 @@
|
|||||||
* Add ability to remember recent projects in config
|
* Add ability to remember recent projects in config
|
||||||
* PaletteEditor: Add RGB key shortcuts for focusing color channels
|
* 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
|
# d2025.05.1
|
||||||
|
|
||||||
* TileSheetEditor: Fix overrun errors when switching subsheets, clear selection
|
* TileSheetEditor: Fix overrun errors when switching subsheets, clear selection
|
||||||
|
@ -126,7 +126,7 @@ void TileSheetEditorModel::paste() {
|
|||||||
auto const pt1 = m_selection->a;
|
auto const pt1 = m_selection->a;
|
||||||
auto const pt2 = ox::Point{s.columns * TileWidth, s.rows * TileHeight};
|
auto const pt2 = ox::Point{s.columns * TileWidth, s.rows * TileHeight};
|
||||||
if (auto const cmd = ox::makeCatch<CutPasteCommand>(
|
if (auto const cmd = ox::makeCatch<CutPasteCommand>(
|
||||||
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);
|
std::ignore = pushCommand(cmd.value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -198,6 +198,7 @@ void TileSheetEditorModel::endDrawCommand() noexcept {
|
|||||||
if (m_ongoingDrawCommand) {
|
if (m_ongoingDrawCommand) {
|
||||||
m_ongoingDrawCommand->finish();
|
m_ongoingDrawCommand->finish();
|
||||||
m_ongoingDrawCommand = nullptr;
|
m_ongoingDrawCommand = nullptr;
|
||||||
|
m_lastDrawUpdatePt = {-1, -1};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -230,9 +231,10 @@ void TileSheetEditorModel::setActiveSubsheet(TileSheet::SubSheetIdx const&idx) n
|
|||||||
m_activeSubsSheetIdx = idx;
|
m_activeSubsSheetIdx = idx;
|
||||||
this->activeSubsheetChanged.emit(m_activeSubsSheetIdx);
|
this->activeSubsheetChanged.emit(m_activeSubsSheetIdx);
|
||||||
clearSelection();
|
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);
|
auto const&activeSubSheet = getSubSheet(m_img, m_activeSubsSheetIdx);
|
||||||
// build idx list
|
// build idx list
|
||||||
if (pt.x >= activeSubSheet.columns * TileWidth || pt.y >= activeSubSheet.rows * TileHeight) {
|
if (pt.x >= activeSubSheet.columns * TileWidth || pt.y >= activeSubSheet.rows * TileHeight) {
|
||||||
@ -393,9 +395,9 @@ ox::Error TileSheetEditorModel::moveSubSheet(TileSheet::SubSheetIdx src, TileShe
|
|||||||
|
|
||||||
void TileSheetEditorModel::getFillPixels(
|
void TileSheetEditorModel::getFillPixels(
|
||||||
TileSheet::SubSheet const&activeSubSheet,
|
TileSheet::SubSheet const&activeSubSheet,
|
||||||
ox::Span<bool> pixels,
|
ox::Span<bool> const pixels,
|
||||||
ox::Point const &pt,
|
ox::Point const &pt,
|
||||||
int const oldColor) const noexcept {
|
uint8_t const oldColor) noexcept {
|
||||||
auto const idx = ptToIdx(pt, activeSubSheet.columns);
|
auto const idx = ptToIdx(pt, activeSubSheet.columns);
|
||||||
auto const relIdx = idx % PixelsPerTile;
|
auto const relIdx = idx % PixelsPerTile;
|
||||||
if (pixels[relIdx] || activeSubSheet.pixels[idx] != oldColor) {
|
if (pixels[relIdx] || activeSubSheet.pixels[idx] != oldColor) {
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
|
|
||||||
namespace nostalgia::gfx {
|
namespace nostalgia::gfx {
|
||||||
|
|
||||||
class TileSheetEditorModel: public ox::SignalHandler {
|
class TileSheetEditorModel final: public ox::SignalHandler {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
ox::Signal<ox::Error(const TileSheet::SubSheetIdx&)> activeSubsheetChanged;
|
ox::Signal<ox::Error(const TileSheet::SubSheetIdx&)> activeSubsheetChanged;
|
||||||
@ -35,7 +35,7 @@ class TileSheetEditorModel: public ox::SignalHandler {
|
|||||||
studio::SelectionTracker m_selTracker;
|
studio::SelectionTracker m_selTracker;
|
||||||
ox::Optional<studio::Selection> m_selection;
|
ox::Optional<studio::Selection> m_selection;
|
||||||
ox::Point m_lineStartPt;
|
ox::Point m_lineStartPt;
|
||||||
ox::Point m_lastDrawUpdatePt;
|
ox::Point m_lastDrawUpdatePt{-1, -1};
|
||||||
bool m_updated = false;
|
bool m_updated = false;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@ -104,7 +104,7 @@ class TileSheetEditorModel: public ox::SignalHandler {
|
|||||||
return m_activeSubsSheetIdx;
|
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 rotateLeft() noexcept;
|
||||||
|
|
||||||
@ -144,11 +144,11 @@ class TileSheetEditorModel: public ox::SignalHandler {
|
|||||||
ox::Error moveSubSheet(TileSheet::SubSheetIdx src, TileSheet::SubSheetIdx dst) noexcept;
|
ox::Error moveSubSheet(TileSheet::SubSheetIdx src, TileSheet::SubSheetIdx dst) noexcept;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void getFillPixels(
|
static void getFillPixels(
|
||||||
TileSheet::SubSheet const &activeSubSheet,
|
TileSheet::SubSheet const &activeSubSheet,
|
||||||
ox::Span<bool> pixels,
|
ox::Span<bool> pixels,
|
||||||
ox::Point const &pt,
|
ox::Point const &pt,
|
||||||
int oldColor) const noexcept;
|
uint8_t oldColor) noexcept;
|
||||||
|
|
||||||
void setPalPath() noexcept;
|
void setPalPath() noexcept;
|
||||||
|
|
||||||
|
@ -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 {
|
void TileSheetEditorView::clickFill(ox::Vec2 const&paneSize, ox::Vec2 const&clickPos) noexcept {
|
||||||
auto const pt = clickPoint(paneSize, clickPos);
|
auto const pt = clickPoint(paneSize, clickPos);
|
||||||
m_model.fill(pt, static_cast<int>(m_palIdx));
|
m_model.fill(pt, static_cast<uint8_t>(m_palIdx));
|
||||||
}
|
}
|
||||||
|
|
||||||
void TileSheetEditorView::releaseMouseButton(TileSheetTool tool) noexcept {
|
void TileSheetEditorView::releaseMouseButton(TileSheetTool tool) noexcept {
|
||||||
|
@ -60,6 +60,11 @@ ox::Result<ox::CStringView> uuidToPath(Context &ctx, ox::StringViewCR uuid) noex
|
|||||||
|
|
||||||
ox::Result<ox::CStringView> uuidToPath(Context &ctx, ox::UUID const&uuid) noexcept;
|
ox::Result<ox::CStringView> 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
|
#ifndef OX_BARE_METAL
|
||||||
|
|
||||||
namespace detail {
|
namespace detail {
|
||||||
|
@ -10,6 +10,6 @@
|
|||||||
|
|
||||||
namespace studio {
|
namespace studio {
|
||||||
|
|
||||||
void registerModule(studio::Module const*) noexcept;
|
void registerModule(Module const*) noexcept;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,17 +1,17 @@
|
|||||||
add_library(
|
add_library(
|
||||||
StudioAppLib
|
StudioAppLib
|
||||||
aboutpopup.cpp
|
|
||||||
app.cpp
|
app.cpp
|
||||||
clawviewer.cpp
|
clawviewer.cpp
|
||||||
deleteconfirmation.cpp
|
|
||||||
filedialogmanager.cpp
|
filedialogmanager.cpp
|
||||||
font.cpp
|
font.cpp
|
||||||
makecopypopup.cpp
|
popups/about.cpp
|
||||||
newdir.cpp
|
popups/deleteconfirmation.cpp
|
||||||
newmenu.cpp
|
popups/makecopy.cpp
|
||||||
newproject.cpp
|
popups/newdir.cpp
|
||||||
|
popups/newmenu.cpp
|
||||||
|
popups/newproject.cpp
|
||||||
|
popups/renamefile.cpp
|
||||||
projectexplorer.cpp
|
projectexplorer.cpp
|
||||||
renamefile.cpp
|
|
||||||
studioui.cpp
|
studioui.cpp
|
||||||
)
|
)
|
||||||
target_compile_definitions(
|
target_compile_definitions(
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
#include <imgui.h>
|
#include <imgui.h>
|
||||||
|
|
||||||
#include <studio/imguiutil.hpp>
|
#include <studio/imguiutil.hpp>
|
||||||
#include "aboutpopup.hpp"
|
#include "about.hpp"
|
||||||
|
|
||||||
namespace olympic {
|
namespace olympic {
|
||||||
extern ox::String appVersion;
|
extern ox::String appVersion;
|
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
#include <studio/imguiutil.hpp>
|
#include <studio/imguiutil.hpp>
|
||||||
|
|
||||||
#include "makecopypopup.hpp"
|
#include "makecopy.hpp"
|
||||||
|
|
||||||
namespace studio {
|
namespace studio {
|
||||||
|
|
@ -7,7 +7,7 @@
|
|||||||
#include <studio/imguiutil.hpp>
|
#include <studio/imguiutil.hpp>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
|
||||||
#include "filedialogmanager.hpp"
|
#include "../filedialogmanager.hpp"
|
||||||
#include "newproject.hpp"
|
#include "newproject.hpp"
|
||||||
|
|
||||||
namespace studio {
|
namespace studio {
|
@ -14,14 +14,14 @@
|
|||||||
#include <studio/project.hpp>
|
#include <studio/project.hpp>
|
||||||
#include <studio/task.hpp>
|
#include <studio/task.hpp>
|
||||||
|
|
||||||
#include "aboutpopup.hpp"
|
#include "popups/about.hpp"
|
||||||
#include "deleteconfirmation.hpp"
|
#include "popups/deleteconfirmation.hpp"
|
||||||
#include "makecopypopup.hpp"
|
#include "popups/makecopy.hpp"
|
||||||
#include "newdir.hpp"
|
#include "popups/newdir.hpp"
|
||||||
#include "newmenu.hpp"
|
#include "popups/newmenu.hpp"
|
||||||
#include "newproject.hpp"
|
#include "popups/newproject.hpp"
|
||||||
#include "projectexplorer.hpp"
|
#include "projectexplorer.hpp"
|
||||||
#include "renamefile.hpp"
|
#include "popups/renamefile.hpp"
|
||||||
|
|
||||||
namespace studio {
|
namespace studio {
|
||||||
|
|
||||||
|
@ -120,7 +120,7 @@ void editConfig(keel::Context &kctx, Func f) noexcept {
|
|||||||
*/
|
*/
|
||||||
template<typename T>
|
template<typename T>
|
||||||
ox::Error headerizeConfigFile(keel::Context &kctx, ox::StringViewCR name = ox::ModelTypeName_v<T>) noexcept {
|
ox::Error headerizeConfigFile(keel::Context &kctx, ox::StringViewCR name = ox::ModelTypeName_v<T>) noexcept {
|
||||||
auto const path = ox::sfmt("/{}.json", name);
|
auto const path = ox::sfmt("/{}.json", detail::slashesToPct(name));
|
||||||
ox::PassThroughFS fs(configPath(kctx));
|
ox::PassThroughFS fs(configPath(kctx));
|
||||||
OX_REQUIRE_M(buff, fs.read(path));
|
OX_REQUIRE_M(buff, fs.read(path));
|
||||||
OX_REQUIRE_M(cv1, ox::readOC<T>(buff));
|
OX_REQUIRE_M(cv1, ox::readOC<T>(buff));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user