mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-25 11:18:54 +01:00
ebiten: Panic when a sub-image is specified at DrawRectangleWithImage and DrawTrianglesWithShader
Updates #1168
This commit is contained in:
parent
63f83ceeaa
commit
65783489a5
8
image.go
8
image.go
@ -437,6 +437,10 @@ func (i *Image) DrawRectangleWithShader(width, height int, shader *Shader, optio
|
||||
if img.isDisposed() {
|
||||
panic("ebiten: the given image to DrawRectangleWithShader must not be disposed")
|
||||
}
|
||||
if img.isSubImage() {
|
||||
// TODO: Implement this.
|
||||
panic("ebiten: rendering a sub-image is not implemented (DrawRectangleWithShader)")
|
||||
}
|
||||
if w, h := img.Size(); width != w || height != h {
|
||||
panic("ebiten: all the source images must be the same size with the rectangle")
|
||||
}
|
||||
@ -517,6 +521,10 @@ func (i *Image) DrawTrianglesWithShader(vertices []Vertex, indices []uint16, sha
|
||||
if img.isDisposed() {
|
||||
panic("ebiten: the given image to DrawTrianglesWithShader must not be disposed")
|
||||
}
|
||||
if img.isSubImage() {
|
||||
// TODO: Implement this.
|
||||
panic("ebiten: rendering a sub-image is not implemented (DrawTrianglesWithShader)")
|
||||
}
|
||||
if imgw == 0 || imgh == 0 {
|
||||
imgw, imgh = img.Size()
|
||||
} else if w, h := img.Size(); imgw != w || imgh != h {
|
||||
|
Loading…
Reference in New Issue
Block a user