Engines/FlatRedBallXNA/FlatRedBall/AI/LineOfSight/VisibilityGrid.cs
/// <summary>
/// Makes walls visible if they are adjacent to visible non-walls.
/// </summary>
Makes walls visible if they are adjacent to visible non-walls.
Makes walls visible if they are adjacent to visible non - walls .
public void BleedDirectlyVisibleToWalls()
        {
            int y;
            for (int x = 1; x < mNumberOfXTiles - 1; x++)
            {
                for (y = 1; y < mNumberOfYTiles - 1; y++)
                {
                    byte valueToSet =
                        (byte)((
                        mBlockedTiles[x][y] *
                        ((mRevealedTiles[x][y + 1] & 1) |
                        (mRevealedTiles[x + 1][y] & 1) |
                        (mRevealedTiles[x][y - 1] & 1) |
                        (mRevealedTiles[x - 1][y] & 1))) << 1);
                    mRevealedTiles[x][y] = (byte)(mRevealedTiles[x][y] | valueToSet);
                }
            }
        }
public void BleedDirectlyVisibleToWalls ( ) { int y ; for ( int x = 1 ; x < mNumberOfXTiles - 1 ; x ++ ) { for ( y = 1 ; y < mNumberOfYTiles - 1 ; y ++ ) { byte valueToSet = ( byte ) ( ( mBlockedTiles [ x ] [ y ] * ( ( mRevealedTiles [ x ] [ y + 1 ] & 1 ) | ( mRevealedTiles [ x + 1 ] [ y ] & 1 ) | ( mRevealedTiles [ x ] [ y - 1 ] & 1 ) | ( mRevealedTiles [ x - 1 ] [ y ] & 1 ) ) ) << 1 ) ; mRevealedTiles [ x ] [ y ] = ( byte ) ( mRevealedTiles [ x ] [ y ] | valueToSet ) ; } } }
Makes walls visible if they are adjacent to visible non-walls.
Makes walls visible if they are adjacent to visible non - walls .
// We're not going to go to the very edges to avoid if statements (for speed reasons) //if (valueToSet != 0) //{ //    //int m = 3; //}