Rename Game.Init -> Game.InitTextures

This commit is contained in:
Hajime Hoshi 2013-10-20 15:51:26 +09:00
parent 6be8a2c691
commit 801688f511
11 changed files with 11 additions and 13 deletions

View File

@ -9,7 +9,7 @@ const (
)
type Game interface {
Init(tf graphics.TextureFactory)
InitTextures(tf graphics.TextureFactory)
Update(context GameContext)
Draw(context graphics.Context)
}

View File

@ -12,7 +12,7 @@ func New() *Blank {
return &Blank{}
}
func (game *Blank) Init(tf graphics.TextureFactory) {
func (game *Blank) InitTextures(tf graphics.TextureFactory) {
}
func (game *Blank) Update(context ebiten.GameContext) {

View File

@ -18,7 +18,7 @@ func New() *Input {
return &Input{}
}
func (game *Input) Init(tf graphics.TextureFactory) {
func (game *Input) InitTextures(tf graphics.TextureFactory) {
file, err := os.Open("images/text.png")
if err != nil {
panic(err)

View File

@ -29,7 +29,7 @@ func New() *Monochrome {
}
}
func (game *Monochrome) Init(tf graphics.TextureFactory) {
func (game *Monochrome) InitTextures(tf graphics.TextureFactory) {
file, err := os.Open("images/ebiten.png")
if err != nil {
panic(err)

View File

@ -35,7 +35,7 @@ func New() *Rects {
}
}
func (game *Rects) Init(tf graphics.TextureFactory) {
func (game *Rects) InitTextures(tf graphics.TextureFactory) {
game.rectTextureID = tf.NewRenderTarget(rectTextureWidth, rectTextureHeight)
game.offscreenID = tf.NewRenderTarget(offscreenWidth, offscreenHeight)
}

View File

@ -25,7 +25,7 @@ func New() *Rotating {
return &Rotating{}
}
func (game *Rotating) Init(tf graphics.TextureFactory) {
func (game *Rotating) InitTextures(tf graphics.TextureFactory) {
file, err := os.Open("images/ebiten.png")
if err != nil {
panic(err)

View File

@ -72,7 +72,7 @@ func New() *Sprites {
return &Sprites{}
}
func (game *Sprites) Init(tf graphics.TextureFactory) {
func (game *Sprites) InitTextures(tf graphics.TextureFactory) {
file, err := os.Open("images/ebiten.png")
if err != nil {
panic(err)

View File

@ -21,7 +21,7 @@ func New() *TestPattern {
return &TestPattern{}
}
func (game *TestPattern) Init(tf graphics.TextureFactory) {
func (game *TestPattern) InitTextures(tf graphics.TextureFactory) {
file, err := os.Open("images/test_pattern.png")
if err != nil {
panic(err)

View File

@ -15,7 +15,6 @@ import (
)
type Context struct {
screen *RenderTarget
screenId graphics.RenderTargetID
screenWidth int
screenHeight int
@ -54,7 +53,6 @@ func (context *Context) Init() {
context.screenId = context.NewRenderTarget(
context.screenWidth, context.screenHeight)
context.screen = context.renderTargets[context.screenId]
}
func (context *Context) ToTexture(renderTargetID graphics.RenderTargetID) graphics.TextureID {
@ -146,7 +144,7 @@ func (context *Context) DrawTextureParts(
}
func (context *Context) ResetOffscreen() {
context.setOffscreen(context.screen)
context.SetOffscreen(context.screenId)
}
func (context *Context) SetOffscreen(renderTargetID graphics.RenderTargetID) {

View File

@ -100,7 +100,7 @@ func ebiten_EbitenOpenGLView_Initialized() {
currentUI.graphicsDevice.Init()
game := <-currentUI.initializing
game.Init(currentUI.graphicsDevice.TextureFactory())
game.InitTextures(currentUI.graphicsDevice.TextureFactory())
currentUI.initialized <- game
}

View File

@ -93,7 +93,7 @@ func (ui *UI) MainLoop() {
ui.graphicsDevice.Init()
game := <-ui.initializing
game.Init(ui.graphicsDevice.TextureFactory())
game.InitTextures(ui.graphicsDevice.TextureFactory())
ui.initialized <- game
// Set the callbacks