mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +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
|
||||
}
|
||||
|
||||
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.
|
||||
// This is same as muptiplying the matrix other and the matrix c in this order.
|
||||
func (c *ColorM) Concat(other ColorM) {
|
||||
|
@ -235,12 +235,8 @@ func (c *drawImageCommand) isMergeable(other *drawImageCommand) bool {
|
||||
if c.src != other.src {
|
||||
return false
|
||||
}
|
||||
for i := 0; i < 4; i++ {
|
||||
for j := 0; j < 5; j++ {
|
||||
if c.color.Element(i, j) != other.color.Element(i, j) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
if !c.color.Equals(&other.color) {
|
||||
return false
|
||||
}
|
||||
if c.mode != other.mode {
|
||||
return false
|
||||
|
Loading…
Reference in New Issue
Block a user