hedgewars/uLandTemplates.pas
changeset 351 29bc9c36ad5f
parent 184 f97a7a3dc8f6
child 358 236bbd12d4d9
equal deleted inserted replaced
350:c3ccec3834e8 351:29bc9c36ad5f
    16  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
    16  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
    17  *)
    17  *)
    18 
    18 
    19 unit uLandTemplates;
    19 unit uLandTemplates;
    20 interface
    20 interface
    21 uses SDLh;
    21 uses SDLh, uFloat;
    22 {$INCLUDE options.inc}
    22 {$INCLUDE options.inc}
    23 
    23 
    24 type PPointArray = ^TPointArray;
    24 type PPointArray = ^TPointArray;
    25      TPointArray = array[0..64] of TPoint;
    25      TPointArray = array[0..64] of TPoint;
    26      TEdgeTemplate = record
    26      TEdgeTemplate = record
    27                      BasePoints: PPointArray;
    27                      BasePoints: PPointArray;
    28                      BasePointsCount: Longword;
    28                      BasePointsCount: Longword;
    29                      BezPassCnt: Longword; 
    29                      BezPassCnt: Longword; 
    30                      PassMin, PassDelta: Longword;
    30                      PassMin, PassDelta: Longword;
    31                      WaveAmplMin, WaveAmplDelta: Double;
    31                      WaveAmplMin, WaveAmplDelta: Longword;
    32                      WaveFreqMin, WaveFreqDelta: Double;
    32                      WaveFreqMin, WaveFreqDelta: Longword;
    33                      FillPoints: PPointArray;
    33                      FillPoints: PPointArray;
    34                      FillPointsCount: Longword;
    34                      FillPointsCount: Longword;
    35                      canMirror, canFlip: boolean;
    35                      canMirror, canFlip: boolean;
    36                      end;
    36                      end;
    37 
    37 
   494        (BasePoints: @Template0Points;
   494        (BasePoints: @Template0Points;
   495         BasePointsCount: Succ(High(Template0Points));
   495         BasePointsCount: Succ(High(Template0Points));
   496         BezPassCnt: 4;
   496         BezPassCnt: 4;
   497         PassMin: 10; PassDelta: 5;
   497         PassMin: 10; PassDelta: 5;
   498         WaveAmplMin:    17; WaveAmplDelta: 20;
   498         WaveAmplMin:    17; WaveAmplDelta: 20;
   499         WaveFreqMin: 0.010; WaveFreqDelta: 0.002;
   499         WaveFreqMin: 0100; WaveFreqDelta: 0020;
   500         FillPoints: @Template0FPoints;
   500         FillPoints: @Template0FPoints;
   501         FillPointsCount: Succ(High(Template0FPoints));
   501         FillPointsCount: Succ(High(Template0FPoints));
   502         canMirror: false; canFlip: false;
   502         canMirror: false; canFlip: false;
   503        ),
   503        ),
   504        (BasePoints: @Template1Points;
   504        (BasePoints: @Template1Points;
   505         BasePointsCount: Succ(High(Template1Points));
   505         BasePointsCount: Succ(High(Template1Points));
   506         BezPassCnt: 3;
   506         BezPassCnt: 3;
   507         PassMin: 10; PassDelta: 2;
   507         PassMin: 10; PassDelta: 2;
   508         WaveAmplMin:    25; WaveAmplDelta: 15;
   508         WaveAmplMin:    25; WaveAmplDelta: 15;
   509         WaveFreqMin: 0.008; WaveFreqDelta: 0.002;
   509         WaveFreqMin:  0080; WaveFreqDelta: 0020;
   510         FillPoints: @Template1FPoints;
   510         FillPoints: @Template1FPoints;
   511         FillPointsCount: Succ(High(Template1FPoints));
   511         FillPointsCount: Succ(High(Template1FPoints));
   512         canMirror: false; canFlip: false;
   512         canMirror: false; canFlip: false;
   513        ),
   513        ),
   514        (BasePoints: @Template2Points;
   514        (BasePoints: @Template2Points;
   515         BasePointsCount: Succ(High(Template2Points));
   515         BasePointsCount: Succ(High(Template2Points));
   516         BezPassCnt: 3;
   516         BezPassCnt: 3;
   517         PassMin: 14; PassDelta: 3;
   517         PassMin: 14; PassDelta: 3;
   518         WaveAmplMin:    10; WaveAmplDelta: 10;
   518         WaveAmplMin:    10; WaveAmplDelta: 10;
   519         WaveFreqMin: 0.010; WaveFreqDelta: 0.002;
   519         WaveFreqMin:  0100; WaveFreqDelta: 0020;
   520         FillPoints: @Template2FPoints;
   520         FillPoints: @Template2FPoints;
   521         FillPointsCount: Succ(High(Template2FPoints));
   521         FillPointsCount: Succ(High(Template2FPoints));
   522         canMirror: true; canFlip: false;
   522         canMirror: true; canFlip: false;
   523        ),
   523        ),
   524        (BasePoints: @Template3Points;
   524        (BasePoints: @Template3Points;
   525         BasePointsCount: Succ(High(Template3Points));
   525         BasePointsCount: Succ(High(Template3Points));
   526         BezPassCnt: 4;
   526         BezPassCnt: 4;
   527         PassMin: 15; PassDelta: 2;
   527         PassMin: 15; PassDelta: 2;
   528         WaveAmplMin:    8; WaveAmplDelta: 12;
   528         WaveAmplMin:    8; WaveAmplDelta: 12;
   529         WaveFreqMin: 0.015; WaveFreqDelta: 0.0015;
   529         WaveFreqMin: 0150; WaveFreqDelta: 0015;
   530         FillPoints: @Template3FPoints;
   530         FillPoints: @Template3FPoints;
   531         FillPointsCount: Succ(High(Template3FPoints));
   531         FillPointsCount: Succ(High(Template3FPoints));
   532         canMirror: true; canFlip: false;
   532         canMirror: true; canFlip: false;
   533        ),
   533        ),
   534        (BasePoints: @Template4Points;
   534        (BasePoints: @Template4Points;
   535         BasePointsCount: Succ(High(Template4Points));
   535         BasePointsCount: Succ(High(Template4Points));
   536         BezPassCnt: 3;
   536         BezPassCnt: 3;
   537         PassMin: 19; PassDelta: 5;
   537         PassMin: 19; PassDelta: 5;
   538         WaveAmplMin:    12; WaveAmplDelta: 14;
   538         WaveAmplMin:    12; WaveAmplDelta: 14;
   539         WaveFreqMin: 0.008; WaveFreqDelta: 0.001;
   539         WaveFreqMin:  0080; WaveFreqDelta: 0010;
   540         FillPoints: @Template4FPoints;
   540         FillPoints: @Template4FPoints;
   541         FillPointsCount: Succ(High(Template4FPoints));
   541         FillPointsCount: Succ(High(Template4FPoints));
   542         canMirror: true; canFlip: false;
   542         canMirror: true; canFlip: false;
   543        ),
   543        ),
   544        (BasePoints: @Template5Points;
   544        (BasePoints: @Template5Points;
   545         BasePointsCount: Succ(High(Template5Points));
   545         BasePointsCount: Succ(High(Template5Points));
   546         BezPassCnt: 4;
   546         BezPassCnt: 4;
   547         PassMin: 15; PassDelta: 1;
   547         PassMin: 15; PassDelta: 1;
   548         WaveAmplMin:    15; WaveAmplDelta: 14;
   548         WaveAmplMin:    15; WaveAmplDelta: 14;
   549         WaveFreqMin: 0.008; WaveFreqDelta: 0.002;
   549         WaveFreqMin:  0080; WaveFreqDelta: 0020;
   550         FillPoints: @Template5FPoints;
   550         FillPoints: @Template5FPoints;
   551         FillPointsCount: Succ(High(Template5FPoints));
   551         FillPointsCount: Succ(High(Template5FPoints));
   552         canMirror: true; canFlip: false;
   552         canMirror: true; canFlip: false;
   553        ),
   553        ),
   554       (BasePoints: @Template6Points;
   554       (BasePoints: @Template6Points;
   555        BasePointsCount: Succ(High(Template6Points));
   555        BasePointsCount: Succ(High(Template6Points));
   556        BezPassCnt: 3;
   556        BezPassCnt: 3;
   557        PassMin: 15; PassDelta: 1;
   557        PassMin: 15; PassDelta: 1;
   558        WaveAmplMin:    15; WaveAmplDelta: 10;
   558        WaveAmplMin:    15; WaveAmplDelta: 10;
   559        WaveFreqMin: 0.010; WaveFreqDelta: 0.0015;
   559        WaveFreqMin:  0100; WaveFreqDelta: 0015;
   560        FillPoints: @Template6FPoints;
   560        FillPoints: @Template6FPoints;
   561        FillPointsCount: Succ(High(Template6FPoints));
   561        FillPointsCount: Succ(High(Template6FPoints));
   562        canMirror: true; canFlip: false;
   562        canMirror: true; canFlip: false;
   563       ),
   563       ),
   564       (BasePoints: @Template7Points;
   564       (BasePoints: @Template7Points;
   565        BasePointsCount: Succ(High(Template7Points));
   565        BasePointsCount: Succ(High(Template7Points));
   566        BezPassCnt: 3;
   566        BezPassCnt: 3;
   567        PassMin: 12; PassDelta: 4;
   567        PassMin: 12; PassDelta: 4;
   568        WaveAmplMin:     5; WaveAmplDelta: 15;
   568        WaveAmplMin:     5; WaveAmplDelta: 15;
   569        WaveFreqMin: 0.015; WaveFreqDelta: 0.002;
   569        WaveFreqMin:  0150; WaveFreqDelta: 0020;
   570        FillPoints: @Template7FPoints;
   570        FillPoints: @Template7FPoints;
   571        FillPointsCount: Succ(High(Template7FPoints));
   571        FillPointsCount: Succ(High(Template7FPoints));
   572        canMirror: true; canFlip: false;
   572        canMirror: true; canFlip: false;
   573       ),
   573       ),
   574       (BasePoints: @Template8Points;
   574       (BasePoints: @Template8Points;
   575        BasePointsCount: Succ(High(Template8Points));
   575        BasePointsCount: Succ(High(Template8Points));
   576        BezPassCnt: 4;
   576        BezPassCnt: 4;
   577        PassMin:  9; PassDelta: 3;
   577        PassMin:  9; PassDelta: 3;
   578        WaveAmplMin:    18; WaveAmplDelta: 18;
   578        WaveAmplMin:    18; WaveAmplDelta: 18;
   579        WaveFreqMin: 0.010; WaveFreqDelta: 0.002;
   579        WaveFreqMin:  0100; WaveFreqDelta: 0020;
   580        FillPoints: @Template8FPoints;
   580        FillPoints: @Template8FPoints;
   581        FillPointsCount: Succ(High(Template8FPoints));
   581        FillPointsCount: Succ(High(Template8FPoints));
   582        canMirror: true; canFlip: false;
   582        canMirror: true; canFlip: false;
   583       ),
   583       ),
   584       (BasePoints: @Template9Points;
   584       (BasePoints: @Template9Points;
   585        BasePointsCount: Succ(High(Template9Points));
   585        BasePointsCount: Succ(High(Template9Points));
   586        BezPassCnt: 4;
   586        BezPassCnt: 4;
   587        PassMin: 17; PassDelta: 3;
   587        PassMin: 17; PassDelta: 3;
   588        WaveAmplMin:    10; WaveAmplDelta: 10;
   588        WaveAmplMin:    10; WaveAmplDelta: 10;
   589        WaveFreqMin: 0.010; WaveFreqDelta: 0.002;
   589        WaveFreqMin:  0100; WaveFreqDelta: 0020;
   590        FillPoints: @Template9FPoints;
   590        FillPoints: @Template9FPoints;
   591        FillPointsCount: Succ(High(Template9FPoints));
   591        FillPointsCount: Succ(High(Template9FPoints));
   592        canMirror: true; canFlip: false;
   592        canMirror: true; canFlip: false;
   593       ),
   593       ),
   594       (BasePoints: @Template10Points;
   594       (BasePoints: @Template10Points;
   595        BasePointsCount: Succ(High(Template10Points));
   595        BasePointsCount: Succ(High(Template10Points));
   596        BezPassCnt: 4;
   596        BezPassCnt: 4;
   597        PassMin: 15; PassDelta: 2;
   597        PassMin: 15; PassDelta: 2;
   598        WaveAmplMin:    15; WaveAmplDelta: 10;
   598        WaveAmplMin:    15; WaveAmplDelta: 10;
   599        WaveFreqMin: 0.008; WaveFreqDelta: 0.002;
   599        WaveFreqMin:  0080; WaveFreqDelta: 0020;
   600        FillPoints: @Template10FPoints;
   600        FillPoints: @Template10FPoints;
   601        FillPointsCount: Succ(High(Template10FPoints));
   601        FillPointsCount: Succ(High(Template10FPoints));
   602        canMirror: false; canFlip: false;
   602        canMirror: false; canFlip: false;
   603       ),
   603       ),
   604       (BasePoints: @Template11Points;
   604       (BasePoints: @Template11Points;
   605        BasePointsCount: Succ(High(Template11Points));
   605        BasePointsCount: Succ(High(Template11Points));
   606        BezPassCnt: 4;
   606        BezPassCnt: 4;
   607        PassMin: 15; PassDelta: 1;
   607        PassMin: 15; PassDelta: 1;
   608        WaveAmplMin:    10; WaveAmplDelta: 10;
   608        WaveAmplMin:    10; WaveAmplDelta: 10;
   609        WaveFreqMin: 0.008; WaveFreqDelta: 0.002;
   609        WaveFreqMin:  0080; WaveFreqDelta: 0020;
   610        FillPoints: @Template11FPoints;
   610        FillPoints: @Template11FPoints;
   611        FillPointsCount: Succ(High(Template11FPoints));
   611        FillPointsCount: Succ(High(Template11FPoints));
   612        canMirror: true; canFlip: false;
   612        canMirror: true; canFlip: false;
   613       ),
   613       ),
   614       (BasePoints: @Template12Points;
   614       (BasePoints: @Template12Points;
   615        BasePointsCount: Succ(High(Template12Points));
   615        BasePointsCount: Succ(High(Template12Points));
   616        BezPassCnt: 3;
   616        BezPassCnt: 3;
   617        PassMin: 10; PassDelta: 1;
   617        PassMin: 10; PassDelta: 1;
   618        WaveAmplMin:    15; WaveAmplDelta: 15;
   618        WaveAmplMin:    15; WaveAmplDelta: 15;
   619        WaveFreqMin: 0.005; WaveFreqDelta: 0.003;
   619        WaveFreqMin:  0050; WaveFreqDelta: 0030;
   620        FillPoints: @Template12FPoints;
   620        FillPoints: @Template12FPoints;
   621        FillPointsCount: Succ(High(Template12FPoints));
   621        FillPointsCount: Succ(High(Template12FPoints));
   622        canMirror: true; canFlip: false;
   622        canMirror: true; canFlip: false;
   623       ),
   623       ),
   624       (BasePoints: @Template13Points;
   624       (BasePoints: @Template13Points;
   625        BasePointsCount: Succ(High(Template13Points));
   625        BasePointsCount: Succ(High(Template13Points));
   626        BezPassCnt: 5;
   626        BezPassCnt: 5;
   627        PassMin: 15; PassDelta: 3;
   627        PassMin: 15; PassDelta: 3;
   628        WaveAmplMin:    18; WaveAmplDelta: 15;
   628        WaveAmplMin:    18; WaveAmplDelta: 15;
   629        WaveFreqMin: 0.0028; WaveFreqDelta: 0.002;
   629        WaveFreqMin:  0028; WaveFreqDelta: 0020;
   630        FillPoints: @Template13FPoints;
   630        FillPoints: @Template13FPoints;
   631        FillPointsCount: Succ(High(Template13FPoints));
   631        FillPointsCount: Succ(High(Template13FPoints));
   632        canMirror: true; canFlip: false;
   632        canMirror: true; canFlip: false;
   633       ),
   633       ),
   634       (BasePoints: @Template14Points;
   634       (BasePoints: @Template14Points;
   635        BasePointsCount: Succ(High(Template14Points));
   635        BasePointsCount: Succ(High(Template14Points));
   636        BezPassCnt: 4;
   636        BezPassCnt: 4;
   637        PassMin: 14; PassDelta: 3;
   637        PassMin: 14; PassDelta: 3;
   638        WaveAmplMin:    20; WaveAmplDelta: 15;
   638        WaveAmplMin:    20; WaveAmplDelta: 15;
   639        WaveFreqMin: 0.003; WaveFreqDelta: 0.002;
   639        WaveFreqMin:  0030; WaveFreqDelta: 0020;
   640        FillPoints: @Template14FPoints;
   640        FillPoints: @Template14FPoints;
   641        FillPointsCount: Succ(High(Template14FPoints));
   641        FillPointsCount: Succ(High(Template14FPoints));
   642        canMirror: true; canFlip: false;
   642        canMirror: true; canFlip: false;
   643       )
   643       )
   644       );
   644       );