mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-25 03:08:54 +01:00
affine: Add ColorM.Equals
This commit is contained in:
parent
d02c67a996
commit
4915531450
@ -75,6 +75,16 @@ func (c *ColorM) dim() int {
|
|||||||
return ColorMDim
|
return ColorMDim
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (c *ColorM) Equals(other *ColorM) bool {
|
||||||
|
if c.values == "" {
|
||||||
|
c.values = colorMIdentityValue
|
||||||
|
}
|
||||||
|
if other.values == "" {
|
||||||
|
other.values = colorMIdentityValue
|
||||||
|
}
|
||||||
|
return c.values == other.values
|
||||||
|
}
|
||||||
|
|
||||||
// Concat multiplies a color matrix with the other color matrix.
|
// Concat multiplies a color matrix with the other color matrix.
|
||||||
// This is same as muptiplying the matrix other and the matrix c in this order.
|
// This is same as muptiplying the matrix other and the matrix c in this order.
|
||||||
func (c *ColorM) Concat(other ColorM) {
|
func (c *ColorM) Concat(other ColorM) {
|
||||||
|
@ -235,13 +235,9 @@ func (c *drawImageCommand) isMergeable(other *drawImageCommand) bool {
|
|||||||
if c.src != other.src {
|
if c.src != other.src {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
for i := 0; i < 4; i++ {
|
if !c.color.Equals(&other.color) {
|
||||||
for j := 0; j < 5; j++ {
|
|
||||||
if c.color.Element(i, j) != other.color.Element(i, j) {
|
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
if c.mode != other.mode {
|
if c.mode != other.mode {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user