tcod 16.2.3__tar.gz → 17.0.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-16.2.3 → tcod-17.0.0}/CHANGELOG.md +15 -0
- {tcod-16.2.3 → tcod-17.0.0}/PKG-INFO +5 -3
- {tcod-16.2.3 → tcod-17.0.0}/build_libtcod.py +4 -3
- {tcod-16.2.3 → tcod-17.0.0}/build_sdl.py +4 -1
- {tcod-16.2.3 → tcod-17.0.0}/pyproject.toml +13 -15
- {tcod-16.2.3 → tcod-17.0.0}/tcod/_internal.py +13 -17
- {tcod-16.2.3 → tcod-17.0.0}/tcod/bsp.py +5 -4
- {tcod-16.2.3 → tcod-17.0.0}/tcod/cffi.py +2 -2
- {tcod-16.2.3 → tcod-17.0.0}/tcod/color.py +7 -7
- {tcod-16.2.3 → tcod-17.0.0}/tcod/console.py +62 -28
- {tcod-16.2.3 → tcod-17.0.0}/tcod/constants.py +1 -1
- {tcod-16.2.3 → tcod-17.0.0}/tcod/context.py +21 -20
- {tcod-16.2.3 → tcod-17.0.0}/tcod/event.py +55 -66
- {tcod-16.2.3 → tcod-17.0.0}/tcod/event_constants.py +1 -18
- {tcod-16.2.3 → tcod-17.0.0}/tcod/image.py +3 -3
- {tcod-16.2.3 → tcod-17.0.0}/tcod/libtcodpy.py +81 -86
- {tcod-16.2.3 → tcod-17.0.0}/tcod/map.py +5 -3
- {tcod-16.2.3 → tcod-17.0.0}/tcod/noise.py +2 -1
- {tcod-16.2.3 → tcod-17.0.0}/tcod/path.py +8 -6
- {tcod-16.2.3 → tcod-17.0.0}/tcod/random.py +4 -3
- {tcod-16.2.3 → tcod-17.0.0}/tcod/render.py +2 -0
- {tcod-16.2.3 → tcod-17.0.0}/tcod/sdl/render.py +31 -33
- {tcod-16.2.3 → tcod-17.0.0}/tcod/tileset.py +31 -7
- {tcod-16.2.3 → tcod-17.0.0}/tcod/version.py +9 -4
- {tcod-16.2.3 → tcod-17.0.0}/tcod.egg-info/PKG-INFO +5 -3
- {tcod-16.2.3 → tcod-17.0.0}/tcod.egg-info/requires.txt +1 -1
- {tcod-16.2.3 → tcod-17.0.0}/CONTRIBUTING.md +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/LICENSE.txt +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/MANIFEST.in +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/README.rst +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/CHANGELOG.md +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/CMakeLists.txt +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/CONTRIBUTING.md +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/LIBTCOD-CREDITS.txt +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/LICENSE.txt +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/README.md +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/libtcod/bresenham.h +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/libtcod/bresenham_c.c +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/libtcod/bsp.h +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/libtcod/bsp_c.c +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/libtcod/color.c +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/libtcod/color.h +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/libtcod/config.h +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/libtcod/console.c +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/libtcod/console.h +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/libtcod/console_drawing.c +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/libtcod/console_drawing.h +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/libtcod/console_etc.c +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/libtcod/console_etc.h +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/libtcod/console_init.c +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/libtcod/console_init.h +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/libtcod/console_printing.c +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/libtcod/console_printing.h +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/libtcod/console_rexpaint.c +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/libtcod/console_rexpaint.h +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/libtcod/console_types.h +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/libtcod/context.c +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/libtcod/context.h +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/libtcod/context_init.c +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/libtcod/context_init.h +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/libtcod/context_viewport.c +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/libtcod/context_viewport.h +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/libtcod/error.c +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/libtcod/error.h +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/libtcod/fov.h +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/libtcod/fov_c.c +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/libtcod/fov_circular_raycasting.c +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/libtcod/fov_diamond_raycasting.c +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/libtcod/fov_permissive2.c +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/libtcod/fov_recursive_shadowcasting.c +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/libtcod/fov_restrictive.c +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/libtcod/fov_symmetric_shadowcast.c +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/libtcod/fov_types.h +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/libtcod/globals.c +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/libtcod/globals.h +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/libtcod/heapq.c +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/libtcod/heapq.h +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/libtcod/heightmap.h +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/libtcod/heightmap_c.c +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/libtcod/image.h +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/libtcod/image_c.c +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/libtcod/lex.h +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/libtcod/lex_c.c +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/libtcod/libtcod.h +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/libtcod/libtcod_int.h +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/libtcod/list.h +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/libtcod/list_c.c +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/libtcod/logging.c +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/libtcod/logging.h +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/libtcod/mersenne.h +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/libtcod/mersenne_c.c +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/libtcod/mersenne_types.h +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/libtcod/mouse.h +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/libtcod/mouse_types.h +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/libtcod/namegen.h +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/libtcod/namegen_c.c +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/libtcod/noise.h +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/libtcod/noise_c.c +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/libtcod/noise_defaults.h +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/libtcod/parser.h +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/libtcod/parser_c.c +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/libtcod/path.h +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/libtcod/path_c.c +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/libtcod/pathfinder.c +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/libtcod/pathfinder.h +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/libtcod/pathfinder_frontier.c +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/libtcod/pathfinder_frontier.h +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/libtcod/portability.h +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/libtcod/random.c +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/libtcod/random.h +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/libtcod/renderer_sdl2.c +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/libtcod/renderer_sdl2.h +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/libtcod/renderer_xterm.c +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/libtcod/renderer_xterm.h +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/libtcod/sdl2/console_grid.glslf +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/libtcod/sdl2/console_grid.glslv +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/libtcod/sdl2/event.h +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/libtcod/sys.h +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/libtcod/sys_c.c +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/libtcod/sys_sdl_c.c +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/libtcod/sys_sdl_img_bmp.c +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/libtcod/sys_sdl_img_png.c +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/libtcod/tileset.c +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/libtcod/tileset.h +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/libtcod/tileset_bdf.c +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/libtcod/tileset_bdf.h +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/libtcod/tileset_fallback.c +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/libtcod/tileset_fallback.h +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/libtcod/tileset_render.c +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/libtcod/tileset_render.h +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/libtcod/tileset_truetype.c +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/libtcod/tileset_truetype.h +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/libtcod/timer.h +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/libtcod/tree.h +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/libtcod/tree_c.c +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/libtcod/txtfield.h +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/libtcod/txtfield_c.c +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/libtcod/utility.h +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/libtcod/version.h +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/libtcod/wrappers.c +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/libtcod/wrappers.h +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/libtcod/zip.h +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/libtcod/zip_c.c +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/libtcod.h +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/libtcod_c.c +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/vendor/khrplatform.h +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/vendor/lodepng.c +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/vendor/lodepng.h +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/vendor/stb.c +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/vendor/stb_ds.h +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/vendor/stb_truetype.h +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/vendor/utf8proc/utf8proc.c +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/vendor/utf8proc/utf8proc.h +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/vendor/utf8proc/utf8proc_data.c +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/vendor/zlib/adler32.c +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/vendor/zlib/compress.c +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/vendor/zlib/crc32.c +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/vendor/zlib/crc32.h +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/vendor/zlib/deflate.c +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/vendor/zlib/deflate.h +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/vendor/zlib/gzclose.c +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/vendor/zlib/gzguts.h +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/vendor/zlib/gzlib.c +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/vendor/zlib/gzread.c +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/vendor/zlib/gzwrite.c +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/vendor/zlib/infback.c +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/vendor/zlib/inffast.c +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/vendor/zlib/inffast.h +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/vendor/zlib/inffixed.h +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/vendor/zlib/inflate.c +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/vendor/zlib/inflate.h +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/vendor/zlib/inftrees.c +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/vendor/zlib/inftrees.h +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/vendor/zlib/trees.c +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/vendor/zlib/trees.h +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/vendor/zlib/uncompr.c +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/vendor/zlib/zconf.h +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/vendor/zlib/zlib.h +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/vendor/zlib/zutil.c +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcod/src/vendor/zlib/zutil.h +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/libtcodpy.py +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/requirements.txt +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/setup.cfg +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/setup.py +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/tcod/__init__.py +5 -5
- {tcod-16.2.3 → tcod-17.0.0}/tcod/__pyinstaller/__init__.py +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/tcod/__pyinstaller/hook-tcod.py +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/tcod/cdef.h +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/tcod/cffi.h +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/tcod/los.py +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/tcod/noise.c +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/tcod/noise.h +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/tcod/path.c +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/tcod/path.h +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/tcod/py.typed +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/tcod/random.h +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/tcod/sdl/__init__.py +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/tcod/sdl/_internal.py +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/tcod/sdl/audio.py +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/tcod/sdl/joystick.py +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/tcod/sdl/mouse.py +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/tcod/sdl/sys.py +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/tcod/sdl/video.py +2 -2
- {tcod-16.2.3 → tcod-17.0.0}/tcod/tcod.c +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/tcod/tcod.h +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/tcod/tcod.py +1 -1
- {tcod-16.2.3 → tcod-17.0.0}/tcod/tdl.c +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/tcod/tdl.h +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/tcod.egg-info/SOURCES.txt +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/tcod.egg-info/dependency_links.txt +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/tcod.egg-info/entry_points.txt +0 -0
- {tcod-16.2.3 → tcod-17.0.0}/tcod.egg-info/top_level.txt +0 -0
- {tcod-16.2.3 → tcod-17.0.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
|
+
## [17.0.0] - 2025-03-28
|
|
10
|
+
|
|
11
|
+
### Changed
|
|
12
|
+
|
|
13
|
+
- `EventDispatch`'s on event methods are now defined as positional parameters, so renaming the `event` parameter is now valid in subclasses.
|
|
14
|
+
|
|
15
|
+
### Deprecated
|
|
16
|
+
|
|
17
|
+
- Keyboard bitmask modifiers `tcod.event.KMOD_*` have been replaced by `tcod.event.Modifier`.
|
|
18
|
+
|
|
19
|
+
### Fixed
|
|
20
|
+
|
|
21
|
+
- Suppressed internal `mouse.tile_motion` deprecation warning.
|
|
22
|
+
- Fixed SDL renderer primitive drawing methods. #159
|
|
23
|
+
|
|
9
24
|
## [16.2.3] - 2024-07-16
|
|
10
25
|
|
|
11
26
|
### Fixed
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: tcod
|
|
3
|
-
Version:
|
|
3
|
+
Version: 17.0.0
|
|
4
4
|
Summary: The official Python port of libtcod.
|
|
5
5
|
Author-email: Kyle Benesch <4b796c65+tcod@gmail.com>
|
|
6
6
|
License: Simplified BSD License
|
|
@@ -41,7 +41,9 @@ Description-Content-Type: text/x-rst
|
|
|
41
41
|
License-File: LICENSE.txt
|
|
42
42
|
Requires-Dist: cffi>=1.15
|
|
43
43
|
Requires-Dist: numpy>=1.21.4; implementation_name != "pypy"
|
|
44
|
-
Requires-Dist: typing_extensions
|
|
44
|
+
Requires-Dist: typing_extensions>=4.12.2
|
|
45
|
+
Dynamic: license-file
|
|
46
|
+
Dynamic: platform
|
|
45
47
|
|
|
46
48
|
.. contents::
|
|
47
49
|
:backlinks: top
|
|
@@ -233,6 +233,7 @@ CONSTANT_MODULE_HEADER = '''"""Constants from the libtcod C API.
|
|
|
233
233
|
|
|
234
234
|
This module is auto-generated by `build_libtcod.py`.
|
|
235
235
|
"""
|
|
236
|
+
|
|
236
237
|
from tcod.color import Color
|
|
237
238
|
|
|
238
239
|
'''
|
|
@@ -366,7 +367,7 @@ def write_library_constants() -> None:
|
|
|
366
367
|
f.write(f"{name[5:]} = {color!r}\n")
|
|
367
368
|
|
|
368
369
|
all_names_merged = ",\n ".join(f'"{name}"' for name in all_names)
|
|
369
|
-
f.write(f"\n__all__ = [\n {all_names_merged},\n]\n")
|
|
370
|
+
f.write(f"\n__all__ = [ # noqa: RUF022\n {all_names_merged},\n]\n")
|
|
370
371
|
update_module_all(Path("tcod/libtcodpy.py"), all_names_merged)
|
|
371
372
|
|
|
372
373
|
with Path("tcod/event_constants.py").open("w", encoding="utf-8") as f:
|
|
@@ -379,12 +380,12 @@ def write_library_constants() -> None:
|
|
|
379
380
|
f.write(f"""{parse_sdl_attrs("SDLK", None)[0]}\n""")
|
|
380
381
|
|
|
381
382
|
f.write("\n# --- SDL keyboard modifiers ---\n")
|
|
382
|
-
f.write("{}\n_REVERSE_MOD_TABLE = {}\n".format(*parse_sdl_attrs("KMOD",
|
|
383
|
+
f.write("{}\n_REVERSE_MOD_TABLE = {}\n".format(*parse_sdl_attrs("KMOD", None)))
|
|
383
384
|
|
|
384
385
|
f.write("\n# --- SDL wheel ---\n")
|
|
385
386
|
f.write("{}\n_REVERSE_WHEEL_TABLE = {}\n".format(*parse_sdl_attrs("SDL_MOUSEWHEEL", all_names)))
|
|
386
387
|
all_names_merged = ",\n ".join(f'"{name}"' for name in all_names)
|
|
387
|
-
f.write(f"\n__all__ = [\n {all_names_merged},\n]\n")
|
|
388
|
+
f.write(f"\n__all__ = [ # noqa: RUF022\n {all_names_merged},\n]\n")
|
|
388
389
|
|
|
389
390
|
event_py = Path("tcod/event.py").read_text(encoding="utf-8")
|
|
390
391
|
|
|
@@ -33,7 +33,7 @@ SDL2_BUNDLE_VERSION = os.environ.get("SDL_VERSION", "2.28.1")
|
|
|
33
33
|
# Used to remove excessive newlines in debug outputs.
|
|
34
34
|
RE_NEWLINES = re.compile(r"\n\n+")
|
|
35
35
|
# Functions using va_list need to be culled.
|
|
36
|
-
RE_VAFUNC = re.compile(r"^.*?\([^()]*va_list[^()]*\)
|
|
36
|
+
RE_VAFUNC = re.compile(r"^.*?\([^()]*va_list[^()]*\)\s*;\s*$", re.MULTILINE)
|
|
37
37
|
# Static inline functions need to be culled.
|
|
38
38
|
RE_INLINE = re.compile(r"^static inline.*?^}$", re.MULTILINE | re.DOTALL)
|
|
39
39
|
# Most SDL_PIXELFORMAT names need their values scrubbed.
|
|
@@ -60,6 +60,9 @@ IGNORE_DEFINES = frozenset(
|
|
|
60
60
|
"SDL_INLINE",
|
|
61
61
|
"SDL_FORCE_INLINE",
|
|
62
62
|
"SDL_FALLTHROUGH",
|
|
63
|
+
"SDL_HAS_FALLTHROUGH",
|
|
64
|
+
"SDL_NO_THREAD_SAFETY_ANALYSIS",
|
|
65
|
+
"SDL_SCOPED_CAPABILITY",
|
|
63
66
|
# Might show up in parsing and not in source.
|
|
64
67
|
"SDL_ANDROID_EXTERNAL_STORAGE_READ",
|
|
65
68
|
"SDL_ANDROID_EXTERNAL_STORAGE_WRITE",
|
|
@@ -23,7 +23,7 @@ license = { text = "Simplified BSD License" }
|
|
|
23
23
|
dependencies = [
|
|
24
24
|
"cffi>=1.15",
|
|
25
25
|
'numpy>=1.21.4; implementation_name != "pypy"',
|
|
26
|
-
"typing_extensions",
|
|
26
|
+
"typing_extensions>=4.12.2",
|
|
27
27
|
]
|
|
28
28
|
keywords = [
|
|
29
29
|
"roguelike",
|
|
@@ -178,20 +178,18 @@ select = [
|
|
|
178
178
|
"D", # pydocstyle
|
|
179
179
|
]
|
|
180
180
|
ignore = [
|
|
181
|
-
"E501",
|
|
182
|
-
"S101",
|
|
183
|
-
"S301",
|
|
184
|
-
"S311",
|
|
185
|
-
"
|
|
186
|
-
"
|
|
187
|
-
"
|
|
188
|
-
"
|
|
189
|
-
"
|
|
190
|
-
"
|
|
191
|
-
"
|
|
192
|
-
"
|
|
193
|
-
"D206", # indent-with-spaces
|
|
194
|
-
"W191", # tab-indentation
|
|
181
|
+
"E501", # line-too-long
|
|
182
|
+
"S101", # assert
|
|
183
|
+
"S301", # suspicious-pickle-usage
|
|
184
|
+
"S311", # suspicious-non-cryptographic-random-usage
|
|
185
|
+
"D203", # one-blank-line-before-class
|
|
186
|
+
"D204", # one-blank-line-after-class
|
|
187
|
+
"D213", # multi-line-summary-second-line
|
|
188
|
+
"D407", # dashed-underline-after-section
|
|
189
|
+
"D408", # section-underline-after-name
|
|
190
|
+
"D409", # section-underline-matches-section-length
|
|
191
|
+
"D206", # indent-with-spaces
|
|
192
|
+
"W191", # tab-indentation
|
|
195
193
|
]
|
|
196
194
|
|
|
197
195
|
[tool.ruff.lint.pydocstyle] # https://docs.astral.sh/ruff/settings/#lintpydocstyle
|
|
@@ -2,17 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
|
-
import functools
|
|
6
5
|
import locale
|
|
7
6
|
import sys
|
|
8
7
|
import warnings
|
|
9
8
|
from pathlib import Path
|
|
10
9
|
from types import TracebackType
|
|
11
|
-
from typing import TYPE_CHECKING, Any, AnyStr, Callable, NoReturn, SupportsInt, TypeVar
|
|
10
|
+
from typing import TYPE_CHECKING, Any, AnyStr, Callable, NoReturn, SupportsInt, TypeVar
|
|
12
11
|
|
|
13
12
|
import numpy as np
|
|
14
13
|
from numpy.typing import ArrayLike, NDArray
|
|
15
|
-
from typing_extensions import Literal
|
|
14
|
+
from typing_extensions import Literal, LiteralString, deprecated
|
|
16
15
|
|
|
17
16
|
from tcod.cffi import ffi, lib
|
|
18
17
|
|
|
@@ -24,31 +23,28 @@ F = TypeVar("F", bound=FuncType)
|
|
|
24
23
|
T = TypeVar("T")
|
|
25
24
|
|
|
26
25
|
|
|
27
|
-
def
|
|
28
|
-
|
|
26
|
+
def _deprecate_passthrough(
|
|
27
|
+
message: str, /, *, category: type[Warning] = DeprecationWarning, stacklevel: int = 0
|
|
28
|
+
) -> Callable[[F], F]:
|
|
29
|
+
"""Return a decorator which skips wrapping a warning onto functions. This is used for non-debug runs."""
|
|
29
30
|
|
|
30
31
|
def decorator(func: F) -> F:
|
|
31
|
-
|
|
32
|
-
return func
|
|
32
|
+
return func
|
|
33
33
|
|
|
34
|
-
|
|
35
|
-
def wrapper(*args: Any, **kwargs: Any) -> Any: # noqa: ANN401
|
|
36
|
-
warnings.warn(message, category, stacklevel=stacklevel + 2)
|
|
37
|
-
return func(*args, **kwargs)
|
|
34
|
+
return decorator
|
|
38
35
|
|
|
39
|
-
return cast(F, wrapper)
|
|
40
36
|
|
|
41
|
-
|
|
37
|
+
deprecate = deprecated if __debug__ or TYPE_CHECKING else _deprecate_passthrough
|
|
42
38
|
|
|
43
39
|
|
|
44
40
|
def pending_deprecate(
|
|
45
|
-
message:
|
|
41
|
+
message: LiteralString = "This function may be deprecated in the future."
|
|
46
42
|
" Consider raising an issue on GitHub if you need this feature.",
|
|
47
43
|
category: type[Warning] = PendingDeprecationWarning,
|
|
48
44
|
stacklevel: int = 0,
|
|
49
45
|
) -> Callable[[F], F]:
|
|
50
46
|
"""Like deprecate, but the default parameters are filled out for a generic pending deprecation warning."""
|
|
51
|
-
return deprecate(message, category, stacklevel)
|
|
47
|
+
return deprecate(message, category=category, stacklevel=stacklevel)
|
|
52
48
|
|
|
53
49
|
|
|
54
50
|
def verify_order(order: Literal["C", "F"]) -> Literal["C", "F"]:
|
|
@@ -119,7 +115,7 @@ def _unicode(string: AnyStr, stacklevel: int = 2) -> str:
|
|
|
119
115
|
stacklevel=stacklevel + 1,
|
|
120
116
|
)
|
|
121
117
|
return string.decode("latin-1")
|
|
122
|
-
return string
|
|
118
|
+
return str(string)
|
|
123
119
|
|
|
124
120
|
|
|
125
121
|
def _fmt(string: str, stacklevel: int = 2) -> bytes:
|
|
@@ -271,5 +267,5 @@ class TempImage:
|
|
|
271
267
|
def _as_image(image: ArrayLike | tcod.image.Image) -> TempImage | tcod.image.Image:
|
|
272
268
|
"""Convert this input into an Image-like object."""
|
|
273
269
|
if hasattr(image, "image_c"):
|
|
274
|
-
return image
|
|
270
|
+
return image
|
|
275
271
|
return TempImage(image)
|
|
@@ -29,8 +29,9 @@ from __future__ import annotations
|
|
|
29
29
|
|
|
30
30
|
from typing import Any, Iterator
|
|
31
31
|
|
|
32
|
+
from typing_extensions import deprecated
|
|
33
|
+
|
|
32
34
|
import tcod.random
|
|
33
|
-
from tcod._internal import deprecate
|
|
34
35
|
from tcod.cffi import ffi, lib
|
|
35
36
|
|
|
36
37
|
|
|
@@ -72,7 +73,7 @@ class BSP:
|
|
|
72
73
|
self.children: tuple[()] | tuple[BSP, BSP] = ()
|
|
73
74
|
|
|
74
75
|
@property
|
|
75
|
-
@
|
|
76
|
+
@deprecated("This attribute has been renamed to `width`.", category=FutureWarning)
|
|
76
77
|
def w(self) -> int: # noqa: D102
|
|
77
78
|
return self.width
|
|
78
79
|
|
|
@@ -81,7 +82,7 @@ class BSP:
|
|
|
81
82
|
self.width = value
|
|
82
83
|
|
|
83
84
|
@property
|
|
84
|
-
@
|
|
85
|
+
@deprecated("This attribute has been renamed to `height`.", category=FutureWarning)
|
|
85
86
|
def h(self) -> int: # noqa: D102
|
|
86
87
|
return self.height
|
|
87
88
|
|
|
@@ -177,7 +178,7 @@ class BSP:
|
|
|
177
178
|
)
|
|
178
179
|
self._unpack_bsp_tree(cdata)
|
|
179
180
|
|
|
180
|
-
@
|
|
181
|
+
@deprecated("Use pre_order method instead of walk.")
|
|
181
182
|
def walk(self) -> Iterator[BSP]:
|
|
182
183
|
"""Iterate over this BSP's hierarchy in pre order.
|
|
183
184
|
|
|
@@ -59,7 +59,7 @@ if sys.platform == "win32":
|
|
|
59
59
|
|
|
60
60
|
|
|
61
61
|
verify_dependencies()
|
|
62
|
-
from tcod._libtcod import ffi, lib # noqa
|
|
62
|
+
from tcod._libtcod import ffi, lib # noqa: E402
|
|
63
63
|
|
|
64
64
|
__sdl_version__ = get_sdl_version()
|
|
65
65
|
|
|
@@ -76,4 +76,4 @@ def _libtcod_log_watcher(message: Any, userdata: None) -> None: # noqa: ANN401
|
|
|
76
76
|
lib.TCOD_set_log_callback(lib._libtcod_log_watcher, ffi.NULL)
|
|
77
77
|
lib.TCOD_set_log_level(0)
|
|
78
78
|
|
|
79
|
-
__all__ = ["
|
|
79
|
+
__all__ = ["__sdl_version__", "ffi", "lib"]
|
|
@@ -31,7 +31,7 @@ class Color(List[int]):
|
|
|
31
31
|
return int(self[0])
|
|
32
32
|
|
|
33
33
|
@r.setter
|
|
34
|
-
@deprecate("Setting color attributes has been deprecated.", FutureWarning)
|
|
34
|
+
@deprecate("Setting color attributes has been deprecated.", category=FutureWarning)
|
|
35
35
|
def r(self, value: int) -> None:
|
|
36
36
|
self[0] = value & 0xFF
|
|
37
37
|
|
|
@@ -45,7 +45,7 @@ class Color(List[int]):
|
|
|
45
45
|
return int(self[1])
|
|
46
46
|
|
|
47
47
|
@g.setter
|
|
48
|
-
@deprecate("Setting color attributes has been deprecated.", FutureWarning)
|
|
48
|
+
@deprecate("Setting color attributes has been deprecated.", category=FutureWarning)
|
|
49
49
|
def g(self, value: int) -> None:
|
|
50
50
|
self[1] = value & 0xFF
|
|
51
51
|
|
|
@@ -59,7 +59,7 @@ class Color(List[int]):
|
|
|
59
59
|
return int(self[2])
|
|
60
60
|
|
|
61
61
|
@b.setter
|
|
62
|
-
@deprecate("Setting color attributes has been deprecated.", FutureWarning)
|
|
62
|
+
@deprecate("Setting color attributes has been deprecated.", category=FutureWarning)
|
|
63
63
|
def b(self, value: int) -> None:
|
|
64
64
|
self[2] = value & 0xFF
|
|
65
65
|
|
|
@@ -82,7 +82,7 @@ class Color(List[int]):
|
|
|
82
82
|
return super().__getitem__("rgb".index(index))
|
|
83
83
|
return super().__getitem__(index)
|
|
84
84
|
|
|
85
|
-
@deprecate("This class will not be mutable in the future.", FutureWarning)
|
|
85
|
+
@deprecate("This class will not be mutable in the future.", category=FutureWarning)
|
|
86
86
|
def __setitem__(self, index: Any, value: Any) -> None: # noqa: ANN401, D105
|
|
87
87
|
if isinstance(index, str):
|
|
88
88
|
super().__setitem__("rgb".index(index), value)
|
|
@@ -99,7 +99,7 @@ class Color(List[int]):
|
|
|
99
99
|
except TypeError:
|
|
100
100
|
return False
|
|
101
101
|
|
|
102
|
-
@deprecate("Use NumPy instead for color math operations.", FutureWarning)
|
|
102
|
+
@deprecate("Use NumPy instead for color math operations.", category=FutureWarning)
|
|
103
103
|
def __add__(self, other: object) -> Color: # type: ignore[override]
|
|
104
104
|
"""Add two colors together.
|
|
105
105
|
|
|
@@ -108,7 +108,7 @@ class Color(List[int]):
|
|
|
108
108
|
"""
|
|
109
109
|
return Color._new_from_cdata(lib.TCOD_color_add(self, other))
|
|
110
110
|
|
|
111
|
-
@deprecate("Use NumPy instead for color math operations.", FutureWarning)
|
|
111
|
+
@deprecate("Use NumPy instead for color math operations.", category=FutureWarning)
|
|
112
112
|
def __sub__(self, other: object) -> Color:
|
|
113
113
|
"""Subtract one color from another.
|
|
114
114
|
|
|
@@ -117,7 +117,7 @@ class Color(List[int]):
|
|
|
117
117
|
"""
|
|
118
118
|
return Color._new_from_cdata(lib.TCOD_color_subtract(self, other))
|
|
119
119
|
|
|
120
|
-
@deprecate("Use NumPy instead for color math operations.", FutureWarning)
|
|
120
|
+
@deprecate("Use NumPy instead for color math operations.", category=FutureWarning)
|
|
121
121
|
def __mul__(self, other: object) -> Color:
|
|
122
122
|
"""Multiply with a scaler or another color.
|
|
123
123
|
|
|
@@ -14,11 +14,11 @@ from typing import Any, Iterable
|
|
|
14
14
|
|
|
15
15
|
import numpy as np
|
|
16
16
|
from numpy.typing import ArrayLike, NDArray
|
|
17
|
-
from typing_extensions import Literal
|
|
17
|
+
from typing_extensions import Literal, deprecated
|
|
18
18
|
|
|
19
19
|
import tcod._internal
|
|
20
20
|
import tcod.constants
|
|
21
|
-
from tcod._internal import _check, _path_encode
|
|
21
|
+
from tcod._internal import _check, _path_encode
|
|
22
22
|
from tcod.cffi import ffi, lib
|
|
23
23
|
|
|
24
24
|
|
|
@@ -29,7 +29,7 @@ def _fmt(string: str) -> bytes:
|
|
|
29
29
|
|
|
30
30
|
_root_console = None
|
|
31
31
|
|
|
32
|
-
rgba_graphic = np.dtype([("ch", np.intc), ("fg", "4B"), ("bg", "4B")])
|
|
32
|
+
rgba_graphic: np.dtype[Any] = np.dtype([("ch", np.intc), ("fg", "4B"), ("bg", "4B")])
|
|
33
33
|
"""A NumPy :any:`dtype` compatible with :any:`Console.rgba`.
|
|
34
34
|
|
|
35
35
|
This dtype is: ``np.dtype([("ch", np.intc), ("fg", "4B"), ("bg", "4B")])``
|
|
@@ -37,7 +37,7 @@ This dtype is: ``np.dtype([("ch", np.intc), ("fg", "4B"), ("bg", "4B")])``
|
|
|
37
37
|
.. versionadded:: 12.3
|
|
38
38
|
"""
|
|
39
39
|
|
|
40
|
-
rgb_graphic = np.dtype([("ch", np.intc), ("fg", "3B"), ("bg", "3B")])
|
|
40
|
+
rgb_graphic: np.dtype[Any] = np.dtype([("ch", np.intc), ("fg", "3B"), ("bg", "3B")])
|
|
41
41
|
"""A NumPy :any:`dtype` compatible with :any:`Console.rgb`.
|
|
42
42
|
|
|
43
43
|
This dtype is: ``np.dtype([("ch", np.intc), ("fg", "3B"), ("bg", "3B")])``
|
|
@@ -104,7 +104,7 @@ class Console:
|
|
|
104
104
|
DTYPE = rgba_graphic
|
|
105
105
|
|
|
106
106
|
# A structured array type with the added "fg_rgb" and "bg_rgb" fields.
|
|
107
|
-
_DTYPE_RGB = np.dtype(
|
|
107
|
+
_DTYPE_RGB: np.dtype[Any] = np.dtype(
|
|
108
108
|
{
|
|
109
109
|
"names": ["ch", "fg", "bg"],
|
|
110
110
|
"formats": [np.int32, "3u1", "3u1"],
|
|
@@ -120,8 +120,9 @@ class Console:
|
|
|
120
120
|
order: Literal["C", "F"] = "C",
|
|
121
121
|
buffer: NDArray[Any] | None = None,
|
|
122
122
|
) -> None:
|
|
123
|
+
"""Initialize the console."""
|
|
123
124
|
self._key_color: tuple[int, int, int] | None = None
|
|
124
|
-
self._order = tcod._internal.verify_order(order)
|
|
125
|
+
self._order: Literal["C", "F"] = tcod._internal.verify_order(order)
|
|
125
126
|
if buffer is not None:
|
|
126
127
|
if self._order == "F":
|
|
127
128
|
buffer = buffer.transpose()
|
|
@@ -247,7 +248,7 @@ class Console:
|
|
|
247
248
|
return self._tiles["ch"].T if self._order == "F" else self._tiles["ch"]
|
|
248
249
|
|
|
249
250
|
@property
|
|
250
|
-
@
|
|
251
|
+
@deprecated("This attribute has been renamed to `rgba`.", category=FutureWarning)
|
|
251
252
|
def tiles(self) -> NDArray[Any]:
|
|
252
253
|
"""An array of this consoles raw tile data.
|
|
253
254
|
|
|
@@ -263,7 +264,7 @@ class Console:
|
|
|
263
264
|
return self.rgba
|
|
264
265
|
|
|
265
266
|
@property
|
|
266
|
-
@
|
|
267
|
+
@deprecated("This attribute has been renamed to `rgba`.", category=FutureWarning)
|
|
267
268
|
def buffer(self) -> NDArray[Any]:
|
|
268
269
|
"""An array of this consoles raw tile data.
|
|
269
270
|
|
|
@@ -275,7 +276,7 @@ class Console:
|
|
|
275
276
|
return self.rgba
|
|
276
277
|
|
|
277
278
|
@property
|
|
278
|
-
@
|
|
279
|
+
@deprecated("This attribute has been renamed to `rgb`.", category=FutureWarning)
|
|
279
280
|
def tiles_rgb(self) -> NDArray[Any]:
|
|
280
281
|
"""An array of this consoles data without the alpha channel.
|
|
281
282
|
|
|
@@ -287,7 +288,7 @@ class Console:
|
|
|
287
288
|
return self.rgb
|
|
288
289
|
|
|
289
290
|
@property
|
|
290
|
-
@
|
|
291
|
+
@deprecated("This attribute has been renamed to `rgb`.", category=FutureWarning)
|
|
291
292
|
def tiles2(self) -> NDArray[Any]:
|
|
292
293
|
"""This name is deprecated in favour of :any:`rgb`.
|
|
293
294
|
|
|
@@ -344,45 +345,78 @@ class Console:
|
|
|
344
345
|
"""
|
|
345
346
|
return self.rgba.view(self._DTYPE_RGB)
|
|
346
347
|
|
|
347
|
-
|
|
348
|
+
_DEPRECATE_CONSOLE_DEFAULTS_MSG = """Console defaults have been deprecated.
|
|
349
|
+
Consider one of the following:
|
|
350
|
+
|
|
351
|
+
# Set parameters once then pass them as kwargs
|
|
352
|
+
DEFAULT_COLOR = {"bg": (0, 0, 127), "fg": (127, 127, 255)}
|
|
353
|
+
console.print(x, y, string, **DEFAULT_COLOR)
|
|
354
|
+
|
|
355
|
+
# Clear the console to a color and then skip setting colors on printing/drawing
|
|
356
|
+
console.clear(fg=(127, 127, 255), bg=(0, 0, 127))
|
|
357
|
+
console.print(x, y, string, fg=None)
|
|
358
|
+
"""
|
|
359
|
+
|
|
360
|
+
@property # Getters used internally, so only deprecate the setters.
|
|
348
361
|
def default_bg(self) -> tuple[int, int, int]:
|
|
349
|
-
"""Tuple[int, int, int]: The default background color.
|
|
362
|
+
"""Tuple[int, int, int]: The default background color.
|
|
363
|
+
|
|
364
|
+
.. deprecated:: 8.5
|
|
365
|
+
These should not be used. Prefer passing defaults as kwargs.
|
|
366
|
+
|
|
367
|
+
.. code-block::
|
|
368
|
+
|
|
369
|
+
DEFAULT_COLOR = {"bg": (0, 0, 127), "fg": (127, 127, 255)}
|
|
370
|
+
console.print(x, y, string, **DEFAULT_COLOR)
|
|
371
|
+
"""
|
|
350
372
|
color = self._console_data.back
|
|
351
373
|
return color.r, color.g, color.b
|
|
352
374
|
|
|
353
375
|
@default_bg.setter
|
|
354
|
-
@
|
|
376
|
+
@deprecated(_DEPRECATE_CONSOLE_DEFAULTS_MSG, category=FutureWarning)
|
|
355
377
|
def default_bg(self, color: tuple[int, int, int]) -> None:
|
|
356
378
|
self._console_data.back = color
|
|
357
379
|
|
|
358
380
|
@property
|
|
359
381
|
def default_fg(self) -> tuple[int, int, int]:
|
|
360
|
-
"""Tuple[int, int, int]: The default foreground color.
|
|
382
|
+
"""Tuple[int, int, int]: The default foreground color.
|
|
383
|
+
|
|
384
|
+
.. deprecated:: 8.5
|
|
385
|
+
These should not be used. Prefer passing defaults as kwargs.
|
|
386
|
+
"""
|
|
361
387
|
color = self._console_data.fore
|
|
362
388
|
return color.r, color.g, color.b
|
|
363
389
|
|
|
364
390
|
@default_fg.setter
|
|
365
|
-
@
|
|
391
|
+
@deprecated(_DEPRECATE_CONSOLE_DEFAULTS_MSG, category=FutureWarning)
|
|
366
392
|
def default_fg(self, color: tuple[int, int, int]) -> None:
|
|
367
393
|
self._console_data.fore = color
|
|
368
394
|
|
|
369
395
|
@property
|
|
370
396
|
def default_bg_blend(self) -> int:
|
|
371
|
-
"""int: The default blending mode.
|
|
397
|
+
"""int: The default blending mode.
|
|
398
|
+
|
|
399
|
+
.. deprecated:: 8.5
|
|
400
|
+
These should not be used. Prefer passing defaults as kwargs.
|
|
401
|
+
"""
|
|
372
402
|
return self._console_data.bkgnd_flag # type: ignore
|
|
373
403
|
|
|
374
404
|
@default_bg_blend.setter
|
|
375
|
-
@
|
|
405
|
+
@deprecated(_DEPRECATE_CONSOLE_DEFAULTS_MSG, category=FutureWarning)
|
|
376
406
|
def default_bg_blend(self, value: int) -> None:
|
|
377
407
|
self._console_data.bkgnd_flag = value
|
|
378
408
|
|
|
379
409
|
@property
|
|
380
410
|
def default_alignment(self) -> int:
|
|
381
|
-
"""int: The default text alignment.
|
|
411
|
+
"""int: The default text alignment.
|
|
412
|
+
|
|
413
|
+
.. deprecated:: 8.5
|
|
414
|
+
These should not be used. Prefer passing defaults as kwargs.
|
|
415
|
+
"""
|
|
382
416
|
return self._console_data.alignment # type: ignore
|
|
383
417
|
|
|
384
418
|
@default_alignment.setter
|
|
385
|
-
@
|
|
419
|
+
@deprecated(_DEPRECATE_CONSOLE_DEFAULTS_MSG, category=FutureWarning)
|
|
386
420
|
def default_alignment(self, value: int) -> None:
|
|
387
421
|
self._console_data.alignment = value
|
|
388
422
|
|
|
@@ -390,7 +424,7 @@ class Console:
|
|
|
390
424
|
"""Raise a warning for bad default values during calls to clear."""
|
|
391
425
|
warnings.warn(
|
|
392
426
|
f"Clearing with the console default values is deprecated.\nAdd {name}={value!r} to this call.",
|
|
393
|
-
|
|
427
|
+
FutureWarning,
|
|
394
428
|
stacklevel=3,
|
|
395
429
|
)
|
|
396
430
|
|
|
@@ -518,7 +552,7 @@ class Console:
|
|
|
518
552
|
stacklevel=3,
|
|
519
553
|
)
|
|
520
554
|
|
|
521
|
-
def print_(
|
|
555
|
+
def print_(
|
|
522
556
|
self,
|
|
523
557
|
x: int,
|
|
524
558
|
y: int,
|
|
@@ -595,7 +629,7 @@ class Console:
|
|
|
595
629
|
)
|
|
596
630
|
)
|
|
597
631
|
|
|
598
|
-
def get_height_rect(self, x: int, y: int, width: int, height: int, string: str) -> int:
|
|
632
|
+
def get_height_rect(self, x: int, y: int, width: int, height: int, string: str) -> int:
|
|
599
633
|
"""Return the height of this text word-wrapped into this rectangle.
|
|
600
634
|
|
|
601
635
|
Args:
|
|
@@ -736,8 +770,8 @@ class Console:
|
|
|
736
770
|
explicit.
|
|
737
771
|
"""
|
|
738
772
|
self.__deprecate_defaults("draw_frame", bg_blend)
|
|
739
|
-
|
|
740
|
-
_check(lib.TCOD_console_printf_frame(self.console_c, x, y, width, height, clear, bg_blend,
|
|
773
|
+
string_: Any = _fmt(string) if string else ffi.NULL
|
|
774
|
+
_check(lib.TCOD_console_printf_frame(self.console_c, x, y, width, height, clear, bg_blend, string_))
|
|
741
775
|
|
|
742
776
|
def blit( # noqa: PLR0913
|
|
743
777
|
self,
|
|
@@ -829,7 +863,7 @@ class Console:
|
|
|
829
863
|
bg_alpha,
|
|
830
864
|
)
|
|
831
865
|
|
|
832
|
-
@
|
|
866
|
+
@deprecated("Pass the key color to Console.blit instead of calling this function.")
|
|
833
867
|
def set_key_color(self, color: tuple[int, int, int] | None) -> None:
|
|
834
868
|
"""Set a consoles blit transparent color.
|
|
835
869
|
|
|
@@ -921,7 +955,7 @@ class Console:
|
|
|
921
955
|
|
|
922
956
|
def __repr__(self) -> str:
|
|
923
957
|
"""Return a string representation of this console."""
|
|
924
|
-
return "tcod.console.Console(width=%i, height=%i,
|
|
958
|
+
return "tcod.console.Console(width=%i, height=%i, order=%r,buffer=\n%r)" % (
|
|
925
959
|
self.width,
|
|
926
960
|
self.height,
|
|
927
961
|
self._order,
|
|
@@ -930,7 +964,7 @@ class Console:
|
|
|
930
964
|
|
|
931
965
|
def __str__(self) -> str:
|
|
932
966
|
"""Return a simplified representation of this consoles contents."""
|
|
933
|
-
return "
|
|
967
|
+
return "<{}>".format("\n ".join("".join(chr(c) for c in line) for line in self._tiles["ch"]))
|
|
934
968
|
|
|
935
969
|
def print( # noqa: PLR0913
|
|
936
970
|
self,
|
|
@@ -1233,7 +1267,7 @@ def get_height_rect(width: int, string: str) -> int:
|
|
|
1233
1267
|
return int(lib.TCOD_console_get_height_rect_wn(width, len(string_), string_))
|
|
1234
1268
|
|
|
1235
1269
|
|
|
1236
|
-
@
|
|
1270
|
+
@deprecated("This function does not support contexts.", category=FutureWarning)
|
|
1237
1271
|
def recommended_size() -> tuple[int, int]:
|
|
1238
1272
|
"""Return the recommended size of a console for the current active window.
|
|
1239
1273
|
|