mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-11 19:48:54 +01:00
internal/ui: rename variables
This commit is contained in:
parent
c3e855ab02
commit
696bbc088f
@ -54,7 +54,7 @@ func skipTooSlowTests(t *testing.T) bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestMain(m *testing.M) {
|
func TestMain(m *testing.M) {
|
||||||
ui.SetPanicOnErrorAtImageAtForTesting(true)
|
ui.SetPanicOnErrorOnReadingPixelsForTesting(true)
|
||||||
t.MainWithRunLoop(m)
|
t.MainWithRunLoop(m)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -22,12 +22,12 @@ import (
|
|||||||
"github.com/hajimehoshi/ebiten/v2/internal/mipmap"
|
"github.com/hajimehoshi/ebiten/v2/internal/mipmap"
|
||||||
)
|
)
|
||||||
|
|
||||||
// panicOnErrorAtImageAt indicates whether (*Image).At panics on an error or not.
|
// panicOnErrorOnReadingPixels indicates whether reading pixels panics on an error or not.
|
||||||
// This value is set only on testing.
|
// This value is set only on testing.
|
||||||
var panicOnErrorAtImageAt bool
|
var panicOnErrorOnReadingPixels bool
|
||||||
|
|
||||||
func SetPanicOnErrorAtImageAtForTesting(value bool) {
|
func SetPanicOnErrorOnReadingPixelsForTesting(value bool) {
|
||||||
panicOnErrorAtImageAt = value
|
panicOnErrorOnReadingPixels = value
|
||||||
}
|
}
|
||||||
|
|
||||||
type Image struct {
|
type Image struct {
|
||||||
@ -89,7 +89,7 @@ func (i *Image) Pixels(x, y, width, height int) []byte {
|
|||||||
|
|
||||||
pix, err := i.mipmap.Pixels(graphicsDriver(), x, y, width, height)
|
pix, err := i.mipmap.Pixels(graphicsDriver(), x, y, width, height)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if panicOnErrorAtImageAt {
|
if panicOnErrorOnReadingPixels {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
theGlobalState.setError(err)
|
theGlobalState.setError(err)
|
||||||
|
Loading…
Reference in New Issue
Block a user