mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-26 18:52:44 +01:00
graphics: Remove imageImpl.screen
This commit is contained in:
parent
7903fe2108
commit
eac816ca47
12
image.go
12
image.go
@ -67,9 +67,6 @@ func (i *images) restorePixels(context *opengl.Context) error {
|
|||||||
// If framebuffers/textures are not disposed here, a newly created framebuffer/texture
|
// If framebuffers/textures are not disposed here, a newly created framebuffer/texture
|
||||||
// number can be a same number as existing one.
|
// number can be a same number as existing one.
|
||||||
for img := range i.images {
|
for img := range i.images {
|
||||||
if img.screen {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
if img.isDisposed() {
|
if img.isDisposed() {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
@ -206,7 +203,7 @@ func NewImage(width, height int, filter Filter) (*Image, error) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
if err := img.image.Fill(color.Transparent); err != nil {
|
if err := img.Fill(color.Transparent); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
eimg, err := theImages.add(img)
|
eimg, err := theImages.add(img)
|
||||||
@ -260,10 +257,5 @@ func newImageWithScreenFramebuffer(width, height int) (*Image, error) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
img.screen = true
|
return &Image{img}, nil
|
||||||
eimg, err := theImages.add(img)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
return eimg, nil
|
|
||||||
}
|
}
|
||||||
|
@ -30,7 +30,6 @@ import (
|
|||||||
|
|
||||||
type imageImpl struct {
|
type imageImpl struct {
|
||||||
image *graphics.Image
|
image *graphics.Image
|
||||||
screen bool
|
|
||||||
disposed bool
|
disposed bool
|
||||||
width int
|
width int
|
||||||
height int
|
height int
|
||||||
@ -147,9 +146,6 @@ func (i *imageImpl) savePixels(context *opengl.Context) error {
|
|||||||
func (i *imageImpl) restorePixels() error {
|
func (i *imageImpl) restorePixels() error {
|
||||||
i.m.Lock()
|
i.m.Lock()
|
||||||
defer i.m.Unlock()
|
defer i.m.Unlock()
|
||||||
if i.screen {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
if i.disposed {
|
if i.disposed {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user