mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-25 19:28:57 +01:00
restorable: Unexport functions
This commit is contained in:
parent
aa5c278445
commit
bc105e7350
@ -94,7 +94,7 @@ func (p *Image) makeStale() {
|
||||
p.stale = true
|
||||
}
|
||||
|
||||
func (p *Image) ClearIfVolatile() {
|
||||
func (p *Image) clearIfVolatile() {
|
||||
if !p.volatile {
|
||||
return
|
||||
}
|
||||
@ -175,7 +175,7 @@ func (p *Image) At(x, y int, context *opengl.Context) (color.RGBA, error) {
|
||||
return color.RGBA{r, g, b, a}, nil
|
||||
}
|
||||
|
||||
func (p *Image) MakeStaleIfDependingOn(target *Image) {
|
||||
func (p *Image) makeStaleIfDependingOn(target *Image) {
|
||||
if p.stale {
|
||||
return
|
||||
}
|
||||
@ -217,7 +217,7 @@ func (p *Image) hasDependency() bool {
|
||||
}
|
||||
|
||||
// Restore restores *graphics.Image from the pixels using its state.
|
||||
func (p *Image) Restore(context *opengl.Context) error {
|
||||
func (p *Image) restore(context *opengl.Context) error {
|
||||
w, h := p.image.Size()
|
||||
if p.screen {
|
||||
// The screen image should also be recreated because framebuffer might
|
||||
|
@ -74,7 +74,7 @@ func (i *images) resetPixelsIfDependingOn(target *Image) {
|
||||
}
|
||||
i.lastChecked = target
|
||||
for img := range i.images {
|
||||
img.MakeStaleIfDependingOn(target)
|
||||
img.makeStaleIfDependingOn(target)
|
||||
}
|
||||
}
|
||||
|
||||
@ -94,12 +94,12 @@ func (i *images) Restore(context *opengl.Context) error {
|
||||
}
|
||||
// Images depending on other images should be processed first.
|
||||
for _, img := range imagesWithoutDependency {
|
||||
if err := img.Restore(context); err != nil {
|
||||
if err := img.restore(context); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
for _, img := range imagesWithDependency {
|
||||
if err := img.Restore(context); err != nil {
|
||||
if err := img.restore(context); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
@ -110,6 +110,6 @@ func (i *images) ClearVolatileImages() {
|
||||
i.m.Lock()
|
||||
defer i.m.Unlock()
|
||||
for img := range i.images {
|
||||
img.ClearIfVolatile()
|
||||
img.clearIfVolatile()
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user