Skip to content

Commit

Permalink
Prepare 13.5.0 release.
Browse files Browse the repository at this point in the history
  • Loading branch information
HexDecimal committed Feb 11, 2022
1 parent f78fe39 commit 1efd263
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 32 deletions.
2 changes: 2 additions & 0 deletions 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]

## [13.5.0] - 2022-02-11
### Added
- `tcod.sdl.audio`, a new module exposing SDL audio devices. This does not include an audio mixer yet.
- `tcod.sdl.mouse`, for SDL mouse and cursor handing.
Expand Down
2 changes: 1 addition & 1 deletion tcod/context.py
Expand Up @@ -376,7 +376,7 @@ def sdl_renderer(self) -> Optional[tcod.sdl.render.Renderer]:
def sdl_atlas(self) -> Optional[tcod.render.SDLTilesetAtlas]:
"""Return a :any:`tcod.render.SDLTilesetAtlas` referencing libtcod's SDL texture atlas if it exists.
.. versionadded:: unreleased
.. versionadded:: 13.5
"""
if self._context_p.type not in (lib.TCOD_RENDERER_SDL, lib.TCOD_RENDERER_SDL2):
return None
Expand Down
2 changes: 1 addition & 1 deletion tcod/sdl/audio.py
@@ -1,6 +1,6 @@
"""SDL2 audio playback and recording tools.
.. versionadded:: unreleased
.. versionadded:: 13.5
"""
from __future__ import annotations

Expand Down
2 changes: 1 addition & 1 deletion tcod/sdl/mouse.py
@@ -1,6 +1,6 @@
"""SDL mouse and cursor functions.
.. versionadded:: unreleased
.. versionadded:: 13.5
"""
from __future__ import annotations

Expand Down
56 changes: 28 additions & 28 deletions tcod/sdl/render.py
Expand Up @@ -45,7 +45,7 @@ class BlendFactor(enum.IntEnum):
:any:`compose_blend_mode`
https://wiki.libsdl.org/SDL_BlendFactor
.. versionadded:: unreleased
.. versionadded:: 13.5
"""

ZERO = 0x1
Expand Down Expand Up @@ -77,7 +77,7 @@ class BlendOperation(enum.IntEnum):
:any:`compose_blend_mode`
https://wiki.libsdl.org/SDL_BlendOperation
.. versionadded:: unreleased
.. versionadded:: 13.5
"""

