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