mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-25 19:28:57 +01:00
internal/color: Remove Add
This commit is contained in:
parent
599b3501fd
commit
14abc28d3a
@ -438,43 +438,6 @@ func (c *ColorM) Concat(other *ColorM) *ColorM {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add is deprecated.
|
|
||||||
func (c *ColorM) Add(other *ColorM) *ColorM {
|
|
||||||
lhsb := colorMIdentityBody
|
|
||||||
lhst := colorMIdentityTranslate
|
|
||||||
rhsb := colorMIdentityBody
|
|
||||||
rhst := colorMIdentityTranslate
|
|
||||||
if other.isInited() {
|
|
||||||
if other.body != nil {
|
|
||||||
lhsb = other.body
|
|
||||||
}
|
|
||||||
if other.translate != nil {
|
|
||||||
lhst = other.translate
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if c.isInited() {
|
|
||||||
if c.body != nil {
|
|
||||||
rhsb = c.body
|
|
||||||
}
|
|
||||||
if c.translate != nil {
|
|
||||||
rhst = c.translate
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
newC := &ColorM{
|
|
||||||
body: make([]float32, 16),
|
|
||||||
translate: make([]float32, 4),
|
|
||||||
}
|
|
||||||
for i := range lhsb {
|
|
||||||
newC.body[i] = lhsb[i] + rhsb[i]
|
|
||||||
}
|
|
||||||
for i := range lhst {
|
|
||||||
newC.translate[i] = lhst[i] + rhst[i]
|
|
||||||
}
|
|
||||||
|
|
||||||
return newC
|
|
||||||
}
|
|
||||||
|
|
||||||
// Scale scales the matrix by (r, g, b, a).
|
// Scale scales the matrix by (r, g, b, a).
|
||||||
func (c *ColorM) Scale(r, g, b, a float32) *ColorM {
|
func (c *ColorM) Scale(r, g, b, a float32) *ColorM {
|
||||||
if !c.isInited() {
|
if !c.isInited() {
|
||||||
|
Loading…
Reference in New Issue
Block a user