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