Releases: libtcod/python-tcod
Releases · libtcod/python-tcod
19.0.0
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.grabhas been split into.mouse_graband.keyboard_grabattributes.tcod.event.KeySymsingle letter symbols are now all uppercase.- Relative mouse mode is set via
tcod.sdl.video.Window.relative_mouse_modeinstead oftcod.sdl.mouse.set_relative_mode. tcod.sdl.render.new_renderer: Removedsoftwareandtarget_texturesparameters,vsynctakesint,drivertakesstrinstead ofint.tcod.sdl.render.Renderer:integer_scalingandlogical_sizeare now set withset_logical_presentationmethod.tcod.sdl.render.Renderer.geometrynow takes float values forcolorinstead of 8-bit integers.tcod.event.Pointand other mouse/tile coordinate types now usefloatinstead ofint.
SDL3 has decided that mouse events have subpixel precision.
If you see any usualfloattypes in your code then this is why.tcod.sdl.audiohas been affected by major changes to SDL3.tcod.sdl.audio.openhas new behavior due to SDL3 and should be avoided.- Callbacks which were assigned to
AudioDevice's must now be applied toAudioStream's instead. AudioDevice's are now opened using references to existing devices.- Sound queueing methods were moved from
AudioDeviceto a newAudioStreamclass. BasicMixermay require manually specifyingfrequencyandchannelsto replicate old behavior.get_devicesandget_capture_devicesnow returndict[str, AudioDevice].
TextInputevents are no longer enabled by default.
Deprecated
tcod.sdl.audio.openwas replaced with a newer API, get a default device withtcod.sdl.audio.get_default_playback().open().tcod.sdl.audio.BasicMixershould be replaced withAudioStream's.- Should no longer use
tcod.sdl.audio.AudioDevicein a context, usecontextlib.closingfor the old behavior.
Removed
- Support dropped for Python 3.8 and 3.9.
- Removed
Joystick.get_current_powerdue to SDL3 changes. WindowFlags.FULLSCREEN_DESKTOPis now justWindowFlags.FULLSCREENtcod.sdl.render.Renderer.integer_scalingremoved.- Removed
callback,spec,queued_samples,queue_audio, anddequeue_audioattributes fromtcod.sdl.audio.AudioDevice.
Fixed
Joystick.get_ballwas broken.
18.1.0
Added
tcod.path.path2dto compute paths for the most basic cases.
Fixed
tcod.noise.gridwould raiseTypeErrorwhen given a plain integer for scale.
18.0.0
Changed
Console.printnow acceptsheightandwidthkeywords and has renamedstringtotext.- Text printed with
Console.printusing right-alignment has been shifted to the left by 1-tile.
Deprecated
- In general the
fg,bg, andbg_blendkeywords are too hard to keep track of as positional arguments so they must be replaced with keyword arguments instead. Console.print: deprecatedstring,fg,bg, andbg_blendbeing given as positional arguments.
Thestringparameter has been renamed totext.Console.print_boxhas been replaced byConsole.print.Console.draw_frame: deprecatedclear,fg,bg, andbg_blendbeing given as positional arguments.Console.draw_rect: deprecatedfg,bg, andbg_blendbeing given as positional arguments.- The
EventDispatchclass 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
Added
- SDL renderer primitive drawing methods now support sequences of tuples.
Fixed
tcod.sdl.Renderer.draw_linestype hint was too narrow.- Fixed crash in
tcod.sdl.Renderer.geometry.
17.0.0
Changed
EventDispatch's on event methods are now defined as positional parameters, so renaming theeventparameter is now valid in subclasses.
Deprecated
- Keyboard bitmask modifiers
tcod.event.KMOD_*have been replaced bytcod.event.Modifier.
Fixed
- Suppressed internal
mouse.tile_motiondeprecation warning. - Fixed SDL renderer primitive drawing methods. #159
16.2.3
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
Fixed
- Ignore the locale when encoding file paths outside of Windows.
- Fix performance when calling joystick functions.
16.2.1
Fixed
- Fixed errors loading files where their paths are non-ASCII and the C locale is not UTF-8.
16.2.0
Changed
- Renamed
gaussmethods to fix typos.