Compare commits

..

1 Commits

Author SHA1 Message Date
e628ce67a0 [keel] Add isUuidUrl function
All checks were successful
Build / build (push) Successful in 1m13s
2025-05-30 23:17:57 -05:00
5 changed files with 40 additions and 45 deletions

View File

@ -3,11 +3,6 @@
* 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

View File

@ -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.value) { CommandId::Paste, m_img, m_activeSubsSheetIdx, pt1, pt2, *cb); cmd.ok()) {
std::ignore = pushCommand(cmd.value); std::ignore = pushCommand(cmd.value);
} }
} }
@ -234,7 +234,7 @@ void TileSheetEditorModel::setActiveSubsheet(TileSheet::SubSheetIdx const &idx)
m_lastDrawUpdatePt = {-1, -1}; m_lastDrawUpdatePt = {-1, -1};
} }
void TileSheetEditorModel::fill(ox::Point const &pt, uint8_t const palIdx) noexcept { void TileSheetEditorModel::fill(ox::Point const&pt, int 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) {
@ -395,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> const pixels, ox::Span<bool> pixels,
ox::Point const&pt, ox::Point const&pt,
uint8_t const oldColor) noexcept { int const oldColor) const 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) {

View File

@ -14,7 +14,7 @@
namespace nostalgia::gfx { namespace nostalgia::gfx {
class TileSheetEditorModel final: public ox::SignalHandler { class TileSheetEditorModel: public ox::SignalHandler {
public: public:
ox::Signal<ox::Error(const TileSheet::SubSheetIdx&)> activeSubsheetChanged; ox::Signal<ox::Error(const TileSheet::SubSheetIdx&)> activeSubsheetChanged;
@ -104,7 +104,7 @@ class TileSheetEditorModel final: public ox::SignalHandler {
return m_activeSubsSheetIdx; return m_activeSubsSheetIdx;
} }
void fill(ox::Point const &pt, uint8_t palIdx) noexcept; void fill(ox::Point const&pt, int palIdx) noexcept;
ox::Error rotateLeft() noexcept; ox::Error rotateLeft() noexcept;
@ -144,11 +144,11 @@ class TileSheetEditorModel final: 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:
static void getFillPixels( 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,
uint8_t oldColor) noexcept; int oldColor) const noexcept;
void setPalPath() noexcept; void setPalPath() noexcept;

View File

@ -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<uint8_t>(m_palIdx)); m_model.fill(pt, static_cast<int>(m_palIdx));
} }
void TileSheetEditorView::releaseMouseButton(TileSheetTool tool) noexcept { void TileSheetEditorView::releaseMouseButton(TileSheetTool tool) noexcept {