Giter VIP home page Giter VIP logo

libtcod-cffi's People

Contributors

hexdecimal avatar pyup-bot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

libtcod-cffi's Issues

map_compute_fov Ignores Radius

Hello,

Calls to the map_compute_fov() function seem to ignore the radius parameter and light only a 3x3 square centered on the player. Even passing 0 (which the documentation says should make the range unlimited) does not work.

I don't know if it's related to the same 1.6 issue mentioned here.

Any help would be appreciated.

Python: 2.7.12
cffi: 1.7.0
libtcod-cffi: 0.2.8

Noise.sample_ogrid alignment problem.

Looks like there's an alignment issue when using the method: Noise.sample_ogrid.

At the moment Noise.sample_mgrid works fine and can be used instead until this issue is resolved.

Finish documentation.

Nearly all of the public API is documented, but the overall docs need better presentation.

In particular, module level docstrings need to be added, and the Sphinx files need reorganizing.

Unable to install Python 3.4, Debian Wheezy error: conflicting types for ‘uintptr_t’

i586-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fPIC -Itcod/include/libtcod-1.5 -Itcod/include/SDL-1.2 -IRelease/tcod/ -I/usr/include/python3.4m -I/home/michael/src/mylarn/python/include/python3.4m -c build/temp.linux-i686-3.4/tcod._libtcod_cp34.c -o build/temp.linux-i686-3.4/build/temp.linux-i686-3.4/tcod._libtcod_cp34.o
In file included from tcod/include/SDL-1.2/SDL_config.h:42:0,
                 from tcod/include/SDL-1.2/SDL_stdinc.h:30,
                 from tcod/include/SDL-1.2/SDL_main.h:26,
                 from tcod/include/SDL-1.2/SDL.h:30,
                 from build/temp.linux-i686-3.4/tcod._libtcod_cp34.c:394:
tcod/include/SDL-1.2/SDL_config_minimal.h:39:23: error: conflicting types foruintptr_ttypedef unsigned long uintptr_t;
                       ^
In file included from /usr/lib/gcc/i586-linux-gnu/4.9/include/stdint.h:9:0,
                 from /usr/include/inttypes.h:27,
                 from /usr/include/python3.4m/pyport.h:9,
                 from /usr/include/python3.4m/Python.h:50,
                 from build/temp.linux-i686-3.4/tcod._libtcod_cp34.c:2:
/usr/include/stdint.h:128:23: note: previous declaration ofuintptr_twas here
 typedef unsigned int  uintptr_t;
                       ^
´´´

libtcod-cffi/tdl vs. libtcodpy

Hi,

I'm fairly new to Python and libtcod. While following "the" main tutorial on RogueBasin, I ran into libtcod-cffi, which I understand as a "pythonic port" of libtcod.

As a Python developer, how can I choose between libtcod and libtcod-cffi? What are the advantages and disadvantages to each side? This Reddit thread seems to capture a couple of points (Linux support, updates get integrated over time).

For v1.0 some methods of FrozenColor are broken

For v1.0 some methods of tcod.FrozenColor are broken. For example tcod.darkest_blue * 3 will raise a TypeError since FrozenColor.__mul__ is an unbound method of Color. I think it can be fixed by replace __mul__ = Color.__mul_ with __mul__ = Color.__mul__.__func__ in init.py

I see FrozenColor has been removed in v2 but would you like to create something like v1.0.1?

Trouble using pip install with Python3.3

Trying to upgrade tdl in Python 3.3.2 on linux64 (Fedora 20). Running pip install libtcod-cffi does not work. I tried several things, see jdklassen@e66c5d0 for the changes I made to get as far as I eventually did.
First error I got was this:

