[nostalgia/core/studio] Add pixel outline to tile sheet editor

This commit is contained in:
2022-01-29 21:53:48 -06:00
parent 99550b60ee
commit f6be36741c
4 changed files with 81 additions and 61 deletions
+9 -11
View File
@@ -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 {
};
}
}