Skip to content

Releases: libtcod/python-tcod

19.5.0

13 Sep 19:30
19.5.0
59d5923
Compare
Choose a tag to compare

Changed

  • Update to libtcod 2.2.1.
  • Scaling defaults to nearest, set os.environ["SDL_RENDER_SCALE_QUALITY"] = "linear" if linear scaling was preferred.

Fixed

  • SDL_RENDER_SCALE_QUALITY is now respected again since the change to SDL3.
  • Fixed crash on controller events.

19.4.1

27 Aug 12:06
19.4.1
30f7834
Compare
Choose a tag to compare

Fixed

  • Fixed dangling pointer in Pathfinder.clear method.
  • Fixed hang in Pathfinder.rebuild_frontier method.

19.4.0

06 Aug 22:42
19.4.0
33a24b6
Compare
Choose a tag to compare

Changed

  • Checking "WindowSizeChanged" was not valid since SDL 3 and was also not valid in previous examples.
    You must no longer check the type of the WindowResized event.

Fixed

  • Corrected some inconsistent angle brackets in the __str__ of Event subclasses. #165
  • Fix regression with window events causing them to be Unknown and uncheckable.

19.3.1

02 Aug 03:46
19.3.1
1af4f65
Compare
Choose a tag to compare

Solved a deprecation warning which was internal to tcod and no doubt annoyed many devs.
Thanks to jmccardle for forcing me to resolve this.

Fixed

  • Silenced internal deprecation warnings within Context.convert_event.

19.3.0

26 Jul 11:00
19.3.0
a58c4dc
Compare
Choose a tag to compare

Added

  • tcod.sdl.render: Added ScaleMode enum and Texture.scale_mode attribute.

19.2.0

20 Jul 14:42
19.2.0
c19aacd
Compare
Choose a tag to compare

Added

  • tcod.noise.grid now has the offset parameter for easier sampling of noise chunks.

19.1.0

12 Jul 09:37
19.1.0
651f58f
Compare
Choose a tag to compare

Added

  • Added text input support to tcod.sdl.video.Window which was missing since the SDL3 update.
    After creating a context use assert context.sdl_window or if context.sdl_window: to verify that an SDL window exists then use context.sdl_window.start_text_input to enable text input events.
    Keep in mind that this can open an on-screen keyboard.

19.0.2

11 Jul 12:42
19.0.2
fbd9f78
Compare
Choose a tag to compare

Resolve wheel deployment issue.

19.0.1

11 Jul 12:19
19.0.1
5232622
Compare
Choose a tag to compare

Fixed

  • Console.print methods using string keyword were marked as invalid instead of deprecated.

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].
  • TextInput events are no longer enabled by default.

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.