hedgewars/uLand.pas
changeset 316 57d50189ad86
parent 196 993cf173218b
child 351 29bc9c36ad5f
equal deleted inserted replaced
315:73003488240b 316:57d50189ad86
    30 procedure GenMap;
    30 procedure GenMap;
    31 procedure GenPreview;
    31 procedure GenPreview;
    32 
    32 
    33 
    33 
    34 implementation
    34 implementation
    35 uses uConsole, uStore, uMisc, uConsts, uRandom, uTeams, uLandObjects;
    35 uses uConsole, uStore, uMisc, uConsts, uRandom, uTeams, uLandObjects, uSHA, uIO;
    36 
    36 
    37 type TPixAr = record
    37 type TPixAr = record
    38               Count: Longword;
    38               Count: Longword;
    39               ar: array[0..Pred(cMaxEdgePoints)] of TPoint;
    39               ar: array[0..Pred(cMaxEdgePoints)] of TPoint;
    40               end;
    40               end;
    41 
    41 
    42 procedure LogLandDigest;
    42 procedure LogLandDigest;
    43 //var ctx: TSHA1Context;
    43 var ctx: TSHA1Context;
    44 //    dig: TSHA1Digest;
    44     dig: TSHA1Digest;
    45 begin
    45     s: shortstring;
    46 //SHA1Init(ctx);
    46 begin
    47 //SHA1Update(ctx, @Land, sizeof(Land));
    47 SHA1Init(ctx);
    48 //dig:= SHA1Final(ctx);
    48 SHA1Update(ctx, @Land, sizeof(Land));
    49 {$IFDEF DEBUGFILE}
    49 dig:= SHA1Final(ctx);
    50 //AddFileLog('SHA1 Land digest: {'+inttostr(dig.LongWords[0])+':'
    50 s:= '{'+inttostr(dig[0])+':'
    51 //           +inttostr(dig.LongWords[1])+':'+inttostr(dig.LongWords[2])+':'
    51        +inttostr(dig[1])+':'
    52 //           +inttostr(dig.LongWords[3])+':'+inttostr(dig.LongWords[4])+'}');
    52        +inttostr(dig[2])+':'
    53 {$ENDIF}
    53        +inttostr(dig[3])+':'
       
    54        +inttostr(dig[4])+'}';
       
    55 SendIPC('M' + s)
    54 end;
    56 end;
    55 
    57 
    56 procedure DrawBezierEdge(var pa: TPixAr; Color: Longword);
    58 procedure DrawBezierEdge(var pa: TPixAr; Color: Longword);
    57 var x, y, i: integer;
    59 var x, y, i: integer;
    58     tx, ty, vx, vy, vlen, t: Double;
    60     tx, ty, vx, vy, vlen, t: Double;