Skip to content

Commit 67c41c9

Browse files
committed
Update libtcod, adds new FOV implementation.
1 parent 550924e commit 67c41c9

6 files changed

Lines changed: 18 additions & 2 deletions

File tree

CHANGELOG.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ v2.0.0
88

99
Unreleased
1010
------------------
11+
Added
12+
- Add new FOV implementation: `tcod.FOV_SYMMETRIC_SHADOWCAST`.
13+
14+
Changed
15+
- Using `libtcod 1.16.0-alpha.14`.
1116

1217
11.16.1 - 2020-10-28
1318
--------------------

build_libtcod.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -430,6 +430,7 @@ def parse_sdl_attrs(prefix: str, all_names: List[str]) -> Tuple[str, str]:
430430
"TCOD_MAJOR_VERSION",
431431
"TCOD_MINOR_VERSION",
432432
"TCOD_PATCHLEVEL",
433+
"TCOD_COMPILEDVERSION",
433434
"TCOD_PATHFINDER_MAX_DIMENSIONS",
434435
"TCOD_KEY_TEXT_SIZE",
435436
"TCOD_NOISE_MAX_DIMENSIONS",
@@ -440,6 +441,7 @@ def parse_sdl_attrs(prefix: str, all_names: List[str]) -> Tuple[str, str]:
440441
"TCOD_E_",
441442
"TCOD_HEAP_",
442443
"TCOD_LEX_",
444+
"TCOD_CHARMAP_",
443445
]
444446

445447

@@ -452,6 +454,8 @@ def write_library_constants() -> None:
452454
all_names = []
453455
f.write(CONSTANT_MODULE_HEADER)
454456
for name in dir(lib):
457+
# To exclude specific names use either EXCLUDE_CONSTANTS or
458+
# EXCLUDE_CONSTANT_PREFIXES before editing this.
455459
if name.endswith("_"):
456460
continue
457461
if name in EXCLUDE_CONSTANTS:

examples/samples_tcod.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -527,6 +527,7 @@ def ev_keydown(self, event: tcod.event.KeyDown):
527527
"PERMISSIVE7",
528528
"PERMISSIVE8",
529529
"RESTRICTIVE",
530+
"SYMMETRIC_SHADOWCAST",
530531
]
531532

532533
TORCH_RADIUS = 10
@@ -661,7 +662,7 @@ def ev_keydown(self, event: tcod.event.KeyDown):
661662
self.light_walls = not self.light_walls
662663
elif event.sym in FOV_SELECT_KEYS:
663664
self.algo_num += FOV_SELECT_KEYS[event.sym]
664-
self.algo_num %= tcod.NB_FOV_ALGORITHMS
665+
self.algo_num %= len(FOV_ALGO_NAMES)
665666
else:
666667
super().ev_keydown(event)
667668

tcod/constants.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
FOV_PERMISSIVE_8 = 11
1919
FOV_RESTRICTIVE = 12
2020
FOV_SHADOW = 2
21+
FOV_SYMMETRIC_SHADOWCAST = 13
2122
KEY_0 = 24
2223
KEY_1 = 25
2324
KEY_2 = 26
@@ -515,6 +516,7 @@
515516
"FOV_PERMISSIVE_8",
516517
"FOV_RESTRICTIVE",
517518
"FOV_SHADOW",
519+
"FOV_SYMMETRIC_SHADOWCAST",
518520
"KEY_0",
519521
"KEY_1",
520522
"KEY_2",

tcod/map.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,12 +200,16 @@ def compute_fov(
200200
* `tcod.FOV_PERMISSIVE(n)`:
201201
`n` starts at 0 (most restrictive) and goes up to 8 (most permissive.)
202202
* `tcod.FOV_RESTRICTIVE`
203+
* `tcod.FOV_SYMMETRIC_SHADOWCAST`
203204
204205
.. versionadded:: 9.3
205206
206207
.. versionchanged:: 11.0
207208
The parameters `x` and `y` have been changed to `pov`.
208209
210+
.. versionchanged:: 11.17
211+
Added `tcod.FOV_SYMMETRIC_SHADOWCAST` option.
212+
209213
Example:
210214
>>> explored = np.zeros((3, 5), dtype=bool, order="F")
211215
>>> transparency = np.ones((3, 5), dtype=bool, order="F")

0 commit comments

Comments
 (0)