anchor.diff:      fTextG: GLuint; //Shading gradient for lighting
       fTextB: GLuint; //Contrast BW for FOW over color-coder
       fUseVBO: Boolean; //Wherever to render terrain through VBO (faster but needs GL1.5) or DrawCalls (slower but needs only GL1.1)
  -    fPos: array of TVertice;
  -    fInd: array of Integer;
  +    fTilesVtx: array of TVertice;
  +    fTilesInd: array of Integer;
       fVtxShd: GLUint;
       fIndShd: GLUint;
  -    fTileUVLookup: array[0..255, 0..3] of TUVRect;
  +    fTileUVLookup: array [0..255, 0..3] of TUVRect;
       function GetTileUV(Index: Word; Rot: Byte): TUVRect;
       procedure UpdateVBO(aFOW: TKMFogOfWarCommon);
       procedure DoTiles;
  
positive.code:   SizeX := Max(fClipRect.Right - fClipRect.Left, 0);
    SizeY := Max(fClipRect.Bottom - fClipRect.Top, 0);
    H := 0;
    SetLength(fPos, (SizeX + 2) * 2 * (SizeY + 1));
    with gTerrain do
    if (MapX > 0) and (MapY > 0) then
    for I := 0 to SizeY do
  
negative.code:   begin
      tX := K + fClipRect.Left;
      tY := I + fClipRect.Top;
      fTilesVtx[H+0].X := tX-1;
      fTilesVtx[H+0].Y := tY-1 - Land[tY, tX].Height / CELL_HEIGHT_DIV;
      fTilesVtx[H+0].Z := tY - 1;
      fTilesVtx[H+0].ULit := Land[tY, tX].Light;
      fTilesVtx[H+0].UShd := -Land[tY, tX].Light;
      if Fog <> nil then
        fTilesVtx[H+0].UFow := Fog^[tY-1, tX-1] / 256
      else
        fTilesVtx[H+0].UFow := 255;
  
      tY := I + fClipRect.Top + 1;
      fTilesVtx[H+1].X := tX-1;
      fTilesVtx[H+1].Y := tY-1 - Land[tY, tX].Height / CELL_HEIGHT_DIV;
      fTilesVtx[H+1].Z := tY - 2;
      fTilesVtx[H+1].ULit := Land[tY, tX].Light;
      fTilesVtx[H+1].UShd := -Land[tY, tX].Light;
      if Fog <> nil then
        fTilesVtx[H+1].UFow := Fog^[tY-1, tX-1] / 256
      else
        fTilesVtx[H+1].UFow := 255;
  
      H := H + 2;
    end;
  
    H := 0;
    SetLength(fTilesInd, (SizeX+1) * (SizeY+1) * 6);
    for I := 0 to SizeY do
    for K := 0 to SizeX do
    begin
      Row := I * (SizeX + 2) * 2;
      fTilesInd[H+0] := Row + K * 2;
      fTilesInd[H+1] := Row + K * 2 + 1;
      fTilesInd[H+2] := Row + K * 2 + 3;
      fTilesInd[H+3] := Row + K * 2;
      fTilesInd[H+4] := Row + K * 2 + 3;
      fTilesInd[H+5] := Row + K * 2 + 2;
      H := H + 6;
    end;
  
    glBindBuffer(GL_ARRAY_BUFFER, fVtxShd);
    glBufferData(GL_ARRAY_BUFFER, Length(fTilesVtx) * SizeOf(TVertice), @fTilesVtx[0].X, GL_STREAM_DRAW);
  
    glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, fIndShd);
    glBufferData(GL_ELEMENT_ARRAY_BUFFER, Length(fTilesInd) * SizeOf(fTilesInd[0]), @fTilesInd[0], GL_STREAM_DRAW);
  end;
  
  
  