diff --git a/image.go b/image.go index 3edb15ebf..88e7eea18 100644 --- a/image.go +++ b/image.go @@ -527,12 +527,8 @@ type DrawTrianglesShaderOptions struct { AntiAlias bool } -func init() { - var op DrawTrianglesShaderOptions - if got, want := len(op.Images), graphics.ShaderImageCount; got != want { - panic(fmt.Sprintf("ebiten: len((DrawTrianglesShaderOptions{}).Images) must be %d but %d", want, got)) - } -} +// Check the number of images. +var _ [len(DrawTrianglesShaderOptions{}.Images)]int = [graphics.ShaderImageCount]int{} // DrawTrianglesShader draws triangles with the specified vertices and their indices with the specified shader. // @@ -673,12 +669,8 @@ type DrawRectShaderOptions struct { Images [4]*Image } -func init() { - var op DrawRectShaderOptions - if got, want := len(op.Images), graphics.ShaderImageCount; got != want { - panic(fmt.Sprintf("ebiten: len((DrawRectShaderOptions{}).Images) must be %d but %d", want, got)) - } -} +// Check the number of images. +var _ [len(DrawRectShaderOptions{}.Images)]int = [graphics.ShaderImageCount]int{} // DrawRectShader draws a rectangle with the specified width and height with the specified shader. //