Soma small fixes + new land template
authorunc0rr
Fri, 22 Sep 2006 18:09:26 +0000
changeset 160 207f520b9e83
parent 159 63909aecb0ed
child 161 d8870bbf960e
Soma small fixes + new land template
hedgewars/hwengine.dpr
hedgewars/uLand.pas
hedgewars/uLandTemplates.pas
--- a/hedgewars/hwengine.dpr	Thu Sep 21 21:29:02 2006 +0000
+++ b/hedgewars/hwengine.dpr	Fri Sep 22 18:09:26 2006 +0000
@@ -217,7 +217,7 @@
 SDL_ShowCursor(0);
 end;
 
-////////////////////////////////////////////////////////////////////////////////
+///////////////
 procedure Game;
 begin
 WriteToConsole('Init SDL... ');
@@ -253,6 +253,7 @@
 MainLoop
 end;
 
+/////////////////////////
 procedure GenLandPreview;
 begin
 InitIPC;
@@ -260,7 +261,7 @@
 TryDo(InitStepsFlags = cifRandomize,
       'Some parameters not set (flags = ' + inttostr(InitStepsFlags) + ')',
       true);
-WriteLnToConsole('Generating preview...');
+
 GenPreview;
 WriteLnToConsole('Sending preview...');
 SendIPCRaw(@Preview, sizeof(Preview));
--- a/hedgewars/uLand.pas	Thu Sep 21 21:29:02 2006 +0000
+++ b/hedgewars/uLand.pas	Fri Sep 22 18:09:26 2006 +0000
@@ -192,7 +192,7 @@
           pa.ar[pa.Count].x:= X;
           pa.ar[pa.Count].y:= Y;
           inc(pa.Count);
-          TryDo(pa.Count < cMaxEdgePoints, 'Edge points overflow', true)
+          TryDo(pa.Count <= cMaxEdgePoints, 'Edge points overflow', true)
           end;
     end;
 end;
@@ -382,6 +382,7 @@
     i: integer;
 begin
 TryDo((pa.ar[0].y < 0) or (pa.ar[0].y > 1023), 'Bad land generated', true);
+TryDo((pa.ar[Pred(pa.Count)].y < 0) or (pa.ar[Pred(pa.Count)].y > 1023), 'Bad land generated', true);
 isUP:= pa.ar[0].y > 0;
 Left:= 1023;
 Right:= Left;
@@ -571,6 +572,7 @@
 procedure GenPreview;
 var x, y, xx, yy, t, bit: integer;
 begin
+WriteLnToConsole('Generating preview...');
 GenBlank(EdgeTemplates[getrandom(Succ(High(EdgeTemplates)))]);
 
 for y:= 0 to 127 do
@@ -583,7 +585,7 @@
             for yy:= y * 8 to y * 8 + 7 do
                 for xx:= x * 64 + bit * 8 to x * 64 + bit * 8 + 7 do
                     if Land[yy, xx] <> 0 then inc(t);
-            if t > 31 then Preview[y, x]:= Preview[y, x] or ($80 shr bit) 
+            if t > 8 then Preview[y, x]:= Preview[y, x] or ($80 shr bit) 
             end
         end
 end;
--- a/hedgewars/uLandTemplates.pas	Thu Sep 21 21:29:02 2006 +0000
+++ b/hedgewars/uLandTemplates.pas	Fri Sep 22 18:09:26 2006 +0000
@@ -453,7 +453,7 @@
 
 const Template13Points: array[0..13] of TPoint =
       (
-       (x:  645; y: 1282),
+       (x:  645; y: 1400),
        (x:  198; y:  732),
        (x:  402; y:  648),
        (x:  609; y:  763),
@@ -466,14 +466,45 @@
        (x: 1038; y:  576),
        (x: 1017; y:  756),
        (x: 1803; y:  728),
-       (x: 1503; y: 1256)
+       (x: 1503; y: 1400)
       );
       Template13FPoints: array[0..0] of TPoint =
       (
        (x: 1023; y:    0)
       );
 
-const EdgeTemplates: array[0..13] of TEdgeTemplate =
+const Template14Points: array[0..22] of TPoint =
+      (
+       (x:  177; y: 1408),
+       (x:  262; y: 1026),
+       (x:  259; y:  303),
+       (x:  765; y:  162),
+       (x:  789; y:  357),
+       (x:  517; y:  420),
+       (x:  658; y:  690),
+       (x:  448; y:  762),
+       (x:  663; y: 1029),
+       (x:  765; y: 1440),
+       (x: 1446; y: 1431),
+       (x: 1439; y: 1026),
+       (x: 1416; y:  825),
+       (x: 1253; y:  840),
+       (x: 1253; y:  600),
+       (x: 1551; y:  573),
+       (x: 1506; y:  390),
+       (x: 1065; y:  366),
+       (x: 1077; y:  171),
+       (x: 1656; y:  156),
+       (x: 1821; y:  396),
+       (x: 1716; y:  768),
+       (x: 1926; y: 1437)
+      );
+      Template14FPoints: array[0..0] of TPoint =
+      (
+       (x: 1023; y:    0)
+      );
+
+const EdgeTemplates: array[0..14] of TEdgeTemplate =
       (
        (BasePoints: @Template0Points;
         BasePointsCount: Succ(High(Template0Points));
@@ -609,10 +640,20 @@
        BasePointsCount: Succ(High(Template13Points));
        BezPassCnt: 5;
        PassMin: 15; PassDelta: 3;
+       WaveAmplMin:    18; WaveAmplDelta: 15;
+       WaveFreqMin: 0.0028; WaveFreqDelta: 0.002;
+       FillPoints: @Template13FPoints;
+       FillPointsCount: Succ(High(Template13FPoints));
+       canMirror: true; canFlip: false;
+      ),
+      (BasePoints: @Template14Points;
+       BasePointsCount: Succ(High(Template14Points));
+       BezPassCnt: 4;
+       PassMin: 14; PassDelta: 3;
        WaveAmplMin:    20; WaveAmplDelta: 15;
        WaveFreqMin: 0.003; WaveFreqDelta: 0.002;
-       FillPoints: @Template13FPoints;
-       FillPointsCount: Succ(High(Template13FPoints));
+       FillPoints: @Template14FPoints;
+       FillPointsCount: Succ(High(Template14FPoints));
        canMirror: true; canFlip: false;
       )
       );