hedgewars/uLandGenTemplateBased.pas
changeset 10495 6d61b44a5652
parent 10494 0eb97cf4c78e
child 10499 0d8016085108
equal deleted inserted replaced
10494:0eb97cf4c78e 10495:6d61b44a5652
   260         end;
   260         end;
   261 
   261 
   262     // don't move new point for more than length of initial segment
   262     // don't move new point for more than length of initial segment
   263     // adjust/parametrize for more flat surfaces (try values 3/4, 1/2 of dab, or even 1/4)
   263     // adjust/parametrize for more flat surfaces (try values 3/4, 1/2 of dab, or even 1/4)
   264     d:= dab;
   264     d:= dab;
       
   265     //d:= dab * (1 + abs(cFeatureSize - 8)) div 6;
       
   266     //d:= dab * (14 + cFeatureSize) div 20;
   265     if distL > d then distL:= d;
   267     if distL > d then distL:= d;
   266     if distR > d then distR:= d;
   268     if distR > d then distR:= d;
   267 
   269 
   268     if distR + distL < minDistance * 2 + 10 then
   270     if distR + distL < minDistance * 2 + 10 then
   269     begin
   271     begin
   340     ResizeLand(Template.TemplateWidth, Template.TemplateHeight);
   342     ResizeLand(Template.TemplateWidth, Template.TemplateHeight);
   341     for y:= 0 to LAND_HEIGHT - 1 do
   343     for y:= 0 to LAND_HEIGHT - 1 do
   342         for x:= 0 to LAND_WIDTH - 1 do
   344         for x:= 0 to LAND_WIDTH - 1 do
   343             Land[y, x]:= lfBasic;
   345             Land[y, x]:= lfBasic;
   344     
   346     
   345     minDistance:= max(cFeatureSize*5,12);
   347     minDistance:= sqr(cFeatureSize) div 8 + 10;
   346     MaxHedgehogs:= Template.MaxHedgehogs;
   348     MaxHedgehogs:= Template.MaxHedgehogs;
   347     hasGirders:= Template.hasGirders;
   349     hasGirders:= Template.hasGirders;
   348     playHeight:= Template.TemplateHeight;
   350     playHeight:= Template.TemplateHeight;
   349     playWidth:= Template.TemplateWidth;
   351     playWidth:= Template.TemplateWidth;
   350     leftX:= (LAND_WIDTH - playWidth) div 2;
   352     leftX:= (LAND_WIDTH - playWidth) div 2;