anchor.diff:  
     if Result = 255 then Exit;
   
  -  if X <= MapX-1 then
  +  if X <= fMapX-1 then
       Result := Max(Result, CheckVerticeRev(aRevArray,X,Y-1));
   
     if Result = 255 then Exit;
   
  -  if (X <= MapX-1) and (Y <= MapY-1) then
  +  if (X <= fMapX-1) and (Y <= fMapY-1) then
       Result := Max(Result, CheckVerticeRev(aRevArray,X,Y));
   
     if Result = 255 then Exit;
   
  -  if Y <= MapY-1 then
  +  if Y <= fMapY-1 then
       Result := Max(Result, CheckVerticeRev(aRevArray,X-1,Y));
   end;
   
  
positive.code: 
      //Avoid repeated computing (+2% performance)
      I1 := max(Pos.Y-aRadius, 0);
      I2 := min(Pos.Y+aRadius, MapY-1);
      K1 := max(Pos.X-aRadius, 0);
      K2 := min(Pos.X+aRadius, MapX-1);
      SqrRadius := Sqr(aRadius);
  
      //Inline maths here to gain performance
  
negative.code:       Revelation[I,K] := 0;
  
    // Cover with smaller radius for AroundRevelation, as nearby could be reveled tiles
    for I := Min(fMapY - 1, TL.Y + RENDER_RADIUS_ADD) to Max(0, BR.Y - RENDER_RADIUS_ADD) do
      for K := Min(fMapX - 1, TL.X + RENDER_RADIUS_ADD) to Max(0, BR.X - RENDER_RADIUS_ADD) do
        RenderRevelation[I,K] := 0;
  
    fCoverHasBeenCalled := True;
  end;
  
  
  