mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
graphics: Don't use GeoM/ColorM in pixels. Use graphics.Matrix instead
This commit is contained in:
parent
3ea6033c3d
commit
62acfb5b0a
10
imageimpl.go
10
imageimpl.go
@ -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
|
||||
|
@ -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
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user