Removed unused cube textures.

This commit is contained in:
Sander Schobers 2021-08-09 08:28:02 +02:00
parent f120de375b
commit 9bf56c1386

View File

@ -18,7 +18,7 @@ type levelController struct {
Scale float32
Level *tins2021.Level
Cubes map[string]cubeTexture
Cubes cubeTexture
Animations map[string]*tins2021.Animations
MonsterTextureNames map[tins2021.MonsterType]string
@ -31,11 +31,7 @@ type levelController struct {
func newLevelControl(ctx ui.Context, level *tins2021.Level) *levelController {
control := &levelController{Level: level, Scale: .6}
textures := ctx.Textures()
control.Cubes = map[string]cubeTexture{
"regular": newCubeTexture(textures, tins2021.Orange),
"blocked": newCubeTexture(textures, tins2021.Purple),
"colored": newCubeTexture(textures, tins2021.Blue),
}
control.Cubes = newCubeTexture(textures, tins2021.Orange)
newAnimatedTexture(ctx, "star", "resources/images/star.png", func() image.Image {
return tins2021.AnimatePolygon(tins2021.CreateStar(5), tins2021.Yellow, tins2021.NewRotateAnimation(defaultAnimationFrames))
})
@ -167,12 +163,10 @@ func (r levelController) Render(ctx ui.Context) {
}
textures := ctx.Textures()
regular := r.Cubes["regular"].Scaled(textures, scale)
// blocked := r.Cubes["blocked"].Scaled(textures, scale)
// colors := r.Cubes["colored"].Scaled(textures, scale)
cubes := r.Cubes.Scaled(textures, scale)
cubeWidth := float32(regular.Normal.Width())
cubeHeight := float32(regular.Normal.Height())
cubeWidth := float32(cubes.Normal.Width())
cubeHeight := float32(cubes.Normal.Height())
player := ctx.Textures().ScaledByName("dwarf", scale*.6)
star := tins2021.NewAnimatedTexture(ctx.Textures().ScaledByName("star", scale*.4), defaultAnimationFrames)
@ -201,9 +195,9 @@ func (r levelController) Render(ctx ui.Context) {
continue
}
screenPos, platformPos := positionOfTile(pos, tile)
tileTexture := regular.Normal.Texture
tileTexture := cubes.Normal.Texture
if tile.Inversed {
tileTexture = regular.Inversed.Texture
tileTexture = cubes.Inversed.Texture
}
renderer.DrawTexturePoint(tileTexture, screenPos)
r.SmallFont.TextAlign(renderer, platformPos, color.Black, strconv.Itoa(distances[pos]), ui.AlignCenter)