mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-24 18:58: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) {
|
||||
ui.SetPanicOnErrorAtImageAtForTesting(true)
|
||||
ui.SetPanicOnErrorOnReadingPixelsForTesting(true)
|
||||
t.MainWithRunLoop(m)
|
||||
}
|
||||
|
||||
|
@ -22,12 +22,12 @@ import (
|
||||
"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.
|
||||
var panicOnErrorAtImageAt bool
|
||||
var panicOnErrorOnReadingPixels bool
|
||||
|
||||
func SetPanicOnErrorAtImageAtForTesting(value bool) {
|
||||
panicOnErrorAtImageAt = value
|
||||
func SetPanicOnErrorOnReadingPixelsForTesting(value bool) {
|
||||
panicOnErrorOnReadingPixels = value
|
||||
}
|
||||
|
||||
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)
|
||||
if err != nil {
|
||||
if panicOnErrorAtImageAt {
|
||||
if panicOnErrorOnReadingPixels {
|
||||
panic(err)
|
||||
}
|
||||
theGlobalState.setError(err)
|
||||
|
Loading…
Reference in New Issue
Block a user