hedgewars/uLand.pas
changeset 3369 c7289e42f0ee
parent 3365 37ac593e9027
child 3407 dcc129c4352e
equal deleted inserted replaced
3368:791fa4664209 3369:c7289e42f0ee
    33     hasBorder: boolean; 
    33     hasBorder: boolean; 
    34     hasGirders: boolean;  
    34     hasGirders: boolean;  
    35     isMap: boolean;  
    35     isMap: boolean;  
    36     playHeight, playWidth, leftX, rightX, topY, MaxHedgehogs: Longword;  // idea is that a template can specify height/width.  Or, a map, a height/width by the dimensions of the image.  If the map has pixels near top of image, it triggers border.
    36     playHeight, playWidth, leftX, rightX, topY, MaxHedgehogs: Longword;  // idea is that a template can specify height/width.  Or, a map, a height/width by the dimensions of the image.  If the map has pixels near top of image, it triggers border.
    37     LandBackSurface: PSDL_Surface;
    37     LandBackSurface: PSDL_Surface;
       
    38     digest: shortstring;
    38 
    39 
    39 type direction = record x, y: LongInt; end;
    40 type direction = record x, y: LongInt; end;
    40 const DIR_N: direction = (x: 0; y: -1);
    41 const DIR_N: direction = (x: 0; y: -1);
    41     DIR_E: direction = (x: 1; y: 0);
    42     DIR_E: direction = (x: 1; y: 0);
    42     DIR_S: direction = (x: 0; y: 1);
    43     DIR_S: direction = (x: 0; y: 1);
    78 CheckLandDigest(s);
    79 CheckLandDigest(s);
    79 SendIPCRaw(@s[0], Length(s) + 1)
    80 SendIPCRaw(@s[0], Length(s) + 1)
    80 end;
    81 end;
    81 
    82 
    82 procedure CheckLandDigest(s: shortstring);
    83 procedure CheckLandDigest(s: shortstring);
    83 const digest: shortstring = '';
       
    84 begin
    84 begin
    85 {$IFDEF DEBUGFILE}
    85 {$IFDEF DEBUGFILE}
    86 AddFileLog('CheckLandDigest: ' + s);
    86     AddFileLog('CheckLandDigest: ' + s + ' digest : ' + digest);
    87 {$ENDIF}
    87 {$ENDIF}
    88 if digest = '' then
    88     if digest = '' then
    89    digest:= s
    89         digest:= s
    90 else
    90     else
    91    TryDo(s = digest, 'Different maps generated, sorry', true)
    91         TryDo(s = digest, 'Different maps generated, sorry', true);
    92 end;
    92 end;
    93 
    93 
    94 procedure DrawLine(X1, Y1, X2, Y2: LongInt; Color: Longword);
    94 procedure DrawLine(X1, Y1, X2, Y2: LongInt; Color: Longword);
    95 var
    95 var
    96   eX, eY, dX, dY: LongInt;
    96   eX, eY, dX, dY: LongInt;
  1309 end;
  1309 end;
  1310 
  1310 
  1311 procedure initModule;
  1311 procedure initModule;
  1312 begin
  1312 begin
  1313     LandBackSurface:= nil;
  1313     LandBackSurface:= nil;
       
  1314     digest:= '';
  1314     FillChar(LandPixels, sizeof(TLandArray), 0);
  1315     FillChar(LandPixels, sizeof(TLandArray), 0);
  1315 end;
  1316 end;
  1316 
  1317 
  1317 procedure freeModule;
  1318 procedure freeModule;
  1318 begin
  1319 begin