A Python cffi port of libtcod.
Project description
About
This is a Python CFFI port of libtcod, this is an offshoot of the python-tdl project and has been made into it’s own package. Both projects are still developed together, and this module provides functions specifically to be used by python-tdl.
This library is hosted on GitHub: https://github.com/HexDecimal/libtcod-cffi
Any issues you have with this module can be reported at the GitHub issue tracker: https://github.com/HexDecimal/libtcod-cffi/issues
python-tdl is a port of libtcod made to be “Pythonic”, you can find it here: https://github.com/HexDecimal/python-tdl
And libtcod is here: http://roguecentral.org/doryen/libtcod/
Installation
The recommended way to install is by using pip.
With Python installed, run the following command to install libtcod-cffi:
python -m pip install libtcod-cffi
See the requirements section when building from source.
Usage
This module was designed to be backwards compatible with the libtcod.py script that was distributed with libtcod. If you had code that runs on the original module you can use this library as a drop-in replacement like this:
import tcod as libtcod
Guides and Tutorials for the original library should also work with this one. When possible, using PyPy will give the best performance, and is highly recommended.
Requirements
Python 2.7+, Python 3.3+, or PyPy 5.4+
Windows, Linux, or Mac OS X
Python cffi module must be version 1.8 or higher
### Extra requirements when installing directly from source
Python pycparser module must be 2.14 or higher
MinGW gcc.exe must be on Windows path for use with pycparser, or an equivalent program must be installed on other OS’s
Mac OS X requires sdl1.2, which can be installed using the homebrew command: “brew install sdl”
Linux requires the following packages: libsdl1.2-dev, libffi-dev, python-dev, and mesa-common-dev
License
libtcod-cffi is distributed under the Simplified 2-clause FreeBSD license. Read LICENSE.txt, and the tcod/lib/README’s for more details.
Changelog
- 2.0a
updated to compile with libtcod-1.6.2 and SDL-2.0.4
- 1.0
sub packages have been removed to follow the libtcodpy API more closely
bsp and pathfinding functions which take a callback no longer have the userdata parameter, if you need to pass data then you should use functools, methods, or enclosing scope rules
numpy buffer alignment issues on some 64-bit OS’s fixed
- 0.3
switched to using pycparser to compile libtcod headers, this may have included many more functions in tcod’s namespace than before
parser custom listener fixed again, likely for good
- 0.2.12
version increment due to how extremely broken the non-Windows builds were (false alarm, this module is just really hard to run integrated tests on)
- 0.2.11
SDL is now bundled correctly in all Python wheels
- 0.2.10
now using GitHub integrations, gaps in platform support have been filled, there should now be wheels for Mac OSX and 64-bit Python on Windows
the building process was simplified from a linking standpoint, most libraries are now statically linked
parser module is broken again
- 0.2.9
Fixed crashes in list and parser modules
- 0.2.8
Fixed off by one error in fov buffer
- 0.2.7
Re-factored some code to reduce compiler warnings
Instructions on how to solve pip/cffi issues added to the readme
Official support for Python 3.5
- 0.2.6
Added requirements.txt to fix a common pip/cffi issue.
Provided SDL headers are now for Windows only.
- 0.2.5
Added /usr/include/SDL to include path
- 0.2.4
Compiler will now use distribution specific SDL header files before falling back on the included header files.
- 0.2.3
better Color performance
parser now works when using a custom listener class
SDL renderer callback now receives a accessible SDL_Surface cdata object.
- 0.2.2
This module can now compile and link properly on Linux
- 0.2.1
console_check_for_keypress and console_wait_for_keypress will work now
console_fill_foreground was fixed
console_init_root can now accept a regular string on Python 3
- 0.2.0
The library is now backwards compatible with the original libtcod.py module. Everything except libtcod’s cfg parser is supported.
- 0.1.0
First version released
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Hashes for libtcod_cffi-2.0a0-py3.5-win-amd64.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | d7d24ebc942f0f04f3714e142ecba1fa8bec405c6ff0b62d04dbbce836c48815 |
|
MD5 | 4736f1e2f102017fc9bead0fa9af7dd1 |
|
BLAKE2b-256 | 0eeaf66e93c53b58e8d9a8d8cd7ddb0d9999c08a665f2314a342dcf9ef538deb |
Hashes for libtcod_cffi-2.0a0-py3.5-win32.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | 817a43f5b70422f32ffd2ae71130d69eedecd93797ad52214d2ee3a29712bf69 |
|
MD5 | f41ca4d6a1fee12ef598f7a0e293ede2 |
|
BLAKE2b-256 | 062f470bf0db88a2cfca12c2486669bff198175996e6adf331ea6441d158c53f |
Hashes for libtcod_cffi-2.0a0-py3.4-win-amd64.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | 48ed6534f8068648e30dd855e7a2211a10fc6a762f989894ae24e4053920facf |
|
MD5 | d7b1658cd4fa6dc9d54dbab309d3e2ae |
|
BLAKE2b-256 | 41f928d38b9d0550e766b368cc0a2c98643f678300ebfc8596f4f6ef3134f561 |
Hashes for libtcod_cffi-2.0a0-py3.4-win32.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4cc29612b68d5dfa633604decc4b5a9147d3e25fc1d0984247f1a4764f1f5817 |
|
MD5 | 3d9c40296f5cec686ea95f5c9ffe955d |
|
BLAKE2b-256 | 9c6e263fc68efcaf429aab735b56789bdc5db6318b71f98d8d4be58d5d5869a2 |
Hashes for libtcod_cffi-2.0a0-py3.3-win-amd64.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | 49b6a6cfd2e05f508a67e3b03182bf067a7208ccfa45b6f86650d2694f6c03f6 |
|
MD5 | 06f893bbf34c86104f1a78db5bf49909 |
|
BLAKE2b-256 | a59d13ef2ba7f34287433de1bbd1924181e43cfe56ddfe07ef9f4f4907fc1642 |
Hashes for libtcod_cffi-2.0a0-py3.3-win32.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8fabb4c5b2caa7813df06bdf4b11333d3fdb87bf22aecfd868fd2030084b1d90 |
|
MD5 | 2ce33994722af39bd74fecde9f60e814 |
|
BLAKE2b-256 | 98eeda08383bb3cd400c1bf6808f82a1e81546119a933e6e5ae36de192833826 |
Hashes for libtcod_cffi-2.0a0-py2.7-win-amd64.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | 91970709fc23830148e7331c0f029ca629c259e9695fb70b065c29a920baf71a |
|
MD5 | 6415d5b26f836d11776a324312fabf82 |
|
BLAKE2b-256 | 3d71f0902528b760d8334cae1e0e82ff28a7fbe271767a446c20825c993ee267 |
Hashes for libtcod_cffi-2.0a0-py2.7-win32.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | 699f0c9a94ebc136900c263b96c933277cc711cdd0d05d09782323a9b555a0a9 |
|
MD5 | f9f56e4f8d7b761e60573be05d55085b |
|
BLAKE2b-256 | f01563374b49b46d0297b8541e84a764cd550d7403b184489f2441c8022c6239 |
Hashes for libtcod_cffi-2.0a0-pp254-pypy_41-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ee1d48e8b4354cb94d2ccddc9a498a70b8f809511d6941d1c31ccef5ef2933bc |
|
MD5 | a3d8eccf0d4ed55906aa342a2350f4d2 |
|
BLAKE2b-256 | bd70e9357a60e02225c5b136d5c6ae6c37a7ed6fc199aed79ac4e4c8d247d6c7 |
Hashes for libtcod_cffi-2.0a0-pp254-pypy_41-macosx_10_11_x86_64.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8499d380e4cbeb3300cbe463ebea88fb203edfd007a3d6d04e5f27c5cb5dc2b1 |
|
MD5 | 9680cd76ab454cb4dc66149f6d0b3147 |
|
BLAKE2b-256 | 313e5a3171e4c39c5921f9118966a705befe31867216fbeb968e49bf69c80cc9 |
Hashes for libtcod_cffi-2.0a0-cp35-cp35m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4b62b2ce58440d9654dc70bd1b55642c3da890fbd530d534bf534be7d5ad1499 |
|
MD5 | d24bd38ee17a9ce6922fe4c7035cdb81 |
|
BLAKE2b-256 | 75f1ba51202e03fff930e13df9c433fe95678cf47fd70bbdf28d29645b5c728d |
Hashes for libtcod_cffi-2.0a0-cp35-cp35m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5d044cee5d58b28f8c3e54f00aa56c39b6c769b84615f2ed7b04271b12aea04e |
|
MD5 | 1584b529384c089ba962ff5ce5b8b754 |
|
BLAKE2b-256 | 13cad17feeed84aef46b0f5d604cd8bd8fc77f58061032a1558e09c2d2689e37 |
Hashes for libtcod_cffi-2.0a0-cp35-cp35m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2ac77a167f856d8833290e1234258fa4f5672059a84519cad21b0cee989ad049 |
|
MD5 | b7155e93a74f282846ed58ff3021c0aa |
|
BLAKE2b-256 | bd6736adb50962d73a9e3936a4e79459ae292ad537fd081b9112384129649f6a |
Hashes for libtcod_cffi-2.0a0-cp35-cp35m-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | caeda4f7c2c87499177d6aab31af6c5092097d5f00006ec185e5e6d57a6e346a |
|
MD5 | 10970fbddd1b6a281737c7f959c8051f |
|
BLAKE2b-256 | 535899bd7d2f3ce5646e7f1153083c615c2076edb8c0a7994ac728b093204469 |
Hashes for libtcod_cffi-2.0a0-cp35-cp35m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f5fcabbaa873a553d20f2c9aee2f059c136e6baf0332429de514ecbd184d2fbb |
|
MD5 | 4884a3744f82ad28bd9d8dde1e83114a |
|
BLAKE2b-256 | e5e3ab61b96a44ec30b6f369b7c49e23552cc9dfc633cf2069d011fa2dfa8c5a |
Hashes for libtcod_cffi-2.0a0-cp34-cp34m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a64047e3a1c14854b4837fe6a942cdc979ab288c845630e3f974320c8d83e338 |
|
MD5 | b9b7e9ceb2acb21384c18e259d5155b1 |
|
BLAKE2b-256 | 1a25d2a0e91fd13c60b9a08ead322388ec48f98626b2c264532d962cd97b944e |
Hashes for libtcod_cffi-2.0a0-cp34-cp34m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d3bd12727f4c57d2cea90222ef656b999450e58ec309a477be9d9717176ce8fc |
|
MD5 | c919e01ddd32bba704fcbf6e2bbf6b68 |
|
BLAKE2b-256 | 326bed11222326f6cc28167e7dd7931472d6f79e7416dfad6eb72c892454c854 |
Hashes for libtcod_cffi-2.0a0-cp34-cp34m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 52167d76dd2cf5b0cd23819efa05dbf8d0a13d2079d6c35b834c27a0a47a87ab |
|
MD5 | 14bde26fb04604977ccf5bb711d3bc1e |
|
BLAKE2b-256 | 80fdff23234db99531fd69033f72681dbbda1901219ff2d5479473b37964c26c |
Hashes for libtcod_cffi-2.0a0-cp34-cp34m-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 02fbbf78147ed2b512f0370c81de2cf34fa5f37e9aa552cfa185740a549f1e2a |
|
MD5 | 59f0e65b305f4d9ab54d815e26b086a7 |
|
BLAKE2b-256 | ccee2720d8f4767e06b9f85d2702638b688ef882864825501a2e2b449c29dedd |
Hashes for libtcod_cffi-2.0a0-cp34-cp34m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 144035c4a29eadaaa2f247d14a9f465be2ee442fe3e4fcac3807fd67a9d8d222 |
|
MD5 | 06885d388976a111016b03739494cdea |
|
BLAKE2b-256 | 8ae24ed32ba41089a5d4baaa00fb0701b96c875e12bb927c7d48d98fe51ce9af |
Hashes for libtcod_cffi-2.0a0-cp33-cp33m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 13e224ab8441ca931a0226104bcb66636065e29be5b9993effd0a0facdbdb2fe |
|
MD5 | 5a9847bf835d67022032f684de45240f |
|
BLAKE2b-256 | 80b867ca2957bbc54bedfe67de8ed6d4d136baeb23ca3c150c76f21458f7c15a |
Hashes for libtcod_cffi-2.0a0-cp33-cp33m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 33e7982abd33c98ae90c107f84c9bbe1352c915bdfaa9c11531a25392e60798f |
|
MD5 | 776df27d2bd8532d74fb97d221933362 |
|
BLAKE2b-256 | 431b97afbb548c540553786e2995a49aaae37c6e1d9652290e08bc58545ce15d |
Hashes for libtcod_cffi-2.0a0-cp33-cp33m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bc6b0054117016be5568bfad22f01ba3cc8aee7e2853d400a43ebb7687094906 |
|
MD5 | 5a99cfa6400740383404179615e48d02 |
|
BLAKE2b-256 | a8caddaa09522993163ed2ea02a92c75034e15467495eece222083b4865573b7 |
Hashes for libtcod_cffi-2.0a0-cp33-cp33m-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ee34c3f0d948da6347d88a10a1e4d9d9a759d52110a9bacf6557e3d23f93ea26 |
|
MD5 | 49d5a8c38d2e2a6c96d9e9e9a276436a |
|
BLAKE2b-256 | 90d4cb194dc089ac3421bbedade4c95d10a5c0a43b3470f9597698912158d5b9 |
Hashes for libtcod_cffi-2.0a0-cp27-cp27mu-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3bbca4f840fe1f83774a03e6a51cb9e8e96a12250660b29c492112972e97008a |
|
MD5 | 3fa0b80e4cb2c725c54b44a737b5fc3a |
|
BLAKE2b-256 | 507f92c5760425934fba74b43b5bfa402850332faf8b1adf6a25e03d539e80ca |
Hashes for libtcod_cffi-2.0a0-cp27-cp27mu-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 973706a458f12458976877aa1d434b5fe0bb23dbec834909b8c0ea46be4185c3 |
|
MD5 | b96686b0c8106bfa43e2b1e4e780a90c |
|
BLAKE2b-256 | bbb5497ed6e1c0a450a2c44b1119a8bfdc1ab51535e0631533255d7e98ca018d |
Hashes for libtcod_cffi-2.0a0-cp27-cp27m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8256d572b205da33b5d5c1d3de817bb4c6f606445809b4ee2ba23cbc76b0d3ca |
|
MD5 | 553cd1183d8bf6376444a1f58d933752 |
|
BLAKE2b-256 | 0e6f598618bdc71a547c712aac2529b937ffba295c4819adc214a467a72151a7 |
Hashes for libtcod_cffi-2.0a0-cp27-cp27m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d2a185782d0eeb73cde24c794db1b69f2e9a1fd72ae1ea6bcdb190da504f792c |
|
MD5 | dc4a3bc1de4bf9c657e01a8c8b22311f |
|
BLAKE2b-256 | fbcb0f64ccd1ecc33e13df133672e6ca3fe8f08ce82c21f8ef9ffdefa630b2f6 |
Hashes for libtcod_cffi-2.0a0-cp27-cp27m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fe6997b45362a87870f38f097e7fd756339370f21e8ae2b52763a9e227b064b1 |
|
MD5 | 99c33394a0122a52be0bb724912b832f |
|
BLAKE2b-256 | 264b74872d0bf5b2e55ece9a76822215779164ecccc88039c0eb583e8d87175c |
Hashes for libtcod_cffi-2.0a0-cp27-cp27m-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 332ee90ee7a83b474c696e0fedcc82856959200f5fe0d0e76c15b3cabd0b87dc |
|
MD5 | f025d4d2b0e53cc6eb84436830ec8a01 |
|
BLAKE2b-256 | 0098c4737ff54cc06d9a0311755e4b2aa55952dd69a257d2d4b59427b4664507 |
Hashes for libtcod_cffi-2.0a0-cp27-cp27m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 59e6287de875acef999d8b151e89f0e1f7575b2952fa31015edc330f930298f2 |
|
MD5 | 5fe5a16df60298adb621a2ae2b2b98a4 |
|
BLAKE2b-256 | 8c359bf00d2fe4128ea3c8625dfbf7947e2e983186b1aab03d344adbdb528d45 |