mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-25 11:18:54 +01:00
Show SetElement function
This commit is contained in:
parent
cf1b1ed15e
commit
3e5688e2e1
@ -17,7 +17,7 @@ package ebiten
|
|||||||
type affine interface {
|
type affine interface {
|
||||||
dim() int
|
dim() int
|
||||||
Element(i, j int) float64
|
Element(i, j int) float64
|
||||||
setElement(i, j int, element float64)
|
SetElement(i, j int, element float64)
|
||||||
}
|
}
|
||||||
|
|
||||||
func isIdentity(ebiten affine) bool {
|
func isIdentity(ebiten affine) bool {
|
||||||
@ -43,7 +43,7 @@ func add(lhs, rhs, result affine) {
|
|||||||
|
|
||||||
for i := 0; i < dim-1; i++ {
|
for i := 0; i < dim-1; i++ {
|
||||||
for j := 0; j < dim; j++ {
|
for j := 0; j < dim; j++ {
|
||||||
result.setElement(i, j, lhs.Element(i, j)+rhs.Element(i, j))
|
result.SetElement(i, j, lhs.Element(i, j)+rhs.Element(i, j))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -64,7 +64,7 @@ func mul(lhs, rhs, result affine) {
|
|||||||
if j == dim-1 {
|
if j == dim-1 {
|
||||||
element += lhs.Element(i, j)
|
element += lhs.Element(i, j)
|
||||||
}
|
}
|
||||||
result.setElement(i, j, element)
|
result.SetElement(i, j, element)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -67,7 +67,8 @@ func (c *ColorMatrix) Add(other ColorMatrix) {
|
|||||||
*c = result
|
*c = result
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *ColorMatrix) setElement(i, j int, element float64) {
|
// SetElement sets an element at (i, j).
|
||||||
|
func (c *ColorMatrix) SetElement(i, j int, element float64) {
|
||||||
c.es[i][j] = element
|
c.es[i][j] = element
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -60,7 +60,8 @@ func (g *GeometryMatrix) Add(other GeometryMatrix) {
|
|||||||
*g = result
|
*g = result
|
||||||
}
|
}
|
||||||
|
|
||||||
func (g *GeometryMatrix) setElement(i, j int, element float64) {
|
// SetElement sets an element at (i, j).
|
||||||
|
func (g *GeometryMatrix) SetElement(i, j int, element float64) {
|
||||||
g.es[i][j] = element
|
g.es[i][j] = element
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user