Skip to content

Commit 06be6f3

Browse files
committed
Update libtcod to 2.3.0
Add TCOD_PRIVATE to list of tags to remove Have RE_INLINE consider a closing brace after a newline to be the end of a function Fix invalid string format specifier Checkout recursive submodules on ReadTheDocs Add UTF8PROC_STATIC macro Setup utf8proc for static linking, needed for latest versions of utf8proc Add missing submodule recursive flag to tox job Switch MacOS runner to macos-26 Previous version was dropped from GitHub and is no longer available
1 parent b623ec9 commit 06be6f3

6 files changed

Lines changed: 64 additions & 37 deletions

File tree

‎.github/workflows/python-package.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ jobs:
214214
persist-credentials: false
215215
fetch-depth: ${{ env.git-depth }}
216216
- name: Checkout submodules
217-
run: git submodule update --init --depth 1
217+
run: git submodule update --init --recursive --depth 1
218218
- name: Set up Python
219219
uses: actions/setup-python@v7
220220
with:
@@ -291,7 +291,7 @@ jobs:
291291

292292
build-macos:
293293
needs: [ruff, mypy, sdist]
294-
runs-on: "macos-14"
294+
runs-on: "macos-26"
295295
timeout-minutes: 30
296296
strategy:
297297
fail-fast: true

‎.readthedocs.yaml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ build:
1414

1515
submodules:
1616
include: all
17+
recursive: true
1718

1819
# Build documentation in the docs/ directory with Sphinx
1920
sphinx:

