hedgewars/uLandTemplates.pas
branchmbait-mangen
changeset 2564 96138f0d3cf6
parent 2425 a4af95e6382c
equal deleted inserted replaced
2561:3038a1a52195 2564:96138f0d3cf6
  1451       );
  1451       );
  1452       Template40FPoints: array[0..0] of TPoint =
  1452       Template40FPoints: array[0..0] of TPoint =
  1453       (
  1453       (
  1454        (x: 512; y:    0)
  1454        (x: 512; y:    0)
  1455       );
  1455       );
       
  1456   {const Template41Points: array[0..4] of TSDL_Rect =
       
  1457       (
       
  1458        (x:   90; y: 1050; w:    1; h:   1),
       
  1459 	   (x:	100; y: 100; w: 400; h: 100),
       
  1460 	   (x:	200; y: 100; w: 400; h: 100),
       
  1461        //(x:  100; y:  800; w:  100; h: 200),
       
  1462        //(x:  300; y:  600; w:  100; h: 200),
       
  1463        //(x:  500; y:  200; w:  100; h: 200),
       
  1464        //(x:  700; y:  600; w:  100; h: 100),
       
  1465        //(x:  900; y:  800; w:  100; h: 200),
       
  1466        (x:  900; y: 1050; w:    1; h:   1),
       
  1467        (x: NTPX; y:    0; w:    1; h:   1)
       
  1468       );
       
  1469   }
       
  1470       Template41FPoints: array[0..0] of TPoint =
       
  1471       (
       
  1472        (x: 128; y:    0)
       
  1473       );
       
  1474   var Template41Points: array[0..100] of TSDL_Rect;
  1456 
  1475 
  1457 ////////////////////////////////////////////////////////////////////////
  1476 ////////////////////////////////////////////////////////////////////////
  1458 const EdgeTemplates: array[0..40] of TEdgeTemplate =
  1477 const EdgeTemplates: array[0..41] of TEdgeTemplate =
  1459       (
  1478       (
  1460        (BasePoints: @Template0Points;
  1479        (BasePoints: @Template0Points;
  1461         BasePointsCount: Succ(High(Template0Points));
  1480         BasePointsCount: Succ(High(Template0Points));
  1462         FillPoints: @Template0FPoints;
  1481         FillPoints: @Template0FPoints;
  1463         FillPointsCount: Succ(High(Template0FPoints));
  1482         FillPointsCount: Succ(High(Template0FPoints));
  1905         RandPassesCount: 3;
  1924         RandPassesCount: 3;
  1906         TemplateHeight: 1024; TemplateWidth: 1024;
  1925         TemplateHeight: 1024; TemplateWidth: 1024;
  1907         canMirror: true; canFlip: false; isNegative: false; canInvert: false;
  1926         canMirror: true; canFlip: false; isNegative: false; canInvert: false;
  1908         hasGirders: false;
  1927         hasGirders: false;
  1909         MaxHedgehogs: 8;
  1928         MaxHedgehogs: 8;
       
  1929        ),
       
  1930        (BasePoints: @Template41Points;
       
  1931         BasePointsCount: Succ(High(Template41Points));
       
  1932         FillPoints: @Template41FPoints;
       
  1933         FillPointsCount: Succ(High(Template41FPoints));
       
  1934         BezierizeCount: 0;
       
  1935         RandPassesCount: 0;
       
  1936         TemplateHeight: 2048; TemplateWidth: 1024;
       
  1937         canMirror: false; canFlip: false; isNegative: false; canInvert: false;
       
  1938         hasGirders: false;
       
  1939         MaxHedgehogs: 8;
  1910        )
  1940        )
  1911       );
  1941       );
  1912 const SmallTemplates: array[0..1] of Longword = ( 39, 40 );
  1942 const SmallTemplates: array[0..1] of Longword = ( 39, 40 );
  1913 const MediumTemplates: array[0..17] of Longword =
  1943 const MediumTemplates: array[0..17] of Longword =
  1914       ( 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17 );
  1944       ( 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17 );
  1917         18, 19, 20, 21, 22, 23, 24, 25, 26, 27,
  1947         18, 19, 20, 21, 22, 23, 24, 25, 26, 27,
  1918         28, 29, 30, 31, 32, 33, 34, 35, 37, 38
  1948         28, 29, 30, 31, 32, 33, 34, 35, 37, 38
  1919       );
  1949       );
  1920 const CavernTemplates: array[0..4] of Longword = (36, 2, 3, 21, 29);
  1950 const CavernTemplates: array[0..4] of Longword = (36, 2, 3, 21, 29);
  1921 const WackyTemplates: array[0..3] of Longword = (37, 38, 39, 40);
  1951 const WackyTemplates: array[0..3] of Longword = (37, 38, 39, 40);
       
  1952 const FractTemplates: array[0..0] of Longword = (41);
       
  1953 
       
  1954 procedure InitFractTemplate;
  1922 
  1955 
  1923 implementation
  1956 implementation
  1924 
  1957 
       
  1958 procedure InitFractTemplate;
       
  1959 function gaussian: integer;
       
  1960 const
       
  1961 	n = 12;
       
  1962 	w = 50;
       
  1963 var 
       
  1964 	i: integer;
       
  1965 	sum: integer;
       
  1966 begin
       
  1967 	sum := 0;
       
  1968 	for i := 1 to n do
       
  1969 		sum := sum + random(w);
       
  1970 	gaussian := sum - (n div 2)*w;
       
  1971 end;
       
  1972 
       
  1973 function rand: integer;
       
  1974 begin
       
  1975 	rand := random(1024) div 10;
       
  1976 	if(random(10) = 1) then rand := -rand;
       
  1977 end;
       
  1978 
       
  1979 function urand: integer;
       
  1980 begin
       
  1981 	urand := random(1024) div 10;
       
  1982 end;
       
  1983 
       
  1984 var 
       
  1985 	i: integer;
       
  1986 	s: integer;
       
  1987 begin
       
  1988        //(x:   90; y: 1050; w:    1; h:   1),
       
  1989 	   //(x:	100; y: 100; w: 400; h: 100),
       
  1990 	   //(x:	200; y: 100; w: 400; h: 100),
       
  1991        //(x:  100; y:  800; w:  100; h: 200),
       
  1992        //(x:  300; y:  600; w:  100; h: 200),
       
  1993        //(x:  500; y:  200; w:  100; h: 200),
       
  1994        //(x:  700; y:  600; w:  100; h: 100),
       
  1995        //(x:  900; y:  800; w:  100; h: 200),
       
  1996        //(x:  900; y: 1050; w:    1; h:   1),
       
  1997        //(x: NTPX; y:    0; w:    1; h:   1)
       
  1998 	Template41Points[0].x :=   90;
       
  1999    	Template41Points[0].y := 1050;
       
  2000 	Template41Points[0].w :=  1;
       
  2001 	Template41Points[0].h := 1;
       
  2002 	Template41Points[99].x :=   90;
       
  2003    	Template41Points[99].y := 1050;
       
  2004 	Template41Points[99].w :=  1;
       
  2005 	Template41Points[99].h := 1;
       
  2006 	Template41Points[100].x :=   NTPX;
       
  2007    	Template41Points[100].y := 0;
       
  2008 	Template41Points[100].w :=  1;
       
  2009 	Template41Points[100].h := 1;
       
  2010 	for i := 0 to 99 do begin
       
  2011 		Template41Points[i].x := Template41Points[i-1].x + urand;
       
  2012 		Template41Points[i].y := Template41Points[i-1].y - rand;
       
  2013 		//Template41Points[i].x := 512 + round(400 * cos(double(i)/50 * 3.1475));
       
  2014 		//Template41Points[i].y := 1024 + round(400 * sin(double(i)/50 * 3.1475));
       
  2015 		//Template41Points[i].x := i*10;
       
  2016 		//Template41Points[i].y := 2048 - i*10; 
       
  2017 		Template41Points[i].w := 100;
       
  2018 		Template41Points[i].h := 100; 
       
  2019 	end;
       
  2020 end;
       
  2021 
       
  2022 initialization
       
  2023 
       
  2024 InitFractTemplate;
       
  2025 
  1925 end.
  2026 end.