summaryrefslogtreecommitdiff
path: root/tiledef.go
diff options
context:
space:
mode:
authoranon5 <anon5clam@protonmail.com>2021-06-21 18:47:26 +0000
committeranon5 <anon5clam@protonmail.com>2021-06-21 18:47:26 +0000
commit425da65ed46061303604610bb539d6495b2b1f3f (patch)
tree10ae3e665132c369ce0207676321cef870679923 /tiledef.go
parent9f239d341ef46b656dda759020da87bdd0606344 (diff)
downloadmt-425da65ed46061303604610bb539d6495b2b1f3f.tar.xz
Add high-level protocol (de)serialization
Diffstat (limited to 'tiledef.go')
-rw-r--r--tiledef.go40
1 files changed, 40 insertions, 0 deletions
diff --git a/tiledef.go b/tiledef.go
new file mode 100644
index 0000000..9a5714d
--- /dev/null
+++ b/tiledef.go
@@ -0,0 +1,40 @@
+package mt
+
+type AlignType uint8
+
+const (
+ NoAlign AlignType = iota
+ WorldAlign
+ UserAlign
+)
+
+type TileFlags uint16
+
+const (
+ TileBackfaceCull TileFlags = 1 << iota
+ TileAbleH
+ TileAbleV
+ TileColor
+ TileScale
+ TileAlign
+)
+
+type TileDef struct {
+ //mt:const uint8(6)
+
+ Texture
+ Anim TileAnim
+ Flags TileFlags
+
+ //mt:if %s.Flags&TileColor != 0
+ R, G, B uint8
+ //mt:end
+
+ //mt:if %s.Flags&TileScale != 0
+ Scale uint8
+ //mt:end
+
+ //mt:if %s.Flags&TileAlign != 0
+ Align AlignType
+ //mt:end
+}