tcod 20.0.0__tar.gz → 20.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {tcod-20.0.0 → tcod-20.1.0}/CHANGELOG.md +15 -0
- {tcod-20.0.0 → tcod-20.1.0}/PKG-INFO +2 -1
- {tcod-20.0.0 → tcod-20.1.0}/pyproject.toml +1 -8
- {tcod-20.0.0 → tcod-20.1.0}/tcod/context.py +1 -1
- {tcod-20.0.0 → tcod-20.1.0}/tcod/event.py +9 -1
- {tcod-20.0.0 → tcod-20.1.0}/tcod/tileset.py +198 -39
- {tcod-20.0.0 → tcod-20.1.0}/tcod/version.py +3 -3
- {tcod-20.0.0 → tcod-20.1.0}/tcod.egg-info/PKG-INFO +2 -1
- {tcod-20.0.0 → tcod-20.1.0}/CONTRIBUTING.md +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/LICENSE.txt +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/MANIFEST.in +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/README.rst +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/build_libtcod.py +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/build_sdl.py +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/CHANGELOG.md +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/CMakeLists.txt +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/CONTRIBUTING.md +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/LIBTCOD-CREDITS.txt +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/LICENSE.txt +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/README.md +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/libtcod/bresenham.h +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/libtcod/bresenham_c.c +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/libtcod/bsp.h +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/libtcod/bsp_c.c +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/libtcod/color.c +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/libtcod/color.h +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/libtcod/config.h +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/libtcod/console.c +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/libtcod/console.h +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/libtcod/console_drawing.c +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/libtcod/console_drawing.h +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/libtcod/console_etc.c +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/libtcod/console_etc.h +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/libtcod/console_init.c +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/libtcod/console_init.h +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/libtcod/console_printing.c +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/libtcod/console_printing.h +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/libtcod/console_rexpaint.c +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/libtcod/console_rexpaint.h +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/libtcod/console_types.h +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/libtcod/context.c +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/libtcod/context.h +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/libtcod/context_init.c +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/libtcod/context_init.h +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/libtcod/context_viewport.c +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/libtcod/context_viewport.h +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/libtcod/error.c +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/libtcod/error.h +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/libtcod/fov.h +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/libtcod/fov_c.c +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/libtcod/fov_circular_raycasting.c +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/libtcod/fov_diamond_raycasting.c +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/libtcod/fov_permissive2.c +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/libtcod/fov_recursive_shadowcasting.c +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/libtcod/fov_restrictive.c +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/libtcod/fov_symmetric_shadowcast.c +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/libtcod/fov_types.h +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/libtcod/globals.c +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/libtcod/globals.h +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/libtcod/heapq.c +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/libtcod/heapq.h +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/libtcod/heightmap.h +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/libtcod/heightmap_c.c +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/libtcod/image.h +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/libtcod/image_c.c +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/libtcod/lex.h +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/libtcod/lex_c.c +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/libtcod/libtcod.h +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/libtcod/libtcod_int.h +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/libtcod/list.h +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/libtcod/list_c.c +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/libtcod/logging.c +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/libtcod/logging.h +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/libtcod/mersenne.h +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/libtcod/mersenne_c.c +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/libtcod/mersenne_types.h +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/libtcod/mouse.h +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/libtcod/mouse_types.h +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/libtcod/namegen.h +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/libtcod/namegen_c.c +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/libtcod/noise.h +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/libtcod/noise_c.c +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/libtcod/noise_defaults.h +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/libtcod/parser.h +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/libtcod/parser_c.c +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/libtcod/path.h +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/libtcod/path_c.c +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/libtcod/pathfinder.c +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/libtcod/pathfinder.h +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/libtcod/pathfinder_frontier.c +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/libtcod/pathfinder_frontier.h +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/libtcod/portability.h +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/libtcod/random.c +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/libtcod/random.h +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/libtcod/renderer_sdl2.c +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/libtcod/renderer_sdl2.h +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/libtcod/renderer_xterm.c +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/libtcod/renderer_xterm.h +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/libtcod/sdl2/console_grid.glslf +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/libtcod/sdl2/console_grid.glslv +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/libtcod/sdl2/event.h +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/libtcod/sys.h +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/libtcod/sys_c.c +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/libtcod/sys_sdl_c.c +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/libtcod/sys_sdl_img_bmp.c +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/libtcod/sys_sdl_img_png.c +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/libtcod/tileset.c +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/libtcod/tileset.h +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/libtcod/tileset_bdf.c +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/libtcod/tileset_bdf.h +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/libtcod/tileset_fallback.c +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/libtcod/tileset_fallback.h +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/libtcod/tileset_render.c +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/libtcod/tileset_render.h +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/libtcod/tileset_truetype.c +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/libtcod/tileset_truetype.h +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/libtcod/timer.h +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/libtcod/tree.h +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/libtcod/tree_c.c +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/libtcod/txtfield.h +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/libtcod/txtfield_c.c +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/libtcod/utility.h +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/libtcod/version.h +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/libtcod/wrappers.c +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/libtcod/wrappers.h +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/libtcod/zip.h +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/libtcod/zip_c.c +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/libtcod.h +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/libtcod_c.c +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/vendor/khrplatform.h +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/vendor/lodepng.c +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/vendor/lodepng.h +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/vendor/stb.c +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/vendor/stb_ds.h +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/vendor/stb_truetype.h +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/vendor/utf8proc/utf8proc.c +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/vendor/utf8proc/utf8proc.h +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/vendor/utf8proc/utf8proc_data.c +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/vendor/zlib/adler32.c +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/vendor/zlib/compress.c +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/vendor/zlib/crc32.c +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/vendor/zlib/crc32.h +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/vendor/zlib/deflate.c +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/vendor/zlib/deflate.h +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/vendor/zlib/gzclose.c +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/vendor/zlib/gzguts.h +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/vendor/zlib/gzlib.c +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/vendor/zlib/gzread.c +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/vendor/zlib/gzwrite.c +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/vendor/zlib/infback.c +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/vendor/zlib/inffast.c +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/vendor/zlib/inffast.h +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/vendor/zlib/inffixed.h +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/vendor/zlib/inflate.c +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/vendor/zlib/inflate.h +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/vendor/zlib/inftrees.c +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/vendor/zlib/inftrees.h +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/vendor/zlib/trees.c +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/vendor/zlib/trees.h +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/vendor/zlib/uncompr.c +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/vendor/zlib/zconf.h +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/vendor/zlib/zlib.h +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/vendor/zlib/zutil.c +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcod/src/vendor/zlib/zutil.h +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/libtcodpy.py +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/requirements.txt +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/setup.cfg +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/setup.py +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/tcod/__init__.py +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/tcod/__pyinstaller/__init__.py +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/tcod/__pyinstaller/hook-tcod.py +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/tcod/_internal.py +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/tcod/_libtcod.pyi +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/tcod/bsp.py +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/tcod/cdef.h +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/tcod/cffi.h +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/tcod/cffi.py +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/tcod/color.py +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/tcod/console.py +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/tcod/constants.py +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/tcod/event_constants.py +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/tcod/image.py +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/tcod/libtcodpy.py +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/tcod/los.py +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/tcod/map.py +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/tcod/noise.c +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/tcod/noise.h +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/tcod/noise.py +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/tcod/path.c +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/tcod/path.h +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/tcod/path.py +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/tcod/py.typed +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/tcod/random.h +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/tcod/random.py +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/tcod/render.py +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/tcod/sdl/__init__.py +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/tcod/sdl/_internal.py +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/tcod/sdl/audio.py +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/tcod/sdl/constants.py +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/tcod/sdl/joystick.py +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/tcod/sdl/mouse.py +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/tcod/sdl/render.py +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/tcod/sdl/sys.py +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/tcod/sdl/video.py +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/tcod/tcod.c +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/tcod/tcod.h +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/tcod/tcod.py +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/tcod.egg-info/SOURCES.txt +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/tcod.egg-info/dependency_links.txt +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/tcod.egg-info/entry_points.txt +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/tcod.egg-info/requires.txt +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/tcod.egg-info/top_level.txt +0 -0
- {tcod-20.0.0 → tcod-20.1.0}/tox.ini +0 -0
|
@@ -6,6 +6,21 @@ This project adheres to [Semantic Versioning](https://semver.org/) since version
|
|
|
6
6
|
|
|
7
7
|
## [Unreleased]
|
|
8
8
|
|
|
9
|
+
## [20.1.0] - 2026-02-25
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
|
|
13
|
+
- `Tileset` now supports `MutableMapping` semantics.
|
|
14
|
+
Can get, set, or iterate over tiles as if it were a dictionary containing tile glyph arrays.
|
|
15
|
+
Also supports `+`, `|`, `+=`, and `|=` with other tilesets or mappings to merge them into a single Tileset.
|
|
16
|
+
- `tcod.tileset.procedural_block_elements` can take a tile shape and return a tileset.
|
|
17
|
+
|
|
18
|
+
### Deprecated
|
|
19
|
+
|
|
20
|
+
- `Tileset.set_tile(codepoint, tile)` was replaced with `tileset[codepoint] = tile` syntax.
|
|
21
|
+
- `Tileset.get_tile(codepoint)` was soft replaced with `tileset[codepoint]` syntax.
|
|
22
|
+
- `tcod.tileset.procedural_block_elements` should be used with dictionary semantics instead of passing in a tileset.
|
|
23
|
+
|
|
9
24
|
## [20.0.0] - 2026-02-06
|
|
10
25
|
|
|
11
26
|
### Added
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: tcod
|
|
3
|
-
Version: 20.
|
|
3
|
+
Version: 20.1.0
|
|
4
4
|
Summary: The official Python port of libtcod.
|
|
5
5
|
Author-email: Kyle Benesch <4b796c65+tcod@gmail.com>
|
|
6
6
|
License-Expression: BSD-2-Clause
|
|
@@ -23,6 +23,7 @@ Classifier: Natural Language :: English
|
|
|
23
23
|
Classifier: Operating System :: POSIX
|
|
24
24
|
Classifier: Operating System :: MacOS :: MacOS X
|
|
25
25
|
Classifier: Operating System :: Microsoft :: Windows
|
|
26
|
+
Classifier: Programming Language :: C
|
|
26
27
|
Classifier: Programming Language :: Python :: 3
|
|
27
28
|
Classifier: Programming Language :: Python :: Free Threading :: 2 - Beta
|
|
28
29
|
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
@@ -52,6 +52,7 @@ classifiers = [ # https://pypi.org/classifiers/
|
|
|
52
52
|
"Operating System :: POSIX",
|
|
53
53
|
"Operating System :: MacOS :: MacOS X",
|
|
54
54
|
"Operating System :: Microsoft :: Windows",
|
|
55
|
+
"Programming Language :: C",
|
|
55
56
|
"Programming Language :: Python :: 3",
|
|
56
57
|
"Programming Language :: Python :: Free Threading :: 2 - Beta",
|
|
57
58
|
"Programming Language :: Python :: Implementation :: CPython",
|
|
@@ -152,20 +153,12 @@ line-length = 120
|
|
|
152
153
|
select = ["ALL"]
|
|
153
154
|
ignore = [
|
|
154
155
|
"COM", # flake8-commas
|
|
155
|
-
"D203", # one-blank-line-before-class
|
|
156
|
-
"D204", # one-blank-line-after-class
|
|
157
|
-
"D213", # multi-line-summary-second-line
|
|
158
|
-
"D407", # dashed-underline-after-section
|
|
159
|
-
"D408", # section-underline-after-name
|
|
160
|
-
"D409", # section-underline-matches-section-length
|
|
161
|
-
"D206", # indent-with-spaces
|
|
162
156
|
"E501", # line-too-long
|
|
163
157
|
"PYI064", # redundant-final-literal
|
|
164
158
|
"S101", # assert
|
|
165
159
|
"S301", # suspicious-pickle-usage
|
|
166
160
|
"S311", # suspicious-non-cryptographic-random-usage
|
|
167
161
|
"SLF001", # private-member-access
|
|
168
|
-
"W191", # tab-indentation
|
|
169
162
|
]
|
|
170
163
|
[tool.ruff.lint.per-file-ignores]
|
|
171
164
|
"**/{tests}/*" = [
|
|
@@ -125,7 +125,7 @@ It is not recommended to use this renderer on Windows.
|
|
|
125
125
|
|
|
126
126
|
def _handle_tileset(tileset: tcod.tileset.Tileset | None) -> Any: # noqa: ANN401
|
|
127
127
|
"""Get the TCOD_Tileset pointer from a Tileset or return a NULL pointer."""
|
|
128
|
-
return tileset._tileset_p if tileset else ffi.NULL
|
|
128
|
+
return tileset._tileset_p if tileset is not None else ffi.NULL
|
|
129
129
|
|
|
130
130
|
|
|
131
131
|
def _handle_title(title: str | None) -> Any: # noqa: ANN401
|
|
@@ -156,6 +156,9 @@ class Point(NamedTuple):
|
|
|
156
156
|
|
|
157
157
|
.. seealso::
|
|
158
158
|
:any:`MouseMotion` :any:`MouseButtonDown` :any:`MouseButtonUp`
|
|
159
|
+
|
|
160
|
+
.. versionchanged:: 19.0
|
|
161
|
+
Now uses floating point coordinates due to the port to SDL3.
|
|
159
162
|
"""
|
|
160
163
|
|
|
161
164
|
x: float
|
|
@@ -481,6 +484,9 @@ class MouseMotion(MouseState):
|
|
|
481
484
|
.. versionchanged:: 15.0
|
|
482
485
|
Renamed `pixel` attribute to `position`.
|
|
483
486
|
Renamed `pixel_motion` attribute to `motion`.
|
|
487
|
+
|
|
488
|
+
.. versionchanged:: 19.0
|
|
489
|
+
`position` and `motion` now use floating point coordinates.
|
|
484
490
|
"""
|
|
485
491
|
|
|
486
492
|
def __init__(
|
|
@@ -558,7 +564,7 @@ class MouseButtonEvent(MouseState):
|
|
|
558
564
|
type (str): Will be "MOUSEBUTTONDOWN" or "MOUSEBUTTONUP",
|
|
559
565
|
depending on the event.
|
|
560
566
|
position (Point): The pixel coordinates of the mouse.
|
|
561
|
-
tile (Point): The
|
|
567
|
+
tile (Point): The tile coordinates of the mouse on the screen.
|
|
562
568
|
button (int): Which mouse button.
|
|
563
569
|
|
|
564
570
|
This will be one of the following names:
|
|
@@ -569,6 +575,8 @@ class MouseButtonEvent(MouseState):
|
|
|
569
575
|
* tcod.event.BUTTON_X1
|
|
570
576
|
* tcod.event.BUTTON_X2
|
|
571
577
|
|
|
578
|
+
.. versionchanged:: 19.0
|
|
579
|
+
`position` and `tile` now use floating point coordinates.
|
|
572
580
|
"""
|
|
573
581
|
|
|
574
582
|
def __init__(
|
|
@@ -2,25 +2,25 @@
|
|
|
2
2
|
|
|
3
3
|
If you want to load a tileset from a common tileset image then you only need :any:`tcod.tileset.load_tilesheet`.
|
|
4
4
|
|
|
5
|
-
Tilesets can be loaded as a whole from tile-sheets or True-Type fonts,
|
|
6
|
-
can be put together from multiple tile images by loading them separately
|
|
7
|
-
using :any:`Tileset.set_tile`.
|
|
5
|
+
Tilesets can be loaded as a whole from tile-sheets or True-Type fonts,
|
|
6
|
+
or they can be put together from multiple tile images by loading them separately using :any:`Tileset.__setitem__`.
|
|
8
7
|
|
|
9
|
-
A major restriction with libtcod is that all tiles must be the same size and
|
|
10
|
-
|
|
11
|
-
useful to use `an alternative library for graphics rendering
|
|
8
|
+
A major restriction with libtcod is that all tiles must be the same size and tiles can't overlap when rendered.
|
|
9
|
+
For sprite-based rendering it can be useful to use `an alternative library for graphics rendering
|
|
12
10
|
<https://wiki.python.org/moin/PythonGameLibraries>`_ while continuing to use
|
|
13
11
|
python-tcod's pathfinding and field-of-view algorithms.
|
|
14
12
|
"""
|
|
15
13
|
|
|
16
14
|
from __future__ import annotations
|
|
17
15
|
|
|
16
|
+
import copy
|
|
18
17
|
import itertools
|
|
18
|
+
from collections.abc import Iterator, Mapping, MutableMapping
|
|
19
19
|
from pathlib import Path
|
|
20
|
-
from typing import TYPE_CHECKING, Any
|
|
20
|
+
from typing import TYPE_CHECKING, Any, SupportsInt, overload
|
|
21
21
|
|
|
22
22
|
import numpy as np
|
|
23
|
-
from typing_extensions import deprecated
|
|
23
|
+
from typing_extensions import Self, deprecated
|
|
24
24
|
|
|
25
25
|
from tcod._internal import _check, _check_p, _console, _path_encode, _raise_tcod_error
|
|
26
26
|
from tcod.cffi import ffi, lib
|
|
@@ -34,10 +34,11 @@ if TYPE_CHECKING:
|
|
|
34
34
|
import tcod.console
|
|
35
35
|
|
|
36
36
|
|
|
37
|
-
class Tileset:
|
|
37
|
+
class Tileset(MutableMapping[int, "NDArray[np.uint8]"]):
|
|
38
38
|
"""A collection of graphical tiles.
|
|
39
39
|
|
|
40
|
-
|
|
40
|
+
.. versionchanged:: 20.1
|
|
41
|
+
Is now a :class:`collections.abc.MutableMapping` type.
|
|
41
42
|
"""
|
|
42
43
|
|
|
43
44
|
def __init__(self, tile_width: int, tile_height: int) -> None:
|
|
@@ -80,28 +81,105 @@ class Tileset:
|
|
|
80
81
|
"""Shape (height, width) of the tile in pixels."""
|
|
81
82
|
return self.tile_height, self.tile_width
|
|
82
83
|
|
|
83
|
-
def
|
|
84
|
+
def __copy__(self) -> Self:
|
|
85
|
+
"""Return a clone of this tileset.
|
|
86
|
+
|
|
87
|
+
This is not an exact copy. :any:`remap` will not work on the clone.
|
|
88
|
+
|
|
89
|
+
.. versionadded:: 20.1
|
|
90
|
+
"""
|
|
91
|
+
clone = self.__class__(self.tile_width, self.tile_height)
|
|
92
|
+
for codepoint, tile in self.items():
|
|
93
|
+
clone[codepoint] = tile
|
|
94
|
+
return clone
|
|
95
|
+
|
|
96
|
+
@staticmethod
|
|
97
|
+
def _iter_items(
|
|
98
|
+
tiles: Iterable[tuple[int, ArrayLike | NDArray[np.uint8]]] | Mapping[int, ArrayLike | NDArray[np.uint8]], /
|
|
99
|
+
) -> Iterable[tuple[int, ArrayLike | NDArray[np.uint8]]]:
|
|
100
|
+
"""Convert a potential mapping to an iterator."""
|
|
101
|
+
if isinstance(tiles, Mapping):
|
|
102
|
+
return tiles.items() # pyright: ignore[reportReturnType]
|
|
103
|
+
return tiles
|
|
104
|
+
|
|
105
|
+
def __iadd__(
|
|
106
|
+
self,
|
|
107
|
+
other: Iterable[tuple[int, ArrayLike | NDArray[np.uint8]]] | Mapping[int, ArrayLike | NDArray[np.uint8]],
|
|
108
|
+
/,
|
|
109
|
+
) -> Self:
|
|
110
|
+
"""Add tiles to this tileset inplace, prefers replacing tiles.
|
|
111
|
+
|
|
112
|
+
.. versionadded:: 20.1
|
|
113
|
+
"""
|
|
114
|
+
for codepoint, tile in self._iter_items(other):
|
|
115
|
+
self[codepoint] = tile
|
|
116
|
+
return self
|
|
117
|
+
|
|
118
|
+
def __add__(
|
|
119
|
+
self,
|
|
120
|
+
other: Iterable[tuple[int, ArrayLike | NDArray[np.uint8]]] | Mapping[int, ArrayLike | NDArray[np.uint8]],
|
|
121
|
+
/,
|
|
122
|
+
) -> Self:
|
|
123
|
+
"""Combine tiles with this tileset, prefers replacing tiles.
|
|
124
|
+
|
|
125
|
+
.. versionadded:: 20.1
|
|
126
|
+
"""
|
|
127
|
+
clone = copy.copy(self)
|
|
128
|
+
clone += other
|
|
129
|
+
return clone
|
|
130
|
+
|
|
131
|
+
def __ior__(
|
|
132
|
+
self,
|
|
133
|
+
other: Iterable[tuple[int, ArrayLike | NDArray[np.uint8]]] | Mapping[int, ArrayLike | NDArray[np.uint8]],
|
|
134
|
+
/,
|
|
135
|
+
) -> Self:
|
|
136
|
+
"""Add tiles to this tileset inplace, keeps existing tiles instead of replacing them.
|
|
137
|
+
|
|
138
|
+
.. versionadded:: 20.1
|
|
139
|
+
"""
|
|
140
|
+
for codepoint, tile in self._iter_items(other):
|
|
141
|
+
if codepoint not in self:
|
|
142
|
+
self[codepoint] = tile
|
|
143
|
+
return self
|
|
144
|
+
|
|
145
|
+
def __or__(
|
|
146
|
+
self,
|
|
147
|
+
other: Iterable[tuple[int, ArrayLike | NDArray[np.uint8]]] | Mapping[int, ArrayLike | NDArray[np.uint8]],
|
|
148
|
+
/,
|
|
149
|
+
) -> Self:
|
|
150
|
+
"""Combine tiles with this tileset, prefers keeping existing tiles instead of replacing them.
|
|
151
|
+
|
|
152
|
+
.. versionadded:: 20.1
|
|
153
|
+
"""
|
|
154
|
+
clone = copy.copy(self)
|
|
155
|
+
clone |= other
|
|
156
|
+
return clone
|
|
157
|
+
|
|
158
|
+
def __contains__(self, codepoint: object, /) -> bool:
|
|
84
159
|
"""Test if a tileset has a codepoint with ``n in tileset``."""
|
|
85
|
-
|
|
160
|
+
if not isinstance(codepoint, SupportsInt):
|
|
161
|
+
return False
|
|
162
|
+
codepoint = int(codepoint)
|
|
163
|
+
if not 0 <= codepoint < self._tileset_p.character_map_length:
|
|
164
|
+
return False
|
|
165
|
+
return bool(self._get_character_map()[int(codepoint)] > 0)
|
|
86
166
|
|
|
87
|
-
def
|
|
88
|
-
"""Return
|
|
167
|
+
def __getitem__(self, codepoint: int, /) -> NDArray[np.uint8]:
|
|
168
|
+
"""Return the RGBA tile data for the given codepoint.
|
|
89
169
|
|
|
90
|
-
|
|
170
|
+
The tile will have a shape of (height, width, rgba) and a dtype of uint8.
|
|
171
|
+
Note that most grey-scale tilesets will only use the alpha channel with a solid white color channel.
|
|
91
172
|
|
|
92
|
-
|
|
93
|
-
uint8. Note that most grey-scale tiles will only use the alpha
|
|
94
|
-
channel and will usually have a solid white color channel.
|
|
173
|
+
.. versionadded:: 20.1
|
|
95
174
|
"""
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
175
|
+
if codepoint not in self:
|
|
176
|
+
raise KeyError(codepoint)
|
|
177
|
+
tile_p = lib.TCOD_tileset_get_tile(self._tileset_p, codepoint)
|
|
178
|
+
return np.frombuffer(ffi.buffer(tile_p[0 : self.tile_shape[0] * self.tile_shape[1]]), dtype=np.uint8).reshape(
|
|
179
|
+
*self.tile_shape, 4, copy=True
|
|
101
180
|
)
|
|
102
|
-
return tile
|
|
103
181
|
|
|
104
|
-
def
|
|
182
|
+
def __setitem__(self, codepoint: int, tile: ArrayLike | NDArray[np.uint8], /) -> None:
|
|
105
183
|
"""Upload a tile into this array.
|
|
106
184
|
|
|
107
185
|
Args:
|
|
@@ -127,14 +205,14 @@ class Tileset:
|
|
|
127
205
|
# Normal usage when a tile already has its own alpha channel.
|
|
128
206
|
# The loaded tile must be the correct shape for the tileset you assign it to.
|
|
129
207
|
# The tile is assigned to a private use area and will not conflict with any exiting codepoint.
|
|
130
|
-
tileset
|
|
208
|
+
tileset[0x100000] = imageio.imread("rgba_tile.png")
|
|
131
209
|
|
|
132
210
|
# Load a greyscale tile.
|
|
133
|
-
tileset
|
|
211
|
+
tileset[0x100001] = imageio.imread("greyscale_tile.png", mode="L")
|
|
134
212
|
# If you are stuck with an RGB array then you can use the red channel as the input: `rgb[:, :, 0]`
|
|
135
213
|
|
|
136
214
|
# Loads an RGB sprite without a background.
|
|
137
|
-
tileset
|
|
215
|
+
tileset[0x100002] = imageio.imread("rgb_no_background.png", mode="RGBA")
|
|
138
216
|
# If you're stuck with an RGB array then you can pad the channel axis with an alpha of 255:
|
|
139
217
|
# rgba = np.pad(rgb, pad_width=((0, 0), (0, 0), (0, 1)), constant_values=255)
|
|
140
218
|
|
|
@@ -147,8 +225,9 @@ class Tileset:
|
|
|
147
225
|
sprite_alpha = sprite_mask.astype(np.uint8) * 255
|
|
148
226
|
# Combine the RGB and alpha arrays into an RGBA array.
|
|
149
227
|
sprite_rgba = np.append(sprite_rgb, sprite_alpha, axis=2)
|
|
150
|
-
tileset
|
|
228
|
+
tileset[0x100003] = sprite_rgba
|
|
151
229
|
|
|
230
|
+
.. versionadded:: 20.1
|
|
152
231
|
"""
|
|
153
232
|
tile = np.ascontiguousarray(tile, dtype=np.uint8)
|
|
154
233
|
if tile.shape == self.tile_shape:
|
|
@@ -173,11 +252,71 @@ class Tileset:
|
|
|
173
252
|
)
|
|
174
253
|
return None
|
|
175
254
|
|
|
255
|
+
def _get_character_map(self) -> NDArray[np.intc]:
|
|
256
|
+
"""Return the internal character mapping as an array.
|
|
257
|
+
|
|
258
|
+
This reference will break if the tileset is modified.
|
|
259
|
+
"""
|
|
260
|
+
return np.frombuffer(
|
|
261
|
+
ffi.buffer(self._tileset_p.character_map[0 : self._tileset_p.character_map_length]), dtype=np.intc
|
|
262
|
+
)
|
|
263
|
+
|
|
264
|
+
def __delitem__(self, codepoint: int, /) -> None:
|
|
265
|
+
"""Unmap a `codepoint` from this tileset.
|
|
266
|
+
|
|
267
|
+
Tilesets are optimized for set-and-forget, deleting a tile may not free up memory.
|
|
268
|
+
|
|
269
|
+
.. versionadded:: 20.1
|
|
270
|
+
"""
|
|
271
|
+
if codepoint not in self:
|
|
272
|
+
raise KeyError(codepoint)
|
|
273
|
+
self._get_character_map()[codepoint] = 0
|
|
274
|
+
|
|
275
|
+
def __len__(self) -> int:
|
|
276
|
+
"""Return the total count of codepoints assigned in this tileset.
|
|
277
|
+
|
|
278
|
+
.. versionadded:: 20.1
|
|
279
|
+
"""
|
|
280
|
+
return int((self._get_character_map() > 0).sum())
|
|
281
|
+
|
|
282
|
+
def __iter__(self) -> Iterator[int]:
|
|
283
|
+
"""Iterate over the assigned codepoints of this tileset.
|
|
284
|
+
|
|
285
|
+
.. versionadded:: 20.1
|
|
286
|
+
"""
|
|
287
|
+
# tolist makes a copy, otherwise the reference to character_map can dangle during iteration
|
|
288
|
+
for i, v in enumerate(self._get_character_map().tolist()):
|
|
289
|
+
if v:
|
|
290
|
+
yield i
|
|
291
|
+
|
|
292
|
+
def get_tile(self, codepoint: int) -> NDArray[np.uint8]:
|
|
293
|
+
"""Return a copy of a tile for the given codepoint.
|
|
294
|
+
|
|
295
|
+
If the tile does not exist then a blank zero array will be returned.
|
|
296
|
+
|
|
297
|
+
The tile will have a shape of (height, width, rgba) and a dtype of
|
|
298
|
+
uint8. Note that most grey-scale tiles will only use the alpha
|
|
299
|
+
channel and will usually have a solid white color channel.
|
|
300
|
+
"""
|
|
301
|
+
try:
|
|
302
|
+
return self[codepoint]
|
|
303
|
+
except KeyError:
|
|
304
|
+
return np.zeros((*self.tile_shape, 4), dtype=np.uint8)
|
|
305
|
+
|
|
306
|
+
@deprecated("Assign to a tile using 'tileset[codepoint] = tile' instead.")
|
|
307
|
+
def set_tile(self, codepoint: int, tile: ArrayLike | NDArray[np.uint8]) -> None:
|
|
308
|
+
"""Upload a tile into this array.
|
|
309
|
+
|
|
310
|
+
.. deprecated:: 20.1
|
|
311
|
+
Was replaced with :any:`Tileset.__setitem__`.
|
|
312
|
+
Use ``tileset[codepoint] = tile`` syntax instead of this method.
|
|
313
|
+
"""
|
|
314
|
+
self[codepoint] = tile
|
|
315
|
+
|
|
176
316
|
def render(self, console: tcod.console.Console) -> NDArray[np.uint8]:
|
|
177
317
|
"""Render an RGBA array, using console with this tileset.
|
|
178
318
|
|
|
179
|
-
`console` is the Console object to render, this can not be the root
|
|
180
|
-
console.
|
|
319
|
+
`console` is the Console object to render, this can not be the root console.
|
|
181
320
|
|
|
182
321
|
The output array will be a np.uint8 array with the shape of:
|
|
183
322
|
``(con_height * tile_height, con_width * tile_width, 4)``.
|
|
@@ -222,8 +361,8 @@ class Tileset:
|
|
|
222
361
|
Large values of `x` will wrap to the next row, so using `x` by itself
|
|
223
362
|
is equivalent to `Tile Index` in the :any:`charmap-reference`.
|
|
224
363
|
|
|
225
|
-
This is
|
|
226
|
-
creation
|
|
364
|
+
This is typically used on tilesets loaded with :any:`load_tilesheet`.
|
|
365
|
+
Other methods of Tileset creation will not have reliable tile indexes.
|
|
227
366
|
|
|
228
367
|
.. versionadded:: 11.12
|
|
229
368
|
"""
|
|
@@ -379,11 +518,23 @@ def load_tilesheet(path: str | PathLike[str], columns: int, rows: int, charmap:
|
|
|
379
518
|
return Tileset._claim(cdata)
|
|
380
519
|
|
|
381
520
|
|
|
382
|
-
|
|
383
|
-
|
|
521
|
+
@overload
|
|
522
|
+
@deprecated(
|
|
523
|
+
"Prefer assigning tiles using dictionary semantics:\n"
|
|
524
|
+
"'tileset += tcod.tileset.procedural_block_elements(shape=tileset.tile_shape)'"
|
|
525
|
+
)
|
|
526
|
+
def procedural_block_elements(*, tileset: Tileset) -> Tileset: ...
|
|
527
|
+
@overload
|
|
528
|
+
def procedural_block_elements(*, shape: tuple[int, int]) -> Tileset: ...
|
|
529
|
+
|
|
530
|
+
|
|
531
|
+
def procedural_block_elements(*, tileset: Tileset | None = None, shape: tuple[int, int] | None = None) -> Tileset:
|
|
532
|
+
"""Generate and return a :any:`Tileset` with procedurally generated block elements.
|
|
384
533
|
|
|
385
534
|
Args:
|
|
386
|
-
tileset
|
|
535
|
+
tileset: A :any:`Tileset` with tiles of any shape. The codepoints of this tileset will be overwritten.
|
|
536
|
+
This parameter is deprecated and only shape `should` be used.
|
|
537
|
+
shape: The ``(height, width)`` tile size to generate.
|
|
387
538
|
|
|
388
539
|
This will overwrite all of the codepoints `listed here <https://en.wikipedia.org/wiki/Block_Elements>`_
|
|
389
540
|
except for the shade glyphs.
|
|
@@ -393,11 +544,15 @@ def procedural_block_elements(*, tileset: Tileset) -> None:
|
|
|
393
544
|
|
|
394
545
|
.. versionadded:: 13.1
|
|
395
546
|
|
|
547
|
+
.. versionchanged:: 20.1
|
|
548
|
+
Added `shape` parameter, now returns a `Tileset`.
|
|
549
|
+
`tileset` parameter is deprecated.
|
|
550
|
+
|
|
396
551
|
Example::
|
|
397
552
|
|
|
398
553
|
>>> import tcod.tileset
|
|
399
554
|
>>> tileset = tcod.tileset.Tileset(8, 8)
|
|
400
|
-
>>> tcod.tileset.procedural_block_elements(
|
|
555
|
+
>>> tileset += tcod.tileset.procedural_block_elements(shape=tileset.tile_shape)
|
|
401
556
|
>>> tileset.get_tile(0x259E)[:, :, 3] # "▞" Quadrant upper right and lower left.
|
|
402
557
|
array([[ 0, 0, 0, 0, 255, 255, 255, 255],
|
|
403
558
|
[ 0, 0, 0, 0, 255, 255, 255, 255],
|
|
@@ -426,6 +581,9 @@ def procedural_block_elements(*, tileset: Tileset) -> None:
|
|
|
426
581
|
[255, 255, 255, 0, 0, 0, 0, 0],
|
|
427
582
|
[255, 255, 255, 0, 0, 0, 0, 0]], dtype=uint8)
|
|
428
583
|
"""
|
|
584
|
+
if tileset is None:
|
|
585
|
+
assert shape is not None
|
|
586
|
+
tileset = Tileset(shape[1], shape[0])
|
|
429
587
|
quadrants: NDArray[np.uint8] = np.zeros(tileset.tile_shape, dtype=np.uint8)
|
|
430
588
|
half_height = tileset.tile_height // 2
|
|
431
589
|
half_width = tileset.tile_width // 2
|
|
@@ -453,7 +611,7 @@ def procedural_block_elements(*, tileset: Tileset) -> None:
|
|
|
453
611
|
):
|
|
454
612
|
alpha: NDArray[np.uint8] = np.asarray((quadrants & quad_mask) != 0, dtype=np.uint8)
|
|
455
613
|
alpha *= 255
|
|
456
|
-
tileset
|
|
614
|
+
tileset[codepoint] = alpha
|
|
457
615
|
|
|
458
616
|
for codepoint, axis, fraction, negative in (
|
|
459
617
|
(0x2581, 0, 7, True), # "▁" Lower one eighth block.
|
|
@@ -477,7 +635,8 @@ def procedural_block_elements(*, tileset: Tileset) -> None:
|
|
|
477
635
|
indexes[axis] = slice(divide, None) if negative else slice(None, divide)
|
|
478
636
|
alpha = np.zeros(tileset.tile_shape, dtype=np.uint8)
|
|
479
637
|
alpha[tuple(indexes)] = 255
|
|
480
|
-
tileset
|
|
638
|
+
tileset[codepoint] = alpha
|
|
639
|
+
return tileset
|
|
481
640
|
|
|
482
641
|
|
|
483
642
|
CHARMAP_CP437 = [
|
|
@@ -28,7 +28,7 @@ version_tuple: VERSION_TUPLE
|
|
|
28
28
|
commit_id: COMMIT_ID
|
|
29
29
|
__commit_id__: COMMIT_ID
|
|
30
30
|
|
|
31
|
-
__version__ = version = '20.
|
|
32
|
-
__version_tuple__ = version_tuple = (20,
|
|
31
|
+
__version__ = version = '20.1.0'
|
|
32
|
+
__version_tuple__ = version_tuple = (20, 1, 0)
|
|
33
33
|
|
|
34
|
-
__commit_id__ = commit_id = '
|
|
34
|
+
__commit_id__ = commit_id = 'g22d80553b'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: tcod
|
|
3
|
-
Version: 20.
|
|
3
|
+
Version: 20.1.0
|
|
4
4
|
Summary: The official Python port of libtcod.
|
|
5
5
|
Author-email: Kyle Benesch <4b796c65+tcod@gmail.com>
|
|
6
6
|
License-Expression: BSD-2-Clause
|
|
@@ -23,6 +23,7 @@ Classifier: Natural Language :: English
|
|
|
23
23
|
Classifier: Operating System :: POSIX
|
|
24
24
|
Classifier: Operating System :: MacOS :: MacOS X
|
|
25
25
|
Classifier: Operating System :: Microsoft :: Windows
|
|
26
|
+
Classifier: Programming Language :: C
|
|
26
27
|
Classifier: Programming Language :: Python :: 3
|
|
27
28
|
Classifier: Programming Language :: Python :: Free Threading :: 2 - Beta
|
|
28
29
|
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|