[nostalgia/core] Get TileSheetEditor's palette view working
This commit is contained in:
@@ -9,7 +9,6 @@
|
||||
#include <nostalgia/core/gfx.hpp>
|
||||
#include <nostalgia/geo/point.hpp>
|
||||
#include <nostalgia/geo/vec.hpp>
|
||||
#include <nostalgia/glutils/glutils.hpp>
|
||||
#include <nostalgia/studio/studio.hpp>
|
||||
|
||||
namespace nostalgia::core {
|
||||
@@ -55,13 +54,14 @@ struct DrawCommand: public studio::UndoCommand {
|
||||
return false;
|
||||
}
|
||||
|
||||
void redo() noexcept override {
|
||||
void redo() noexcept final {
|
||||
for (const auto &c : m_changes) {
|
||||
oxDebugf("{} to {}", c.idx, m_palIdx);
|
||||
m_img->setPixel(c.idx, m_palIdx);
|
||||
}
|
||||
}
|
||||
|
||||
void undo() noexcept override {
|
||||
void undo() noexcept final {
|
||||
for (const auto &c : m_changes) {
|
||||
m_img->setPixel(c.idx, c.oldPalIdx);
|
||||
}
|
||||
@@ -137,9 +137,9 @@ class TileSheetEditorModel {
|
||||
[[nodiscard]]
|
||||
constexpr const NostalgiaPalette &pal() const noexcept;
|
||||
|
||||
void draw(const geo::Point &pt, std::size_t palIdx) noexcept;
|
||||
void drawCommand(const geo::Point &pt, std::size_t palIdx) noexcept;
|
||||
|
||||
void endDraw() noexcept;
|
||||
void endDrawCommand() noexcept;
|
||||
|
||||
[[nodiscard]]
|
||||
bool updated() const noexcept;
|
||||
|
||||
Reference in New Issue
Block a user