hedgewars/uLandGenPerlin.pas
changeset 10494 0eb97cf4c78e
parent 10492 0cf3b2762606
child 10510 9329dab04490
equal deleted inserted replaced
10493:bcbf029e6b08 10494:0eb97cf4c78e
    53 end;
    53 end;
    54 
    54 
    55 
    55 
    56 function lerp(t, a, b: LongInt) : LongInt; inline;
    56 function lerp(t, a, b: LongInt) : LongInt; inline;
    57 begin
    57 begin
    58     lerp:= a + (Int64(b - a) * t shr 12)
    58     lerp:= a + ((Int64(b) - a) * t shr 12)
    59 end;
    59 end;
    60 
    60 
    61 
    61 
    62 function grad(hash, x, y: LongInt) : LongInt; inline;
    62 function grad(hash, x, y: LongInt) : LongInt; inline;
    63 var h, v, u: LongInt;
    63 var h, v, u: LongInt;
   101 begin
   101 begin
   102     f:= t * t * t * (t * (t * 6 - 15) + 10);
   102     f:= t * t * t * (t * (t * 6 - 15) + 10);
   103 end;
   103 end;
   104 
   104 
   105 procedure inoise_setup();
   105 procedure inoise_setup();
   106 var i, ii, t: LongInt;
   106 var i, ii, t: Longword;
   107 begin
   107 begin
   108     for i:= 0 to 254 do
   108     for i:= 0 to 254 do
   109         p[i]:= i + 1;
   109         p[i]:= i + 1;
   110     p[255]:= 0;
   110     p[255]:= 0;
   111 
   111