Running setup.py install for libtcod-cffi
    Complete output from command /home/jdklassen/projects/env/bin/python3 -c "import setuptools, tokenize;__file__='/tmp/pip-e40lon-build/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-i4zb04-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/jdklassen/projects/env/include/site/python3.3/libtcod-cffi:
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-3.3
    creating build/lib.linux-x86_64-3.3/tcod
    copying tcod/__init__.py -> build/lib.linux-x86_64-3.3/tcod
    copying tcod/parser.py -> build/lib.linux-x86_64-3.3/tcod
    copying tcod/sys_.py -> build/lib.linux-x86_64-3.3/tcod
    copying tcod/dijkstra.py -> build/lib.linux-x86_64-3.3/tcod
    copying tcod/libtcod.py -> build/lib.linux-x86_64-3.3/tcod
    copying tcod/console.py -> build/lib.linux-x86_64-3.3/tcod
    copying tcod/color.py -> build/lib.linux-x86_64-3.3/tcod
    copying tcod/image.py -> build/lib.linux-x86_64-3.3/tcod
    copying tcod/bsp.py -> build/lib.linux-x86_64-3.3/tcod
    copying tcod/path.py -> build/lib.linux-x86_64-3.3/tcod
    copying tcod/map.py -> build/lib.linux-x86_64-3.3/tcod
    copying tcod/heightmap.py -> build/lib.linux-x86_64-3.3/tcod
    copying tcod/random.py -> build/lib.linux-x86_64-3.3/tcod
    copying tcod/namegen.py -> build/lib.linux-x86_64-3.3/tcod
    copying tcod/noise.py -> build/lib.linux-x86_64-3.3/tcod
    copying tcod/line.py -> build/lib.linux-x86_64-3.3/tcod
    copying tcod/mouse.py -> build/lib.linux-x86_64-3.3/tcod
    copying tcod/version.txt -> build/lib.linux-x86_64-3.3/tcod
    creating build/lib.linux-x86_64-3.3/tcod/lib
    copying tcod/lib/LIBTCOD-LICENSE.txt -> build/lib.linux-x86_64-3.3/tcod/lib
    copying tcod/lib/LIBTCOD-CREDITS.txt -> build/lib.linux-x86_64-3.3/tcod/lib
    copying tcod/lib/README-SDL.txt -> build/lib.linux-x86_64-3.3/tcod/lib
    creating build/lib.linux-x86_64-3.3/tcod/lib/linux64
    copying tcod/lib/linux64/libtcod.so -> build/lib.linux-x86_64-3.3/tcod/lib/linux64
    running build_ext
    generating cffi module 'build/temp.linux-x86_64-3.3/tcod._libtcod_cp33_x64.c'
    creating build/temp.linux-x86_64-3.3
    building 'tcod._libtcod_cp33_x64' extension
    creating build/temp.linux-x86_64-3.3/build
    creating build/temp.linux-x86_64-3.3/build/temp.linux-x86_64-3.3
    gcc -pthread -Wno-unused-result -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -Itcod/include/libtcod-1.5 -IRelease/tcod/ -I/usr/include/python3.3m -c build/temp.linux-x86_64-3.3/tcod._libtcod_cp33_x64.c -o build/temp.linux-x86_64-3.3/build/temp.linux-x86_64-3.3/tcod._libtcod_cp33_x64.o /O2 /W3
    gcc: error: /O2: No such file or directory
    gcc: error: /W3: No such file or directory
    error: command 'gcc' failed with exit status 1

