mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
graphics: Rename noSave -> volatile
This commit is contained in:
parent
11e67d0eed
commit
17fbffb720
@ -47,7 +47,7 @@ func (c *graphicsContext) SetSize(screenWidth, screenHeight int, screenScale flo
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
offscreen.impl.noSave = true
|
||||
offscreen.impl.volatile = true
|
||||
|
||||
intScreenScale := int(math.Ceil(screenScale))
|
||||
w := screenWidth * intScreenScale
|
||||
@ -56,7 +56,7 @@ func (c *graphicsContext) SetSize(screenWidth, screenHeight int, screenScale flo
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
offscreen2.impl.noSave = true
|
||||
offscreen2.impl.volatile = true
|
||||
|
||||
w = int(float64(screenWidth) * screenScale)
|
||||
h = int(float64(screenHeight) * screenScale)
|
||||
@ -64,7 +64,6 @@ func (c *graphicsContext) SetSize(screenWidth, screenHeight int, screenScale flo
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
c.screen.impl.noSave = true
|
||||
c.screen.Clear()
|
||||
|
||||
c.offscreen = offscreen
|
||||
|
13
imageimpl.go
13
imageimpl.go
@ -36,7 +36,7 @@ type imageImpl struct {
|
||||
height int
|
||||
filter Filter
|
||||
pixels []uint8
|
||||
noSave bool
|
||||
volatile bool
|
||||
screen bool
|
||||
m sync.Mutex
|
||||
}
|
||||
@ -94,10 +94,11 @@ func newScreenImageImpl(width, height int) (*imageImpl, error) {
|
||||
return nil, err
|
||||
}
|
||||
i := &imageImpl{
|
||||
image: img,
|
||||
width: width,
|
||||
height: height,
|
||||
screen: true,
|
||||
image: img,
|
||||
width: width,
|
||||
height: height,
|
||||
volatile: true,
|
||||
screen: true,
|
||||
}
|
||||
runtime.SetFinalizer(i, (*imageImpl).Dispose)
|
||||
return i, nil
|
||||
@ -181,7 +182,7 @@ func (i *imageImpl) savePixels(context *opengl.Context) error {
|
||||
if i.screen {
|
||||
return nil
|
||||
}
|
||||
if i.noSave {
|
||||
if i.volatile {
|
||||
return nil
|
||||
}
|
||||
if i.disposed {
|
||||
|
Loading…
Reference in New Issue
Block a user