mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-26 03:38:55 +01:00
restorable: Remove unneeded NextPowerOf2Int usage
This commit is contained in:
parent
1068156215
commit
676a023a30
@ -19,8 +19,6 @@ import (
|
|||||||
"image/color"
|
"image/color"
|
||||||
"image/draw"
|
"image/draw"
|
||||||
"runtime"
|
"runtime"
|
||||||
|
|
||||||
"github.com/hajimehoshi/ebiten/internal/math"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// CopyImage copies origImg to a new RGBA image.
|
// CopyImage copies origImg to a new RGBA image.
|
||||||
@ -32,7 +30,7 @@ import (
|
|||||||
func CopyImage(origImg image.Image) *image.RGBA {
|
func CopyImage(origImg image.Image) *image.RGBA {
|
||||||
size := origImg.Bounds().Size()
|
size := origImg.Bounds().Size()
|
||||||
w, h := size.X, size.Y
|
w, h := size.X, size.Y
|
||||||
newImg := image.NewRGBA(image.Rect(0, 0, math.NextPowerOf2Int(w), math.NextPowerOf2Int(h)))
|
newImg := image.NewRGBA(image.Rect(0, 0, w, h))
|
||||||
switch origImg := origImg.(type) {
|
switch origImg := origImg.(type) {
|
||||||
case *image.Paletted:
|
case *image.Paletted:
|
||||||
b := origImg.Bounds()
|
b := origImg.Bounds()
|
||||||
|
Loading…
Reference in New Issue
Block a user