ADD = 0x1
Expand All @@ -100,7 +100,7 @@ class BlendMode(enum.IntEnum):
:any:`Renderer.draw_blend_mode`
:any:`compose_blend_mode`
.. versionadded:: unreleased
.. versionadded:: 13.5
"""

NONE = 0x00000000
Expand Down Expand Up @@ -128,7 +128,7 @@ def compose_blend_mode(
.. seealso::
https://wiki.libsdl.org/SDL_ComposeCustomBlendMode
.. versionadded:: unreleased
.. versionadded:: 13.5
"""
return BlendMode(
lib.SDL_ComposeCustomBlendMode(
Expand Down Expand Up @@ -157,7 +157,7 @@ def __init__(self, sdl_texture_p: Any, sdl_renderer_p: Any = None) -> None:
self.access: Final[TextureAccess] = TextureAccess(query[1])
"""Texture access mode, read only.
.. versionchanged:: unreleased
.. versionchanged:: 13.5
Attribute is now a :any:`TextureAccess` value.
"""
self.width: Final[int] = query[2]
Expand All @@ -178,7 +178,7 @@ def _query(self) -> Tuple[int, int, int, int]:
def update(self, pixels: NDArray[Any], rect: Optional[Tuple[int, int, int, int]] = None) -> None:
"""Update the pixel data of this texture.
.. versionadded:: unreleased
.. versionadded:: 13.5
"""
if rect is None:
rect = (0, 0, self.width, self.height)
Expand All @@ -202,7 +202,7 @@ def alpha_mod(self, value: int) -> None:
def blend_mode(self) -> BlendMode:
"""Texture blend mode, can be set.
.. versionchanged:: unreleased
.. versionchanged:: 13.5
Property now returns a BlendMode instance.
"""
out = ffi.new("SDL_BlendMode*")
Expand Down Expand Up @@ -271,7 +271,7 @@ def copy(
center: The (x, y) point where rotation is applied. If None then the center of `dest` is used.
flip: Flips the `texture` when drawing it.
.. versionchanged:: unreleased
.. versionchanged:: 13.5
`source` and `dest` can now be float tuples.
Added the `angle`, `center`, and `flip` parameters.
"""
Expand Down Expand Up @@ -349,7 +349,7 @@ def upload_texture(
def draw_color(self) -> Tuple[int, int, int, int]:
"""Get or set the active RGBA draw color for this renderer.
.. versionadded:: unreleased
.. versionadded:: 13.5
"""
rgba = ffi.new("uint8_t[4]")
_check(lib.SDL_GetRenderDrawColor(self.p, rgba, rgba + 1, rgba + 2, rgba + 3))
Expand All @@ -363,7 +363,7 @@ def draw_color(self, rgba: Tuple[int, int, int, int]) -> None:
def draw_blend_mode(self) -> BlendMode:
"""Get or set the active blend mode of this renderer.
.. versionadded:: unreleased
.. versionadded:: 13.5
"""
out = ffi.new("SDL_BlendMode*")
_check(lib.SDL_GetRenderDrawBlendMode(self.p, out))
Expand All @@ -380,7 +380,7 @@ def output_size(self) -> Tuple[int, int]:
.. seealso::
https://wiki.libsdl.org/SDL_GetRendererOutputSize
.. versionadded:: unreleased
.. versionadded:: 13.5
"""
out = ffi.new("int[2]")
_check(lib.SDL_GetRendererOutputSize(self.p, out, out + 1))
Expand All @@ -392,7 +392,7 @@ def clip_rect(self) -> Optional[Tuple[int, int, int, int]]:
Set to None to disable clipping.
.. versionadded:: unreleased
.. versionadded:: 13.5
"""
if not lib.SDL_RenderIsClipEnabled(self.p):
return None
Expand All @@ -412,7 +412,7 @@ def integer_scaling(self) -> bool:
.. seealso::
https://wiki.libsdl.org/SDL_RenderSetIntegerScale
.. versionadded:: unreleased
.. versionadded:: 13.5
"""
return bool(lib.SDL_RenderGetIntegerScale(self.p))

Expand All @@ -429,7 +429,7 @@ def logical_size(self) -> Tuple[int, int]:
.. seealso::
https://wiki.libsdl.org/SDL_RenderSetLogicalSize
.. versionadded:: unreleased
.. versionadded:: 13.5
"""
out = ffi.new("int[2]")
lib.SDL_RenderGetLogicalSize(self.p, out, out + 1)
Expand All @@ -446,7 +446,7 @@ def scale(self) -> Tuple[float, float]:
.. seealso::
https://wiki.libsdl.org/SDL_RenderSetScale
.. versionadded:: unreleased
.. versionadded:: 13.5
"""
out = ffi.new("float[2]")
lib.SDL_RenderGetScale(self.p, out, out + 1)
Expand All @@ -463,7 +463,7 @@ def viewport(self) -> Optional[Tuple[int, int, int, int]]:
.. seealso::
https://wiki.libsdl.org/SDL_RenderSetViewport
.. versionadded:: unreleased
.. versionadded:: 13.5
"""
rect = ffi.new("SDL_Rect*")
lib.SDL_RenderGetViewport(self.p, rect)
Expand All @@ -477,7 +477,7 @@ def viewport(self, rect: Optional[Tuple[int, int, int, int]]) -> None:
def set_vsync(self, enable: bool) -> None:
"""Enable or disable VSync for this renderer.
.. versionadded:: unreleased
.. versionadded:: 13.5
"""
_check(lib.SDL_RenderSetVSync(self.p, enable))

Expand All @@ -489,7 +489,7 @@ def read_pixels(
out: Optional[NDArray[Any]] = None,
) -> NDArray[Any]:
"""
.. versionadded:: unreleased
.. versionadded:: 13.5
"""
if format is None:
format = lib.SDL_PIXELFORMAT_RGBA32
Expand All @@ -516,41 +516,41 @@ def read_pixels(
def clear(self) -> None:
"""Clear the current render target with :any:`draw_color`.
.. versionadded:: unreleased
.. versionadded:: 13.5
"""
_check(lib.SDL_RenderClear(self.p))

def fill_rect(self, rect: Tuple[float, float, float, float]) -> None:
"""Fill a rectangle with :any:`draw_color`.
.. versionadded:: unreleased
.. versionadded:: 13.5
"""
_check(lib.SDL_RenderFillRectF(self.p, (rect,)))

def draw_rect(self, rect: Tuple[float, float, float, float]) -> None:
"""Draw a rectangle outline.
.. versionadded:: unreleased
.. versionadded:: 13.5
"""
_check(lib.SDL_RenderDrawRectF(self.p, (rect,)))

def draw_point(self, xy: Tuple[float, float]) -> None:
"""Draw a point.
.. versionadded:: unreleased
.. versionadded:: 13.5
"""
_check(lib.SDL_RenderDrawPointF(self.p, (xy,)))

def draw_line(self, start: Tuple[float, float], end: Tuple[float, float]) -> None:
"""Draw a single line.
.. versionadded:: unreleased
.. versionadded:: 13.5
"""
_check(lib.SDL_RenderDrawLineF(self.p, *start, *end))

def fill_rects(self, rects: NDArray[Union[np.intc, np.float32]]) -> None:
"""Fill multiple rectangles from an array.
.. versionadded:: unreleased
.. versionadded:: 13.5
"""
assert len(rects.shape) == 2
assert rects.shape[1] == 4
Expand All @@ -565,7 +565,7 @@ def fill_rects(self, rects: NDArray[Union[np.intc, np.float32]]) -> None:
def draw_rects(self, rects: NDArray[Union[np.intc, np.float32]]) -> None:
"""Draw multiple outlined rectangles from an array.
.. versionadded:: unreleased
.. versionadded:: 13.5
"""
assert len(rects.shape) == 2
assert rects.shape[1] == 4
Expand All @@ -580,7 +580,7 @@ def draw_rects(self, rects: NDArray[Union[np.intc, np.float32]]) -> None:
def draw_points(self, points: NDArray[Union[np.intc, np.float32]]) -> None:
"""Draw an array of points.
.. versionadded:: unreleased
.. versionadded:: 13.5
"""
assert len(points.shape) == 2
assert points.shape[1] == 2
Expand All @@ -595,7 +595,7 @@ def draw_points(self, points: NDArray[Union[np.intc, np.float32]]) -> None:
def draw_lines(self, points: NDArray[Union[np.intc, np.float32]]) -> None:
"""Draw a connected series of lines from an array.
.. versionadded:: unreleased
.. versionadded:: 13.5
"""
assert len(points.shape) == 2
assert points.shape[1] == 2
Expand All @@ -618,7 +618,7 @@ def geometry(
) -> None:
"""Render triangles from texture and vertex data.
.. versionadded:: unreleased
.. versionadded:: 13.5
"""
assert xy.dtype == np.float32
assert len(xy.shape) == 2
Expand Down
2 changes: 1 addition & 1 deletion tcod/sdl/video.py
Expand Up @@ -284,7 +284,7 @@ def mouse_rect(self) -> Optional[Tuple[int, int, int, int]]:
Setting this will not automatically grab the cursor.
.. versionadded:: unreleased
.. versionadded:: 13.5
"""
_version_at_least((2, 0, 18))
rect = lib.SDL_GetWindowMouseRect(self.p)
Expand Down

0 comments on commit 1efd263

Please sign in to comment.