mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-26 02:42:02 +01:00
affine: Refactoring
This commit is contained in:
parent
05d91eac09
commit
803aa77c20
12
colorm.go
12
colorm.go
@ -92,15 +92,21 @@ func Monochrome() ColorM {
|
|||||||
|
|
||||||
// ScaleColor is deprecated as of 1.2.0-alpha. Use Scale instead.
|
// ScaleColor is deprecated as of 1.2.0-alpha. Use Scale instead.
|
||||||
func ScaleColor(r, g, b, a float64) ColorM {
|
func ScaleColor(r, g, b, a float64) ColorM {
|
||||||
return ColorM{affine.ScaleColor(r, g, b, a)}
|
c := ColorM{}
|
||||||
|
c.Scale(r, g, b, a)
|
||||||
|
return c
|
||||||
}
|
}
|
||||||
|
|
||||||
// TranslateColor is deprecated as of 1.2.0-alpha. Use Translate instead.
|
// TranslateColor is deprecated as of 1.2.0-alpha. Use Translate instead.
|
||||||
func TranslateColor(r, g, b, a float64) ColorM {
|
func TranslateColor(r, g, b, a float64) ColorM {
|
||||||
return ColorM{affine.TranslateColor(r, g, b, a)}
|
c := ColorM{}
|
||||||
|
c.Translate(r, g, b, a)
|
||||||
|
return c
|
||||||
}
|
}
|
||||||
|
|
||||||
// RotateHue is deprecated as of 1.2.0-alpha. Use RotateHue member function instead.
|
// RotateHue is deprecated as of 1.2.0-alpha. Use RotateHue member function instead.
|
||||||
func RotateHue(theta float64) ColorM {
|
func RotateHue(theta float64) ColorM {
|
||||||
return ColorM{affine.RotateHue(theta)}
|
c := ColorM{}
|
||||||
|
c.RotateHue(theta)
|
||||||
|
return c
|
||||||
}
|
}
|
||||||
|
12
geom.go
12
geom.go
@ -88,15 +88,21 @@ func (g *GeoM) SetElement(i, j int, element float64) {
|
|||||||
|
|
||||||
// ScaleGeo is deprecated as of 1.2.0-alpha. Use Scale instead.
|
// ScaleGeo is deprecated as of 1.2.0-alpha. Use Scale instead.
|
||||||
func ScaleGeo(x, y float64) GeoM {
|
func ScaleGeo(x, y float64) GeoM {
|
||||||
return GeoM{affine.ScaleGeo(x, y)}
|
g := GeoM{}
|
||||||
|
g.Scale(x, y)
|
||||||
|
return g
|
||||||
}
|
}
|
||||||
|
|
||||||
// TranslateGeo is deprecated as of 1.2.0-alpha. Use Translate instead.
|
// TranslateGeo is deprecated as of 1.2.0-alpha. Use Translate instead.
|
||||||
func TranslateGeo(tx, ty float64) GeoM {
|
func TranslateGeo(tx, ty float64) GeoM {
|
||||||
return GeoM{affine.TranslateGeo(tx, ty)}
|
g := GeoM{}
|
||||||
|
g.Translate(tx, ty)
|
||||||
|
return g
|
||||||
}
|
}
|
||||||
|
|
||||||
// RotateGeo is deprecated as of 1.2.0-alpha. Use Rotate instead.
|
// RotateGeo is deprecated as of 1.2.0-alpha. Use Rotate instead.
|
||||||
func RotateGeo(theta float64) GeoM {
|
func RotateGeo(theta float64) GeoM {
|
||||||
return GeoM{affine.RotateGeo(theta)}
|
g := GeoM{}
|
||||||
|
g.Rotate(theta)
|
||||||
|
return g
|
||||||
}
|
}
|
||||||
|
@ -211,24 +211,3 @@ func init() {
|
|||||||
func Monochrome() ColorM {
|
func Monochrome() ColorM {
|
||||||
return monochrome
|
return monochrome
|
||||||
}
|
}
|
||||||
|
|
||||||
// ScaleColor is deprecated as of 1.2.0-alpha. Use Scale instead.
|
|
||||||
func ScaleColor(r, g, b, a float64) ColorM {
|
|
||||||
c := ColorM{}
|
|
||||||
c.Scale(r, g, b, a)
|
|
||||||
return c
|
|
||||||
}
|
|
||||||
|
|
||||||
// TranslateColor is deprecated as of 1.2.0-alpha. Use Translate instead.
|
|
||||||
func TranslateColor(r, g, b, a float64) ColorM {
|
|
||||||
c := ColorM{}
|
|
||||||
c.Translate(r, g, b, a)
|
|
||||||
return c
|
|
||||||
}
|
|
||||||
|
|
||||||
// RotateHue is deprecated as of 1.2.0-alpha. Use RotateHue member function instead.
|
|
||||||
func RotateHue(theta float64) ColorM {
|
|
||||||
c := ColorM{}
|
|
||||||
c.RotateHue(theta)
|
|
||||||
return c
|
|
||||||
}
|
|
||||||
|
@ -169,24 +169,3 @@ func (g *GeoM) Rotate(theta float64) {
|
|||||||
g.d = sin*b + cos*d
|
g.d = sin*b + cos*d
|
||||||
g.ty = sin*tx + cos*ty
|
g.ty = sin*tx + cos*ty
|
||||||
}
|
}
|
||||||
|
|
||||||
// ScaleGeo is deprecated as of 1.2.0-alpha. Use Scale instead.
|
|
||||||
func ScaleGeo(x, y float64) GeoM {
|
|
||||||
g := GeoM{}
|
|
||||||
g.Scale(x, y)
|
|
||||||
return g
|
|
||||||
}
|
|
||||||
|
|
||||||
// TranslateGeo is deprecated as of 1.2.0-alpha. Use Translate instead.
|
|
||||||
func TranslateGeo(tx, ty float64) GeoM {
|
|
||||||
g := GeoM{}
|
|
||||||
g.Translate(tx, ty)
|
|
||||||
return g
|
|
||||||
}
|
|
||||||
|
|
||||||
// RotateGeo is deprecated as of 1.2.0-alpha. Use Rotate instead.
|
|
||||||
func RotateGeo(theta float64) GeoM {
|
|
||||||
g := GeoM{}
|
|
||||||
g.Rotate(theta)
|
|
||||||
return g
|
|
||||||
}
|
|
||||||
|
Loading…
Reference in New Issue
Block a user