mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-12 03:58:55 +01:00
shareable: Refactoring
This commit is contained in:
parent
138d9b8e47
commit
8d17ec837a
@ -354,16 +354,14 @@ func (i *Image) DrawTriangles(srcs [graphics.ShaderImageNum]*Image, vertices []f
|
|||||||
}
|
}
|
||||||
|
|
||||||
var offsets [graphics.ShaderImageNum - 1][2]float32
|
var offsets [graphics.ShaderImageNum - 1][2]float32
|
||||||
for i := range offsets {
|
for i, subimageOffset := range subimageOffsets {
|
||||||
src := srcs[i+1]
|
src := srcs[i+1]
|
||||||
if src == nil {
|
if src == nil {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
ox, oy, _, _ := src.regionWithPadding()
|
ox, oy, _, _ := src.regionWithPadding()
|
||||||
ox += paddingSize
|
offsets[i][0] = float32(ox) + paddingSize - oxf + subimageOffset[0]
|
||||||
oy += paddingSize
|
offsets[i][1] = float32(oy) + paddingSize - oyf + subimageOffset[1]
|
||||||
offsets[i][0] = float32(ox) - oxf + subimageOffsets[i][0]
|
|
||||||
offsets[i][1] = float32(oy) - oyf + subimageOffsets[i][1]
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var s *restorable.Shader
|
var s *restorable.Shader
|
||||||
|
Loading…
Reference in New Issue
Block a user