mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-26 11:48:55 +01:00
graphics: Refactoring
This commit is contained in:
parent
1627176d59
commit
b733f03489
16
imageimpl.go
16
imageimpl.go
@ -267,7 +267,14 @@ func (i *imageImpl) restore(context *opengl.Context) error {
|
|||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
if !i.volatile {
|
if i.volatile {
|
||||||
|
var err error
|
||||||
|
i.image, err = graphics.NewImage(i.width, i.height, glFilter(i.filter))
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
img := image.NewRGBA(image.Rect(0, 0, i.width, i.height))
|
img := image.NewRGBA(image.Rect(0, 0, i.width, i.height))
|
||||||
if i.pixels != nil {
|
if i.pixels != nil {
|
||||||
for j := 0; j < i.height; j++ {
|
for j := 0; j < i.height; j++ {
|
||||||
@ -305,13 +312,6 @@ func (i *imageImpl) restore(context *opengl.Context) error {
|
|||||||
i.baseColor = nil
|
i.baseColor = nil
|
||||||
i.drawImageHistory = nil
|
i.drawImageHistory = nil
|
||||||
return nil
|
return nil
|
||||||
}
|
|
||||||
var err error
|
|
||||||
i.image, err = graphics.NewImage(i.width, i.height, glFilter(i.filter))
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (i *imageImpl) Dispose() error {
|
func (i *imageImpl) Dispose() error {
|
||||||
|
Loading…
Reference in New Issue
Block a user