Skip to content

Commit

Permalink
Prepare 16.0.0 release.
Browse files Browse the repository at this point in the history
  • Loading branch information
HexDecimal committed May 28, 2023
1 parent eaf4571 commit 98531c5
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 24 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Expand Up @@ -4,6 +4,8 @@ Changes relevant to the users of python-tcod are documented here.
This project adheres to [Semantic Versioning](https://semver.org/) since version `2.0.0`.

## [Unreleased]

## [16.0.0] - 2023-05-27
### Added
- Added PathLike support to more libtcodpy functions.
- New `tcod.sdl.mouse.show` function for querying or setting mouse visibility.
Expand All @@ -17,7 +19,7 @@ This project adheres to [Semantic Versioning](https://semver.org/) since version
- Deprecated the libtcodpy functions for images and noise generators.

### Removed
- `tcod.console_set_custom_font` can no longer take bytes.
- `tcod.console_set_custom_font` can no longer take bytes as the file path.

### Fixed
- Fix `tcod.sdl.mouse.warp_in_window` function.
Expand Down
4 changes: 2 additions & 2 deletions tcod/image.py
Expand Up @@ -69,7 +69,7 @@ def from_array(cls, array: ArrayLike) -> Image:
def from_file(cls, path: str | PathLike[str]) -> Image:
"""Return a new Image loaded from the given `path`.
.. versionadded:: Unreleased
.. versionadded:: 16.0
"""
path = Path(path).resolve(strict=True)
return cls._from_cdata(ffi.gc(lib.TCOD_image_load(bytes(path)), lib.TCOD_image_delete))
Expand Down Expand Up @@ -303,7 +303,7 @@ def save_as(self, filename: str | PathLike[str]) -> None:
Args:
filename (Text): File path to same this Image.
.. versionchanged:: Unreleased
.. versionchanged:: 16.0
Added PathLike support.
"""
lib.TCOD_image_save(self.image_c, bytes(Path(filename)))
Expand Down
36 changes: 18 additions & 18 deletions tcod/libtcodpy.py
Expand Up @@ -985,7 +985,7 @@ def console_set_custom_font(
Load fonts using :any:`tcod.tileset.load_tilesheet` instead.
See :ref:`getting-started` for more info.
.. versionchanged:: Unreleased
.. versionchanged:: 16.0
Added PathLike support. `fontFile` no longer takes bytes.
"""
fontFile = Path(fontFile).resolve(strict=True)
Expand Down Expand Up @@ -1800,7 +1800,7 @@ def console_from_file(filename: str | PathLike[str]) -> tcod.console.Console:
Other formats are not actively supported.
.. versionchanged:: Unreleased
.. versionchanged:: 16.0
Added PathLike support.
"""
filename = Path(filename).resolve(strict=True)
Expand Down Expand Up @@ -1979,7 +1979,7 @@ def console_load_asc(con: tcod.console.Console, filename: str | PathLike[str]) -
.. deprecated:: 12.7
This format is no longer supported.
.. versionchanged:: Unreleased
.. versionchanged:: 16.0
Added PathLike support.
"""
filename = Path(filename).resolve(strict=True)
Expand All @@ -1993,7 +1993,7 @@ def console_save_asc(con: tcod.console.Console, filename: str | PathLike[str]) -
.. deprecated:: 12.7
This format is no longer supported.
.. versionchanged:: Unreleased
.. versionchanged:: 16.0
Added PathLike support.
"""
return bool(lib.TCOD_console_save_asc(_console(con), bytes(Path(filename))))
Expand All @@ -2006,7 +2006,7 @@ def console_load_apf(con: tcod.console.Console, filename: str | PathLike[str]) -
.. deprecated:: 12.7
This format is no longer supported.
.. versionchanged:: Unreleased
.. versionchanged:: 16.0
Added PathLike support.
"""
filename = Path(filename).resolve(strict=True)
Expand All @@ -2020,7 +2020,7 @@ def console_save_apf(con: tcod.console.Console, filename: str | PathLike[str]) -
.. deprecated:: 12.7
This format is no longer supported.
.. versionchanged:: Unreleased
.. versionchanged:: 16.0
Added PathLike support.
"""
return bool(lib.TCOD_console_save_apf(_console(con), bytes(Path(filename))))
Expand All @@ -2034,7 +2034,7 @@ def console_load_xp(con: tcod.console.Console, filename: str | PathLike[str]) ->
Functions modifying console objects in-place are deprecated.
Use :any:`tcod.console_from_xp` to load a Console from a file.
.. versionchanged:: Unreleased
.. versionchanged:: 16.0
Added PathLike support.
"""
filename = Path(filename).resolve(strict=True)
Expand All @@ -2045,7 +2045,7 @@ def console_load_xp(con: tcod.console.Console, filename: str | PathLike[str]) ->
def console_save_xp(con: tcod.console.Console, filename: str | PathLike[str], compress_level: int = 9) -> bool:
"""Save a console to a REXPaint `.xp` file.
.. versionchanged:: Unreleased
.. versionchanged:: 16.0
Added PathLike support.
"""
return bool(lib.TCOD_console_save_xp(_console(con), bytes(Path(filename)), compress_level))
Expand All @@ -2055,7 +2055,7 @@ def console_save_xp(con: tcod.console.Console, filename: str | PathLike[str], co
def console_from_xp(filename: str | PathLike[str]) -> tcod.console.Console:
"""Return a single console from a REXPaint `.xp` file.
.. versionchanged:: Unreleased
.. versionchanged:: 16.0
Added PathLike support.
"""
filename = Path(filename).resolve(strict=True)
Expand All @@ -2068,7 +2068,7 @@ def console_list_load_xp(
) -> list[tcod.console.Console] | None:
"""Return a list of consoles from a REXPaint `.xp` file.
.. versionchanged:: Unreleased
.. versionchanged:: 16.0
Added PathLike support.
"""
filename = Path(filename).resolve(strict=True)
Expand All @@ -2093,7 +2093,7 @@ def console_list_save_xp(
) -> bool:
"""Save a list of consoles to a REXPaint `.xp` file.
.. versionchanged:: Unreleased
.. versionchanged:: 16.0
Added PathLike support.
"""
tcod_list = lib.TCOD_list_new()
Expand Down Expand Up @@ -3040,10 +3040,10 @@ def image_load(filename: str | PathLike[str]) -> tcod.image.Image:
Args:
filename: Path to a .bmp or .png image file.
.. versionchanged:: Unreleased
.. versionchanged:: 16.0
Added PathLike support.
.. deprecated:: Unreleased
.. deprecated:: 16.0
Use :any:`tcod.image.Image.from_file` instead.
"""
return tcod.image.Image.from_file(filename)
Expand All @@ -3058,7 +3058,7 @@ def image_from_console(console: tcod.console.Console) -> tcod.image.Image:
Args:
console (Console): Any Console instance.
.. deprecated:: Unreleased
.. deprecated:: 16.0
:any:`Tileset.render` is a better alternative.
"""
return tcod.image.Image._from_cdata(
Expand All @@ -3073,7 +3073,7 @@ def image_from_console(console: tcod.console.Console) -> tcod.image.Image:
def image_refresh_console(image: tcod.image.Image, console: tcod.console.Console) -> None:
"""Update an image made with :any:`image_from_console`.
.. deprecated:: Unreleased
.. deprecated:: 16.0
This function is unnecessary, use :any:`Tileset.render` instead.
"""
image.refresh_console(console)
Expand Down Expand Up @@ -3419,7 +3419,7 @@ def map_get_height(map: tcod.map.Map) -> int:
def mouse_show_cursor(visible: bool) -> None:
"""Change the visibility of the mouse cursor.
.. deprecated:: Unreleased
.. deprecated:: 16.0
Use :any:`tcod.sdl.mouse.show` instead.
"""
lib.TCOD_mouse_show_cursor(visible)
Expand All @@ -3429,7 +3429,7 @@ def mouse_show_cursor(visible: bool) -> None:
def mouse_is_cursor_visible() -> bool:
"""Return True if the mouse cursor is visible.
.. deprecated:: Unreleased
.. deprecated:: 16.0
Use :any:`tcod.sdl.mouse.show` instead.
"""
return bool(lib.TCOD_mouse_is_cursor_visible())
Expand Down Expand Up @@ -4087,7 +4087,7 @@ def sys_save_screenshot(name: str | PathLike[str] | None = None) -> None:
This function is not supported by contexts.
Use :any:`Context.save_screenshot` instead.
.. versionchanged:: Unreleased
.. versionchanged:: 16.0
Added PathLike support.
"""
lib.TCOD_sys_save_screenshot(bytes(Path(name)) if name is not None else ffi.NULL)
Expand Down
4 changes: 2 additions & 2 deletions tcod/sdl/audio.py
Expand Up @@ -111,7 +111,7 @@ def convert_audio(
.. versionadded:: 13.6
.. versionchanged:: Unreleased
.. versionchanged:: 16.0
Now converts floating types to `np.float32` when SDL doesn't support the specific format.
.. seealso::
Expand Down Expand Up @@ -167,7 +167,7 @@ class AudioDevice:
When you use this object directly the audio passed to :any:`queue_audio` is always played synchronously.
For more typical asynchronous audio you should pass an AudioDevice to :any:`BasicMixer`.
.. versionchanged:: Unreleased
.. versionchanged:: 16.0
Can now be used as a context which will close the device on exit.
"""

Expand Down
2 changes: 1 addition & 1 deletion tcod/sdl/mouse.py
Expand Up @@ -244,7 +244,7 @@ def show(visible: bool | None = None) -> bool:
Returns:
True if the cursor is visible.
.. versionadded:: Unreleased
.. versionadded:: 16.0
"""
_OPTIONS = {None: lib.SDL_QUERY, False: lib.SDL_DISABLE, True: lib.SDL_ENABLE}
return _check(lib.SDL_ShowCursor(_OPTIONS[visible])) == int(lib.SDL_ENABLE)

0 comments on commit 98531c5

Please sign in to comment.