hedgewars/uLand.pas
changeset 7483 d479b98d38f7
parent 7477 26706bf32ecf
child 7549 f6145d12bb17
child 7556 4617e8ec0507
equal deleted inserted replaced
7480:536f5f3260f1 7483:d479b98d38f7
    18 
    18 
    19 {$INCLUDE "options.inc"}
    19 {$INCLUDE "options.inc"}
    20 
    20 
    21 unit uLand;
    21 unit uLand;
    22 interface
    22 interface
    23 uses SDLh, uLandTemplates, uFloat, uConsts, GLunit, uTypes;
    23 uses SDLh, uLandTemplates, uFloat, uConsts, GLunit, uTypes, uAILandMarks;
    24 
    24 
    25 procedure initModule;
    25 procedure initModule;
    26 procedure freeModule;
    26 procedure freeModule;
    27 procedure DrawBottomBorder;
    27 procedure DrawBottomBorder;
    28 procedure GenMap;
    28 procedure GenMap;
    52     else
    52     else
    53         SetLength(LandPixels, LAND_HEIGHT div 2, LAND_WIDTH div 2);
    53         SetLength(LandPixels, LAND_HEIGHT div 2, LAND_WIDTH div 2);
    54 
    54 
    55     SetLength(Land, LAND_HEIGHT, LAND_WIDTH);
    55     SetLength(Land, LAND_HEIGHT, LAND_WIDTH);
    56     SetLength(LandDirty, (LAND_HEIGHT div 32), (LAND_WIDTH div 32));
    56     SetLength(LandDirty, (LAND_HEIGHT div 32), (LAND_WIDTH div 32));
    57     uLandTexture.initModule;
       
    58     end;
    57     end;
    59 end;
    58 end;
    60 
    59 
    61 procedure ColorizeLand(Surface: PSDL_Surface);
    60 procedure ColorizeLand(Surface: PSDL_Surface);
    62 var tmpsurf: PSDL_Surface;
    61 var tmpsurf: PSDL_Surface;
   702                     w:= 255;
   701                     w:= 255;
   703                 w:= (w and $FF shl RShift) or (w and $FF shl BShift) or (w and $FF shl GShift) or (LandPixels[y div 2,x div 2] and AMask);
   702                 w:= (w and $FF shl RShift) or (w and $FF shl BShift) or (w and $FF shl GShift) or (LandPixels[y div 2,x div 2] and AMask);
   704                 LandPixels[y,x]:= w or (LandPixels[y div 2, x div 2] and AMask)
   703                 LandPixels[y,x]:= w or (LandPixels[y div 2, x div 2] and AMask)
   705                 end
   704                 end
   706     end;
   705     end;
   707 
       
   708 UpdateLandTexture(0, LAND_WIDTH, 0, LAND_HEIGHT, false);
       
   709 end;
   706 end;
   710 
   707 
   711 procedure GenPreview(out Preview: TPreview);
   708 procedure GenPreview(out Preview: TPreview);
   712 var rh, rw, ox, oy, x, y, xx, yy, t, bit, cbit, lh, lw: LongInt;
   709 var rh, rw, ox, oy, x, y, xx, yy, t, bit, cbit, lh, lw: LongInt;
   713 begin
   710 begin