restorable: Refactoring: Remove newImageWithoutInit

This commit is contained in:
Hajime Hoshi 2018-12-01 20:28:38 +01:00
parent c6dd0a75d9
commit 3f75da5f35

View File

@ -57,19 +57,7 @@ type Image struct {
h2 int h2 int
} }
var dummyImage = newImageWithoutInit(16, 16, false) var dummyImage = NewImage(16, 16, false)
// newImageWithoutInit creates an image without initialization.
//
// Note that Dispose is not called automatically.
func newImageWithoutInit(width, height int, volatile bool) *Image {
i := &Image{
image: graphicscommand.NewImage(width, height),
volatile: volatile,
}
theImages.add(i)
return i
}
// NewImage creates an empty image with the given size. // NewImage creates an empty image with the given size.
// //
@ -77,7 +65,11 @@ func newImageWithoutInit(width, height int, volatile bool) *Image {
// //
// Note that Dispose is not called automatically. // Note that Dispose is not called automatically.
func NewImage(width, height int, volatile bool) *Image { func NewImage(width, height int, volatile bool) *Image {
i := newImageWithoutInit(width, height, volatile) i := &Image{
image: graphicscommand.NewImage(width, height),
volatile: volatile,
}
theImages.add(i)
return i return i
} }