mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
internal/buffered: remove unnecessary deferred functions
This commit is contained in:
parent
820c71b895
commit
b0f88bce7d
@ -47,27 +47,11 @@ func EndFrame(graphicsDriver graphicsdriver.Graphics, swapBuffersForGL func()) e
|
||||
}
|
||||
|
||||
func NewImage(width, height int, imageType atlas.ImageType) *Image {
|
||||
i := &Image{
|
||||
return &Image{
|
||||
width: width,
|
||||
height: height,
|
||||
img: atlas.NewImage(width, height, imageType),
|
||||
}
|
||||
i.initialize(imageType)
|
||||
return i
|
||||
}
|
||||
|
||||
func (i *Image) initialize(imageType atlas.ImageType) {
|
||||
if maybeCanAddDelayedCommand() {
|
||||
if tryAddDelayedCommand(func() {
|
||||
i.initializeImpl(imageType)
|
||||
}) {
|
||||
return
|
||||
}
|
||||
}
|
||||
i.initializeImpl(imageType)
|
||||
}
|
||||
|
||||
func (i *Image) initializeImpl(imageType atlas.ImageType) {
|
||||
i.img = atlas.NewImage(i.width, i.height, imageType)
|
||||
}
|
||||
|
||||
func (i *Image) invalidatePixels() {
|
||||
|
Loading…
Reference in New Issue
Block a user