‎CHANGELOG.md‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ This project adheres to [Semantic Versioning](https://semver.org/) since version
66

77
## [Unreleased]
88

9+
### Changed
10+
- Updated libtcod to 2.3.0
11+
912
## [21.2.2] - 2026-10-22
1013

1114
### Changed

‎build_libtcod.py‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,13 @@
4242
RE_PREPROCESSOR = re.compile(r"(?!#define\s+\w+\s+\d+$)#.*?(?<!\\)$", re.DOTALL | re.MULTILINE)
4343
RE_INCLUDE = re.compile(r'#include "([^"]*)"')
4444
RE_TAGS = re.compile(
45-
r"TCODLIB_C?API|TCOD_PUBLIC|TCOD_NODISCARD|TCOD_DEPRECATED_NOMESSAGE|TCOD_DEPRECATED_ENUM"
45+
r"TCODLIB_C?API|TCOD_PUBLIC|TCOD_PRIVATE|TCOD_NODISCARD|TCOD_DEPRECATED_NOMESSAGE|TCOD_DEPRECATED_ENUM"
4646
r"|(TCOD_DEPRECATED\(\".*?\"\))"
4747
r"|(TCOD_DEPRECATED|TCODLIB_FORMAT)\([^)]*\)|__restrict"
4848
r"|TCODLIB_(BEGIN|END)_IGNORE_DEPRECATIONS"
4949
)
5050
RE_VAFUNC = re.compile(r"^[^;]*\([^;]*va_list.*\);", re.MULTILINE)
51-
RE_INLINE = re.compile(r"(^.*?inline.*?\(.*?\))\s*\{.*?\}$", re.DOTALL | re.MULTILINE)
51+
RE_INLINE = re.compile(r"(^[^\n]*?inline.*?\(.*?\))\s*\{.*?\n\}$", re.DOTALL | re.MULTILINE)
5252

5353

5454
class ParsedHeader:
@@ -197,6 +197,7 @@ def walk_sources(directory: str) -> Iterator[str]:
197197
# Fix implicit declaration of multiple functions in zlib.
198198
define_macros.append(("HAVE_UNISTD_H", 1))
199199

200+
define_macros.append(("UTF8PROC_STATIC", None))
200201

201202
tdl_build = os.environ.get("TDL_BUILD", "RELEASE").upper()
202203

@@ -232,7 +233,7 @@ def walk_sources(directory: str) -> Iterator[str]:
232233
# Print the source, for debugging.
233234
print(f"Error with: {include.path}")
234235
for i, line in enumerate(include.header.split("\n"), 1):
235-
print(f"{i:03i} {line}")
236+
print(f"{i:03d} {line}")
236237
raise
237238
ffi.cdef(
238239
"""

‎libtcod‎

Submodule libtcod updated 150 files

‎tcod/_libtcod.pyi‎

Lines changed: 53 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -5464,7 +5464,7 @@ class _lib:
54645464

54655465
@staticmethod
54665466
def TCOD_console_from_file(filename: Any, /) -> Any:
5467-
"""TCOD_console_t TCOD_console_from_file(const char *filename)"""
5467+
"""TCOD_Console *TCOD_console_from_file(const char *filename)"""
54685468

54695469
@staticmethod
54705470
def TCOD_console_from_xp(filename: Any, /) -> Any:
@@ -5602,11 +5602,11 @@ class _lib:
56025602

56035603
@staticmethod
56045604
def TCOD_console_load_apf(con: Any, filename: Any, /) -> bool:
5605-
"""bool TCOD_console_load_apf(TCOD_console_t con, const char *filename)"""
5605+
"""bool TCOD_console_load_apf(TCOD_Console *con, const char *filename)"""
56065606

56075607
@staticmethod
56085608
def TCOD_console_load_asc(con: Any, filename: Any, /) -> bool:
5609-
"""bool TCOD_console_load_asc(TCOD_console_t con, const char *filename)"""
5609+
"""bool TCOD_console_load_asc(TCOD_Console *con, const char *filename)"""
56105610

56115611
@staticmethod
56125612
def TCOD_console_load_xp(con: Any, filename: Any, /) -> bool:
@@ -5810,11 +5810,11 @@ class _lib:
58105810

58115811
@staticmethod
58125812
def TCOD_console_save_apf(con: Any, filename: Any, /) -> bool:
5813-
"""bool TCOD_console_save_apf(TCOD_console_t con, const char *filename)"""
5813+
"""bool TCOD_console_save_apf(TCOD_Console *con, const char *filename)"""
58145814

58155815
@staticmethod
58165816
def TCOD_console_save_asc(con: Any, filename: Any, /) -> bool:
5817-
"""bool TCOD_console_save_asc(TCOD_console_t con, const char *filename)"""
5817+
"""bool TCOD_console_save_asc(TCOD_Console *con, const char *filename)"""
58185818

58195819
@staticmethod
58205820
def TCOD_console_save_xp(con: Any, filename: Any, compress_level: int, /) -> bool:
@@ -6103,7 +6103,7 @@ class _lib:
61036103
scale: float,
61046104
/,
61056105
) -> None:
6106-
"""void TCOD_heightmap_add_fbm(TCOD_heightmap_t *hm, TCOD_noise_t noise, float mul_x, float mul_y, float add_x, float add_y, float octaves, float delta, float scale)"""
6106+
"""void TCOD_heightmap_add_fbm(TCOD_heightmap_t *hm, TCOD_Noise *noise, float mul_x, float mul_y, float add_x, float add_y, float octaves, float delta, float scale)"""
61076107

61086108
@staticmethod
61096109
def TCOD_heightmap_add_hill(hm: Any, hx: float, hy: float, h_radius: float, h_height: float, /) -> None:
@@ -6152,8 +6152,8 @@ class _lib:
61526152
"""float TCOD_heightmap_get_interpolated_value(const TCOD_heightmap_t *hm, float x, float y)"""
61536153

61546154
@staticmethod
6155-
def TCOD_heightmap_get_minmax(hm: Any, min: Any, max: Any, /) -> None:
6156-
"""void TCOD_heightmap_get_minmax(const TCOD_heightmap_t *hm, float *min, float *max)"""
6155+
def TCOD_heightmap_get_minmax(heightmap: Any, min_out: Any, max_out: Any, /) -> None:
6156+
"""void TCOD_heightmap_get_minmax(const TCOD_heightmap_t *heightmap, float *min_out, float *max_out)"""
61576157

61586158
@staticmethod
61596159
def TCOD_heightmap_get_normal(hm: Any, x: float, y: float, n: Any, waterLevel: float, /) -> None:
@@ -6164,13 +6164,21 @@ class _lib:
61646164
"""float TCOD_heightmap_get_slope(const TCOD_heightmap_t *hm, int x, int y)"""
61656165

61666166
@staticmethod
6167-
def TCOD_heightmap_get_value(hm: Any, x: int, y: int, /) -> float:
6168-
"""float TCOD_heightmap_get_value(const TCOD_heightmap_t *hm, int x, int y)"""
6167+
def TCOD_heightmap_get_value(heightmap: Any, x: int, y: int, /) -> float:
6168+
"""inline static float TCOD_heightmap_get_value(const TCOD_heightmap_t *heightmap, int x, int y)"""
61696169

61706170
@staticmethod
61716171
def TCOD_heightmap_has_land_on_border(hm: Any, waterLevel: float, /) -> bool:
61726172
"""bool TCOD_heightmap_has_land_on_border(const TCOD_heightmap_t *hm, float waterLevel)"""
61736173

6174+
@staticmethod
6175+
def TCOD_heightmap_in_bounds(heightmap: Any, x: int, y: int, /) -> bool:
6176+
"""inline static bool TCOD_heightmap_in_bounds(const TCOD_heightmap_t *heightmap, int x, int y)"""
6177+
6178+
@staticmethod
6179+
def TCOD_heightmap_is_valid(heightmap: Any, /) -> bool:
6180+
"""inline static bool TCOD_heightmap_is_valid(const TCOD_heightmap_t *heightmap)"""
6181+
61746182
@staticmethod
61756183
def TCOD_heightmap_islandify(hm: Any, seaLevel: float, rnd: Any, /) -> None:
61766184
"""void TCOD_heightmap_islandify(TCOD_heightmap_t *hm, float seaLevel, TCOD_Random *rnd)"""
@@ -6181,6 +6189,12 @@ class _lib:
61816189
) -> None:
61826190
"""void TCOD_heightmap_kernel_transform(TCOD_heightmap_t *hm, int kernel_size, const int *dx, const int *dy, const float *weight, float minLevel, float maxLevel)"""
61836191

6192+
@staticmethod
6193+
def TCOD_heightmap_kernel_transform_out(
6194+
hm_src: Any, hm_dst: Any, kernel_size: int, dx: Any, dy: Any, weight: Any, mask: Any, /
6195+
) -> None:
6196+
"""void TCOD_heightmap_kernel_transform_out(const TCOD_heightmap_t *hm_src, TCOD_heightmap_t *hm_dst, int kernel_size, const int *dx, const int *dy, const float *weight, const uint8_t *mask)"""
6197+
61846198
@staticmethod
61856199
def TCOD_heightmap_lerp_hm(hm1: Any, hm2: Any, out: Any, coef: float, /) -> None:
61866200
"""void TCOD_heightmap_lerp_hm(const TCOD_heightmap_t *hm1, const TCOD_heightmap_t *hm2, TCOD_heightmap_t *out, float coef)"""
@@ -6224,11 +6238,15 @@ class _lib:
62246238
scale: float,
62256239
/,
62266240
) -> None:
6227-
"""void TCOD_heightmap_scale_fbm(TCOD_heightmap_t *hm, TCOD_noise_t noise, float mul_x, float mul_y, float add_x, float add_y, float octaves, float delta, float scale)"""
6241+
"""void TCOD_heightmap_scale_fbm(TCOD_heightmap_t *hm, TCOD_Noise *noise, float mul_x, float mul_y, float add_x, float add_y, float octaves, float delta, float scale)"""
6242+
6243+
@staticmethod
6244+
def TCOD_heightmap_set_value(heightmap: Any, x: int, y: int, value: float, /) -> None:
6245+
"""inline static void TCOD_heightmap_set_value(TCOD_heightmap_t *heightmap, int x, int y, float value)"""
62286246

62296247
@staticmethod
6230-
def TCOD_heightmap_set_value(hm: Any, x: int, y: int, value: float, /) -> None:
6231-
"""void TCOD_heightmap_set_value(TCOD_heightmap_t *hm, int x, int y, float value)"""
6248+
def TCOD_heightmap_threshold_mask(hm: Any, mask: Any, minLevel: float, maxLevel: float, /) -> None:
6249+
"""void TCOD_heightmap_threshold_mask(const TCOD_heightmap_t *hm, uint8_t *mask, float minLevel, float maxLevel)"""
62326250

62336251
@staticmethod
62346252
def TCOD_image_blit(
@@ -7180,6 +7198,10 @@ class _lib:
71807198
def TCOD_strncasecmp(s1: Any, s2: Any, n: int, /) -> int:
71817199
"""int TCOD_strncasecmp(const char *s1, const char *s2, size_t n)"""
71827200

7201+
@staticmethod
7202+
def TCOD_strscpy(dest: Any, src: Any, count: int, /) -> int:
7203+
"""inline static size_t TCOD_strscpy(char *dest, const char *src, size_t count)"""
7204+
71837205
@staticmethod
71847206
def TCOD_struct_add_flag(def_: Any, propname: Any, /) -> None:
71857207
"""void TCOD_struct_add_flag(TCOD_ParserStruct *def, const char *propname)"""
@@ -7645,40 +7667,40 @@ class _lib:
76457667
"""TCOD_zip_t TCOD_zip_new(void)"""
76467668

76477669
@staticmethod
7648-
def TCOD_zip_put_char(zip: Any, val: Any, /) -> None:
7649-
"""void TCOD_zip_put_char(TCOD_zip_t zip, char val)"""
7670+
def TCOD_zip_put_char(zip: Any, value: Any, /) -> None:
7671+
"""void TCOD_zip_put_char(TCOD_zip_t zip, char value)"""
76507672

76517673
@staticmethod
7652-
def TCOD_zip_put_color(zip: Any, val: Any, /) -> None:
7653-
"""void TCOD_zip_put_color(TCOD_zip_t zip, const TCOD_color_t val)"""
7674+
def TCOD_zip_put_color(zip: Any, value: Any, /) -> None:
7675+
"""void TCOD_zip_put_color(TCOD_zip_t zip, const TCOD_color_t value)"""
76547676

76557677
@staticmethod
7656-
def TCOD_zip_put_console(zip: Any, val: Any, /) -> None:
7657-
"""void TCOD_zip_put_console(TCOD_zip_t zip, const TCOD_Console *val)"""
7678+
def TCOD_zip_put_console(zip: Any, value: Any, /) -> None:
7679+
"""void TCOD_zip_put_console(TCOD_zip_t zip, const TCOD_Console *value)"""
76587680

76597681
@staticmethod
76607682
def TCOD_zip_put_data(zip: Any, nbBytes: int, data: Any, /) -> None:
76617683
"""void TCOD_zip_put_data(TCOD_zip_t zip, int nbBytes, const void *data)"""
76627684

76637685
@staticmethod
7664-
def TCOD_zip_put_float(zip: Any, val: float, /) -> None:
7665-
"""void TCOD_zip_put_float(TCOD_zip_t zip, float val)"""
7686+
def TCOD_zip_put_float(zip: Any, value: float, /) -> None:
7687+
"""void TCOD_zip_put_float(TCOD_zip_t zip, float value)"""
76667688

76677689
@staticmethod
7668-
def TCOD_zip_put_image(zip: Any, val: Any, /) -> None:
7669-
"""void TCOD_zip_put_image(TCOD_zip_t zip, const TCOD_Image *val)"""
7690+
def TCOD_zip_put_image(zip: Any, value: Any, /) -> None:
7691+
"""void TCOD_zip_put_image(TCOD_zip_t zip, const TCOD_Image *value)"""
76707692

76717693
@staticmethod
7672-
def TCOD_zip_put_int(zip: Any, val: int, /) -> None:
7673-
"""void TCOD_zip_put_int(TCOD_zip_t zip, int val)"""
7694+
def TCOD_zip_put_int(zip: Any, value: int, /) -> None:
7695+
"""void TCOD_zip_put_int(TCOD_zip_t zip, int value)"""
76747696

76757697
@staticmethod
7676-
def TCOD_zip_put_random(zip: Any, val: Any, /) -> None:
7677-
"""void TCOD_zip_put_random(TCOD_zip_t zip, const TCOD_Random *val)"""
7698+
def TCOD_zip_put_random(zip: Any, value: Any, /) -> None:
7699+
"""void TCOD_zip_put_random(TCOD_zip_t zip, const TCOD_Random *value)"""
76787700

76797701
@staticmethod
7680-
def TCOD_zip_put_string(zip: Any, val: Any, /) -> None:
7681-
"""void TCOD_zip_put_string(TCOD_zip_t zip, const char *val)"""
7702+
def TCOD_zip_put_string(zip: Any, value: Any, /) -> None:
7703+
"""void TCOD_zip_put_string(TCOD_zip_t zip, const char *value)"""
76827704

76837705
@staticmethod
76847706
def TCOD_zip_save_to_file(zip: Any, filename: Any, /) -> int:
@@ -9704,15 +9726,15 @@ class _lib:
97049726
TCOD_LOG_INFO: Final[Literal[20]] = 20
97059727
TCOD_LOG_WARNING: Final[Literal[30]] = 30
97069728
TCOD_MAJOR_VERSION: Final[Literal[2]] = 2
9707-
TCOD_MINOR_VERSION: Final[Literal[2]] = 2
9729+
TCOD_MINOR_VERSION: Final[Literal[3]] = 3
97089730
TCOD_NB_RENDERERS: Final[int]
97099731
TCOD_NOISE_DEFAULT: Final[Literal[0]] = 0
97109732
TCOD_NOISE_MAX_DIMENSIONS: Final[Literal[4]] = 4
97119733
TCOD_NOISE_MAX_OCTAVES: Final[Literal[128]] = 128
97129734
TCOD_NOISE_PERLIN: Final[Literal[1]] = 1
97139735
TCOD_NOISE_SIMPLEX: Final[Literal[2]] = 2
97149736
TCOD_NOISE_WAVELET: Final[Literal[4]] = 4
9715-
TCOD_PATCHLEVEL: Final[Literal[2]] = 2
9737+
TCOD_PATCHLEVEL: Final[Literal[0]] = 0
97169738
TCOD_PATHFINDER_MAX_DIMENSIONS: Final[Literal[4]] = 4
97179739
TCOD_RENDERER_GLSL: Final[int]
97189740
TCOD_RENDERER_OPENGL2: Final[int]

0 commit comments

Comments
 (0)