Skip to content

Commit c811aa8

Browse files
committed
Add XTERM renderer.
1 parent 14f4549 commit c811aa8

File tree

6 files changed

+24
-1
lines changed

6 files changed

+24
-1
lines changed

CHANGELOG.rst

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

99
Unreleased
1010
------------------
11+
Added
12+
- New experimental renderer `tcod.context.RENDERER_XTERM`.
13+
1114
Fixed
1215
- Functions accepting `Path`-like parameters now accept the more correct `os.PathLike` type.
1316

build_libtcod.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -388,13 +388,15 @@ def parse_sdl_attrs(prefix: str, all_names: List[str]) -> Tuple[str, str]:
388388
"TCOD_KEY_TEXT_SIZE",
389389
"TCOD_NOISE_MAX_DIMENSIONS",
390390
"TCOD_NOISE_MAX_OCTAVES",
391+
"TCOD_FALLBACK_FONT_SIZE",
391392
]
392393

393394
EXCLUDE_CONSTANT_PREFIXES = [
394395
"TCOD_E_",
395396
"TCOD_HEAP_",
396397
"TCOD_LEX_",
397398
"TCOD_CHARMAP_",
399+
"TCOD_LOG_",
398400
]
399401

400402

tcod/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -556,6 +556,7 @@
556556
"RENDERER_OPENGL2",
557557
"RENDERER_SDL",
558558
"RENDERER_SDL2",
559+
"RENDERER_XTERM",
559560
"RIGHT",
560561
"RNG_CMWC",
561562
"RNG_MT",

tcod/constants.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@
247247
KEY_PRESSED = 1
248248
KEY_RELEASED = 2
249249
LEFT = 0
250-
NB_RENDERERS = 5
250+
NB_RENDERERS = 6
251251
NOISE_DEFAULT = 0
252252
NOISE_PERLIN = 1
253253
NOISE_SIMPLEX = 2
@@ -257,6 +257,7 @@
257257
RENDERER_OPENGL2 = 4
258258
RENDERER_SDL = 2
259259
RENDERER_SDL2 = 3
260+
RENDERER_XTERM = 5
260261
RIGHT = 1
261262
RNG_CMWC = 1
262263
RNG_MT = 0
@@ -755,6 +756,7 @@
755756
"RENDERER_OPENGL2",
756757
"RENDERER_SDL",
757758
"RENDERER_SDL2",
759+
"RENDERER_XTERM",
758760
"RIGHT",
759761
"RNG_CMWC",
760762
"RNG_MT",

tcod/context.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@
8080
"RENDERER_OPENGL2",
8181
"RENDERER_SDL",
8282
"RENDERER_SDL2",
83+
"RENDERER_XTERM",
8384
)
8485

8586
SDL_WINDOW_FULLSCREEN = lib.SDL_WINDOW_FULLSCREEN
@@ -126,6 +127,19 @@
126127
Rendering is decided by SDL2 and can be changed by using an SDL2 hint:
127128
https://wiki.libsdl.org/SDL_HINT_RENDER_DRIVER
128129
"""
130+
RENDERER_XTERM = lib.TCOD_RENDERER_XTERM
131+
"""A renderer targeting modern terminals with 24-bit color support.
132+
133+
This is an experimental renderer with partial support for XTerm and SSH.
134+
This will work best on those terminals.
135+
136+
Terminal inputs and events will be passed to SDL's event system.
137+
138+
There is poor support for ANSI escapes on Windows 10.
139+
It is not recommended to use this renderer on Windows.
140+
141+
.. versionadded:: 13.3
142+
"""
129143

130144

131145
def _handle_tileset(tileset: Optional[tcod.tileset.Tileset]) -> Any:

tcod/libtcodpy.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4713,6 +4713,7 @@ def _atexit_verify() -> None:
47134713
"RENDERER_OPENGL2",
47144714
"RENDERER_SDL",
47154715
"RENDERER_SDL2",
4716+
"RENDERER_XTERM",
47164717
"RIGHT",
47174718
"RNG_CMWC",
47184719
"RNG_MT",

0 commit comments

Comments
 (0)