[nostalgia/core/studio] Add pixel outline to tile sheet editor
This commit is contained in:
@@ -4,6 +4,8 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <ox/model/def.hpp>
|
||||
|
||||
#include <nostalgia/common/bounds.hpp>
|
||||
#include <nostalgia/core/gfx.hpp>
|
||||
#include <nostalgia/glutils/glutils.hpp>
|
||||
@@ -20,7 +22,7 @@ enum class CommandId {
|
||||
ModPixel = 2,
|
||||
UpdateDimension = 3,
|
||||
InsertTile = 4,
|
||||
ClipboardPaste = 4,
|
||||
ClipboardPaste = 5,
|
||||
};
|
||||
|
||||
enum class TileSheetTool: int {
|
||||
@@ -49,20 +51,16 @@ struct PixelChunk {
|
||||
int size = 0;
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
constexpr ox::Error model(T *io, PixelChunk *c) noexcept {
|
||||
io->template setTypeInfo<PixelChunk>();
|
||||
oxReturnError(io->field("pt", &c->pt));
|
||||
oxReturnError(io->field("size", &c->size));
|
||||
return OxError(0);
|
||||
}
|
||||
oxModelBegin(PixelChunk)
|
||||
oxModelField(pt)
|
||||
oxModelField(size)
|
||||
oxModelEnd()
|
||||
|
||||
struct TileSheetClipboard {
|
||||
static constexpr auto TypeName = "net.drinkingtea.nostalgia.core.studio.TileSheetClipboard";
|
||||
static constexpr auto TypeVersion = 1;
|
||||
|
||||
template<typename T>
|
||||
friend ox::Error model(T*, TileSheetClipboard*);
|
||||
oxModelFriend(TileSheetClipboard);
|
||||
|
||||
protected:
|
||||
ox::Vector<int> m_pixels;
|
||||
@@ -158,4 +156,4 @@ class TileSheetEditor: public studio::Editor {
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user