tcod 18.0.0__tar.gz → 19.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.
Files changed (218) hide show
  1. {tcod-18.0.0 → tcod-19.0.0}/CHANGELOG.md +56 -0
  2. {tcod-18.0.0 → tcod-19.0.0}/LICENSE.txt +1 -1
  3. {tcod-18.0.0 → tcod-19.0.0}/PKG-INFO +8 -8
  4. {tcod-18.0.0 → tcod-19.0.0}/README.rst +2 -2
  5. {tcod-18.0.0 → tcod-19.0.0}/build_libtcod.py +250 -8
  6. tcod-19.0.0/build_sdl.py +387 -0
  7. {tcod-18.0.0 → tcod-19.0.0}/libtcod/CHANGELOG.md +61 -1
  8. {tcod-18.0.0 → tcod-19.0.0}/libtcod/CMakeLists.txt +11 -1
  9. {tcod-18.0.0 → tcod-19.0.0}/libtcod/CONTRIBUTING.md +2 -2
  10. {tcod-18.0.0 → tcod-19.0.0}/libtcod/LICENSE.txt +1 -1
  11. {tcod-18.0.0 → tcod-19.0.0}/libtcod/README.md +3 -1
  12. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/libtcod/bresenham.h +5 -4
  13. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/libtcod/bresenham_c.c +1 -1
  14. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/libtcod/bsp.h +5 -4
  15. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/libtcod/bsp_c.c +4 -4
  16. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/libtcod/color.c +19 -13
  17. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/libtcod/color.h +5 -4
  18. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/libtcod/config.h +2 -1
  19. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/libtcod/console.c +6 -6
  20. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/libtcod/console.h +7 -1
  21. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/libtcod/console_drawing.c +1 -1
  22. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/libtcod/console_drawing.h +5 -1
  23. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/libtcod/console_etc.c +17 -17
  24. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/libtcod/console_etc.h +2 -1
  25. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/libtcod/console_init.c +6 -7
  26. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/libtcod/console_init.h +2 -1
  27. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/libtcod/console_printing.c +20 -20
  28. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/libtcod/console_printing.h +10 -2
  29. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/libtcod/console_rexpaint.c +19 -19
  30. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/libtcod/console_rexpaint.h +2 -1
  31. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/libtcod/console_types.h +2 -1
  32. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/libtcod/context.c +19 -13
  33. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/libtcod/context.h +6 -4
  34. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/libtcod/context_init.c +10 -11
  35. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/libtcod/context_init.h +2 -1
  36. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/libtcod/context_viewport.c +1 -1
  37. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/libtcod/context_viewport.h +2 -1
  38. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/libtcod/error.c +5 -5
  39. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/libtcod/error.h +2 -1
  40. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/libtcod/fov.h +5 -4
  41. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/libtcod/fov_c.c +7 -7
  42. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/libtcod/fov_circular_raycasting.c +5 -5
  43. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/libtcod/fov_diamond_raycasting.c +4 -4
  44. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/libtcod/fov_permissive2.c +78 -49
  45. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/libtcod/fov_recursive_shadowcasting.c +3 -3
  46. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/libtcod/fov_restrictive.c +9 -9
  47. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/libtcod/fov_symmetric_shadowcast.c +1 -1
  48. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/libtcod/fov_types.h +2 -1
  49. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/libtcod/globals.c +1 -1
  50. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/libtcod/globals.h +2 -1
  51. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/libtcod/heapq.c +1 -1
  52. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/libtcod/heapq.h +2 -1
  53. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/libtcod/heightmap.h +5 -4
  54. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/libtcod/heightmap_c.c +23 -23
  55. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/libtcod/image.h +5 -4
  56. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/libtcod/image_c.c +27 -28
  57. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/libtcod/lex.h +2 -1
  58. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/libtcod/lex_c.c +5 -5
  59. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/libtcod/libtcod.h +2 -1
  60. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/libtcod/libtcod_int.h +2 -1
  61. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/libtcod/list.h +5 -4
  62. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/libtcod/list_c.c +4 -4
  63. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/libtcod/logging.c +6 -9
  64. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/libtcod/logging.h +10 -9
  65. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/libtcod/mersenne.h +5 -4
  66. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/libtcod/mersenne_c.c +14 -14
  67. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/libtcod/mersenne_types.h +5 -4
  68. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/libtcod/mouse.h +5 -4
  69. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/libtcod/mouse_types.h +2 -1
  70. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/libtcod/namegen.h +5 -5
  71. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/libtcod/namegen_c.c +11 -9
  72. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/libtcod/noise.h +5 -4
  73. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/libtcod/noise_c.c +32 -32
  74. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/libtcod/noise_defaults.h +5 -4
  75. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/libtcod/parser.h +5 -4
  76. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/libtcod/parser_c.c +5 -5
  77. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/libtcod/path.h +18 -17
  78. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/libtcod/path_c.c +52 -67
  79. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/libtcod/pathfinder.c +2 -2
  80. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/libtcod/pathfinder.h +2 -1
  81. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/libtcod/pathfinder_frontier.c +2 -2
  82. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/libtcod/pathfinder_frontier.h +2 -1
  83. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/libtcod/portability.h +2 -1
  84. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/libtcod/random.c +1 -1
  85. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/libtcod/random.h +2 -1
  86. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/libtcod/renderer_sdl2.c +106 -122
  87. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/libtcod/renderer_sdl2.h +28 -11
  88. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/libtcod/renderer_xterm.c +60 -65
  89. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/libtcod/renderer_xterm.h +3 -8
  90. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/libtcod/sdl2/event.h +2 -1
  91. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/libtcod/sys.h +9 -8
  92. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/libtcod/sys_c.c +12 -8
  93. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/libtcod/sys_sdl_c.c +110 -137
  94. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/libtcod/sys_sdl_img_bmp.c +3 -3
  95. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/libtcod/sys_sdl_img_png.c +9 -16
  96. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/libtcod/tileset.c +3 -3
  97. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/libtcod/tileset.h +2 -1
  98. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/libtcod/tileset_bdf.c +1 -1
  99. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/libtcod/tileset_bdf.h +2 -1
  100. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/libtcod/tileset_fallback.c +1 -1
  101. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/libtcod/tileset_fallback.h +2 -1
  102. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/libtcod/tileset_render.c +7 -5
  103. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/libtcod/tileset_render.h +2 -1
  104. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/libtcod/tileset_truetype.c +2 -2
  105. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/libtcod/tileset_truetype.h +2 -1
  106. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/libtcod/timer.h +2 -1
  107. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/libtcod/tree.h +5 -4
  108. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/libtcod/tree_c.c +1 -1
  109. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/libtcod/txtfield.h +5 -4
  110. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/libtcod/txtfield_c.c +12 -12
  111. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/libtcod/utility.h +7 -6
  112. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/libtcod/version.h +7 -6
  113. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/libtcod/wrappers.c +1 -1
  114. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/libtcod/wrappers.h +2 -1
  115. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/libtcod/zip.h +5 -4
  116. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/libtcod/zip_c.c +3 -3
  117. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/libtcod.h +2 -1
  118. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/libtcod_c.c +1 -1
  119. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/vendor/stb.c +0 -2
  120. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/vendor/utf8proc/utf8proc_data.c +0 -1
  121. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/vendor/zlib/deflate.c +6 -6
  122. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/vendor/zlib/trees.h +0 -1
  123. {tcod-18.0.0 → tcod-19.0.0}/pyproject.toml +15 -18
  124. {tcod-18.0.0 → tcod-19.0.0}/requirements.txt +1 -1
  125. {tcod-18.0.0 → tcod-19.0.0}/setup.py +17 -11
  126. {tcod-18.0.0 → tcod-19.0.0}/tcod/_internal.py +3 -2
  127. tcod-19.0.0/tcod/_libtcod.pyi +9729 -0
  128. {tcod-18.0.0 → tcod-19.0.0}/tcod/bsp.py +2 -1
  129. {tcod-18.0.0 → tcod-19.0.0}/tcod/cffi.py +12 -16
  130. {tcod-18.0.0 → tcod-19.0.0}/tcod/color.py +3 -3
  131. {tcod-18.0.0 → tcod-19.0.0}/tcod/console.py +33 -5
  132. {tcod-18.0.0 → tcod-19.0.0}/tcod/context.py +14 -17
  133. {tcod-18.0.0 → tcod-19.0.0}/tcod/event.py +185 -157
  134. {tcod-18.0.0 → tcod-19.0.0}/tcod/event_constants.py +112 -90
  135. {tcod-18.0.0 → tcod-19.0.0}/tcod/libtcodpy.py +4 -3
  136. {tcod-18.0.0 → tcod-19.0.0}/tcod/map.py +3 -4
  137. {tcod-18.0.0 → tcod-19.0.0}/tcod/noise.py +13 -8
  138. {tcod-18.0.0 → tcod-19.0.0}/tcod/path.c +2 -2
  139. {tcod-18.0.0 → tcod-19.0.0}/tcod/path.h +9 -9
  140. {tcod-18.0.0 → tcod-19.0.0}/tcod/path.py +175 -22
  141. {tcod-18.0.0 → tcod-19.0.0}/tcod/random.py +2 -1
  142. tcod-19.0.0/tcod/sdl/_internal.py +219 -0
  143. tcod-19.0.0/tcod/sdl/audio.py +1069 -0
  144. tcod-19.0.0/tcod/sdl/constants.py +489 -0
  145. {tcod-18.0.0 → tcod-19.0.0}/tcod/sdl/joystick.py +86 -107
  146. {tcod-18.0.0 → tcod-19.0.0}/tcod/sdl/mouse.py +20 -7
  147. {tcod-18.0.0 → tcod-19.0.0}/tcod/sdl/render.py +105 -115
  148. {tcod-18.0.0 → tcod-19.0.0}/tcod/sdl/sys.py +5 -3
  149. {tcod-18.0.0 → tcod-19.0.0}/tcod/sdl/video.py +82 -44
  150. {tcod-18.0.0 → tcod-19.0.0}/tcod/tcod.c +1 -1
  151. {tcod-18.0.0 → tcod-19.0.0}/tcod/tileset.py +10 -10
  152. {tcod-18.0.0 → tcod-19.0.0}/tcod/version.py +2 -2
  153. {tcod-18.0.0 → tcod-19.0.0}/tcod.egg-info/PKG-INFO +8 -8
  154. {tcod-18.0.0 → tcod-19.0.0}/tcod.egg-info/SOURCES.txt +2 -0
  155. tcod-18.0.0/build_sdl.py +0 -320
  156. tcod-18.0.0/tcod/sdl/_internal.py +0 -126
  157. tcod-18.0.0/tcod/sdl/audio.py +0 -693
  158. {tcod-18.0.0 → tcod-19.0.0}/CONTRIBUTING.md +0 -0
  159. {tcod-18.0.0 → tcod-19.0.0}/MANIFEST.in +0 -0
  160. {tcod-18.0.0 → tcod-19.0.0}/libtcod/LIBTCOD-CREDITS.txt +0 -0
  161. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/libtcod/sdl2/console_grid.glslf +0 -0
  162. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/libtcod/sdl2/console_grid.glslv +0 -0
  163. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/vendor/khrplatform.h +0 -0
  164. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/vendor/lodepng.c +0 -0
  165. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/vendor/lodepng.h +0 -0
  166. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/vendor/stb_ds.h +0 -0
  167. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/vendor/stb_truetype.h +0 -0
  168. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/vendor/utf8proc/utf8proc.c +0 -0
  169. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/vendor/utf8proc/utf8proc.h +0 -0
  170. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/vendor/zlib/adler32.c +0 -0
  171. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/vendor/zlib/compress.c +0 -0
  172. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/vendor/zlib/crc32.c +0 -0
  173. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/vendor/zlib/crc32.h +0 -0
  174. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/vendor/zlib/deflate.h +0 -0
  175. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/vendor/zlib/gzclose.c +0 -0
  176. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/vendor/zlib/gzguts.h +0 -0
  177. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/vendor/zlib/gzlib.c +0 -0
  178. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/vendor/zlib/gzread.c +0 -0
  179. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/vendor/zlib/gzwrite.c +0 -0
  180. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/vendor/zlib/infback.c +0 -0
  181. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/vendor/zlib/inffast.c +0 -0
  182. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/vendor/zlib/inffast.h +0 -0
  183. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/vendor/zlib/inffixed.h +0 -0
  184. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/vendor/zlib/inflate.c +0 -0
  185. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/vendor/zlib/inflate.h +0 -0
  186. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/vendor/zlib/inftrees.c +0 -0
  187. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/vendor/zlib/inftrees.h +0 -0
  188. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/vendor/zlib/trees.c +0 -0
  189. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/vendor/zlib/uncompr.c +0 -0
  190. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/vendor/zlib/zconf.h +0 -0
  191. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/vendor/zlib/zlib.h +0 -0
  192. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/vendor/zlib/zutil.c +0 -0
  193. {tcod-18.0.0 → tcod-19.0.0}/libtcod/src/vendor/zlib/zutil.h +0 -0
  194. {tcod-18.0.0 → tcod-19.0.0}/libtcodpy.py +0 -0
  195. {tcod-18.0.0 → tcod-19.0.0}/setup.cfg +0 -0
  196. {tcod-18.0.0 → tcod-19.0.0}/tcod/__init__.py +0 -0
  197. {tcod-18.0.0 → tcod-19.0.0}/tcod/__pyinstaller/__init__.py +0 -0
  198. {tcod-18.0.0 → tcod-19.0.0}/tcod/__pyinstaller/hook-tcod.py +0 -0
  199. {tcod-18.0.0 → tcod-19.0.0}/tcod/cdef.h +0 -0
  200. {tcod-18.0.0 → tcod-19.0.0}/tcod/cffi.h +0 -0
  201. {tcod-18.0.0 → tcod-19.0.0}/tcod/constants.py +0 -0
  202. {tcod-18.0.0 → tcod-19.0.0}/tcod/image.py +0 -0
  203. {tcod-18.0.0 → tcod-19.0.0}/tcod/los.py +0 -0
  204. {tcod-18.0.0 → tcod-19.0.0}/tcod/noise.c +0 -0
  205. {tcod-18.0.0 → tcod-19.0.0}/tcod/noise.h +0 -0
  206. {tcod-18.0.0 → tcod-19.0.0}/tcod/py.typed +0 -0
  207. {tcod-18.0.0 → tcod-19.0.0}/tcod/random.h +0 -0
  208. {tcod-18.0.0 → tcod-19.0.0}/tcod/render.py +0 -0
  209. {tcod-18.0.0 → tcod-19.0.0}/tcod/sdl/__init__.py +0 -0
  210. {tcod-18.0.0 → tcod-19.0.0}/tcod/tcod.h +0 -0
  211. {tcod-18.0.0 → tcod-19.0.0}/tcod/tcod.py +0 -0
  212. {tcod-18.0.0 → tcod-19.0.0}/tcod/tdl.c +0 -0
  213. {tcod-18.0.0 → tcod-19.0.0}/tcod/tdl.h +0 -0
  214. {tcod-18.0.0 → tcod-19.0.0}/tcod.egg-info/dependency_links.txt +0 -0
  215. {tcod-18.0.0 → tcod-19.0.0}/tcod.egg-info/entry_points.txt +0 -0
  216. {tcod-18.0.0 → tcod-19.0.0}/tcod.egg-info/requires.txt +0 -0
  217. {tcod-18.0.0 → tcod-19.0.0}/tcod.egg-info/top_level.txt +0 -0
  218. {tcod-18.0.0 → tcod-19.0.0}/tox.ini +0 -0
