2024-01-16 01:08:21 +03:00
|
|
|
package gg
|
|
|
|
|
2024-05-28 11:24:12 +03:00
|
|
|
import "github.com/hajimehoshi/ebiten/v2"
|
|
|
|
import "surdeus.su/core/gg/mx"
|
2024-01-16 01:08:21 +03:00
|
|
|
|
2024-05-28 11:24:12 +03:00
|
|
|
type EVertice = ebiten.Vertex
|
|
|
|
|
|
|
|
// Ebitens vector in better abstractions like Vectors.
|
|
|
|
type Vertice struct {
|
|
|
|
Dst mx.Vector
|
|
|
|
Src mx.Vector
|
|
|
|
Color
|
|
|
|
}
|
|
|
|
|
|
|
|
func (v Vertice) ToAPI() EVertice {
|
|
|
|
return EVertice {
|
|
|
|
DstX: float32(v.Dst.X),
|
|
|
|
DstY: float32(v.Dst.Y),
|
|
|
|
SrcX: float32(v.Src.X),
|
|
|
|
SrcY: float32(v.Src.Y),
|
|
|
|
ColorR: float32(v.Color.R)/(float32(MaxColorValue)),
|
|
|
|
ColorG: float32(v.Color.G)/(float32(MaxColorValue)),
|
|
|
|
ColorB: float32(v.Color.B)/(float32(MaxColorValue)),
|
|
|
|
ColorA: float32(v.Color.A)/(float32(MaxColorValue)),
|
|
|
|
}
|
|
|
|
}
|