mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
buffered: Remove unnecessary line and add comments
This commit is contained in:
parent
b9e0b5f04b
commit
514c3faebd
@ -127,11 +127,12 @@ func (i *Image) At(x, y int) (r, g, b, a byte, err error) {
|
||||
if needsToDelayCommands {
|
||||
panic("buffered: the command queue is not available yet at At")
|
||||
}
|
||||
// If there are pixels that needs to be resolved, use this rather than resolving. Resolving pixels needs
|
||||
// to access GPU and is expensive (#1137).
|
||||
if i.pixels != nil {
|
||||
idx := i.width*y + x
|
||||
return i.pixels[4*idx], i.pixels[4*idx+1], i.pixels[4*idx+2], i.pixels[4*idx+3], nil
|
||||
}
|
||||
i.resolvePendingPixels(true)
|
||||
return i.img.At(x, y)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user