fix supid viewport bug
This commit is contained in:
@ -195,7 +195,9 @@ func (ps *precomputedShade) PrecomputeFovMap() {
|
||||
}
|
||||
|
||||
func (ps *precomputedShade) recalc(level *gamemap.Level, initCoords types.Coords, radius int) {
|
||||
|
||||
for i, _ := range ps.CellList {
|
||||
ps.CellList[i].lit = 0
|
||||
}
|
||||
ps.originCoords = initCoords
|
||||
|
||||
if radius > ps.MaxTorchRadius {
|
||||
@ -250,6 +252,7 @@ func (ps *precomputedShade) recalc(level *gamemap.Level, initCoords types.Coords
|
||||
|
||||
func (ps *precomputedShade) ComputeFov(level *gamemap.Level, initCoords types.Coords, radius int) {
|
||||
|
||||
level.SetAllInvisible()
|
||||
ps.recalc(level, initCoords, radius)
|
||||
|
||||
for _, cell := range ps.CellList {
|
||||
@ -260,6 +263,7 @@ func (ps *precomputedShade) ComputeFov(level *gamemap.Level, initCoords types.Co
|
||||
continue
|
||||
}
|
||||
level.GetTile(cs).Visible = true
|
||||
level.GetTile(cs).Explored = true
|
||||
}
|
||||
|
||||
//light walls, crutch
|
||||
@ -273,6 +277,7 @@ func (ps *precomputedShade) ComputeFov(level *gamemap.Level, initCoords types.Co
|
||||
(maybeNb.X == cell.X || maybeNb.Y == cell.Y) &&
|
||||
maybeNb.lit > 0 { //magic constant!
|
||||
level.GetTile(cs).Visible = true
|
||||
level.GetTile(cs).Explored = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user