anchor.diff:    gRenderAux.Free;
   
     inherited;
  +end;
  +
  +
  +function GetThoughtInterpSpriteOffset(aTh: TKMUnitThought): Integer;
  +const THOUGHT_INTERP_LOOKUP: array[TKMUnitThought] of Integer = (
  +  -1,90156,90220,90284,90348,90412,90476,90540,90604
  +);
  +begin
  +  if INTERPOLATED_ANIMS then
  +  begin
  +    Result := THOUGHT_INTERP_LOOKUP[aTh];
  +  end
  +  else
  +    Result := -1;
  +end;
  +
  +
  +function GetTreeAnimSprite(aTree, aStep: Integer; aStepFrac: Single; aLoop: Boolean): Integer;
  +const
  +  TREE_INTERP_LOOKUP: array [0..OBJECTS_CNT] of Integer = (
  +  -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
  +  -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
  +  -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
  +  -1,-1,-1,-1,-1,260,388,516,644,772,868,964,-1,964,-1,-1,
  +  -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
  +  -1,-1,-1,-1,-1,-1,-1,1060,1124,1188,1252,1412,1460,1524,1588,1652,
  +  1060,1124,1188,1812,1876,1060,1124,1188,2036,2100,1060,1124,2260,2324,2388,2548,
  +  2596,2692,2788,2548,2596,2692,2948,3044,1412,3204,3268,3332,3396,-1,-1,-1,
  +  -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
  +  -1,-1,-1,-1,3556,3628,3676,3740,3556,3628,3900,3964,3556,3628,3900,4124,
  +  4188,3556,3628,3676,4348,4412,3556,3628,3676,4572,4412,4636,-1,-1,-1,-1,
  +  -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
  +  -1,-1,-1,-1,-1,-1,-1,4700,4796,4892,4988,5084,5180,5276,-1,-1,
  +  -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
  +  -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
  +  -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1);
  +var
  +  A: TKMAnimLoop;
  +begin
  +  A := gMapElements[aTree].Anim;
  +  if INTERPOLATED_ANIMS and (aTree <= High(TREE_INTERP_LOOKUP)) and (TREE_INTERP_LOOKUP[aTree] > 0) then
  +  begin
  +    Result := TREE_INTERP_LOOKUP[aTree]
  +      + INTERP_LEVEL*(aStep mod Byte(A.Count));
  +
  +    //For the last step of non-looping animations, skip the interp
  +    if aLoop or ((aStep mod Byte(A.Count)) < A.Count-1) then
  +      Result := Result + EnsureRange(Floor(INTERP_LEVEL*aStepFrac), 0, INTERP_LEVEL-1);
  +  end
  +  else
  +  begin
  +    Result := A.Step[aStep mod Byte(A.Count) +1]+1;
  +  end;
   end;
   
   
  
positive.code:   // The thought should be slightly lower than the unit so it goes OVER warrior flags
    ground := ground + THOUGHT_X_OFFSET;
  
    // Thought bubbles are animated in reverse
    Id := THOUGHT_BOUNDS[Thought, 2] + 1 -
         (gGameParams.Tick mod Word(THOUGHT_BOUNDS[Thought, 2] - THOUGHT_BOUNDS[Thought, 1]));
  
    cornerX := pX + R.Pivot[Id].X / CELL_SIZE_PX;
    cornerY := gTerrain.RenderFlatToHeight(pX, pY) + (R.Pivot[Id].Y + R.Size[Id].Y) / CELL_SIZE_PX - 1.5;
  
negative.code:   with gTerrain do
      for I := 0 to FallingTrees.Count - 1 do
      begin
        RenderMapElement1(FallingTrees.Tag[I], aAnimStep - FallingTrees.Tag2[I], FallingTrees[I].X, FallingTrees[I].Y, False);
        Assert(AnimStep - FallingTrees.Tag2[I] <= 100, 'Falling tree overrun?');
      end;
  
  