hedgewars/uLandTemplates.pas
changeset 365 a26cec847dd7
parent 364 52cb4d6f84b7
child 386 21eeb5ac0486
equal deleted inserted replaced
364:52cb4d6f84b7 365:a26cec847dd7
    19 unit uLandTemplates;
    19 unit uLandTemplates;
    20 interface
    20 interface
    21 uses SDLh, uFloat;
    21 uses SDLh, uFloat;
    22 {$INCLUDE options.inc}
    22 {$INCLUDE options.inc}
    23 
    23 
       
    24 const NTPX = Low(TSDL_Rect.x); 
       
    25 
    24 type PPointArray = ^TPointArray;
    26 type PPointArray = ^TPointArray;
    25      TPointArray = array[0..64] of TSDL_Rect;
    27      TPointArray = array[0..64] of TSDL_Rect;
    26      TEdgeTemplate = record
    28      TEdgeTemplate = record
    27                      BasePoints: PPointArray;
    29                      BasePoints: PPointArray;
    28                      BasePointsCount: Longword;
    30                      BasePointsCount: Longword;
    30                      FillPointsCount: Longword;
    32                      FillPointsCount: Longword;
    31                      RandPassesCount: Longword;
    33                      RandPassesCount: Longword;
    32                      canMirror, canFlip: boolean;
    34                      canMirror, canFlip: boolean;
    33                      end;
    35                      end;
    34 
    36 
    35 const Template0Points: array[0..17] of TSDL_Rect =
    37 const Template0Points: array[0..18] of TSDL_Rect =
    36       (
    38       (
    37        (x:  410; y: 1024; w:    1; h:    1),
    39        (x:  410; y: 1024; w:    1; h:    1),
    38        (x:  160; y:  760; w:  130; h:  170),
    40        (x:  160; y:  760; w:  130; h:  170),
    39        (x:  342; y:  706; w:  316; h:  150),
    41        (x:  342; y:  706; w:  316; h:  150),
    40        (x:  238; y:  386; w:  270; h:  180),
    42        (x:  238; y:  386; w:  270; h:  180),
    49        (x: 1426; y:  592; w:  140; h:  142),
    51        (x: 1426; y:  592; w:  140; h:  142),
    50        (x: 1310; y:  192; w:  150; h:  350),
    52        (x: 1310; y:  192; w:  150; h:  350),
    51        (x: 1588; y:  194; w:  148; h:  332),
    53        (x: 1588; y:  194; w:  148; h:  332),
    52        (x: 1618; y:  472; w:  276; h:  314),
    54        (x: 1618; y:  472; w:  276; h:  314),
    53        (x: 1710; y:  850; w:  130; h:   86),
    55        (x: 1710; y:  850; w:  130; h:   86),
    54        (x: 1734; y: 1024; w:    1; h:    1)
    56        (x: 1734; y: 1024; w:    1; h:    1),
       
    57        (x: NTPX; y:    0; w:    1; h:    1)
    55       );
    58       );
    56       Template0FPoints: array[0..0] of TPoint =
    59       Template0FPoints: array[0..0] of TPoint =
    57       (
    60       (
    58        (x: 1023; y:    0)
    61        (x: 1023; y:    0)
    59       );
    62       );
    60 
    63 
    61 const Template1Points: array[0..14] of TSDL_Rect =
    64 const Template1Points: array[0..15] of TSDL_Rect =
    62       (
    65       (
    63        (x:  400; y: 1024; w:   25; h:    1),
    66        (x:  400; y: 1024; w:   25; h:    1),
    64        (x:  284; y:  892; w:  254; h:   58),
    67        (x:  284; y:  892; w:  254; h:   58),
    65        (x:  492; y:  634; w:  100; h:  200),
    68        (x:  492; y:  634; w:  100; h:  200),
    66        (x:  274; y:  256; w:  276; h:  400),
    69        (x:  274; y:  256; w:  276; h:  400),
    72        (x: 1012; y:  540; w:  188; h:  298),
    75        (x: 1012; y:  540; w:  188; h:  298),
    73        (x: 1240; y:  668; w:  136; h:  172),
    76        (x: 1240; y:  668; w:  136; h:  172),
    74        (x: 1270; y:  194; w:  120; h:  392),
    77        (x: 1270; y:  194; w:  120; h:  392),
    75        (x: 1514; y:  194; w:  364; h:  362),
    78        (x: 1514; y:  194; w:  364; h:  362),
    76        (x: 1450; y:  652; w:  315; h:  232),
    79        (x: 1450; y:  652; w:  315; h:  232),
    77        (x: 1460; y: 1024; w:   25; h:    1)
    80        (x: 1460; y: 1024; w:   25; h:    1),
       
    81        (x: NTPX; y:    0; w:    1; h:    1)
    78       );
    82       );
    79       Template1FPoints: array[0..0] of TPoint =
    83       Template1FPoints: array[0..0] of TPoint =
    80       (
    84       (
    81        (x: 1023; y:    0)
    85        (x: 1023; y:    0)
    82       );
    86       );
    83 
    87 
    84 const Template2Points: array[0..20] of TSDL_Rect =
    88 const Template2Points: array[0..21] of TSDL_Rect =
    85       (
    89       (
    86        (x:  354; y: 1024; w:    1; h:    1),
    90        (x:  354; y: 1024; w:    1; h:    1),
    87        (x:  232; y:  926; w:  226; h:   60),
    91        (x:  232; y:  926; w:  226; h:   60),
    88        (x:  120; y:  846; w:  298; h:   62),
    92        (x:  120; y:  846; w:  298; h:   62),
    89        (x:  280; y:  704; w:  210; h:  102),
    93        (x:  280; y:  704; w:  210; h:  102),
   101        (x: 1416; y:  546; w:   90; h:  398),
   105        (x: 1416; y:  546; w:   90; h:  398),
   102        (x: 1546; y:  192; w:  134; h:  532),
   106        (x: 1546; y:  192; w:  134; h:  532),
   103        (x: 1702; y:  246; w:  156; h:  258),
   107        (x: 1702; y:  246; w:  156; h:  258),
   104        (x: 1700; y:  548; w:  132; h:  340),
   108        (x: 1700; y:  548; w:  132; h:  340),
   105        (x: 1534; y:  898; w:  252; h:   82),
   109        (x: 1534; y:  898; w:  252; h:   82),
   106        (x: 1604; y: 1024; w:    1; h:    1)
   110        (x: 1604; y: 1024; w:    1; h:    1),
       
   111        (x: NTPX; y:    0; w:    1; h:    1)
   107       );
   112       );
   108       Template2FPoints: array[0..0] of TPoint =
   113       Template2FPoints: array[0..0] of TPoint =
   109       (
   114       (
   110        (x: 1023; y:    0)
   115        (x: 1023; y:    0)
   111       );
   116       );
   112 
   117 
   113 const EdgeTemplates: array[0..2] of TEdgeTemplate =
   118 const Template3Points: array[0..16] of TSDL_Rect =
       
   119       (
       
   120        (x:  348; y: 1024; w:    1; h:    1),
       
   121        (x:  236; y:  852; w:  208; h:   72),
       
   122        (x:  498; y:  710; w:  308; h:   60),
       
   123        (x:  728; y:  852; w:  434; h:   40),
       
   124        (x: 1174; y:  712; w:  332; h:   40),
       
   125        (x: 1402; y:  838; w:  226; h:   36),
       
   126        (x: 1530; y: 1024; w:    1; h:    1),
       
   127        (x: NTPX; y:    0; w:    1; h:    1),
       
   128        (x: 1660; y:  498; w:  111; h:  111),
       
   129        (x: 1270; y:  476; w:   34; h:  102),
       
   130        (x:  682; y:  414; w:  284; h:  132),
       
   131        (x:  230; y:  328; w:  126; h:  168),
       
   132        (x:  410; y:  174; w:  114; h:  100),
       
   133        (x:  790; y:  172; w:  352; h:  120),
       
   134        (x: 1274; y:  128; w:   60; h:  240),
       
   135        (x: 1434; y:  222; w:  254; h:  116),
       
   136        (x: NTPX; y:    0; w:    1; h:    1)
       
   137       );
       
   138       Template3FPoints: array[0..0] of TPoint =
       
   139       (
       
   140        (x: 1023; y:    0)
       
   141       );
       
   142 
       
   143 const Template4Points: array[0..22] of TSDL_Rect =
       
   144       (
       
   145        (x:  418; y: 1024; w:    1; h:    1),
       
   146        (x:  248; y:  900; w:  186; h:   62),
       
   147        (x:  272; y:  692; w:  254; h:  138),
       
   148        (x:  610; y:  768; w:   90; h:  166),
       
   149        (x:  820; y:  616; w:  224; h:  258),
       
   150        (x: 1242; y:  758; w:   96; h:  146),
       
   151        (x: 1550; y:  698; w:  224; h:  134),
       
   152        (x: 1530; y:  902; w:  210; h:   54),
       
   153        (x: 1532; y: 1024; w:    1; h:    1),
       
   154        (x: NTPX; y:    0; w:    1; h:    1),
       
   155        (x:  202; y:  418; w:  110; h:   92),
       
   156        (x:  252; y:  312; w:  160; h:   32),
       
   157        (x:  150; y:  168; w:  134; h:   78),
       
   158        (x:  702; y:  160; w:  132; h:   84),
       
   159        (x:  702; y:  308; w:  230; h:   36),
       
   160        (x:  720; y:  408; w:  166; h:   96),
       
   161        (x: NTPX; y:    0; w:    1; h:    1),
       
   162        (x: 1702; y:  434; w:  202; h:   42),
       
   163        (x: 1252; y:  388; w:  134; h:   98),
       
   164        (x: 1214; y:  152; w:  116; h:  154),
       
   165        (x: 1428; y:  252; w:  150; h:   70),
       
   166        (x: 1750; y:  152; w:   86; h:  220),
       
   167        (x: NTPX; y:    0; w:    1; h:    1)
       
   168       );
       
   169       Template4FPoints: array[0..0] of TPoint =
       
   170       (
       
   171        (x: 1023; y:    0)
       
   172       );
       
   173 
       
   174 const EdgeTemplates: array[0..4] of TEdgeTemplate =
   114       (
   175       (
   115        (BasePoints: @Template0Points;
   176        (BasePoints: @Template0Points;
   116         BasePointsCount: Succ(High(Template0Points));
   177         BasePointsCount: Succ(High(Template0Points));
   117         FillPoints: @Template0FPoints;
   178         FillPoints: @Template0FPoints;
   118         FillPointsCount: Succ(High(Template0FPoints));
   179         FillPointsCount: Succ(High(Template0FPoints));
   122        (BasePoints: @Template1Points;
   183        (BasePoints: @Template1Points;
   123         BasePointsCount: Succ(High(Template1Points));
   184         BasePointsCount: Succ(High(Template1Points));
   124         FillPoints: @Template1FPoints;
   185         FillPoints: @Template1FPoints;
   125         FillPointsCount: Succ(High(Template1FPoints));
   186         FillPointsCount: Succ(High(Template1FPoints));
   126         RandPassesCount: 3;
   187         RandPassesCount: 3;
   127         canMirror: true; canFlip: false;
   188         canMirror: false; canFlip: false;
   128        ),
   189        ),
   129        (BasePoints: @Template2Points;
   190        (BasePoints: @Template2Points;
   130         BasePointsCount: Succ(High(Template2Points));
   191         BasePointsCount: Succ(High(Template2Points));
   131         FillPoints: @Template2FPoints;
   192         FillPoints: @Template2FPoints;
   132         FillPointsCount: Succ(High(Template2FPoints));
   193         FillPointsCount: Succ(High(Template2FPoints));
   133         RandPassesCount: 3;
   194         RandPassesCount: 3;
   134         canMirror: true; canFlip: false;
   195         canMirror: false; canFlip: false;
       
   196        ),
       
   197        (BasePoints: @Template3Points;
       
   198         BasePointsCount: Succ(High(Template3Points));
       
   199         FillPoints: @Template3FPoints;
       
   200         FillPointsCount: Succ(High(Template3FPoints));
       
   201         RandPassesCount: 3;
       
   202         canMirror: false; canFlip: false;
       
   203        ),
       
   204        (BasePoints: @Template4Points;
       
   205         BasePointsCount: Succ(High(Template4Points));
       
   206         FillPoints: @Template4FPoints;
       
   207         FillPointsCount: Succ(High(Template4FPoints));
       
   208         RandPassesCount: 3;
       
   209         canMirror: false; canFlip: false;
   135        )
   210        )
   136       );
   211       );
   137 
   212 
   138 
   213 
   139 
   214