51
|
1 |
(*
|
|
2 |
* Hedgewars, a worms-like game
|
|
3 |
* Copyright (c) 2005, 2006 Andrey Korotaev <unC0Rr@gmail.com>
|
|
4 |
*
|
|
5 |
* Distributed under the terms of the BSD-modified licence:
|
|
6 |
*
|
|
7 |
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
8 |
* of this software and associated documentation files (the "Software"), to deal
|
|
9 |
* with the Software without restriction, including without limitation the
|
|
10 |
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
|
11 |
* sell copies of the Software, and to permit persons to whom the Software is
|
|
12 |
* furnished to do so, subject to the following conditions:
|
|
13 |
*
|
|
14 |
* 1. Redistributions of source code must retain the above copyright notice,
|
|
15 |
* this list of conditions and the following disclaimer.
|
|
16 |
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
17 |
* this list of conditions and the following disclaimer in the documentation
|
|
18 |
* and/or other materials provided with the distribution.
|
|
19 |
* 3. The name of the author may not be used to endorse or promote products
|
|
20 |
* derived from this software without specific prior written permission.
|
|
21 |
*
|
|
22 |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
|
23 |
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
24 |
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
|
25 |
* EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
26 |
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
27 |
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
|
28 |
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
29 |
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
|
30 |
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
31 |
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
32 |
*)
|
|
33 |
|
23
|
34 |
unit uLandTemplates;
|
|
35 |
interface
|
|
36 |
uses SDLh;
|
|
37 |
{$INCLUDE options.inc}
|
|
38 |
|
|
39 |
type PPointArray = ^TPointArray;
|
|
40 |
TPointArray = array[0..0] of TPoint;
|
|
41 |
TEdgeTemplate = record
|
|
42 |
BasePoints: PPointArray;
|
|
43 |
BasePointsCount: Longword;
|
|
44 |
BezPassCnt: Longword;
|
|
45 |
PassMin, PassDelta: Longword;
|
|
46 |
WaveAmplMin, WaveAmplDelta: real;
|
|
47 |
WaveFreqMin, WaveFreqDelta: real;
|
|
48 |
FillPoints: PPointArray;
|
|
49 |
FillPointsCount: Longword;
|
27
|
50 |
canMirror, canFlip: boolean;
|
23
|
51 |
end;
|
|
52 |
|
|
53 |
const Template0Points: array[0..4] of TPoint =
|
|
54 |
(
|
|
55 |
(x: 500; y: 1500),
|
|
56 |
(x: 350; y: 400),
|
|
57 |
(x: 1023; y: 820),
|
|
58 |
(x: 1700; y: 400),
|
|
59 |
(x: 1550; y: 1500)
|
|
60 |
);
|
|
61 |
Template0FPoints: array[0..0] of TPoint =
|
|
62 |
(
|
51
|
63 |
(x: 1023; y: 0)
|
23
|
64 |
);
|
|
65 |
|
30
|
66 |
const Template1Points: array[0..12] of TPoint =
|
23
|
67 |
(
|
|
68 |
(x: 300; y: 1500),
|
|
69 |
(x: 300; y: 1000),
|
|
70 |
(x: 250; y: 750),
|
30
|
71 |
(x: 550; y: 480),
|
|
72 |
(x: 650; y: 780),
|
|
73 |
(x: 810; y: 780),
|
|
74 |
(x: 800; y: 500),
|
27
|
75 |
(x: 1200; y: 500),
|
30
|
76 |
(x: 1300; y: 800),
|
|
77 |
(x: 1500; y: 500),
|
23
|
78 |
(x: 1800; y: 750),
|
|
79 |
(x: 1750; y: 1000),
|
|
80 |
(x: 1750; y: 1500)
|
|
81 |
);
|
|
82 |
Template1FPoints: array[0..0] of TPoint =
|
|
83 |
(
|
51
|
84 |
(x: 1023; y: 0)
|
23
|
85 |
);
|
|
86 |
|
30
|
87 |
const Template2Points: array[0..28] of TPoint =
|
23
|
88 |
(
|
|
89 |
(x: 350; y: 1500),
|
|
90 |
(x: 350; y: 1000),
|
27
|
91 |
(x: 190; y: 850),
|
|
92 |
(x: 500; y: 750),
|
|
93 |
(x: 520; y: 450),
|
|
94 |
(x: 190; y: 600),
|
23
|
95 |
(x: 210; y: 260),
|
30
|
96 |
(x: 800; y: 310),
|
|
97 |
(x: 1350; y: 220),
|
|
98 |
(x: 1250; y: 360),
|
|
99 |
(x: 1550; y: 520),
|
|
100 |
(x: 1100; y: 400),
|
|
101 |
(x: 900; y: 470),
|
23
|
102 |
(x: 650; y: 400),
|
30
|
103 |
(x: 900; y: 750),
|
|
104 |
(x: 600; y: 750),
|
|
105 |
(x: 600; y: 850),
|
|
106 |
(x: 1100; y: 900),
|
23
|
107 |
(x: 1200; y: 1000),
|
30
|
108 |
(x: 1200; y: 1300),
|
|
109 |
(x: 1400; y: 1300),
|
23
|
110 |
(x: 1400; y: 1000),
|
30
|
111 |
(x: 1280; y: 850),
|
|
112 |
(x: 1150; y: 630),
|
|
113 |
(x: 1600; y: 850),
|
23
|
114 |
(x: 1800; y: 600),
|
|
115 |
(x: 1900; y: 600),
|
|
116 |
(x: 1700; y: 1010),
|
30
|
117 |
(x: 1700; y: 1500)
|
23
|
118 |
);
|
51
|
119 |
Template2FPoints: array[0..0] of TPoint =
|
23
|
120 |
(
|
51
|
121 |
(x: 1023; y: 0)
|
23
|
122 |
);
|
|
123 |
|
27
|
124 |
const Template3Points: array[0..23] of TPoint =
|
|
125 |
(
|
|
126 |
(x: 200; y: 1500),
|
|
127 |
(x: 200; y: 1000),
|
|
128 |
(x: 390; y: 650),
|
|
129 |
(x: 210; y: 260),
|
|
130 |
(x: 1000; y: 420),
|
|
131 |
(x: 1100; y: 200),
|
|
132 |
(x: 1250; y: 420),
|
|
133 |
(x: 1250; y: 620),
|
|
134 |
(x: 900; y: 610),
|
|
135 |
(x: 650; y: 450),
|
|
136 |
(x: 550; y: 500),
|
|
137 |
(x: 650; y: 700),
|
|
138 |
(x: 1200; y: 800),
|
|
139 |
(x: 1200; y: 1000),
|
|
140 |
(x: 1200; y: 1200),
|
|
141 |
(x: 1400; y: 1200),
|
|
142 |
(x: 1400; y: 1000),
|
|
143 |
(x: 1280; y: 750),
|
|
144 |
(x: 1500; y: 600),
|
|
145 |
(x: 1400; y: 200),
|
|
146 |
(x: 1800; y: 200),
|
|
147 |
(x: 1700; y: 600),
|
|
148 |
(x: 1900; y: 1010),
|
|
149 |
(x: 1800; y: 1200)
|
|
150 |
);
|
51
|
151 |
Template3FPoints: array[0..0] of TPoint =
|
27
|
152 |
(
|
51
|
153 |
(x: 1023; y: 0)
|
27
|
154 |
);
|
|
155 |
|
|
156 |
const Template4Points: array[0..38] of TPoint =
|
|
157 |
(
|
|
158 |
(x: 200; y: 1500),
|
|
159 |
(x: 200; y: 1000),
|
|
160 |
(x: 210; y: 800),
|
|
161 |
(x: 480; y: 830),
|
|
162 |
(x: 460; y: 700),
|
|
163 |
(x: 150; y: 610),
|
|
164 |
(x: 150; y: 310),
|
|
165 |
(x: 220; y: 200),
|
|
166 |
(x: 340; y: 195),
|
|
167 |
(x: 410; y: 415),
|
|
168 |
(x: 420; y: 495),
|
|
169 |
(x: 535; y: 615),
|
|
170 |
(x: 705; y: 600),
|
|
171 |
(x: 760; y: 425),
|
|
172 |
(x: 815; y: 230),
|
|
173 |
(x: 970; y: 200),
|
|
174 |
(x: 1050; y: 360),
|
|
175 |
(x: 850; y: 590),
|
|
176 |
(x: 1070; y: 790),
|
|
177 |
(x: 1000; y: 1000),
|
|
178 |
(x: 1000; y: 1500),
|
|
179 |
(x: 1250; y: 1500),
|
|
180 |
(x: 1250; y: 1000),
|
|
181 |
(x: 1260; y: 830),
|
|
182 |
(x: 1290; y: 700),
|
|
183 |
(x: 1270; y: 450),
|
|
184 |
(x: 1180; y: 280),
|
|
185 |
(x: 1210; y: 160),
|
|
186 |
(x: 1370; y: 160),
|
|
187 |
(x: 1505; y: 205),
|
|
188 |
(x: 1630; y: 315),
|
|
189 |
(x: 1660; y: 450),
|
|
190 |
(x: 1580; y: 620),
|
|
191 |
(x: 1670; y: 725),
|
|
192 |
(x: 1800; y: 730),
|
|
193 |
(x: 1860; y: 680),
|
|
194 |
(x: 1925; y: 810),
|
|
195 |
(x: 1800; y: 1000),
|
|
196 |
(x: 1800; y: 1500)
|
|
197 |
);
|
51
|
198 |
Template4FPoints: array[0..0] of TPoint =
|
27
|
199 |
(
|
51
|
200 |
(x: 1023; y: 0)
|
27
|
201 |
);
|
30
|
202 |
|
|
203 |
const Template5Points: array[0..10] of TPoint =
|
|
204 |
(
|
|
205 |
(x: 225; y: 1260),
|
|
206 |
(x: 254; y: 226),
|
|
207 |
(x: 729; y: 238),
|
|
208 |
(x: 658; y: 441),
|
|
209 |
(x: 661; y: 651),
|
|
210 |
(x: 1023; y: 759),
|
|
211 |
(x: 1374; y: 648),
|
|
212 |
(x: 1473; y: 285),
|
|
213 |
(x: 1803; y: 207),
|
|
214 |
(x: 1839; y: 801),
|
|
215 |
(x: 1674; y: 1239)
|
|
216 |
);
|
|
217 |
Template5FPoints: array[0..0] of TPoint =
|
|
218 |
(
|
51
|
219 |
(x: 1023; y: 0)
|
30
|
220 |
);
|
27
|
221 |
|
35
|
222 |
const Template6Points: array[0..20] of TPoint =
|
|
223 |
(
|
|
224 |
(x: 318; y: 1494),
|
|
225 |
(x: 270; y: 1023),
|
|
226 |
(x: 252; y: 921),
|
|
227 |
(x: 480; y: 888),
|
|
228 |
(x: 492; y: 753),
|
|
229 |
(x: 654; y: 756),
|
|
230 |
(x: 687; y: 630),
|
|
231 |
(x: 906; y: 627),
|
|
232 |
(x: 987; y: 813),
|
|
233 |
(x: 1125; y: 825),
|
|
234 |
(x: 1134; y: 645),
|
|
235 |
(x: 1236; y: 558),
|
|
236 |
(x: 1260; y: 438),
|
|
237 |
(x: 1467; y: 462),
|
|
238 |
(x: 1536; y: 348),
|
|
239 |
(x: 1680; y: 402),
|
|
240 |
(x: 1713; y: 594),
|
|
241 |
(x: 1593; y: 693),
|
|
242 |
(x: 1707; y: 774),
|
|
243 |
(x: 1728; y: 894),
|
|
244 |
(x: 1788; y: 1491)
|
|
245 |
);
|
|
246 |
Template6FPoints: array[0..0] of TPoint =
|
|
247 |
(
|
51
|
248 |
(x: 1023; y: 0)
|
35
|
249 |
);
|
|
250 |
|
49
|
251 |
const Template7Points: array[0..43] of TPoint =
|
|
252 |
(
|
|
253 |
(x: 180; y: 1485),
|
|
254 |
(x: 411; y: 1020),
|
|
255 |
(x: 402; y: 912),
|
|
256 |
(x: 141; y: 897),
|
|
257 |
(x: 156; y: 729),
|
|
258 |
(x: 417; y: 813),
|
|
259 |
(x: 432; y: 585),
|
|
260 |
(x: 147; y: 570),
|
|
261 |
(x: 138; y: 435),
|
|
262 |
(x: 444; y: 417),
|
|
263 |
(x: 447; y: 207),
|
|
264 |
(x: 573; y: 261),
|
|
265 |
(x: 663; y: 201),
|
|
266 |
(x: 711; y: 375),
|
|
267 |
(x: 897; y: 411),
|
|
268 |
(x: 936; y: 498),
|
|
269 |
(x: 663; y: 558),
|
|
270 |
(x: 669; y: 762),
|
|
271 |
(x: 957; y: 723),
|
|
272 |
(x: 984; y: 864),
|
|
273 |
(x: 729; y: 879),
|
|
274 |
(x: 879; y: 1020),
|
|
275 |
(x: 981; y: 1449),
|
|
276 |
(x: 1242; y: 1449),
|
|
277 |
(x: 1476; y: 1020),
|
|
278 |
(x: 1470; y: 900),
|
|
279 |
(x: 1284; y: 897),
|
|
280 |
(x: 1218; y: 774),
|
|
281 |
(x: 1464; y: 765),
|
|
282 |
(x: 1464; y: 672),
|
|
283 |
(x: 1119; y: 630),
|
|
284 |
(x: 1116; y: 537),
|
|
285 |
(x: 1485; y: 501),
|
|
286 |
(x: 1167; y: 246),
|
|
287 |
(x: 1263; y: 180),
|
|
288 |
(x: 1572; y: 312),
|
|
289 |
(x: 1767; y: 162),
|
|
290 |
(x: 1827; y: 306),
|
|
291 |
(x: 1647; y: 465),
|
|
292 |
(x: 1875; y: 621),
|
|
293 |
(x: 1683; y: 747),
|
|
294 |
(x: 1665; y: 831),
|
|
295 |
(x: 1818; y: 951),
|
|
296 |
(x: 1893; y: 1476)
|
51
|
297 |
);
|
|
298 |
Template7FPoints: array[0..0] of TPoint =
|
49
|
299 |
(
|
51
|
300 |
(x: 1023; y: 0)
|
49
|
301 |
);
|
|
302 |
|
51
|
303 |
const Template8Points: array[0..23] of TPoint =
|
|
304 |
(
|
|
305 |
(x: 222; y: 1482),
|
|
306 |
(x: 354; y: 1023),
|
|
307 |
(x: 249; y: 783),
|
|
308 |
(x: 240; y: 421),
|
|
309 |
(x: 411; y: 401),
|
|
310 |
(x: 432; y: 777),
|
|
311 |
(x: 573; y: 777),
|
|
312 |
(x: 567; y: 300),
|
|
313 |
(x: 696; y: 250),
|
|
314 |
(x: 744; y: 683),
|
|
315 |
(x: 897; y: 698),
|
|
316 |
(x: 885; y: 450),
|
|
317 |
(x: 1032; y: 479),
|
|
318 |
(x: 1065; y: 698),
|
|
319 |
(x: 1200; y: 690),
|
|
320 |
(x: 1200; y: 218),
|
|
321 |
(x: 1326; y: 252),
|
|
322 |
(x: 1359; y: 786),
|
|
323 |
(x: 1470; y: 810),
|
|
324 |
(x: 1485; y: 379),
|
|
325 |
(x: 1608; y: 342),
|
|
326 |
(x: 1641; y: 819),
|
|
327 |
(x: 1719; y: 864),
|
|
328 |
(x: 1746; y: 1440) );
|
|
329 |
Template8FPoints: array[0..0] of TPoint =
|
|
330 |
(
|
|
331 |
(x: 1023; y: 0)
|
|
332 |
);
|
|
333 |
|
|
334 |
const EdgeTemplates: array[0..8] of TEdgeTemplate =
|
23
|
335 |
(
|
|
336 |
(BasePoints: @Template0Points;
|
|
337 |
BasePointsCount: Succ(High(Template0Points));
|
|
338 |
BezPassCnt: 4;
|
27
|
339 |
PassMin: 10; PassDelta: 5;
|
|
340 |
WaveAmplMin: 17; WaveAmplDelta: 20;
|
|
341 |
WaveFreqMin: 0.010; WaveFreqDelta: 0.002;
|
23
|
342 |
FillPoints: @Template0FPoints;
|
|
343 |
FillPointsCount: Succ(High(Template0FPoints));
|
27
|
344 |
canMirror: false; canFlip: false;
|
23
|
345 |
),
|
|
346 |
(BasePoints: @Template1Points;
|
|
347 |
BasePointsCount: Succ(High(Template1Points));
|
30
|
348 |
BezPassCnt: 3;
|
27
|
349 |
PassMin: 10; PassDelta: 2;
|
|
350 |
WaveAmplMin: 25; WaveAmplDelta: 15;
|
|
351 |
WaveFreqMin: 0.008; WaveFreqDelta: 0.002;
|
23
|
352 |
FillPoints: @Template1FPoints;
|
|
353 |
FillPointsCount: Succ(High(Template1FPoints));
|
27
|
354 |
canMirror: false; canFlip: false;
|
23
|
355 |
),
|
|
356 |
(BasePoints: @Template2Points;
|
|
357 |
BasePointsCount: Succ(High(Template2Points));
|
25
|
358 |
BezPassCnt: 3;
|
27
|
359 |
PassMin: 14; PassDelta: 3;
|
|
360 |
WaveAmplMin: 10; WaveAmplDelta: 10;
|
|
361 |
WaveFreqMin: 0.010; WaveFreqDelta: 0.002;
|
23
|
362 |
FillPoints: @Template2FPoints;
|
|
363 |
FillPointsCount: Succ(High(Template2FPoints));
|
27
|
364 |
canMirror: true; canFlip: false;
|
|
365 |
),
|
|
366 |
(BasePoints: @Template3Points;
|
|
367 |
BasePointsCount: Succ(High(Template3Points));
|
|
368 |
BezPassCnt: 4;
|
|
369 |
PassMin: 15; PassDelta: 2;
|
|
370 |
WaveAmplMin: 8; WaveAmplDelta: 12;
|
|
371 |
WaveFreqMin: 0.015; WaveFreqDelta: 0.0015;
|
|
372 |
FillPoints: @Template3FPoints;
|
|
373 |
FillPointsCount: Succ(High(Template3FPoints));
|
|
374 |
canMirror: true; canFlip: false;
|
|
375 |
),
|
|
376 |
(BasePoints: @Template4Points;
|
|
377 |
BasePointsCount: Succ(High(Template4Points));
|
|
378 |
BezPassCnt: 3;
|
|
379 |
PassMin: 19; PassDelta: 5;
|
|
380 |
WaveAmplMin: 12; WaveAmplDelta: 14;
|
|
381 |
WaveFreqMin: 0.008; WaveFreqDelta: 0.001;
|
|
382 |
FillPoints: @Template4FPoints;
|
|
383 |
FillPointsCount: Succ(High(Template4FPoints));
|
|
384 |
canMirror: true; canFlip: false;
|
49
|
385 |
),
|
30
|
386 |
(BasePoints: @Template5Points;
|
|
387 |
BasePointsCount: Succ(High(Template5Points));
|
|
388 |
BezPassCnt: 4;
|
|
389 |
PassMin: 15; PassDelta: 1;
|
|
390 |
WaveAmplMin: 15; WaveAmplDelta: 14;
|
|
391 |
WaveFreqMin: 0.008; WaveFreqDelta: 0.002;
|
|
392 |
FillPoints: @Template5FPoints;
|
|
393 |
FillPointsCount: Succ(High(Template5FPoints));
|
|
394 |
canMirror: true; canFlip: false;
|
35
|
395 |
),
|
|
396 |
(BasePoints: @Template6Points;
|
|
397 |
BasePointsCount: Succ(High(Template6Points));
|
|
398 |
BezPassCnt: 3;
|
|
399 |
PassMin: 15; PassDelta: 1;
|
|
400 |
WaveAmplMin: 15; WaveAmplDelta: 10;
|
|
401 |
WaveFreqMin: 0.010; WaveFreqDelta: 0.0015;
|
|
402 |
FillPoints: @Template6FPoints;
|
|
403 |
FillPointsCount: Succ(High(Template6FPoints));
|
|
404 |
canMirror: true; canFlip: false;
|
49
|
405 |
),
|
|
406 |
(BasePoints: @Template7Points;
|
|
407 |
BasePointsCount: Succ(High(Template7Points));
|
|
408 |
BezPassCnt: 3;
|
|
409 |
PassMin: 12; PassDelta: 4;
|
|
410 |
WaveAmplMin: 5; WaveAmplDelta: 15;
|
|
411 |
WaveFreqMin: 0.015; WaveFreqDelta: 0.002;
|
|
412 |
FillPoints: @Template7FPoints;
|
|
413 |
FillPointsCount: Succ(High(Template7FPoints));
|
|
414 |
canMirror: true; canFlip: false;
|
51
|
415 |
),
|
|
416 |
(BasePoints: @Template8Points;
|
|
417 |
BasePointsCount: Succ(High(Template8Points));
|
|
418 |
BezPassCnt: 4;
|
|
419 |
PassMin: 9; PassDelta: 3;
|
|
420 |
WaveAmplMin: 18; WaveAmplDelta: 18;
|
|
421 |
WaveFreqMin: 0.010; WaveFreqDelta: 0.002;
|
|
422 |
FillPoints: @Template8FPoints;
|
|
423 |
FillPointsCount: Succ(High(Template8FPoints));
|
|
424 |
canMirror: true; canFlip: false;
|
35
|
425 |
)
|
23
|
426 |
);
|
|
427 |
|
30
|
428 |
|
|
429 |
|
23
|
430 |
implementation
|
|
431 |
|
|
432 |
end.
|