graphics: Don't use GeoM/ColorM in pixels. Use graphics.Matrix instead

This commit is contained in:
Hajime Hoshi 2016-07-24 06:46:47 +09:00
parent 3ea6033c3d
commit 62acfb5b0a
2 changed files with 8 additions and 8 deletions

View File

@ -174,21 +174,21 @@ func (i *imageImpl) DrawImage(image *Image, options *DrawImageOptions) error {
if i.disposed {
return errors.New("ebiten: image is already disposed")
}
geom := options.GeoM
colorm := options.ColorM
c := &drawImageHistoryItem{
image: image.impl.image,
vertices: vertices,
geom: options.GeoM,
colorm: options.ColorM,
geom: &geom,
colorm: &colorm,
mode: opengl.CompositeMode(options.CompositeMode),
}
if image.impl.pixels.inconsistent {
i.pixels.makeInconsistent()
}
i.pixels.appendDrawImageHistory(c)
geom := &options.GeoM
colorm := &options.ColorM
mode := opengl.CompositeMode(options.CompositeMode)
if err := i.image.DrawImage(image.impl.image, vertices, geom, colorm, mode); err != nil {
if err := i.image.DrawImage(image.impl.image, vertices, &geom, &colorm, mode); err != nil {
return err
}
return nil

View File

@ -25,8 +25,8 @@ import (
type drawImageHistoryItem struct {
image *graphics.Image
vertices []int16
geom GeoM
colorm ColorM
geom graphics.Matrix
colorm graphics.Matrix
mode opengl.CompositeMode
}
@ -181,7 +181,7 @@ func (p *pixels) restore(context *opengl.Context, width, height int, filter Filt
/*if c.image.impl.hasHistory() {
panic("not reach")
}*/
if err := gimg.DrawImage(c.image, c.vertices, &c.geom, &c.colorm, c.mode); err != nil {
if err := gimg.DrawImage(c.image, c.vertices, c.geom, c.colorm, c.mode); err != nil {
return nil, err
}
}