blob: 8d664df8b1124ea975af44c9b90ad0396a4d0ecd (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
package mt
type AnimType uint8
const (
NoAnim AnimType = iota // none
VerticalFrameAnim // vertical frame
SpriteSheetAnim // sprite sheet
maxAnim
)
//go:generate stringer -linecomment -type AnimType
type TileAnim struct {
Type AnimType
//mt:assert %s.Type < maxAnim
//mt:if %s.Type == SpriteSheetAnim
AspectRatio [2]uint8
//mt:end
//mt:if %s.Type == VerticalFrameAnim
NFrames [2]uint16
//mt:end
//mt:if %s.Type != NoAnim
Duration float32 // in seconds
//mt:end
}
|