Looked for '/O2' and '/W3', found them in build_libtcod.py in extra_compile_args. From what I could find (e. g. http://stackoverflow.com/questions/22526570/what-are-equivalent-gcc-flags-for-visual-studio-warning-levels), these appear to be from visual studio. I imagine they should have some sort of check for compiler before adding them, but to see how far I could get, I removed them completely. (From now on, I used python setup.py sdist to build the libtcod-cffi-0.2.1.tar.gz and pip install ../path/to/file. Couldn't use PyPI to get my custom changes... Hopefully this was the right way to build it and I didn't break anything else.) Then I started to get this error:

  Running setup.py install for libtcod-cffi
    Complete output from command /home/jdklassen/projects/env/bin/python3 -c "import setuptools, tokenize;__file__='/tmp/pip-f02m9x-build/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-zd84z8-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/jdklassen/projects/env/include/site/python3.3/libtcod-cffi:
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-3.3
    creating build/lib.linux-x86_64-3.3/tcod
    copying tcod/__init__.py -> build/lib.linux-x86_64-3.3/tcod
    copying tcod/parser.py -> build/lib.linux-x86_64-3.3/tcod
    copying tcod/sys_.py -> build/lib.linux-x86_64-3.3/tcod
    copying tcod/dijkstra.py -> build/lib.linux-x86_64-3.3/tcod
    copying tcod/libtcod.py -> build/lib.linux-x86_64-3.3/tcod
    copying tcod/console.py -> build/lib.linux-x86_64-3.3/tcod
    copying tcod/color.py -> build/lib.linux-x86_64-3.3/tcod
    copying tcod/image.py -> build/lib.linux-x86_64-3.3/tcod
    copying tcod/bsp.py -> build/lib.linux-x86_64-3.3/tcod
    copying tcod/path.py -> build/lib.linux-x86_64-3.3/tcod
    copying tcod/map.py -> build/lib.linux-x86_64-3.3/tcod
    copying tcod/heightmap.py -> build/lib.linux-x86_64-3.3/tcod
    copying tcod/random.py -> build/lib.linux-x86_64-3.3/tcod
    copying tcod/namegen.py -> build/lib.linux-x86_64-3.3/tcod
    copying tcod/noise.py -> build/lib.linux-x86_64-3.3/tcod
    copying tcod/line.py -> build/lib.linux-x86_64-3.3/tcod
    copying tcod/mouse.py -> build/lib.linux-x86_64-3.3/tcod
    copying tcod/version.txt -> build/lib.linux-x86_64-3.3/tcod
    creating build/lib.linux-x86_64-3.3/tcod/lib
    copying tcod/lib/LIBTCOD-LICENSE.txt -> build/lib.linux-x86_64-3.3/tcod/lib
    copying tcod/lib/LIBTCOD-CREDITS.txt -> build/lib.linux-x86_64-3.3/tcod/lib
    copying tcod/lib/README-SDL.txt -> build/lib.linux-x86_64-3.3/tcod/lib
    creating build/lib.linux-x86_64-3.3/tcod/lib/linux64
    copying tcod/lib/linux64/libtcod.so -> build/lib.linux-x86_64-3.3/tcod/lib/linux64
    running build_ext
    generating cffi module 'build/temp.linux-x86_64-3.3/tcod._libtcod_cp33_x64.c'
    creating build/temp.linux-x86_64-3.3
    building 'tcod._libtcod_cp33_x64' extension
    creating build/temp.linux-x86_64-3.3/build
    creating build/temp.linux-x86_64-3.3/build/temp.linux-x86_64-3.3
    gcc -pthread -Wno-unused-result -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -Itcod/include/libtcod-1.5 -IRelease/tcod/ -I/usr/include/python3.3m -c build/temp.linux-x86_64-3.3/tcod._libtcod_cp33_x64.c -o build/temp.linux-x86_64-3.3/build/temp.linux-x86_64-3.3/tcod._libtcod_cp33_x64.o
    build/temp.linux-x86_64-3.3/tcod._libtcod_cp33_x64.c: In function ‘TDL_list_get_bool’:
    build/temp.linux-x86_64-3.3/tcod._libtcod_cp33_x64.c:400:12: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
         return (bool)TCOD_list_get(l, idx);
                ^
    build/temp.linux-x86_64-3.3/tcod._libtcod_cp33_x64.c: In function ‘TDL_list_get_char’:
    build/temp.linux-x86_64-3.3/tcod._libtcod_cp33_x64.c:404:12: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
         return (char)TCOD_list_get(l, idx);
                ^
    build/temp.linux-x86_64-3.3/tcod._libtcod_cp33_x64.c: In function ‘TDL_list_get_int’:
    build/temp.linux-x86_64-3.3/tcod._libtcod_cp33_x64.c:408:12: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
         return (int)TCOD_list_get(l, idx);
                ^
    build/temp.linux-x86_64-3.3/tcod._libtcod_cp33_x64.c: In function ‘TDL_list_get_float’:
    build/temp.linux-x86_64-3.3/tcod._libtcod_cp33_x64.c:413:5: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
         return *(float*)&val;
         ^
    build/temp.linux-x86_64-3.3/tcod._libtcod_cp33_x64.c: In function ‘TDL_list_get_dice’:
    build/temp.linux-x86_64-3.3/tcod._libtcod_cp33_x64.c:427:5: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
         return *(TCOD_dice_t*)&val;
         ^
    gcc -pthread -shared -Wl,-z,relro build/temp.linux-x86_64-3.3/build/temp.linux-x86_64-3.3/tcod._libtcod_cp33_x64.o -Ltcod/lib/linux64/ -L/usr/lib64 -llibtcod -lpython3.3m -o build/lib.linux-x86_64-3.3/tcod/_libtcod_cp33_x64.cpython-33m.so
    /usr/bin/ld: cannot find -llibtcod
    collect2: error: ld returned 1 exit status
    error: command 'gcc' failed with exit status 1

Following suggested advice from http://stackoverflow.com/a/21647591, I ran ld -L tcod/lib/linux64/ -llibtcod --verbose (options copied from the pip log) and I can see from the output that it is searching for 'tcod/lib/linux64//liblibtcod.so' (and not, I assume 'tcod/lib/linux64/libtcod.so'). I looked in build_libtcod.py again and found _get_library_dirs_crossplatform() and _get_libraries_crossplatform() and modified their linux cases to remove the '/' and the 'lib'.

Now it pip installs nicely, but now (and after pip install tdl), I get this error:

>>> import tdl
Traceback (most recent call last):
  File "/home/jdklassen/projects/env/lib/python3.3/site-packages/tcod/libtcod.py", line 30, in <module>
    import _libtcod # PyPy
ImportError: No module named '_libtcod'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/jdklassen/projects/env/lib/python3.3/site-packages/tdl/__init__.py", line 73, in <module>
    from tcod import ffi as _ffi
  File "/home/jdklassen/projects/env/lib/python3.3/site-packages/tcod/__init__.py", line 20, in <module>
    from .libtcod import lib, ffi, _lib, _ffi
  File "/home/jdklassen/projects/env/lib/python3.3/site-packages/tcod/libtcod.py", line 40, in <module>
    _libtcod = _importlib.import_module(_module_name, 'tcod')
  File "/home/jdklassen/projects/env/lib64/python3.3/importlib/__init__.py", line 90, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
ImportError: libtcod.so: cannot open shared object file: No such file or directory
>>>

This is now well beyond what I know. Inspecting further I found two things that might be useful:

  1. the variable _module_name in the second last traceback is '._libtcod_cp33_x64'
  2. libtcod.py does append a reasonable looking path to os.environ['PATH'], namely '/home/jdklassen/projects/env/lib/python3.3/site-packages/tcod/lib/linux64/' (I even tried it without the trailing slash in _get_lib_path_crossplatform(), to no avail), which does contain a libtcod.so file. I guess _bootstrap._gcd_import() is looking somewhere else?

SDL Symbol not found

So after a pip install and a find/replace from libtcodpy to tcod, I ended up with this problem:

Traceback (most recent call last):
  File "<redacted>/bin/<readacted>", line 11, in <module>
    load_entry_point('<readacted>', 'console_scripts', '<readacted>')()
  File "<redacted>/lib/python3.6/site-packages/pkg_resources/__init__.py", line 560, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "<redacted>/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2648, in load_entry_point
    return ep.load()
  File "<redacted>/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2302, in load
    return self.resolve()
  File "<redacted>/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2308, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "<redacted>/__init__.py", line 40, in <module>
    from .utils import get_logger, main_menu  # noqa
  File "<redacted>/utils/__init__.py", line 3, in <module>
    from .ui import *  # noqa
  File "<redacted>/utils/ui/__init__.py", line 2, in <module>
    from .keys import *  # noqa
  File "<redacted>/utils/ui/keys.py", line 2, in <module>
    import tcod as tcod
  File "<redacted>/lib/python3.6/site-packages/tcod/__init__.py", line 20, in <module>
    from tcod.libtcodpy import *
  File "<redacted>/lib/python3.6/site-packages/tcod/libtcodpy.py", line 10, in <module>
    from tcod.libtcod import *
  File "<redacted>/lib/python3.6/site-packages/tcod/libtcod.py", line 85, in <module>
    from tcod._libtcod import lib, ffi
ImportError: dlopen(<redacted>/lib/python3.6/site-packages/tcod/_libtcod.abi3.so, 2): Symbol not found: _SDL_CaptureMouse
  Referenced from: <redacted>/lib/python3.6/site-packages/tcod/_libtcod.abi3.so
  Expected in: /Library/Frameworks/SDL2.framework/Versions/A/SDL2
 in <redacted>/lib/python3.6/site-packages/tcod/_libtcod.abi3.so

As a note I can install just fine from the most recent bitbucket pull of libtcod using scons. And if I point my virtual environment to the <libtcod-repo-path>/python folder, I can do a quick pip install -e . without an issue.

It feels like SDL is not getting picked up properly. Any thoughts?

Note I'm on a mac.

Wheel/Exe for Python 3.5

There are currently no .whl or .exe installers for the latest Python version, 3.5.*. I have a 64-bit version of Python installed and trying to compile on Windows is a real pain. Updated installers would be a big help.

Fails to pip install in Python 2.7.5: cffi.api.CDefError: parse error illegal char '\r'

I tried upgrading my tdl from 1.2.0, and I'm getting this error on Python 2.7.5 in 64bit linux (Fedora 20). I have limited experience with c compiling and none with cffi, so I'm not sure what needs to be fixed. I searched for '\r' in tcod/ and could find none outside of tcod/lib/LIBTCOD-LICENSE.txt and tcod/lib/README-SDL.txt and some binary files (.so, .dylib, .dll).

$ pip install libtcod-cffi
Collecting libtcod-cffi
  Using cached libtcod-cffi-0.2.1.zip
    Complete output from command python setup.py egg_info:

    Installed /tmp/pip-build-JG1HLV/libtcod-cffi/.eggs/cffi-1.1.2-py2.7-linux-x86_64.egg
    Searching for pycparser
    Reading https://pypi.python.org/simple/pycparser/
    Best match: pycparser 2.14
    Downloading https://pypi.python.org/packages/source/p/pycparser/pycparser-2.14.tar.gz#md5=a2bc8d28c923b4fe2b2c3b4b51a4f935
    Processing pycparser-2.14.tar.gz
    Writing /tmp/easy_install-Gjrzd6/pycparser-2.14/setup.cfg
    Running pycparser-2.14/setup.py -q bdist_egg --dist-dir /tmp/easy_install-Gjrzd6/pycparser-2.14/egg-dist-tmp-SFoDRZ
    warning: no previously-included files matching 'yacctab.*' found under directory 'tests'
    warning: no previously-included files matching 'lextab.*' found under directory 'tests'
    warning: no previously-included files matching 'yacctab.*' found under directory 'examples'
    warning: no previously-included files matching 'lextab.*' found under directory 'examples'
    zip_safe flag not set; analyzing archive contents...
    Moving pycparser-2.14-py2.7.egg to /tmp/pip-build-JG1HLV/libtcod-cffi/.eggs

    Installed /tmp/pip-build-JG1HLV/libtcod-cffi/.eggs/pycparser-2.14-py2.7.egg
    Traceback (most recent call last):
      File "<string>", line 20, in <module>
      File "/tmp/pip-build-JG1HLV/libtcod-cffi/setup.py", line 66, in <module>
        license = 'Simplified BSD License'
      File "/usr/lib64/python2.7/distutils/core.py", line 112, in setup
        _setup_distribution = dist = klass(attrs)
      File "/home/jdklassen/projects/libtcod-cffi/env/lib/python2.7/site-packages/setuptools/dist.py", line 269, in __init__
        _Distribution.__init__(self,attrs)
      File "/usr/lib64/python2.7/distutils/dist.py", line 287, in __init__
        self.finalize_options()
      File "/home/jdklassen/projects/libtcod-cffi/env/lib/python2.7/site-packages/setuptools/dist.py", line 325, in finalize_options
        ep.load()(self, ep.name, value)
      File "/tmp/pip-build-JG1HLV/libtcod-cffi/.eggs/cffi-1.1.2-py2.7-linux-x86_64.egg/cffi/setuptools_ext.py", line 154, in cffi_modules
        add_cffi_module(dist, cffi_module)
      File "/tmp/pip-build-JG1HLV/libtcod-cffi/.eggs/cffi-1.1.2-py2.7-linux-x86_64.egg/cffi/setuptools_ext.py", line 48, in add_cffi_module
        execfile(build_file_name, mod_vars)
      File "/tmp/pip-build-JG1HLV/libtcod-cffi/.eggs/cffi-1.1.2-py2.7-linux-x86_64.egg/cffi/setuptools_ext.py", line 24, in execfile
        exec(code, glob, glob)
      File "build_libtcod.py", line 39, in <module>
        ffi.cdef(open('tcod/libtcod_cdef.h', 'r').read())
      File "/tmp/pip-build-JG1HLV/libtcod-cffi/.eggs/cffi-1.1.2-py2.7-linux-x86_64.egg/cffi/api.py", line 107, in cdef
        self._parser.parse(csource, override=override, packed=packed)
      File "/tmp/pip-build-JG1HLV/libtcod-cffi/.eggs/cffi-1.1.2-py2.7-linux-x86_64.egg/cffi/cparser.py", line 167, in parse
        self._internal_parse(csource)
      File "/tmp/pip-build-JG1HLV/libtcod-cffi/.eggs/cffi-1.1.2-py2.7-linux-x86_64.egg/cffi/cparser.py", line 173, in _internal_parse
        ast, macros, csource = self._parse(csource)
      File "/tmp/pip-build-JG1HLV/libtcod-cffi/.eggs/cffi-1.1.2-py2.7-linux-x86_64.egg/cffi/cparser.py", line 130, in _parse
        self.convert_pycparser_error(e, csource)
      File "/tmp/pip-build-JG1HLV/libtcod-cffi/.eggs/cffi-1.1.2-py2.7-linux-x86_64.egg/cffi/cparser.py", line 159, in convert_pycparser_error
        raise api.CDefError(msg)
    cffi.api.CDefError: parse error
    :3:1: Illegal character '\r'

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-JG1HLV/libtcod-cffi

Initial Update

Hi 👊

This is my first visit to this fine repo, but it seems you have been working hard to keep all dependencies updated so far.

Once you have closed this issue, I'll create seperate pull requests for every update as soon as I find one.

That's it for now!

Happy merging! 🤖

Enhancement Request: Better search for LIBTCOD_DLL_PATH

Notably, I'm on a mac.

I wrote this code, and I now preface it before I import tcod:

def setup_tcod_shared_object_paths():
    dll_path_to_search = [
        os.path.abspath(os.getcwd()),
        os.path.dirname(__file__),
    ]

    if sys.platform in ['darwin', 'linux']:
        dll_path_to_search.extend([
            '~/lib',
            '~/.local/lib',
            '/usr/local/lib',
            '/usr/lib',
        ])
    elif sys.platform in ['win32']:
        dll_path_to_search.extend([
            '\\Windows\\System32',
            '\\Windows',
        ])

    if 'LIBTCOD_DLL_PATH' not in os.environ:
        os.environ['LIBTCOD_DLL_PATH'] = ';'.join(dll_path_to_search)
    else:
        dll_path = os.environ.get('LIBTCOD_DLL_PATH')
        dll_path = ';'.join((dll_path, ';'.join(dll_path_to_search)))


setup_tcod_shared_object_paths()
import tcod  # noqa

It would maybe be nice if we added something like this to tcod here: https://github.com/HexDecimal/libtcod-cffi/blob/master/tcod/__init__.py#L19

It won't catch all cases, but it would lower the barrier for many new people.

Object serialization support.

Classes depending on CData objects need custom code in order to support Python's copy and random modules.

Supported classes:

  • BSP
  • Color
  • Console
  • Image
  • Map
  • Noise
  • AStar/Dijkstra
  • Random
  • Verify that numpy buffer arrays pickle correctly.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.