libtcod 0.0.9 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +4 -4
- data/LICENSE +21 -21
- data/README.md +1 -1
- data/Rakefile +2 -2
- data/bin/libtcod-ruby-test +344 -344
- data/clib/i686/libSDL.dylib +0 -0
- data/clib/i686/libtcod.dylib +0 -0
- data/clib/powerpc/libSDL.dylib +0 -0
- data/clib/powerpc/libtcod.dylib +0 -0
- data/lib/libtcod.rb +11 -11
- data/lib/libtcod/bindings.rb +657 -654
- data/lib/libtcod/color_consts.rb +225 -225
- data/lib/libtcod/consts.rb +218 -218
- data/lib/libtcod/struct.rb +34 -34
- data/lib/libtcod/system.rb +7 -7
- data/lib/libtcod/version.rb +1 -1
- data/libtcod.gemspec +21 -21
- data/test/color.rb +39 -39
- data/test/console.rb +8 -8
- metadata +14 -12
data/clib/i686/libSDL.dylib
CHANGED
Binary file
|
data/clib/i686/libtcod.dylib
CHANGED
Binary file
|
Binary file
|
Binary file
|
data/lib/libtcod.rb
CHANGED
@@ -1,11 +1,11 @@
|
|
1
|
-
require 'ffi'
|
2
|
-
require 'libtcod/version'
|
3
|
-
require 'libtcod/struct'
|
4
|
-
require 'libtcod/consts'
|
5
|
-
require 'libtcod/bindings'
|
6
|
-
require 'libtcod/color_consts'
|
7
|
-
require 'libtcod/system'
|
8
|
-
require 'libtcod/console'
|
9
|
-
require 'libtcod/map'
|
10
|
-
|
11
|
-
APP_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..'))
|
1
|
+
require 'ffi'
|
2
|
+
require 'libtcod/version'
|
3
|
+
require 'libtcod/struct'
|
4
|
+
require 'libtcod/consts'
|
5
|
+
require 'libtcod/bindings'
|
6
|
+
require 'libtcod/color_consts'
|
7
|
+
require 'libtcod/system'
|
8
|
+
require 'libtcod/console'
|
9
|
+
require 'libtcod/map'
|
10
|
+
|
11
|
+
APP_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..'))
|
data/lib/libtcod/bindings.rb
CHANGED
@@ -1,654 +1,657 @@
|
|
1
|
-
APP_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..', '..'))
|
2
|
-
|
3
|
-
module TCOD
|
4
|
-
extend FFI::Library
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
end
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
tcod_function :
|
62
|
-
tcod_function :
|
63
|
-
tcod_function :
|
64
|
-
tcod_function :
|
65
|
-
tcod_function :
|
66
|
-
tcod_function :
|
67
|
-
tcod_function :
|
68
|
-
tcod_function :
|
69
|
-
tcod_function :
|
70
|
-
tcod_function :
|
71
|
-
tcod_function :
|
72
|
-
tcod_function :
|
73
|
-
tcod_function :
|
74
|
-
tcod_function :
|
75
|
-
tcod_function :
|
76
|
-
tcod_function :
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
:
|
85
|
-
:
|
86
|
-
:
|
87
|
-
:
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
tcod_function :
|
105
|
-
tcod_function :
|
106
|
-
tcod_function :
|
107
|
-
tcod_function :
|
108
|
-
tcod_function :
|
109
|
-
tcod_function :
|
110
|
-
tcod_function :
|
111
|
-
tcod_function :
|
112
|
-
tcod_function :
|
113
|
-
tcod_function :
|
114
|
-
tcod_function :
|
115
|
-
tcod_function :
|
116
|
-
tcod_function :
|
117
|
-
tcod_function :
|
118
|
-
tcod_function :
|
119
|
-
tcod_function :
|
120
|
-
tcod_function :
|
121
|
-
tcod_function :
|
122
|
-
tcod_function :
|
123
|
-
tcod_function :
|
124
|
-
tcod_function :
|
125
|
-
tcod_function :
|
126
|
-
tcod_function :
|
127
|
-
tcod_function :
|
128
|
-
tcod_function :
|
129
|
-
tcod_function :
|
130
|
-
tcod_function :
|
131
|
-
tcod_function :
|
132
|
-
tcod_function :
|
133
|
-
tcod_function :
|
134
|
-
tcod_function :
|
135
|
-
tcod_function :
|
136
|
-
tcod_function :
|
137
|
-
tcod_function :
|
138
|
-
tcod_function :
|
139
|
-
tcod_function :
|
140
|
-
tcod_function :
|
141
|
-
tcod_function :
|
142
|
-
tcod_function :
|
143
|
-
tcod_function :
|
144
|
-
tcod_function :
|
145
|
-
tcod_function :
|
146
|
-
tcod_function :
|
147
|
-
tcod_function :
|
148
|
-
tcod_function :
|
149
|
-
tcod_function :
|
150
|
-
tcod_function :
|
151
|
-
tcod_function :
|
152
|
-
tcod_function :
|
153
|
-
tcod_function :
|
154
|
-
tcod_function :
|
155
|
-
tcod_function :
|
156
|
-
tcod_function :
|
157
|
-
tcod_function :
|
158
|
-
tcod_function :
|
159
|
-
tcod_function :
|
160
|
-
tcod_function :
|
161
|
-
tcod_function :
|
162
|
-
tcod_function :
|
163
|
-
tcod_function :
|
164
|
-
tcod_function :
|
165
|
-
tcod_function :
|
166
|
-
tcod_function :
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
tcod_function :
|
185
|
-
tcod_function :
|
186
|
-
tcod_function :
|
187
|
-
tcod_function :
|
188
|
-
tcod_function :
|
189
|
-
tcod_function :
|
190
|
-
tcod_function :
|
191
|
-
tcod_function :
|
192
|
-
tcod_function :
|
193
|
-
tcod_function :
|
194
|
-
tcod_function :
|
195
|
-
|
196
|
-
|
197
|
-
tcod_function :
|
198
|
-
tcod_function :
|
199
|
-
|
200
|
-
tcod_function :
|
201
|
-
tcod_function :
|
202
|
-
tcod_function :
|
203
|
-
tcod_function :
|
204
|
-
tcod_function :
|
205
|
-
tcod_function :
|
206
|
-
tcod_function :
|
207
|
-
tcod_function :
|
208
|
-
tcod_function :
|
209
|
-
tcod_function :
|
210
|
-
tcod_function :
|
211
|
-
tcod_function :
|
212
|
-
tcod_function :
|
213
|
-
tcod_function :
|
214
|
-
tcod_function :
|
215
|
-
tcod_function :
|
216
|
-
tcod_function :
|
217
|
-
tcod_function :
|
218
|
-
tcod_function :
|
219
|
-
tcod_function :
|
220
|
-
tcod_function :
|
221
|
-
tcod_function :
|
222
|
-
tcod_function :
|
223
|
-
tcod_function :
|
224
|
-
tcod_function :
|
225
|
-
tcod_function :
|
226
|
-
tcod_function :
|
227
|
-
tcod_function :
|
228
|
-
tcod_function :
|
229
|
-
|
230
|
-
tcod_function :
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
tcod_function :
|
251
|
-
tcod_function :
|
252
|
-
tcod_function :
|
253
|
-
|
254
|
-
|
255
|
-
tcod_function :
|
256
|
-
|
257
|
-
|
258
|
-
tcod_function :
|
259
|
-
tcod_function :
|
260
|
-
tcod_function :
|
261
|
-
tcod_function :
|
262
|
-
tcod_function :
|
263
|
-
tcod_function :
|
264
|
-
tcod_function :
|
265
|
-
tcod_function :
|
266
|
-
tcod_function :
|
267
|
-
tcod_function :
|
268
|
-
tcod_function :
|
269
|
-
tcod_function :
|
270
|
-
tcod_function :
|
271
|
-
tcod_function :
|
272
|
-
tcod_function :
|
273
|
-
tcod_function :
|
274
|
-
tcod_function :
|
275
|
-
tcod_function :
|
276
|
-
tcod_function :
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
tcod_function :
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
@s
|
375
|
-
end
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
@name
|
392
|
-
end
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
tcod_function :
|
419
|
-
tcod_function :
|
420
|
-
tcod_function :
|
421
|
-
tcod_function :
|
422
|
-
tcod_function :
|
423
|
-
tcod_function :
|
424
|
-
|
425
|
-
tcod_function :
|
426
|
-
tcod_function :
|
427
|
-
|
428
|
-
tcod_function :
|
429
|
-
tcod_function :
|
430
|
-
tcod_function :
|
431
|
-
tcod_function :
|
432
|
-
tcod_function :
|
433
|
-
tcod_function :
|
434
|
-
tcod_function :
|
435
|
-
tcod_function :
|
436
|
-
tcod_function :
|
437
|
-
tcod_function :
|
438
|
-
tcod_function :
|
439
|
-
tcod_function :
|
440
|
-
tcod_function :
|
441
|
-
|
442
|
-
tcod_function :
|
443
|
-
tcod_function :
|
444
|
-
|
445
|
-
tcod_function :
|
446
|
-
tcod_function :
|
447
|
-
tcod_function :
|
448
|
-
tcod_function :
|
449
|
-
tcod_function :
|
450
|
-
tcod_function :
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
|
467
|
-
|
468
|
-
|
469
|
-
tcod_function :
|
470
|
-
tcod_function :
|
471
|
-
tcod_function :
|
472
|
-
tcod_function :
|
473
|
-
tcod_function :
|
474
|
-
tcod_function :
|
475
|
-
tcod_function :
|
476
|
-
tcod_function :
|
477
|
-
tcod_function :
|
478
|
-
tcod_function :
|
479
|
-
tcod_function :
|
480
|
-
tcod_function :
|
481
|
-
tcod_function :
|
482
|
-
|
483
|
-
|
484
|
-
|
485
|
-
|
486
|
-
|
487
|
-
|
488
|
-
|
489
|
-
|
490
|
-
|
491
|
-
|
492
|
-
|
493
|
-
|
494
|
-
|
495
|
-
tcod_function :
|
496
|
-
tcod_function :
|
497
|
-
tcod_function :
|
498
|
-
tcod_function :
|
499
|
-
tcod_function :
|
500
|
-
tcod_function :
|
501
|
-
|
502
|
-
|
503
|
-
|
504
|
-
|
505
|
-
|
506
|
-
|
507
|
-
|
508
|
-
|
509
|
-
|
510
|
-
|
511
|
-
|
512
|
-
|
513
|
-
|
514
|
-
|
515
|
-
|
516
|
-
|
517
|
-
|
518
|
-
|
519
|
-
|
520
|
-
|
521
|
-
|
522
|
-
|
523
|
-
tcod_function :
|
524
|
-
tcod_function :
|
525
|
-
tcod_function :
|
526
|
-
tcod_function :
|
527
|
-
tcod_function :
|
528
|
-
tcod_function :
|
529
|
-
tcod_function :
|
530
|
-
tcod_function :
|
531
|
-
tcod_function :
|
532
|
-
tcod_function :
|
533
|
-
|
534
|
-
|
535
|
-
|
536
|
-
|
537
|
-
|
538
|
-
|
539
|
-
|
540
|
-
|
541
|
-
tcod_function :
|
542
|
-
tcod_function :
|
543
|
-
tcod_function :
|
544
|
-
tcod_function :
|
545
|
-
tcod_function :
|
546
|
-
tcod_function :
|
547
|
-
tcod_function :
|
548
|
-
tcod_function :
|
549
|
-
tcod_function :
|
550
|
-
tcod_function :
|
551
|
-
tcod_function :
|
552
|
-
tcod_function :
|
553
|
-
tcod_function :
|
554
|
-
tcod_function :
|
555
|
-
tcod_function :
|
556
|
-
tcod_function :
|
557
|
-
tcod_function :
|
558
|
-
tcod_function :
|
559
|
-
tcod_function :
|
560
|
-
|
561
|
-
|
562
|
-
|
563
|
-
|
564
|
-
|
565
|
-
|
566
|
-
|
567
|
-
|
568
|
-
|
569
|
-
|
570
|
-
|
571
|
-
|
572
|
-
|
573
|
-
|
574
|
-
|
575
|
-
|
576
|
-
|
577
|
-
|
578
|
-
:
|
579
|
-
:
|
580
|
-
:
|
581
|
-
:
|
582
|
-
:
|
583
|
-
|
584
|
-
|
585
|
-
|
586
|
-
|
587
|
-
|
588
|
-
|
589
|
-
tcod_function :
|
590
|
-
tcod_function :
|
591
|
-
tcod_function :
|
592
|
-
tcod_function :
|
593
|
-
tcod_function :
|
594
|
-
tcod_function :
|
595
|
-
tcod_function :
|
596
|
-
tcod_function :
|
597
|
-
tcod_function :
|
598
|
-
tcod_function :
|
599
|
-
tcod_function :
|
600
|
-
tcod_function :
|
601
|
-
tcod_function :
|
602
|
-
tcod_function :
|
603
|
-
tcod_function :
|
604
|
-
|
605
|
-
|
606
|
-
|
607
|
-
|
608
|
-
|
609
|
-
|
610
|
-
|
611
|
-
|
612
|
-
|
613
|
-
|
614
|
-
|
615
|
-
|
616
|
-
|
617
|
-
|
618
|
-
|
619
|
-
|
620
|
-
|
621
|
-
tcod_function :
|
622
|
-
tcod_function :
|
623
|
-
tcod_function :
|
624
|
-
tcod_function :
|
625
|
-
tcod_function :
|
626
|
-
tcod_function :
|
627
|
-
tcod_function :
|
628
|
-
tcod_function :
|
629
|
-
tcod_function :
|
630
|
-
tcod_function :
|
631
|
-
tcod_function :
|
632
|
-
tcod_function :
|
633
|
-
tcod_function :
|
634
|
-
tcod_function :
|
635
|
-
tcod_function :
|
636
|
-
tcod_function :
|
637
|
-
tcod_function :
|
638
|
-
tcod_function :
|
639
|
-
tcod_function :
|
640
|
-
tcod_function :
|
641
|
-
tcod_function :
|
642
|
-
tcod_function :
|
643
|
-
tcod_function :
|
644
|
-
tcod_function :
|
645
|
-
tcod_function :
|
646
|
-
|
647
|
-
|
648
|
-
|
649
|
-
|
650
|
-
|
651
|
-
|
652
|
-
tcod_function :
|
653
|
-
tcod_function :
|
654
|
-
|
1
|
+
APP_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..', '..'))
|
2
|
+
|
3
|
+
module TCOD
|
4
|
+
extend FFI::Library
|
5
|
+
|
6
|
+
libname = 'libtcod'
|
7
|
+
ext = RUBY_PLATFORM.include?('darwin') ? '.dylib' : '.so'
|
8
|
+
|
9
|
+
case RUBY_PLATFORM
|
10
|
+
when /mingw32/
|
11
|
+
libname = 'libtcod-mingw'
|
12
|
+
ext = '-mingw.dll'
|
13
|
+
platform = 'i686'
|
14
|
+
when /powerpc/
|
15
|
+
platform = 'powerpc'
|
16
|
+
when /x86_64/
|
17
|
+
platform = 'amd64'
|
18
|
+
when /i.86/
|
19
|
+
platform = 'i686'
|
20
|
+
end
|
21
|
+
|
22
|
+
libpath = File.join(APP_ROOT, 'clib', platform, "libtcod#{ext}")
|
23
|
+
ffi_lib [libname, libpath]
|
24
|
+
|
25
|
+
# Remove redundant namespacing
|
26
|
+
def self.tcod_function(sym, *args)
|
27
|
+
attach_function(sym[5..-1].to_sym, sym, *args)
|
28
|
+
end
|
29
|
+
|
30
|
+
### Color module
|
31
|
+
class Color < FFI::Struct
|
32
|
+
layout :r, :uchar,
|
33
|
+
:g, :uchar,
|
34
|
+
:b, :uchar
|
35
|
+
|
36
|
+
def self.rgb(r,g,b)
|
37
|
+
TCOD.color_RGB(r,g,b)
|
38
|
+
end
|
39
|
+
|
40
|
+
def self.hsv(h,s,v)
|
41
|
+
TCOD.color_HSV(h,s,v)
|
42
|
+
end
|
43
|
+
|
44
|
+
def ==(col)
|
45
|
+
TCOD.color_equals(self, col)
|
46
|
+
end
|
47
|
+
|
48
|
+
def *(col_or_float)
|
49
|
+
if col_or_float.is_a? Color
|
50
|
+
TCOD.color_multiply(self, col_or_float)
|
51
|
+
else
|
52
|
+
TCOD.color_multiply_scalar(self, col_or_float)
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
def to_s
|
57
|
+
"<Color #{self[:r]}, #{self[:g]}, #{self[:b]}>"
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
tcod_function :TCOD_color_RGB, [ :uchar, :uchar, :uchar ], Color.val
|
62
|
+
tcod_function :TCOD_color_HSV, [ :float, :float, :float ], Color.val
|
63
|
+
tcod_function :TCOD_color_equals, [ Color.val, Color.val ], :bool
|
64
|
+
tcod_function :TCOD_color_add, [ Color.val, Color.val ], Color.val
|
65
|
+
tcod_function :TCOD_color_subtract, [ Color.val, Color.val ], Color.val
|
66
|
+
tcod_function :TCOD_color_multiply, [ Color.val, Color.val ], Color.val
|
67
|
+
tcod_function :TCOD_color_multiply_scalar, [ Color.val, :float ], Color.val
|
68
|
+
tcod_function :TCOD_color_lerp, [ Color.val, Color.val, :float ], Color.val
|
69
|
+
tcod_function :TCOD_color_set_HSV, [ :pointer, :float, :float, :float ], :void
|
70
|
+
tcod_function :TCOD_color_get_HSV, [ Color.val, :pointer, :pointer, :pointer ], :void
|
71
|
+
tcod_function :TCOD_color_get_hue, [ Color.val ], :float
|
72
|
+
tcod_function :TCOD_color_set_hue, [ :pointer, :float ], :void
|
73
|
+
tcod_function :TCOD_color_get_saturation, [ Color.val ], :float
|
74
|
+
tcod_function :TCOD_color_set_saturation, [ :pointer, :float ], :void
|
75
|
+
tcod_function :TCOD_color_get_value, [ Color.val ], :float
|
76
|
+
tcod_function :TCOD_color_set_value, [ :pointer, :float ], :void
|
77
|
+
tcod_function :TCOD_color_shift_hue, [ :pointer, :float ], :void
|
78
|
+
tcod_function :TCOD_color_scale_HSV, [ :pointer, :float, :float ], :void
|
79
|
+
tcod_function :TCOD_color_gen_map, [ :pointer, :int, :pointer, :pointer ], :void
|
80
|
+
|
81
|
+
### Console module
|
82
|
+
class Key < MethodStruct
|
83
|
+
layout :vk, :int,
|
84
|
+
:c, :uchar,
|
85
|
+
:pressed, :bool,
|
86
|
+
:lalt, :bool,
|
87
|
+
:lctrl, :bool,
|
88
|
+
:ralt, :bool,
|
89
|
+
:rctrl, :bool,
|
90
|
+
:shift, :bool
|
91
|
+
|
92
|
+
def c
|
93
|
+
self[:c].chr
|
94
|
+
end
|
95
|
+
end
|
96
|
+
|
97
|
+
TCOD_renderer_t = :int
|
98
|
+
TCOD_bkgnd_flag_t = :int
|
99
|
+
TCOD_alignment_t = :int
|
100
|
+
TCOD_keycode_t = :int
|
101
|
+
TCOD_colctrl_t = :int
|
102
|
+
TCOD_console_t = :pointer
|
103
|
+
|
104
|
+
tcod_function :TCOD_console_init_root, [ :int, :int, :string, :bool, TCOD_renderer_t ], :void
|
105
|
+
tcod_function :TCOD_console_set_window_title, [ :string ], :void
|
106
|
+
tcod_function :TCOD_console_set_fullscreen, [ :bool ], :void
|
107
|
+
tcod_function :TCOD_console_is_fullscreen, [ ], :bool
|
108
|
+
tcod_function :TCOD_console_is_window_closed, [ ], :bool
|
109
|
+
tcod_function :TCOD_console_set_custom_font, [ :string, :int, :int, :int ], :void
|
110
|
+
tcod_function :TCOD_console_map_ascii_code_to_font, [ :int, :int, :int ], :void
|
111
|
+
tcod_function :TCOD_console_map_ascii_codes_to_font, [ :int, :int, :int, :int ], :void
|
112
|
+
tcod_function :TCOD_console_map_string_to_font, [ :string, :int, :int ], :void
|
113
|
+
tcod_function :TCOD_console_set_dirty, [ :int, :int, :int, :int ], :void
|
114
|
+
tcod_function :TCOD_console_set_default_background, [ :pointer, Color.val ], :void
|
115
|
+
tcod_function :TCOD_console_set_default_foreground, [ :pointer, Color.val ], :void
|
116
|
+
tcod_function :TCOD_console_clear, [ :pointer ], :void
|
117
|
+
tcod_function :TCOD_console_set_char_background, [ :pointer, :int, :int, Color.val, TCOD_bkgnd_flag_t ], :void
|
118
|
+
tcod_function :TCOD_console_set_char_foreground, [ :pointer, :int, :int, Color.val ], :void
|
119
|
+
tcod_function :TCOD_console_set_char, [ :pointer, :int, :int, :int ], :void
|
120
|
+
tcod_function :TCOD_console_put_char, [ :pointer, :int, :int, :int, TCOD_bkgnd_flag_t ], :void
|
121
|
+
tcod_function :TCOD_console_put_char_ex, [ :pointer, :int, :int, :int, Color.val, Color.val ], :void
|
122
|
+
tcod_function :TCOD_console_set_background_flag, [ :pointer, TCOD_bkgnd_flag_t ], :void
|
123
|
+
tcod_function :TCOD_console_get_background_flag, [ :pointer ], TCOD_bkgnd_flag_t
|
124
|
+
tcod_function :TCOD_console_set_alignment, [ :pointer, TCOD_alignment_t ], :void
|
125
|
+
tcod_function :TCOD_console_get_alignment, [ :pointer ], TCOD_alignment_t
|
126
|
+
tcod_function :TCOD_console_print, [ :pointer, :int, :int, :string, :varargs ], :void
|
127
|
+
tcod_function :TCOD_console_print_ex, [ :pointer, :int, :int, TCOD_bkgnd_flag_t, TCOD_alignment_t, :string, :varargs ], :void
|
128
|
+
tcod_function :TCOD_console_print_rect, [ :pointer, :int, :int, :int, :int, :string, :varargs ], :int
|
129
|
+
tcod_function :TCOD_console_print_rect_ex, [ :pointer, :int, :int, :int, :int, TCOD_bkgnd_flag_t, TCOD_alignment_t, :string, :varargs ], :int
|
130
|
+
tcod_function :TCOD_console_get_height_rect, [ :pointer, :int, :int, :int, :int, :string, :varargs ], :int
|
131
|
+
tcod_function :TCOD_console_rect, [ :pointer, :int, :int, :int, :int, :bool, TCOD_bkgnd_flag_t ], :void
|
132
|
+
tcod_function :TCOD_console_hline, [ :pointer, :int, :int, :int, TCOD_bkgnd_flag_t ], :void
|
133
|
+
tcod_function :TCOD_console_vline, [ :pointer, :int, :int, :int, TCOD_bkgnd_flag_t ], :void
|
134
|
+
tcod_function :TCOD_console_print_frame, [ :pointer, :int, :int, :int, :int, :bool, TCOD_bkgnd_flag_t, :string, :varargs ], :void
|
135
|
+
tcod_function :TCOD_console_map_string_to_font_utf, [ :pointer, :int, :int ], :void
|
136
|
+
tcod_function :TCOD_console_print_utf, [ :pointer, :int, :int, :pointer, :varargs ], :void
|
137
|
+
tcod_function :TCOD_console_print_ex_utf, [ :pointer, :int, :int, TCOD_bkgnd_flag_t, TCOD_alignment_t, :pointer, :varargs ], :void
|
138
|
+
tcod_function :TCOD_console_print_rect_utf, [ :pointer, :int, :int, :int, :int, :pointer, :varargs ], :int
|
139
|
+
tcod_function :TCOD_console_print_rect_ex_utf, [ :pointer, :int, :int, :int, :int, TCOD_bkgnd_flag_t, TCOD_alignment_t, :pointer, :varargs ], :int
|
140
|
+
tcod_function :TCOD_console_get_height_rect_utf, [ :pointer, :int, :int, :int, :int, :pointer, :varargs ], :int
|
141
|
+
tcod_function :TCOD_console_get_default_background, [ :pointer ], Color.val
|
142
|
+
tcod_function :TCOD_console_get_default_foreground, [ :pointer ], Color.val
|
143
|
+
tcod_function :TCOD_console_get_char_background, [ :pointer, :int, :int ], Color.val
|
144
|
+
tcod_function :TCOD_console_get_char_foreground, [ :pointer, :int, :int ], Color.val
|
145
|
+
tcod_function :TCOD_console_get_char, [ :pointer, :int, :int ], :int
|
146
|
+
tcod_function :TCOD_console_set_fade, [ :uchar, Color.val ], :void
|
147
|
+
tcod_function :TCOD_console_get_fade, [ ], :uchar
|
148
|
+
tcod_function :TCOD_console_get_fading_color, [ ], Color.val
|
149
|
+
tcod_function :TCOD_console_flush, [ ], :void
|
150
|
+
tcod_function :TCOD_console_set_color_control, [ TCOD_colctrl_t, Color.val, Color.val ], :void
|
151
|
+
tcod_function :TCOD_console_check_for_keypress, [ :int ], Key.val
|
152
|
+
tcod_function :TCOD_console_wait_for_keypress, [ :bool ], Key.val
|
153
|
+
tcod_function :TCOD_console_set_keyboard_repeat, [ :int, :int ], :void
|
154
|
+
tcod_function :TCOD_console_disable_keyboard_repeat, [ ], :void
|
155
|
+
tcod_function :TCOD_console_is_key_pressed, [ TCOD_keycode_t ], :bool
|
156
|
+
tcod_function :TCOD_console_from_file, [ :string ], :pointer
|
157
|
+
tcod_function :TCOD_console_load_asc, [ :pointer, :string ], :bool
|
158
|
+
tcod_function :TCOD_console_load_apf, [ :pointer, :string ], :bool
|
159
|
+
tcod_function :TCOD_console_save_asc, [ :pointer, :string ], :bool
|
160
|
+
tcod_function :TCOD_console_save_apf, [ :pointer, :string ], :bool
|
161
|
+
tcod_function :TCOD_console_new, [ :int, :int ], :pointer
|
162
|
+
tcod_function :TCOD_console_get_width, [ :pointer ], :int
|
163
|
+
tcod_function :TCOD_console_get_height, [ :pointer ], :int
|
164
|
+
tcod_function :TCOD_console_set_key_color, [ :pointer, Color.val ], :void
|
165
|
+
tcod_function :TCOD_console_blit, [ :pointer, :int, :int, :int, :int, :pointer, :int, :int, :float, :float ], :void
|
166
|
+
tcod_function :TCOD_console_delete, [ :pointer ], :void
|
167
|
+
tcod_function :TCOD_console_credits, [ ], :void
|
168
|
+
tcod_function :TCOD_console_credits_reset, [ ], :void
|
169
|
+
tcod_function :TCOD_console_credits_render, [ :int, :int, :bool ], :bool
|
170
|
+
|
171
|
+
### System module
|
172
|
+
EVENT_KEY_PRESS = 1
|
173
|
+
EVENT_MOUSE_RELEASE = 16
|
174
|
+
EVENT_KEY_RELEASE = 2
|
175
|
+
EVENT_MOUSE_MOVE = 4
|
176
|
+
EVENT_MOUSE_PRESS = 8
|
177
|
+
EVENT_MOUSE = EVENT_MOUSE_MOVE|EVENT_MOUSE_PRESS|EVENT_MOUSE_RELEASE
|
178
|
+
EVENT_KEY = EVENT_KEY_PRESS|EVENT_KEY_RELEASE
|
179
|
+
EVENT_ANY = EVENT_KEY|EVENT_MOUSE
|
180
|
+
|
181
|
+
TCOD_image_t = :pointer
|
182
|
+
TCOD_list_t = :pointer
|
183
|
+
|
184
|
+
tcod_function :TCOD_sys_elapsed_milli, [ ], :uint32
|
185
|
+
tcod_function :TCOD_sys_elapsed_seconds, [ ], :float
|
186
|
+
tcod_function :TCOD_sys_sleep_milli, [ :uint32 ], :void
|
187
|
+
tcod_function :TCOD_sys_save_screenshot, [ :string ], :void
|
188
|
+
tcod_function :TCOD_sys_force_fullscreen_resolution, [ :int, :int ], :void
|
189
|
+
tcod_function :TCOD_sys_set_renderer, [ TCOD_renderer_t ], :void
|
190
|
+
tcod_function :TCOD_sys_get_renderer, [ ], TCOD_renderer_t
|
191
|
+
tcod_function :TCOD_sys_set_fps, [ :int ], :void
|
192
|
+
tcod_function :TCOD_sys_get_fps, [ ], :int
|
193
|
+
tcod_function :TCOD_sys_get_last_frame_length, [ ], :float
|
194
|
+
tcod_function :TCOD_sys_get_current_resolution, [ :pointer, :pointer ], :void
|
195
|
+
tcod_function :TCOD_sys_get_fullscreen_offsets, [ :pointer, :pointer ], :void
|
196
|
+
tcod_function :TCOD_sys_update_char, [ :int, :int, :int, TCOD_image_t, :int, :int ], :void
|
197
|
+
tcod_function :TCOD_sys_get_char_size, [ :pointer, :pointer ], :void
|
198
|
+
#tcod_function :TCOD_sys_get_sdl_window, [ ], :pointer
|
199
|
+
|
200
|
+
tcod_function :TCOD_sys_wait_for_event, [ :int, :pointer, :pointer, :bool ], :int
|
201
|
+
tcod_function :TCOD_sys_check_for_event, [ :int, :pointer, :pointer ], :int
|
202
|
+
tcod_function :TCOD_sys_create_directory, [ :string ], :bool
|
203
|
+
tcod_function :TCOD_sys_delete_file, [ :string ], :bool
|
204
|
+
tcod_function :TCOD_sys_delete_directory, [ :string ], :bool
|
205
|
+
tcod_function :TCOD_sys_is_directory, [ :string ], :bool
|
206
|
+
tcod_function :TCOD_sys_get_directory_content, [ :string, :string ], TCOD_list_t
|
207
|
+
tcod_function :TCOD_sys_file_exists, [ :string, :varargs ], :bool
|
208
|
+
tcod_function :TCOD_sys_read_file, [ :string, :pointer, :pointer ], :bool
|
209
|
+
tcod_function :TCOD_sys_write_file, [ :string, :pointer, :uint32 ], :bool
|
210
|
+
tcod_function :TCOD_sys_clipboard_set, [ :string ], :void
|
211
|
+
tcod_function :TCOD_sys_clipboard_get, [ ], :string
|
212
|
+
tcod_function :TCOD_thread_new, [ callback([ :pointer ], :int), :pointer ], :pointer
|
213
|
+
tcod_function :TCOD_thread_delete, [ :pointer ], :void
|
214
|
+
tcod_function :TCOD_sys_get_num_cores, [ ], :int
|
215
|
+
tcod_function :TCOD_thread_wait, [ :pointer ], :void
|
216
|
+
tcod_function :TCOD_mutex_new, [ ], :pointer
|
217
|
+
tcod_function :TCOD_mutex_in, [ :pointer ], :void
|
218
|
+
tcod_function :TCOD_mutex_out, [ :pointer ], :void
|
219
|
+
tcod_function :TCOD_mutex_delete, [ :pointer ], :void
|
220
|
+
tcod_function :TCOD_semaphore_new, [ :int ], :pointer
|
221
|
+
tcod_function :TCOD_semaphore_lock, [ :pointer ], :void
|
222
|
+
tcod_function :TCOD_semaphore_unlock, [ :pointer ], :void
|
223
|
+
tcod_function :TCOD_semaphore_delete, [ :pointer ], :void
|
224
|
+
tcod_function :TCOD_condition_new, [ ], :pointer
|
225
|
+
tcod_function :TCOD_condition_signal, [ :pointer ], :void
|
226
|
+
tcod_function :TCOD_condition_broadcast, [ :pointer ], :void
|
227
|
+
tcod_function :TCOD_condition_wait, [ :pointer, :pointer ], :void
|
228
|
+
tcod_function :TCOD_condition_delete, [ :pointer ], :void
|
229
|
+
tcod_function :TCOD_load_library, [ :string ], :pointer
|
230
|
+
tcod_function :TCOD_get_function_address, [ :pointer, :string ], :pointer
|
231
|
+
tcod_function :TCOD_close_library, [ :pointer ], :void
|
232
|
+
callback(:SDL_renderer_t, [ :pointer ], :void)
|
233
|
+
tcod_function :TCOD_sys_register_SDL_renderer, [ :SDL_renderer_t ], :void
|
234
|
+
|
235
|
+
### Line module
|
236
|
+
class BresenhamData < MethodStruct
|
237
|
+
layout(
|
238
|
+
:stepx, :int,
|
239
|
+
:stepy, :int,
|
240
|
+
:e, :int,
|
241
|
+
:deltax, :int,
|
242
|
+
:deltay, :int,
|
243
|
+
:origx, :int,
|
244
|
+
:origy, :int,
|
245
|
+
:destx, :int,
|
246
|
+
:desty, :int
|
247
|
+
)
|
248
|
+
end
|
249
|
+
callback(:TCOD_line_listener_t, [ :int, :int ], :bool)
|
250
|
+
tcod_function :TCOD_line_init, [ :int, :int, :int, :int ], :void
|
251
|
+
tcod_function :TCOD_line_step, [ :pointer, :pointer ], :bool
|
252
|
+
tcod_function :TCOD_line, [ :int, :int, :int, :int, :TCOD_line_listener_t ], :bool
|
253
|
+
tcod_function :TCOD_line_init_mt, [ :int, :int, :int, :int, :pointer ], :void
|
254
|
+
tcod_function :TCOD_line_step_mt, [ :pointer, :pointer, :pointer ], :bool
|
255
|
+
tcod_function :TCOD_line_mt, [ :int, :int, :int, :int, :TCOD_line_listener_t, :pointer ], :bool
|
256
|
+
|
257
|
+
### Image module
|
258
|
+
tcod_function :TCOD_image_new, [ :int, :int ], :pointer
|
259
|
+
tcod_function :TCOD_image_from_console, [ TCOD_console_t ], :pointer
|
260
|
+
tcod_function :TCOD_image_refresh_console, [ :pointer, TCOD_console_t ], :void
|
261
|
+
tcod_function :TCOD_image_load, [ :string ], :pointer
|
262
|
+
tcod_function :TCOD_image_clear, [ :pointer, Color.val ], :void
|
263
|
+
tcod_function :TCOD_image_invert, [ :pointer ], :void
|
264
|
+
tcod_function :TCOD_image_hflip, [ :pointer ], :void
|
265
|
+
tcod_function :TCOD_image_rotate90, [ :pointer, :int ], :void
|
266
|
+
tcod_function :TCOD_image_vflip, [ :pointer ], :void
|
267
|
+
tcod_function :TCOD_image_scale, [ :pointer, :int, :int ], :void
|
268
|
+
tcod_function :TCOD_image_save, [ :pointer, :string ], :void
|
269
|
+
tcod_function :TCOD_image_get_size, [ :pointer, :pointer, :pointer ], :void
|
270
|
+
tcod_function :TCOD_image_get_pixel, [ :pointer, :int, :int ], Color.val
|
271
|
+
tcod_function :TCOD_image_get_alpha, [ :pointer, :int, :int ], :int
|
272
|
+
tcod_function :TCOD_image_get_mipmap_pixel, [ :pointer, :float, :float, :float, :float ], Color.val
|
273
|
+
tcod_function :TCOD_image_put_pixel, [ :pointer, :int, :int, Color.val ], :void
|
274
|
+
tcod_function :TCOD_image_blit, [ :pointer, TCOD_console_t, :float, :float, TCOD_bkgnd_flag_t, :float, :float, :float ], :void
|
275
|
+
tcod_function :TCOD_image_blit_rect, [ :pointer, TCOD_console_t, :int, :int, :int, :int, TCOD_bkgnd_flag_t ], :void
|
276
|
+
tcod_function :TCOD_image_blit_2x, [ :pointer, TCOD_console_t, :int, :int, :int, :int, :int, :int ], :void
|
277
|
+
tcod_function :TCOD_image_delete, [ :pointer ], :void
|
278
|
+
tcod_function :TCOD_image_set_key_color, [ :pointer, Color.val ], :void
|
279
|
+
tcod_function :TCOD_image_is_pixel_transparent, [ :pointer, :int, :int ], :bool
|
280
|
+
|
281
|
+
### Mouse module
|
282
|
+
class Mouse < MethodStruct
|
283
|
+
layout(
|
284
|
+
:x, :int,
|
285
|
+
:y, :int,
|
286
|
+
:dx, :int,
|
287
|
+
:dy, :int,
|
288
|
+
:cx, :int,
|
289
|
+
:cy, :int,
|
290
|
+
:dcx, :int,
|
291
|
+
:dcy, :int,
|
292
|
+
:lbutton, :bool,
|
293
|
+
:rbutton, :bool,
|
294
|
+
:mbutton, :bool,
|
295
|
+
:lbutton_pressed, :bool,
|
296
|
+
:rbutton_pressed, :bool,
|
297
|
+
:mbutton_pressed, :bool,
|
298
|
+
:wheel_up, :bool,
|
299
|
+
:wheel_down, :bool
|
300
|
+
)
|
301
|
+
end
|
302
|
+
tcod_function :TCOD_mouse_show_cursor, [ :bool ], :void
|
303
|
+
tcod_function :TCOD_mouse_get_status, [ ], Mouse.val
|
304
|
+
tcod_function :TCOD_mouse_is_cursor_visible, [ ], :bool
|
305
|
+
tcod_function :TCOD_mouse_move, [ :int, :int ], :void
|
306
|
+
#tcod_function :TCOD_mouse_includes_touch, [ :bool ], :void
|
307
|
+
|
308
|
+
### Parser module
|
309
|
+
TYPE_NONE = 0
|
310
|
+
TYPE_BOOL = 1
|
311
|
+
TYPE_VALUELIST02 = 10
|
312
|
+
TYPE_LIST = 1024
|
313
|
+
TYPE_VALUELIST03 = 11
|
314
|
+
TYPE_VALUELIST04 = 12
|
315
|
+
TYPE_VALUELIST05 = 13
|
316
|
+
TYPE_VALUELIST06 = 14
|
317
|
+
TYPE_VALUELIST07 = 15
|
318
|
+
TYPE_VALUELIST08 = 16
|
319
|
+
TYPE_VALUELIST09 = 17
|
320
|
+
TYPE_VALUELIST10 = 18
|
321
|
+
TYPE_VALUELIST11 = 19
|
322
|
+
TYPE_CHAR = 2
|
323
|
+
TYPE_VALUELIST12 = 20
|
324
|
+
TYPE_VALUELIST13 = 21
|
325
|
+
TYPE_VALUELIST14 = 22
|
326
|
+
TYPE_VALUELIST15 = 23
|
327
|
+
TYPE_CUSTOM00 = 24
|
328
|
+
TYPE_CUSTOM01 = 25
|
329
|
+
TYPE_CUSTOM02 = 26
|
330
|
+
TYPE_CUSTOM03 = 27
|
331
|
+
TYPE_CUSTOM04 = 28
|
332
|
+
TYPE_CUSTOM05 = 29
|
333
|
+
TYPE_INT = 3
|
334
|
+
TYPE_CUSTOM06 = 30
|
335
|
+
TYPE_CUSTOM07 = 31
|
336
|
+
TYPE_CUSTOM08 = 32
|
337
|
+
TYPE_CUSTOM09 = 33
|
338
|
+
TYPE_CUSTOM10 = 34
|
339
|
+
TYPE_CUSTOM11 = 35
|
340
|
+
TYPE_CUSTOM12 = 36
|
341
|
+
TYPE_CUSTOM13 = 37
|
342
|
+
TYPE_CUSTOM14 = 38
|
343
|
+
TYPE_CUSTOM15 = 39
|
344
|
+
TYPE_FLOAT = 4
|
345
|
+
TYPE_STRING = 5
|
346
|
+
TYPE_COLOR = 6
|
347
|
+
TYPE_DICE = 7
|
348
|
+
TYPE_VALUELIST00 = 8
|
349
|
+
TYPE_VALUELIST01 = 9
|
350
|
+
|
351
|
+
class Dice < MethodStruct
|
352
|
+
layout(
|
353
|
+
:nb_rolls, :int,
|
354
|
+
:nb_faces, :int,
|
355
|
+
:multiplier, :float,
|
356
|
+
:addsub, :float
|
357
|
+
)
|
358
|
+
end
|
359
|
+
|
360
|
+
class TCODValueT < MethodUnion
|
361
|
+
layout(
|
362
|
+
:b, :bool,
|
363
|
+
:c, :char,
|
364
|
+
:i, :int32,
|
365
|
+
:f, :float,
|
366
|
+
:s, :pointer,
|
367
|
+
:col, Color,
|
368
|
+
:dice, Dice,
|
369
|
+
:list, TCOD_list_t,
|
370
|
+
:custom, :pointer
|
371
|
+
)
|
372
|
+
def s=(str)
|
373
|
+
@s = FFI::MemoryPointer.from_string(str)
|
374
|
+
self[:s] = @s
|
375
|
+
end
|
376
|
+
def s
|
377
|
+
@s.get_string(0)
|
378
|
+
end
|
379
|
+
end
|
380
|
+
|
381
|
+
class TCODStructIntT < MethodStruct
|
382
|
+
layout(
|
383
|
+
:name, :pointer,
|
384
|
+
:flags, TCOD_list_t,
|
385
|
+
:props, TCOD_list_t,
|
386
|
+
:lists, TCOD_list_t,
|
387
|
+
:structs, TCOD_list_t
|
388
|
+
)
|
389
|
+
def name=(str)
|
390
|
+
@name = FFI::MemoryPointer.from_string(str)
|
391
|
+
self[:name] = @name
|
392
|
+
end
|
393
|
+
def name
|
394
|
+
@name.get_string(0)
|
395
|
+
end
|
396
|
+
end
|
397
|
+
|
398
|
+
callback(:TCOD_parser_custom_t, [ :pointer, :pointer, :pointer, :string ], TCODValueT.val)
|
399
|
+
class TCODParserIntT < MethodStruct
|
400
|
+
layout(
|
401
|
+
:structs, TCOD_list_t,
|
402
|
+
:customs, [:TCOD_parser_custom_t, 16],
|
403
|
+
:fatal, :bool,
|
404
|
+
:props, TCOD_list_t
|
405
|
+
)
|
406
|
+
end
|
407
|
+
|
408
|
+
class TCODParserListenerT < MethodStruct
|
409
|
+
layout(
|
410
|
+
:new_struct, callback([ :pointer, :string ], :bool),
|
411
|
+
:new_flag, callback([ :string ], :bool),
|
412
|
+
:new_property, callback([ :string, :int, TCODValueT ], :bool),
|
413
|
+
:end_struct, callback([ :pointer, :string ], :bool),
|
414
|
+
:error, callback([ :string ], :void)
|
415
|
+
)
|
416
|
+
end
|
417
|
+
|
418
|
+
tcod_function :TCOD_struct_get_name, [ :pointer ], :string
|
419
|
+
tcod_function :TCOD_struct_add_property, [ :pointer, :string, :int, :bool ], :void
|
420
|
+
tcod_function :TCOD_struct_add_list_property, [ :pointer, :string, :int, :bool ], :void
|
421
|
+
tcod_function :TCOD_struct_add_value_list, [ :pointer, :string, :pointer, :bool ], :void
|
422
|
+
tcod_function :TCOD_struct_add_value_list_sized, [ :pointer, :string, :pointer, :int, :bool ], :void
|
423
|
+
tcod_function :TCOD_struct_add_flag, [ :pointer, :string ], :void
|
424
|
+
tcod_function :TCOD_struct_add_structure, [ :pointer, :pointer ], :void
|
425
|
+
tcod_function :TCOD_struct_is_mandatory, [ :pointer, :string ], :bool
|
426
|
+
tcod_function :TCOD_struct_get_type, [ :pointer, :string ], :int
|
427
|
+
|
428
|
+
tcod_function :TCOD_parser_new, [ ], :pointer
|
429
|
+
tcod_function :TCOD_parser_new_struct, [ :pointer, :string ], :pointer
|
430
|
+
tcod_function :TCOD_parser_new_custom_type, [ :pointer, :TCOD_parser_custom_t ], :int
|
431
|
+
tcod_function :TCOD_parser_run, [ :pointer, :string, :pointer ], :void
|
432
|
+
tcod_function :TCOD_parser_delete, [ :pointer ], :void
|
433
|
+
tcod_function :TCOD_parser_error, [ :string, :varargs ], :void
|
434
|
+
tcod_function :TCOD_parser_get_bool_property, [ :pointer, :string ], :bool
|
435
|
+
tcod_function :TCOD_parser_get_char_property, [ :pointer, :string ], :int
|
436
|
+
tcod_function :TCOD_parser_get_int_property, [ :pointer, :string ], :int
|
437
|
+
tcod_function :TCOD_parser_get_float_property, [ :pointer, :string ], :float
|
438
|
+
tcod_function :TCOD_parser_get_string_property, [ :pointer, :string ], :string
|
439
|
+
tcod_function :TCOD_parser_get_color_property, [ :pointer, :string ], Color.val
|
440
|
+
tcod_function :TCOD_parser_get_dice_property, [ :pointer, :string ], Dice.val
|
441
|
+
tcod_function :TCOD_parser_get_dice_property_py, [ :pointer, :string, :pointer ], :void
|
442
|
+
tcod_function :TCOD_parser_get_custom_property, [ :pointer, :string ], :pointer
|
443
|
+
tcod_function :TCOD_parser_get_list_property, [ :pointer, :string, :int ], TCOD_list_t
|
444
|
+
|
445
|
+
tcod_function :TCOD_parse_bool_value, [ ], TCODValueT
|
446
|
+
tcod_function :TCOD_parse_char_value, [ ], TCODValueT
|
447
|
+
tcod_function :TCOD_parse_integer_value, [ ], TCODValueT
|
448
|
+
tcod_function :TCOD_parse_float_value, [ ], TCODValueT
|
449
|
+
tcod_function :TCOD_parse_string_value, [ ], TCODValueT
|
450
|
+
tcod_function :TCOD_parse_color_value, [ ], TCODValueT
|
451
|
+
tcod_function :TCOD_parse_dice_value, [ ], TCODValueT
|
452
|
+
tcod_function :TCOD_parse_value_list_value, [ :pointer, :int ], TCODValueT
|
453
|
+
tcod_function :TCOD_parse_property_value, [ :pointer, :pointer, :string, :bool ], TCODValueT
|
454
|
+
|
455
|
+
### Random module
|
456
|
+
RNG_MT = 0
|
457
|
+
RNG_CMWC = 1
|
458
|
+
|
459
|
+
DISTRIBUTION_LINEAR = 0
|
460
|
+
DISTRIBUTION_GAUSSIAN = 1
|
461
|
+
DISTRIBUTION_GAUSSIAN_RANGE = 2
|
462
|
+
DISTRIBUTION_GAUSSIAN_INVERSE = 3
|
463
|
+
DISTRIBUTION_GAUSSIAN_RANGE_INVERSE = 4
|
464
|
+
|
465
|
+
TCOD_random_algo_t = :int
|
466
|
+
TCOD_distribution_t = :int
|
467
|
+
TCOD_random_t = :pointer
|
468
|
+
|
469
|
+
tcod_function :TCOD_random_get_instance, [ ], :pointer
|
470
|
+
tcod_function :TCOD_random_new, [ TCOD_random_algo_t ], :pointer
|
471
|
+
tcod_function :TCOD_random_save, [ :pointer ], :pointer
|
472
|
+
tcod_function :TCOD_random_restore, [ :pointer, :pointer ], :void
|
473
|
+
tcod_function :TCOD_random_new_from_seed, [ TCOD_random_algo_t, :uint32 ], :pointer
|
474
|
+
tcod_function :TCOD_random_delete, [ :pointer ], :void
|
475
|
+
tcod_function :TCOD_random_set_distribution, [ :pointer, TCOD_distribution_t ], :void
|
476
|
+
tcod_function :TCOD_random_get_int, [ :pointer, :int, :int ], :int
|
477
|
+
tcod_function :TCOD_random_get_float, [ :pointer, :float, :float ], :float
|
478
|
+
tcod_function :TCOD_random_get_double, [ :pointer, :double, :double ], :double
|
479
|
+
tcod_function :TCOD_random_get_int_mean, [ :pointer, :int, :int, :int ], :int
|
480
|
+
tcod_function :TCOD_random_get_float_mean, [ :pointer, :float, :float, :float ], :float
|
481
|
+
tcod_function :TCOD_random_get_double_mean, [ :pointer, :double, :double, :double ], :double
|
482
|
+
tcod_function :TCOD_random_dice_new, [ :string ], Dice.val
|
483
|
+
tcod_function :TCOD_random_dice_roll, [ :pointer, Dice.val ], :int
|
484
|
+
tcod_function :TCOD_random_dice_roll_s, [ :pointer, :string ], :int
|
485
|
+
|
486
|
+
### Noise module
|
487
|
+
NOISE_DEFAULT_HURST = 0.5
|
488
|
+
NOISE_DEFAULT_LACUNARITY = 2.0
|
489
|
+
|
490
|
+
NOISE_DEFAULT = 0
|
491
|
+
NOISE_PERLIN = 1
|
492
|
+
NOISE_SIMPLEX = 2
|
493
|
+
NOISE_WAVELET = 4
|
494
|
+
|
495
|
+
tcod_function :TCOD_noise_new, [ :int, :float, :float, TCOD_random_t ], :pointer
|
496
|
+
tcod_function :TCOD_noise_set_type, [ :pointer, :int ], :void
|
497
|
+
tcod_function :TCOD_noise_get_ex, [ :pointer, :pointer, :int ], :float
|
498
|
+
tcod_function :TCOD_noise_get_fbm_ex, [ :pointer, :pointer, :float, :int ], :float
|
499
|
+
tcod_function :TCOD_noise_get_turbulence_ex, [ :pointer, :pointer, :float, :int ], :float
|
500
|
+
tcod_function :TCOD_noise_get, [ :pointer, :pointer ], :float
|
501
|
+
tcod_function :TCOD_noise_get_fbm, [ :pointer, :pointer, :float ], :float
|
502
|
+
tcod_function :TCOD_noise_get_turbulence, [ :pointer, :pointer, :float ], :float
|
503
|
+
tcod_function :TCOD_noise_delete, [ :pointer ], :void
|
504
|
+
|
505
|
+
### FOV module
|
506
|
+
FOV_BASIC = 0
|
507
|
+
FOV_DIAMOND = 1
|
508
|
+
FOV_SHADOW = 2
|
509
|
+
FOV_PERMISSIVE_0 = 3
|
510
|
+
FOV_PERMISSIVE_1 = 4
|
511
|
+
FOV_PERMISSIVE_2 = 5
|
512
|
+
FOV_PERMISSIVE_3 = 6
|
513
|
+
FOV_PERMISSIVE_4 = 7
|
514
|
+
FOV_PERMISSIVE_5 = 8
|
515
|
+
FOV_PERMISSIVE_6 = 9
|
516
|
+
FOV_PERMISSIVE_7 = 10
|
517
|
+
FOV_PERMISSIVE_8 = 11
|
518
|
+
FOV_RESTRICTIVE = 12
|
519
|
+
NB_FOV_ALGORITHMS = 13
|
520
|
+
|
521
|
+
TCOD_fov_algorithm_t = :int
|
522
|
+
|
523
|
+
tcod_function :TCOD_map_new, [ :int, :int ], :pointer
|
524
|
+
tcod_function :TCOD_map_clear, [ :pointer, :bool, :bool ], :void
|
525
|
+
tcod_function :TCOD_map_copy, [ :pointer, :pointer ], :void
|
526
|
+
tcod_function :TCOD_map_set_properties, [ :pointer, :int, :int, :bool, :bool ], :void
|
527
|
+
tcod_function :TCOD_map_delete, [ :pointer ], :void
|
528
|
+
tcod_function :TCOD_map_compute_fov, [ :pointer, :int, :int, :int, :bool, TCOD_fov_algorithm_t ], :void
|
529
|
+
tcod_function :TCOD_map_is_in_fov, [ :pointer, :int, :int ], :bool
|
530
|
+
tcod_function :TCOD_map_set_in_fov, [ :pointer, :int, :int, :bool ], :void
|
531
|
+
tcod_function :TCOD_map_is_transparent, [ :pointer, :int, :int ], :bool
|
532
|
+
tcod_function :TCOD_map_is_walkable, [ :pointer, :int, :int ], :bool
|
533
|
+
tcod_function :TCOD_map_get_width, [ :pointer ], :int
|
534
|
+
tcod_function :TCOD_map_get_height, [ :pointer ], :int
|
535
|
+
tcod_function :TCOD_map_get_nb_cells, [ :pointer ], :int
|
536
|
+
|
537
|
+
### Pathfinding module
|
538
|
+
TCOD_map_t = :pointer
|
539
|
+
|
540
|
+
callback(:TCOD_path_func_t, [ :int, :int, :int, :int, :pointer ], :float)
|
541
|
+
tcod_function :TCOD_path_new_using_map, [ TCOD_map_t, :float ], :pointer
|
542
|
+
tcod_function :TCOD_path_new_using_function, [ :int, :int, :TCOD_path_func_t, :pointer, :float ], :pointer
|
543
|
+
tcod_function :TCOD_path_compute, [ :pointer, :int, :int, :int, :int ], :bool
|
544
|
+
tcod_function :TCOD_path_walk, [ :pointer, :pointer, :pointer, :bool ], :bool
|
545
|
+
tcod_function :TCOD_path_is_empty, [ :pointer ], :bool
|
546
|
+
tcod_function :TCOD_path_size, [ :pointer ], :int
|
547
|
+
tcod_function :TCOD_path_reverse, [ :pointer ], :void
|
548
|
+
tcod_function :TCOD_path_get, [ :pointer, :int, :pointer, :pointer ], :void
|
549
|
+
tcod_function :TCOD_path_get_origin, [ :pointer, :pointer, :pointer ], :void
|
550
|
+
tcod_function :TCOD_path_get_destination, [ :pointer, :pointer, :pointer ], :void
|
551
|
+
tcod_function :TCOD_path_delete, [ :pointer ], :void
|
552
|
+
tcod_function :TCOD_dijkstra_new, [ TCOD_map_t, :float ], :pointer
|
553
|
+
tcod_function :TCOD_dijkstra_new_using_function, [ :int, :int, :TCOD_path_func_t, :pointer, :float ], :pointer
|
554
|
+
tcod_function :TCOD_dijkstra_compute, [ :pointer, :int, :int ], :void
|
555
|
+
tcod_function :TCOD_dijkstra_get_distance, [ :pointer, :int, :int ], :float
|
556
|
+
tcod_function :TCOD_dijkstra_path_set, [ :pointer, :int, :int ], :bool
|
557
|
+
tcod_function :TCOD_dijkstra_is_empty, [ :pointer ], :bool
|
558
|
+
tcod_function :TCOD_dijkstra_size, [ :pointer ], :int
|
559
|
+
tcod_function :TCOD_dijkstra_reverse, [ :pointer ], :void
|
560
|
+
tcod_function :TCOD_dijkstra_get, [ :pointer, :int, :pointer, :pointer ], :void
|
561
|
+
tcod_function :TCOD_dijkstra_path_walk, [ :pointer, :pointer, :pointer ], :bool
|
562
|
+
tcod_function :TCOD_dijkstra_delete, [ :pointer ], :void
|
563
|
+
|
564
|
+
### BSP module
|
565
|
+
class TCODTreeT < FFI::Struct
|
566
|
+
layout(
|
567
|
+
:next, :pointer,
|
568
|
+
:father, :pointer,
|
569
|
+
:sons, :pointer
|
570
|
+
)
|
571
|
+
end
|
572
|
+
tcod_function :TCOD_tree_new, [ ], :pointer
|
573
|
+
tcod_function :TCOD_tree_add_son, [ :pointer, :pointer ], :void
|
574
|
+
|
575
|
+
|
576
|
+
class TCODBspT < MethodStruct
|
577
|
+
layout(
|
578
|
+
:tree, TCODTreeT,
|
579
|
+
:x, :int,
|
580
|
+
:y, :int,
|
581
|
+
:w, :int,
|
582
|
+
:h, :int,
|
583
|
+
:position, :int,
|
584
|
+
:level, :uint8,
|
585
|
+
:horizontal, :bool
|
586
|
+
)
|
587
|
+
end
|
588
|
+
callback(:TCOD_bsp_callback_t, [ :pointer, :pointer ], :bool)
|
589
|
+
tcod_function :TCOD_bsp_new, [ ], :pointer
|
590
|
+
tcod_function :TCOD_bsp_new_with_size, [ :int, :int, :int, :int ], :pointer
|
591
|
+
tcod_function :TCOD_bsp_delete, [ :pointer ], :void
|
592
|
+
tcod_function :TCOD_bsp_left, [ :pointer ], :pointer
|
593
|
+
tcod_function :TCOD_bsp_right, [ :pointer ], :pointer
|
594
|
+
tcod_function :TCOD_bsp_father, [ :pointer ], :pointer
|
595
|
+
tcod_function :TCOD_bsp_is_leaf, [ :pointer ], :bool
|
596
|
+
tcod_function :TCOD_bsp_traverse_pre_order, [ :pointer, :TCOD_bsp_callback_t, :pointer ], :bool
|
597
|
+
tcod_function :TCOD_bsp_traverse_in_order, [ :pointer, :TCOD_bsp_callback_t, :pointer ], :bool
|
598
|
+
tcod_function :TCOD_bsp_traverse_post_order, [ :pointer, :TCOD_bsp_callback_t, :pointer ], :bool
|
599
|
+
tcod_function :TCOD_bsp_traverse_level_order, [ :pointer, :TCOD_bsp_callback_t, :pointer ], :bool
|
600
|
+
tcod_function :TCOD_bsp_traverse_inverted_level_order, [ :pointer, :TCOD_bsp_callback_t, :pointer ], :bool
|
601
|
+
tcod_function :TCOD_bsp_contains, [ :pointer, :int, :int ], :bool
|
602
|
+
tcod_function :TCOD_bsp_find_node, [ :pointer, :int, :int ], :pointer
|
603
|
+
tcod_function :TCOD_bsp_resize, [ :pointer, :int, :int, :int, :int ], :void
|
604
|
+
tcod_function :TCOD_bsp_split_once, [ :pointer, :bool, :int ], :void
|
605
|
+
tcod_function :TCOD_bsp_split_recursive, [ :pointer, TCOD_random_t, :int, :int, :int, :float, :float ], :void
|
606
|
+
tcod_function :TCOD_bsp_remove_sons, [ :pointer ], :void
|
607
|
+
|
608
|
+
### Heightmap module
|
609
|
+
class TCODHeightmapT < MethodStruct
|
610
|
+
layout(
|
611
|
+
:w, :int,
|
612
|
+
:h, :int,
|
613
|
+
:values, :pointer
|
614
|
+
)
|
615
|
+
end
|
616
|
+
|
617
|
+
TCOD_noise_t = :pointer
|
618
|
+
float_3 = :pointer # float n[3]
|
619
|
+
int_4 = :pointer
|
620
|
+
|
621
|
+
tcod_function :TCOD_heightmap_new, [ :int, :int ], :pointer
|
622
|
+
tcod_function :TCOD_heightmap_delete, [ :pointer ], :void
|
623
|
+
tcod_function :TCOD_heightmap_get_value, [ :pointer, :int, :int ], :float
|
624
|
+
tcod_function :TCOD_heightmap_get_interpolated_value, [ :pointer, :float, :float ], :float
|
625
|
+
tcod_function :TCOD_heightmap_set_value, [ :pointer, :int, :int, :float ], :void
|
626
|
+
tcod_function :TCOD_heightmap_get_slope, [ :pointer, :int, :int ], :float
|
627
|
+
tcod_function :TCOD_heightmap_get_normal, [ :pointer, :float, :float, float_3, :float ], :void
|
628
|
+
tcod_function :TCOD_heightmap_count_cells, [ :pointer, :float, :float ], :int
|
629
|
+
tcod_function :TCOD_heightmap_has_land_on_border, [ :pointer, :float ], :bool
|
630
|
+
tcod_function :TCOD_heightmap_get_minmax, [ :pointer, :pointer, :pointer ], :void
|
631
|
+
tcod_function :TCOD_heightmap_copy, [ :pointer, :pointer ], :void
|
632
|
+
tcod_function :TCOD_heightmap_add, [ :pointer, :float ], :void
|
633
|
+
tcod_function :TCOD_heightmap_scale, [ :pointer, :float ], :void
|
634
|
+
tcod_function :TCOD_heightmap_clamp, [ :pointer, :float, :float ], :void
|
635
|
+
tcod_function :TCOD_heightmap_normalize, [ :pointer, :float, :float ], :void
|
636
|
+
tcod_function :TCOD_heightmap_clear, [ :pointer ], :void
|
637
|
+
tcod_function :TCOD_heightmap_lerp_hm, [ :pointer, :pointer, :pointer, :float ], :void
|
638
|
+
tcod_function :TCOD_heightmap_add_hm, [ :pointer, :pointer, :pointer ], :void
|
639
|
+
tcod_function :TCOD_heightmap_multiply_hm, [ :pointer, :pointer, :pointer ], :void
|
640
|
+
tcod_function :TCOD_heightmap_add_hill, [ :pointer, :float, :float, :float, :float ], :void
|
641
|
+
tcod_function :TCOD_heightmap_dig_hill, [ :pointer, :float, :float, :float, :float ], :void
|
642
|
+
tcod_function :TCOD_heightmap_dig_bezier, [ :pointer, int_4, int_4, :float, :float, :float, :float ], :void
|
643
|
+
tcod_function :TCOD_heightmap_rain_erosion, [ :pointer, :int, :float, :float, TCOD_random_t ], :void
|
644
|
+
tcod_function :TCOD_heightmap_kernel_transform, [ :pointer, :int, :pointer, :pointer, :pointer, :float, :float ], :void
|
645
|
+
tcod_function :TCOD_heightmap_add_voronoi, [ :pointer, :int, :int, :pointer, TCOD_random_t ], :void
|
646
|
+
tcod_function :TCOD_heightmap_add_fbm, [ :pointer, TCOD_noise_t, :float, :float, :float, :float, :float, :float, :float ], :void
|
647
|
+
tcod_function :TCOD_heightmap_scale_fbm, [ :pointer, TCOD_noise_t, :float, :float, :float, :float, :float, :float, :float ], :void
|
648
|
+
tcod_function :TCOD_heightmap_islandify, [ :pointer, :float, TCOD_random_t ], :void
|
649
|
+
|
650
|
+
|
651
|
+
### Name Generator module
|
652
|
+
tcod_function :TCOD_namegen_parse, [ :string, TCOD_random_t ], :void
|
653
|
+
tcod_function :TCOD_namegen_generate, [ :string, :bool ], :string
|
654
|
+
tcod_function :TCOD_namegen_generate_custom, [ :string, :string, :bool ], :string
|
655
|
+
tcod_function :TCOD_namegen_get_sets, [ ], TCOD_list_t
|
656
|
+
tcod_function :TCOD_namegen_destroy, [ ], :void
|
657
|
+
end
|