fond memleak, colordance broken

This commit is contained in:
anton.gurov
2019-10-31 15:08:09 +03:00
parent c372670953
commit 96d6818754
4 changed files with 166 additions and 78 deletions

View File

@ -155,21 +155,30 @@ func (vp *ViewPort) Render() {
for y := 0; y < vp.H; y++ {
for x := 0; x < vp.W; x++ {
mapCoords := types.Coords{vp.X + x, vp.Y + y}
//vp.level.GetTile(mapCoords).Render()
tile := vp.level.GetTile(mapCoords)
if tile.Visible {
if tile.MustDraw {
//darkened version of landscape
vp.layer.WithColor("green").
Put(mapCoords.X, mapCoords.Y, tile.Char)
}
} else {
if redraw == true || tile.Colordance {
vp.layer.WithColor("white").
Put(mapCoords.X, mapCoords.Y, tile.Char)
tile.Explored = true
tile.MustDraw = true
}
}
//vp.layer.
// WithRawColor(tile.GetRawColor()).
// PutWithBackground(mapCoords.X, mapCoords.Y, tile.GetChar(), "grey")
vp.layer.PutToBase(mapCoords.X,mapCoords.Y,tile.GetChar(), tile.GetRawColor(), tile.GetRawBgColor())
//if tile.Visible {
// if tile.MustDraw {
// //darkened version of landscape
// vp.layer.WithColor("green").
// Put(mapCoords.X, mapCoords.Y, tile.Char)
// }
//} else {
// if redraw == true || tile.Colordance {
// vp.layer.WithColor("grey").
// Put(mapCoords.X, mapCoords.Y, tile.Char)
// tile.Explored = true
// tile.MustDraw = true
// }
//}
}
}