mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-27 11:12:44 +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 {
|
if i.disposed {
|
||||||
return errors.New("ebiten: image is already disposed")
|
return errors.New("ebiten: image is already disposed")
|
||||||
}
|
}
|
||||||
|
geom := options.GeoM
|
||||||
|
colorm := options.ColorM
|
||||||
c := &drawImageHistoryItem{
|
c := &drawImageHistoryItem{
|
||||||
image: image.impl.image,
|
image: image.impl.image,
|
||||||
vertices: vertices,
|
vertices: vertices,
|
||||||
geom: options.GeoM,
|
geom: &geom,
|
||||||
colorm: options.ColorM,
|
colorm: &colorm,
|
||||||
mode: opengl.CompositeMode(options.CompositeMode),
|
mode: opengl.CompositeMode(options.CompositeMode),
|
||||||
}
|
}
|
||||||
if image.impl.pixels.inconsistent {
|
if image.impl.pixels.inconsistent {
|
||||||
i.pixels.makeInconsistent()
|
i.pixels.makeInconsistent()
|
||||||
}
|
}
|
||||||
i.pixels.appendDrawImageHistory(c)
|
i.pixels.appendDrawImageHistory(c)
|
||||||
geom := &options.GeoM
|
|
||||||
colorm := &options.ColorM
|
|
||||||
mode := opengl.CompositeMode(options.CompositeMode)
|
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 err
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
|
@ -25,8 +25,8 @@ import (
|
|||||||
type drawImageHistoryItem struct {
|
type drawImageHistoryItem struct {
|
||||||
image *graphics.Image
|
image *graphics.Image
|
||||||
vertices []int16
|
vertices []int16
|
||||||
geom GeoM
|
geom graphics.Matrix
|
||||||
colorm ColorM
|
colorm graphics.Matrix
|
||||||
mode opengl.CompositeMode
|
mode opengl.CompositeMode
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -181,7 +181,7 @@ func (p *pixels) restore(context *opengl.Context, width, height int, filter Filt
|
|||||||
/*if c.image.impl.hasHistory() {
|
/*if c.image.impl.hasHistory() {
|
||||||
panic("not reach")
|
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
|
return nil, err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user