vector: use WritePixels instead of Fill for whiteImage

This commit is contained in:
Hajime Hoshi 2023-03-01 15:26:07 +09:00
parent e53118235b
commit c76201090a

View File

@ -28,7 +28,13 @@ var (
) )
func init() { func init() {
whiteImage.Fill(color.White) b := whiteImage.Bounds()
pix := make([]byte, 4*b.Dx()*b.Dy())
for i := range pix {
pix[i] = 0xff
}
// This is hacky, but WritePixels is better than Fill in term of automatic texture packing.
whiteImage.WritePixels(pix)
} }
func drawVerticesForUtil(dst *ebiten.Image, vs []ebiten.Vertex, is []uint16, clr color.Color) { func drawVerticesForUtil(dst *ebiten.Image, vs []ebiten.Vertex, is []uint16, clr color.Color) {