From edceec9220a1f1dced4fca6fbaaea6667786bedd Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Sun, 23 Jun 2013 02:16:22 +0900 Subject: [PATCH] Rename TextureLocation to TexturePart --- example/game/sprites/sprites.go | 8 ++++---- graphics/graphics.go | 4 ++-- graphics/opengl/graphics_context.go | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/example/game/sprites/sprites.go b/example/game/sprites/sprites.go index 49c89acf1..86cbc0a26 100644 --- a/example/game/sprites/sprites.go +++ b/example/game/sprites/sprites.go @@ -20,7 +20,7 @@ type Sprite struct { vy int } -func NewSprite(screenWidth, screenHeight, width, height int) *Sprite { +func newSprite(screenWidth, screenHeight, width, height int) *Sprite { maxX := screenWidth - width maxY := screenHeight - height sprite := &Sprite{ @@ -89,7 +89,7 @@ func (game *Sprites) Init(tf graphics.TextureFactory) { game.ebitenTexture = tf.NewTextureFromImage(img) game.sprites = []*Sprite{} for i := 0; i < 1000; i++ { - sprite := NewSprite( + sprite := newSprite( game.ScreenWidth(), game.ScreenHeight(), game.ebitenTexture.Width, @@ -108,10 +108,10 @@ func (game *Sprites) Draw(g graphics.GraphicsContext, offscreen graphics.Texture g.Fill(&color.RGBA{R: 128, G: 128, B: 255, A: 255}) // Draw the sprites - locations := make([]graphics.TextureLocation, 0, len(game.sprites)) + locations := make([]graphics.TexturePart, 0, len(game.sprites)) texture := game.ebitenTexture for _, sprite := range game.sprites { - location := graphics.TextureLocation{ + location := graphics.TexturePart{ LocationX: sprite.x, LocationY: sprite.y, Source: graphics.Rect{ diff --git a/graphics/graphics.go b/graphics/graphics.go index 3bd30169b..c5babd220 100644 --- a/graphics/graphics.go +++ b/graphics/graphics.go @@ -18,7 +18,7 @@ type Rect struct { Height int } -type TextureLocation struct { +type TexturePart struct { LocationX int LocationY int Source Rect @@ -32,7 +32,7 @@ type GraphicsContext interface { geometryMatrix matrix.Geometry, colorMatrix matrix.Color) DrawTextureParts(textureId TextureID, - locations []TextureLocation, + locations []TexturePart, geometryMatrix matrix.Geometry, colorMatrix matrix.Color) SetOffscreen(textureId TextureID) diff --git a/graphics/opengl/graphics_context.go b/graphics/opengl/graphics_context.go index 6764882e7..3ee70850c 100644 --- a/graphics/opengl/graphics_context.go +++ b/graphics/opengl/graphics_context.go @@ -121,13 +121,13 @@ func (context *GraphicsContext) DrawTexture( texture graphics.Texture, geometryMatrix matrix.Geometry, colorMatrix matrix.Color) { source := graphics.Rect{0, 0, texture.Width, texture.Height} - locations := []graphics.TextureLocation{{0, 0, source}} + locations := []graphics.TexturePart{{0, 0, source}} context.DrawTextureParts(texture.ID, locations, geometryMatrix, colorMatrix) } func (context *GraphicsContext) DrawTextureParts( - textureID graphics.TextureID, locations []graphics.TextureLocation, + textureID graphics.TextureID, locations []graphics.TexturePart, geometryMatrix matrix.Geometry, colorMatrix matrix.Color) { texture := context.textures[textureID]