fond memleak, colordance broken
This commit is contained in:
@ -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
|
||||
// }
|
||||
//}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user