mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-12 22:17:26 +01:00
internal/graphicscommand: rename pixelCommand -> readPixelCommand
Updates #1995
This commit is contained in:
parent
c382cb2b05
commit
869147eda0
@ -533,21 +533,21 @@ func (c *replacePixelsCommand) Exec(graphicsDriver graphicsdriver.Graphics, inde
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
type pixelsCommand struct {
|
type readPixelsCommand struct {
|
||||||
result []byte
|
result []byte
|
||||||
img *Image
|
img *Image
|
||||||
}
|
}
|
||||||
|
|
||||||
// Exec executes a pixelsCommand.
|
// Exec executes a readPixelsCommand.
|
||||||
func (c *pixelsCommand) Exec(graphicsDriver graphicsdriver.Graphics, indexOffset int) error {
|
func (c *readPixelsCommand) Exec(graphicsDriver graphicsdriver.Graphics, indexOffset int) error {
|
||||||
if err := c.img.image.ReadPixels(c.result); err != nil {
|
if err := c.img.image.ReadPixels(c.result); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *pixelsCommand) String() string {
|
func (c *readPixelsCommand) String() string {
|
||||||
return fmt.Sprintf("pixels: image: %d", c.img.id)
|
return fmt.Sprintf("read-pixels: image: %d", c.img.id)
|
||||||
}
|
}
|
||||||
|
|
||||||
// disposeImageCommand represents a command to dispose an image.
|
// disposeImageCommand represents a command to dispose an image.
|
||||||
|
@ -155,7 +155,7 @@ func (i *Image) DrawTriangles(srcs [graphics.ShaderImageCount]*Image, offsets [g
|
|||||||
// ReadPixels returns an error when an error happens in the graphics driver.
|
// ReadPixels returns an error when an error happens in the graphics driver.
|
||||||
func (i *Image) ReadPixels(graphicsDriver graphicsdriver.Graphics, buf []byte) error {
|
func (i *Image) ReadPixels(graphicsDriver graphicsdriver.Graphics, buf []byte) error {
|
||||||
i.resolveBufferedReplacePixels()
|
i.resolveBufferedReplacePixels()
|
||||||
c := &pixelsCommand{
|
c := &readPixelsCommand{
|
||||||
img: i,
|
img: i,
|
||||||
result: buf,
|
result: buf,
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user