Skip to content

Releases: libtcod/python-tcod

19.0.0

13 Jun 19:31
19.0.0
50721e8
Compare
Choose a tag to compare

Finished port to SDL3, this has caused several breaking changes from SDL such as lowercase key constants now being uppercase and mouse events returning float instead of int.
Be sure to run Mypy on your projects to catch any issues from this update.

Changed

  • Updated libtcod to 2.1.1
  • Updated SDL to 3.2.16
    This will cause several breaking changes such as the names of keyboard constants and other SDL enums.
  • tcod.sdl.video.Window.grab has been split into .mouse_grab and .keyboard_grab attributes.
  • tcod.event.KeySym single letter symbols are now all uppercase.
  • Relative mouse mode is set via tcod.sdl.video.Window.relative_mouse_mode instead of tcod.sdl.mouse.set_relative_mode.
  • tcod.sdl.render.new_renderer: Removed software and target_textures parameters, vsync takes int, driver takes str instead of int.
  • tcod.sdl.render.Renderer: integer_scaling and logical_size are now set with set_logical_presentation method.
  • tcod.sdl.render.Renderer.geometry now takes float values for color instead of 8-bit integers.
  • tcod.event.Point and other mouse/tile coordinate types now use float instead of int.
    SDL3 has decided that mouse events have subpixel precision.
    If you see any usual float types in your code then this is why.
  • tcod.sdl.audio has been affected by major changes to SDL3.
    • tcod.sdl.audio.open has new behavior due to SDL3 and should be avoided.
    • Callbacks which were assigned to AudioDevice's must now be applied to AudioStream's instead.
    • AudioDevice's are now opened using references to existing devices.
    • Sound queueing methods were moved from AudioDevice to a new AudioStream class.
    • BasicMixer may require manually specifying frequency and channels to replicate old behavior.
    • get_devices and get_capture_devices now return dict[str, AudioDevice].

Deprecated

  • tcod.sdl.audio.open was replaced with a newer API, get a default device with tcod.sdl.audio.get_default_playback().open().
  • tcod.sdl.audio.BasicMixer should be replaced with AudioStream's.
  • Should no longer use tcod.sdl.audio.AudioDevice in a context, use contextlib.closing for the old behavior.

Removed

  • Support dropped for Python 3.8 and 3.9.
  • Removed Joystick.get_current_power due to SDL3 changes.
  • WindowFlags.FULLSCREEN_DESKTOP is now just WindowFlags.FULLSCREEN
  • tcod.sdl.render.Renderer.integer_scaling removed.
  • Removed callback, spec, queued_samples, queue_audio, and dequeue_audio attributes from tcod.sdl.audio.AudioDevice.

Fixed

  • Joystick.get_ball was broken.

18.1.0

05 May 00:59
18.1.0
f553f45
Compare
Choose a tag to compare

Added

  • tcod.path.path2d to compute paths for the most basic cases.

Fixed

  • tcod.noise.grid would raise TypeError when given a plain integer for scale.

18.0.0

08 Apr 05:52
18.0.0
de5d845
Compare
Choose a tag to compare

Changed

  • Console.print now accepts height and width keywords and has renamed string to text.
  • Text printed with Console.print using right-alignment has been shifted to the left by 1-tile.

Deprecated

  • In general the fg, bg, and bg_blend keywords are too hard to keep track of as positional arguments so they must be replaced with keyword arguments instead.
  • Console.print: deprecated string, fg, bg, and bg_blend being given as positional arguments.
    The string parameter has been renamed to text.
  • Console.print_box has been replaced by Console.print.
  • Console.draw_frame: deprecated clear, fg, bg, and bg_blend being given as positional arguments.
  • Console.draw_rect: deprecated fg, bg, and bg_blend being given as positional arguments.
  • The EventDispatch class is now deprecated.
    This class was made before Python supported protocols and structural pattern matching,
    now the class serves little purpose and its usage can create a minor technical burden.

17.1.0

29 Mar 04:46
17.1.0
250d0ad
Compare
Choose a tag to compare

Added

  • SDL renderer primitive drawing methods now support sequences of tuples.

Fixed

  • tcod.sdl.Renderer.draw_lines type hint was too narrow.
  • Fixed crash in tcod.sdl.Renderer.geometry.

17.0.0

28 Mar 08:11
17.0.0
048d180
Compare
Choose a tag to compare

Changed

  • EventDispatch's on event methods are now defined as positional parameters, so renaming the event parameter is now valid in subclasses.

Deprecated

  • Keyboard bitmask modifiers tcod.event.KMOD_* have been replaced by tcod.event.Modifier.

Fixed

  • Suppressed internal mouse.tile_motion deprecation warning.
  • Fixed SDL renderer primitive drawing methods. #159

16.2.3

16 Jul 22:28
16.2.3
59ec797
Compare
Choose a tag to compare

Fixed

  • Fixed access violation when events are polled before SDL is initialized.
  • Fixed access violation when libtcod images fail to load.
  • Verify input files exist when calling libtcodpy.parser_run, libtcodpy.namegen_parse, tcod.image.load.

16.2.2

16 Jan 06:55
16.2.2
5dcbcd4
Compare
Choose a tag to compare

Fixed

  • Ignore the locale when encoding file paths outside of Windows.
  • Fix performance when calling joystick functions.

16.2.1

25 Sep 06:08
16.2.1
b032d80
Compare
Choose a tag to compare

Fixed

  • Fixed errors loading files where their paths are non-ASCII and the C locale is not UTF-8.

16.2.0

21 Sep 03:47
16.2.0
688fc66
Compare
Choose a tag to compare

Changed

  • Renamed gauss methods to fix typos.

16.1.1

10 Jul 08:07
16.1.1
e597ceb
Compare
Choose a tag to compare

Changed

  • Added an empty __slots__ to EventDispatch.
  • Bundle SDL 2.28.1 on Windows and MacOS.

Fixed

  • Fixed "SDL failed to get a vertex buffer for this Direct3D 9 rendering batch!"
    #131

Removed

  • Dropped support for Python 3.7.