@@ -6,6 +6,62 @@ This project adheres to [Semantic Versioning](https://semver.org/) since version
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [19.0.0] - 2025-06-13
10
+
11
+ Finished port to SDL3, this has caused several breaking changes from SDL such as lowercase key constants now being uppercase and mouse events returning `float` instead of `int`.
12
+ Be sure to run [Mypy](https://mypy.readthedocs.io/en/stable/getting_started.html) on your projects to catch any issues from this update.
13
+
14
+ ### Changed
15
+
16
+ - Updated libtcod to 2.1.1
17
+ - Updated SDL to 3.2.16
18
+ This will cause several breaking changes such as the names of keyboard constants and other SDL enums.
19
+ - `tcod.sdl.video.Window.grab` has been split into `.mouse_grab` and `.keyboard_grab` attributes.
20
+ - `tcod.event.KeySym` single letter symbols are now all uppercase.
21
+ - Relative mouse mode is set via `tcod.sdl.video.Window.relative_mouse_mode` instead of `tcod.sdl.mouse.set_relative_mode`.
22
+ - `tcod.sdl.render.new_renderer`: Removed `software` and `target_textures` parameters, `vsync` takes `int`, `driver` takes `str` instead of `int`.
23
+ - SDL renderer logical
24
+ - `tcod.sdl.render.Renderer`: `integer_scaling` and `logical_size` are now set with `set_logical_presentation` method.
25
+ - `tcod.sdl.render.Renderer.geometry` now takes float values for `color` instead of 8-bit integers.
26
+ - `tcod.event.Point` and other mouse/tile coordinate types now use `float` instead of `int`.
27
+ SDL3 has decided that mouse events have subpixel precision.
28
+ If you see any usual `float` types in your code then this is why.
29
+ - `tcod.sdl.audio` has been affected by major changes to SDL3.
30
+ - `tcod.sdl.audio.open` has new behavior due to SDL3 and should be avoided.
31
+ - Callbacks which were assigned to `AudioDevice`'s must now be applied to `AudioStream`'s instead.
32
+ - `AudioDevice`'s are now opened using references to existing devices.
33
+ - Sound queueing methods were moved from `AudioDevice` to a new `AudioStream` class.
34
+ - `BasicMixer` may require manually specifying `frequency` and `channels` to replicate old behavior.
35
+ - `get_devices` and `get_capture_devices` now return `dict[str, AudioDevice]`.
36
+
37
+ ### Deprecated
38
+
39
+ - `tcod.sdl.audio.open` was replaced with a newer API, get a default device with `tcod.sdl.audio.get_default_playback().open()`.
40
+ - `tcod.sdl.audio.BasicMixer` should be replaced with `AudioStream`'s.
41
+ - Should no longer use `tcod.sdl.audio.AudioDevice` in a context, use `contextlib.closing` for the old behavior.
42
+
43
+ ### Removed
44
+
45
+ - Support dropped for Python 3.8 and 3.9.
46
+ - Removed `Joystick.get_current_power` due to SDL3 changes.
47
+ - `WindowFlags.FULLSCREEN_DESKTOP` is now just `WindowFlags.FULLSCREEN`
48
+ - `tcod.sdl.render.Renderer.integer_scaling` removed.
49
+ - Removed `callback`, `spec`, `queued_samples`, `queue_audio`, and `dequeue_audio` attributes from `tcod.sdl.audio.AudioDevice`.
50
+
51
+ ### Fixed
52
+
53
+ - `Joystick.get_ball` was broken.
54
+
55
+ ## [18.1.0] - 2025-05-05
56
+
57
+ ### Added
58
+
59
+ - `tcod.path.path2d` to compute paths for the most basic cases.
60
+
61
+ ### Fixed
62
+
63
+ - `tcod.noise.grid` would raise `TypeError` when given a plain integer for scale.
64
+
9
65
  ## [18.0.0] - 2025-04-08
10
66
 
11
67
  ### Changed
@@ -1,6 +1,6 @@
1
1
  BSD 2-Clause License
2
2
 
3
- Copyright (c) 2009-2023, Kyle Benesch and the python-tcod contributors.
3
+ Copyright (c) 2009-2025, Kyle Benesch and the python-tcod contributors.
4
4
  All rights reserved.
5
5
 
6
6
  Redistribution and use in source and binary forms, with or without
@@ -1,9 +1,9 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: tcod
3
- Version: 18.0.0
3
+ Version: 19.0.0
4
4
  Summary: The official Python port of libtcod.
5
5
  Author-email: Kyle Benesch <4b796c65+tcod@gmail.com>
6
- License: Simplified BSD License
6
+ License-Expression: BSD-2-Clause
7
7
  Project-URL: Homepage, https://github.com/libtcod/python-tcod
8
8
  Project-URL: Documentation, https://python-tcod.readthedocs.io
9
9
  Project-URL: Changelog, https://github.com/libtcod/python-tcod/blob/main/CHANGELOG.md
@@ -19,26 +19,26 @@ Classifier: Environment :: Win32 (MS Windows)
19
19
  Classifier: Environment :: MacOS X
20
20
  Classifier: Environment :: X11 Applications
21
21
  Classifier: Intended Audience :: Developers
22
- Classifier: License :: OSI Approved :: BSD License
23
22
  Classifier: Natural Language :: English
24
23
  Classifier: Operating System :: POSIX
25
24
  Classifier: Operating System :: MacOS :: MacOS X
26
25
  Classifier: Operating System :: Microsoft :: Windows
27
26
  Classifier: Programming Language :: Python :: 3
28
- Classifier: Programming Language :: Python :: 3.8
29
- Classifier: Programming Language :: Python :: 3.9
30
27
  Classifier: Programming Language :: Python :: 3.10
31
28
  Classifier: Programming Language :: Python :: 3.11
32
29
  Classifier: Programming Language :: Python :: 3.12
30
+ Classifier: Programming Language :: Python :: 3.13
33
31
  Classifier: Programming Language :: Python :: Implementation :: CPython
34
32
  Classifier: Programming Language :: Python :: Implementation :: PyPy
35
33
  Classifier: Topic :: Games/Entertainment
36
34
  Classifier: Topic :: Multimedia :: Graphics
37
35
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
38
36
  Classifier: Typing :: Typed
39
- Requires-Python: >=3.8
37
+ Requires-Python: >=3.10
40
38
  Description-Content-Type: text/x-rst
41
39
  License-File: LICENSE.txt
40
+ License-File: libtcod/LICENSE.txt
41
+ License-File: libtcod/LIBTCOD-CREDITS.txt
42
42
  Requires-Dist: cffi>=1.15
43
43
  Requires-Dist: numpy>=1.21.4; implementation_name != "pypy"
44
44
  Requires-Dist: typing_extensions>=4.12.2
@@ -93,9 +93,9 @@ For the most part it's just::
93
93
  ==============
94
94
  Requirements
95
95
  ==============
96
- * Python 3.8+
96
+ * Python 3.10+
97
97
  * Windows, Linux, or MacOS X 10.9+.
98
- * On Linux, requires libsdl2 (2.0.10+).
98
+ * On Linux, requires libsdl3
99
99
 
100
100
  ===========
101
101
  Changelog
@@ -46,9 +46,9 @@ For the most part it's just::
46
46
  ==============
47
47
  Requirements
48
48
  ==============
49
- * Python 3.8+
49
+ * Python 3.10+
50
50
  * Windows, Linux, or MacOS X 10.9+.
51
- * On Linux, requires libsdl2 (2.0.10+).
51
+ * On Linux, requires libsdl3
52
52
 
53
53
  ===========
54
54
  Changelog
@@ -3,15 +3,22 @@
3
3
 
4
4
  from __future__ import annotations
5
5
 
6
+ import ast
6
7
  import contextlib
7
8
  import glob
8
9
  import os
9
10
  import platform
10
11
  import re
12
+ import subprocess
11
13
  import sys
14
+ from collections.abc import Iterable, Iterator
12
15
  from pathlib import Path
13
- from typing import Any, ClassVar, Iterable, Iterator
16
+ from typing import Any, ClassVar
14
17
 
18
+ import attrs
19
+ import pycparser # type: ignore[import-untyped]
20
+ import pycparser.c_ast # type: ignore[import-untyped]
21
+ import pycparser.c_generator # type: ignore[import-untyped]
15
22
  from cffi import FFI
16
23
 
17
24
  # ruff: noqa: T201
@@ -20,7 +27,7 @@ sys.path.append(str(Path(__file__).parent)) # Allow importing local modules.
20
27
 
21
28
  import build_sdl
22
29
 
23
- Py_LIMITED_API = 0x03060000
30
+ Py_LIMITED_API = 0x03100000
24
31
 
25
32
  HEADER_PARSE_PATHS = ("tcod/", "libtcod/src/libtcod/")
26
33
  HEADER_PARSE_EXCLUDES = ("gl2_ext_.h", "renderer_gl_internal.h", "event.h")
@@ -203,15 +210,16 @@ else:
203
210
  extra_link_args.extend(GCC_CFLAGS[tdl_build])
204
211
 
205
212
  ffi = FFI()
206
- ffi.cdef(build_sdl.get_cdef())
213
+ sdl_cdef, sdl_strings = build_sdl.get_cdef()
214
+ ffi.cdef(sdl_cdef)
207
215
  for include in includes:
208
216
  try:
209
217
  ffi.cdef(include.header)
210
- except Exception:
218
+ except Exception: # noqa: PERF203
211
219
  # Print the source, for debugging.
212
220
  print(f"Error with: {include.path}")
213
221
  for i, line in enumerate(include.header.split("\n"), 1):
214
- print("%03i %s" % (i, line))
222
+ print(f"{i:03i} {line}")
215
223
  raise
216
224
  ffi.cdef(
217
225
  """
@@ -220,7 +228,10 @@ ffi.cdef(
220
228
  )
221
229
  ffi.set_source(
222
230
  module_name,
223
- "#include <tcod/cffi.h>\n#include <SDL.h>",
231
+ """\
232
+ #include <tcod/cffi.h>
233
+ #define SDL_oldnames_h_
234
+ #include <SDL3/SDL.h>""",
224
235
  include_dirs=include_dirs,
225
236
  library_dirs=library_dirs,
226
237
  sources=sources,
@@ -379,10 +390,10 @@ def write_library_constants() -> None:
379
390
  f.write(f"""{parse_sdl_attrs("SDL_SCANCODE", None)[0]}\n""")
380
391
 
381
392
  f.write("\n# --- SDL keyboard symbols ---\n")
382
- f.write(f"""{parse_sdl_attrs("SDLK", None)[0]}\n""")
393
+ f.write(f"""{parse_sdl_attrs("SDLK_", None)[0]}\n""")
383
394
 
384
395
  f.write("\n# --- SDL keyboard modifiers ---\n")
385
- f.write("{}\n_REVERSE_MOD_TABLE = {}\n".format(*parse_sdl_attrs("KMOD", None)))
396
+ f.write("{}\n_REVERSE_MOD_TABLE = {}\n".format(*parse_sdl_attrs("SDL_KMOD", None)))
386
397
 
387
398
  f.write("\n# --- SDL wheel ---\n")
388
399
  f.write("{}\n_REVERSE_WHEEL_TABLE = {}\n".format(*parse_sdl_attrs("SDL_MOUSEWHEEL", all_names)))
@@ -406,6 +417,237 @@ def write_library_constants() -> None:
406
417
 
407
418
  Path("tcod/event.py").write_text(event_py, encoding="utf-8")
408
419
 
420
+ with Path("tcod/sdl/constants.py").open("w", encoding="utf-8") as f:
421
+ f.write('"""SDL private constants."""\n\n')
422
+ for name, value in sdl_strings.items():
423
+ f.write(f"{name} = {ast.literal_eval(value)!r}\n")
424
+
425
+ subprocess.run(["ruff", "format", "--silent", Path("tcod/sdl/constants.py")], check=True) # noqa: S603, S607
426
+
427
+
428
+ def _fix_reserved_name(name: str) -> str:
429
+ """Add underscores to reserved Python keywords."""
430
+ assert isinstance(name, str)
431
+ if name in ("def", "in"):
432
+ return name + "_"
433
+ return name
434
+
435
+
436
+ @attrs.define(frozen=True)
437
+ class ConvertedParam:
438
+ name: str = attrs.field(converter=_fix_reserved_name)
439
+ hint: str
440
+ original: str
441
+
442
+
443
+ def _type_from_names(names: list[str]) -> str:
444
+ if not names:
445
+ return ""
446
+ if names[-1] == "void":
447
+ return "None"
448
+ if names in (["unsigned", "char"], ["bool"]):
449
+ return "bool"
450
+ if names[-1] in ("size_t", "int", "ptrdiff_t"):
451
+ return "int"
452
+ if names[-1] in ("float", "double"):
453
+ return "float"
454
+ return "Any"
455
+
456
+
457
+ def _param_as_hint(node: pycparser.c_ast.Node, default_name: str) -> ConvertedParam:
458
+ original = pycparser.c_generator.CGenerator().visit(node)
459
+ name: str
460
+ names: list[str]
461
+ match node:
462
+ case pycparser.c_ast.Typename(type=pycparser.c_ast.TypeDecl(type=pycparser.c_ast.IdentifierType(names=names))):
463
+ # Unnamed type
464
+ return ConvertedParam(default_name, _type_from_names(names), original)
465
+ case pycparser.c_ast.Decl(
466
+ name=name, type=pycparser.c_ast.TypeDecl(type=pycparser.c_ast.IdentifierType(names=names))
467
+ ):
468
+ # Named type
469
+ return ConvertedParam(name, _type_from_names(names), original)
470
+ case pycparser.c_ast.Decl(
471
+ name=name,
472
+ type=pycparser.c_ast.ArrayDecl(
473
+ type=pycparser.c_ast.TypeDecl(type=pycparser.c_ast.IdentifierType(names=names))
474
+ ),
475
+ ):
476
+ # Named array
477
+ return ConvertedParam(name, "Any", original)
478
+ case pycparser.c_ast.Decl(name=name, type=pycparser.c_ast.PtrDecl()):
479
+ # Named pointer
480
+ return ConvertedParam(name, "Any", original)
481
+ case pycparser.c_ast.Typename(name=name, type=pycparser.c_ast.PtrDecl()):
482
+ # Forwarded struct
483
+ return ConvertedParam(name or default_name, "Any", original)
484
+ case pycparser.c_ast.TypeDecl(type=pycparser.c_ast.IdentifierType(names=names)):
485
+ # Return type
486
+ return ConvertedParam(default_name, _type_from_names(names), original)
487
+ case pycparser.c_ast.PtrDecl():
488
+ # Return pointer
489
+ return ConvertedParam(default_name, "Any", original)
490
+ case pycparser.c_ast.EllipsisParam():
491
+ # C variable args
492
+ return ConvertedParam("*__args", "Any", original)
493
+ case _:
494
+ raise AssertionError
495
+
496
+
497
+ class DefinitionCollector(pycparser.c_ast.NodeVisitor): # type: ignore[misc]
498
+ """Gathers functions and names from C headers."""
499
+
500
+ def __init__(self) -> None:
501
+ """Initialize the object with empty values."""
502
+ self.functions: list[str] = []
503
+ """Indented Python function definitions."""
504
+ self.variables: set[str] = set()
505
+ """Python variable definitions."""
506
+
507
+ def parse_defines(self, string: str, /) -> None:
508
+ """Parse C define directives into hinted names."""
509
+ for match in re.finditer(r"#define\s+(\S+)\s+(\S+)\s*", string):
510
+ name, value = match.groups()
511
+ if value == "...":
512
+ self.variables.add(f"{name}: Final[int]")
513
+ else:
514
+ self.variables.add(f"{name}: Final[Literal[{value}]] = {value}")
515
+
516
+ def visit_Decl(self, node: pycparser.c_ast.Decl) -> None: # noqa: N802
517
+ """Parse C FFI functions into type hinted Python functions."""
518
+ match node:
519
+ case pycparser.c_ast.Decl(
520
+ type=pycparser.c_ast.FuncDecl(),
521
+ ):
522
+ assert isinstance(node.type.args, pycparser.c_ast.ParamList), type(node.type.args)
523
+ arg_hints = [_param_as_hint(param, f"arg{i}") for i, param in enumerate(node.type.args.params)]
524
+ return_hint = _param_as_hint(node.type.type, "")
525
+ if len(arg_hints) == 1 and arg_hints[0].hint == "None": # Remove void parameter
526
+ arg_hints = []
527
+
528
+ python_params = [f"{p.name}: {p.hint}" for p in arg_hints]
529
+ if python_params:
530
+ if arg_hints[-1].name.startswith("*"):
531
+ python_params.insert(-1, "/")
532
+ else:
533
+ python_params.append("/")
534
+ c_def = pycparser.c_generator.CGenerator().visit(node)
535
+ python_def = f"""def {node.name}({", ".join(python_params)}) -> {return_hint.hint}:"""
536
+ self.functions.append(f''' {python_def}\n """{c_def}"""''')
537
+
538
+ def visit_Enumerator(self, node: pycparser.c_ast.Enumerator) -> None: # noqa: N802
539
+ """Parse C enums into hinted names."""
540
+ name: str | None
541
+ value: str | int
542
+ match node:
543
+ case pycparser.c_ast.Enumerator(name=name, value=None):
544
+ self.variables.add(f"{name}: Final[int]")
545
+ case pycparser.c_ast.Enumerator(name=name, value=pycparser.c_ast.ID()):
546
+ self.variables.add(f"{name}: Final[int]")
547
+ case pycparser.c_ast.Enumerator(name=name, value=pycparser.c_ast.Constant(value=value)):
548
+ value = int(str(value).removesuffix("u"), base=0)
549
+ self.variables.add(f"{name}: Final[Literal[{value}]] = {value}")
550
+ case pycparser.c_ast.Enumerator(
551
+ name=name, value=pycparser.c_ast.UnaryOp(op="-", expr=pycparser.c_ast.Constant(value=value))
552
+ ):
553
+ value = -int(str(value).removesuffix("u"), base=0)
554
+ self.variables.add(f"{name}: Final[Literal[{value}]] = {value}")
555
+ case pycparser.c_ast.Enumerator(name=name):
556
+ self.variables.add(f"{name}: Final[int]")
557
+ case _:
558
+ raise AssertionError
559
+
560
+
561
+ def write_hints() -> None:
562
+ """Write a custom _libtcod.pyi file from C definitions."""
563
+ function_collector = DefinitionCollector()
564
+ c = pycparser.CParser()
565
+
566
+ # Parse SDL headers
567
+ cdef = sdl_cdef
568
+ cdef = cdef.replace("int...", "int")
569
+ cdef = (
570
+ """
571
+ typedef int bool;
572
+ typedef int int8_t;
573
+ typedef int uint8_t;
574
+ typedef int int16_t;
575
+ typedef int uint16_t;
576
+ typedef int int32_t;
577
+ typedef int uint32_t;
578
+ typedef int int64_t;
579
+ typedef int uint64_t;
580
+ typedef int wchar_t;
581
+ typedef int intptr_t;
582
+ """
583
+ + cdef
584
+ )
585
+ for match in re.finditer(r"SDL_PIXELFORMAT_\w+", cdef):
586
+ function_collector.variables.add(f"{match.group()}: int")
587
+ cdef = re.sub(r"(typedef enum SDL_PixelFormat).*(SDL_PixelFormat;)", r"\1 \2", cdef, flags=re.DOTALL)
588
+ cdef = cdef.replace("padding[...]", "padding[]")
589
+ cdef = cdef.replace("...;} SDL_TouchFingerEvent;", "} SDL_TouchFingerEvent;")
590
+ function_collector.parse_defines(cdef)
591
+ cdef = re.sub(r"\n#define .*", "", cdef)
592
+ cdef = re.sub(r"""extern "Python" \{(.*?)\}""", r"\1", cdef, flags=re.DOTALL)
593
+ cdef = re.sub(r"//.*", "", cdef)
594
+ cdef = cdef.replace("...;", ";")
595
+ ast = c.parse(cdef)
596
+ function_collector.visit(ast)
597
+
598
+ # Parse libtcod headers
599
+ cdef = "\n".join(include.header for include in includes)
600
+ function_collector.parse_defines(cdef)
601
+ cdef = re.sub(r"\n?#define .*", "", cdef)
602
+ cdef = re.sub(r"//.*", "", cdef)
603
+ cdef = (
604
+ """
605
+ typedef int int8_t;
606
+ typedef int uint8_t;
607
+ typedef int int16_t;
608
+ typedef int uint16_t;
609
+ typedef int int32_t;
610
+ typedef int uint32_t;
611
+ typedef int int64_t;
612
+ typedef int uint64_t;
613
+ typedef int wchar_t;
614
+ typedef int intptr_t;
615
+ typedef int ptrdiff_t;
616
+ typedef int size_t;
617
+ typedef unsigned char bool;
618
+ typedef void* SDL_PropertiesID;
619
+ """
620
+ + cdef
621
+ )
622
+ cdef = re.sub(r"""extern "Python" \{(.*?)\}""", r"\1", cdef, flags=re.DOTALL)
623
+ function_collector.visit(c.parse(cdef))
624
+ function_collector.variables.add("TCOD_ctx: Any")
625
+ function_collector.variables.add("TCOD_COMPILEDVERSION: Final[int]")
626
+
627
+ # Write PYI file
628
+ out_functions = """\n\n @staticmethod\n""".join(sorted(function_collector.functions))
629
+ out_variables = "\n ".join(sorted(function_collector.variables))
630
+
631
+ pyi = f"""\
632
+ # Autogenerated with build_libtcod.py
633
+ from typing import Any, Final, Literal
634
+
635
+ # pyi files for CFFI ports are not standard
636
+ # ruff: noqa: A002, ANN401, D402, D403, D415, N801, N802, N803, N815, PLW0211, PYI021
637
+
638
+ class _lib:
639
+ @staticmethod
640
+ {out_functions}
641
+
642
+ {out_variables}
643
+
644
+ lib: _lib
645
+ ffi: Any
646
+ """
647
+ Path("tcod/_libtcod.pyi").write_text(pyi)
648
+ subprocess.run(["ruff", "format", "--silent", Path("tcod/_libtcod.pyi")], check=True) # noqa: S603, S607
649
+
409
650
 
410
651
  if __name__ == "__main__":
652
+ write_hints()
411
653
  write_library_constants()