Skip to content

2.4.0 - The happy new year release

Compare
Choose a tag to compare
@github-actions github-actions released this 02 Jan 08:44
4356e63

โ˜€๏ธ๐Ÿซ๐ŸŽŠ๐Ÿก๐ŸŽ†๐Ÿ ๐Ÿ•›๐Ÿซ๐ŸŒˆ๐ŸŽ„๐Ÿฉ๐Ÿช๐ŸŽ‡๐Ÿ ๐ŸŽ‰๐Ÿก๐Ÿช…
pip uninstall pygame (if previously installed, to avoid package conflicts)
pip install pygame-ce --upgrade
โ˜€๏ธ๐Ÿซ๐ŸŽŠ๐Ÿก๐ŸŽ†๐Ÿ ๐Ÿ•›๐Ÿซ๐ŸŒˆ๐ŸŽ„๐Ÿฉ๐Ÿช๐ŸŽ‡๐Ÿ ๐ŸŽ‰๐Ÿก๐Ÿช…

Happy new year! And with that, hello and welcome to yet another release of pygame-ce!

In about 4 months since the last release, this release has seen 36 contributors make over 150 pull requests and 606 commits with 81,203 line additions and 88,026 line deletions across 375 files! Wow!

The 2.4.x series drops support for Python 3.7, which has reached EOL. If you are still using this, consider upgrading to a newer Python version!

Special thanks to all our new (and returning after a while) contributors. Check out the changes!

Notable changes

๐ŸŸข A new experimental geometry submodule with a Circle class

A new submodule is making its way to pygame, how exciting!

The pygame_geometry project started with the purpose of helping users integrate special colliders more easily, by providing implementations for things like polygons, circles, lines, and raycasting. This submodule is still in early development and is very much experimental, but is set to slowly make its way into pygame-ce over the next couple of releases.

A big thanks to everyone who contributed to pygame-geometry so far: @Emc2356, @itzpr3d4t0r, @novialriptide, @ScriptLineStudios, @avaxar, @gresm, @Matiiss, @newpaxonian, @maqa41 and @blankRiot96

Parts of the submodule were ported bit by bit in the PRs #2268, #2562, #2560, #2614, #2540, #2536, #2519 and #2545

As with all experimental submodules, do remember that things in here are subject to change, and there are a lot more things to be added! See the docs for the current progress.

๐Ÿš€ More SIMD-based performance enhancements

Did you know pygame-ce uses optimized assembly? We use single instruction, multiple data (SIMD) instructions to speed up operations with lots of parallel computations. In this release, we've used this to increase performance of several transform and Surface operations (with more to come in future releases). These optimizations target Intel/AMD and ARM architectures.

  • @MyreMylar added an optimized backend for transform.greyscale through #2421 and #2432. Expected speedup: 7x for ARM/old x86 computers. 11x for x86 computers that support AVX2.
  • @itzpr3d4t0r worked on speeding Surface.fill when used with blend flags in #2566, #2382 and #2565. Expected speedup: Ridiculously faster, like 50-100x faster
  • @Starbuck5 added a new optimized backend for transform.smoothscale in #2473 and #2544. Expected speedup: 15% faster on x86, 35% faster on ARM.

๐ŸชŸ Improvements to the experimental Window class

A lot of nice work went behind the experimental Window class in this release. The Window class enables controlling multiple windows, and enables cool new windowing features over the pygame.display API. This is important because we hope the Window API exits experimental status soon! See the docs for the current progress.

API Changes

New API

Updated API

  • @yunline improved subpixel rendering (float coordinates) for _sdl2.video.Texture and _sdl2.video.Renderer in #2039
  • @yunline added support for int/str color values in _sdl2.video module in #2400
  • @gresm added and improved support for subclassing mixer.Sound and mixer.Channel in #2590
  • @oddbookworm added keyword argument support to Rect.collidedict[all] in #2309
  • @oddbookworm did some changes to allow clamp_magnitudeing of the zero vector when possible in #2598
  • @Starbuck5 updated our build to use SDL_image 2.8.0, which adds support for QOI images, in #2595.

Removals and deprecations

Performance enchancements

In addition to those mentioned above that are SIMD-related

  • @Starbuck5 optimized vector argument parsing in #2443, so Vector methods that operate on another Vector (like move_towards) are now ~10% faster.
  • @itzpr3d4t0r made many [F]Rect methods implement the FASTCALL convention in #2043, #2563 and #2570. All the updated functions should now work faster!
  • @Matiiss and @itzpr3d4t0r optimized hadling of [F]Rect arguments in #2041 and #2465.

Bug fixes

  • @dr0id added checks to disable font API usage when the subsystem is not initialized in #2371
  • @oddbookworm fixed an underflow issue in tick_busy_loop in #2466
  • @Damus666 did some WASM related fixes in display, math and color submodules in #2480 and #2482 (by adding required PyObject *_null parameter to functions marked with METH_NOARGS)
  • @pmp-p fixed a WASM loader incorrect target issue in #2586
  • A team of new contributors: @igordsm, @JorasOliveira, @Antonioarf, @jpgianfaldoni, @caioesr, @cicerotcv and @nataliaqmc fixed a colorkey issue in transform.rotozoom in #2491
  • @yunline fix a segfault in the update method of _sdl2.video.Texture in #2553
  • @ankith26 fix file-like close not called in freetype.Font in #2606
  • @Temmie3754 fixed incorrectly drawn edges in draw.polygon in #2131
  • @Temmie3754 fixed gfxdraw.bezier for when there are a lot of points in #2503
  • @MyreMylar fixed a segfault when passing empty StringIO/File objects to Font in #2548
  • @MyreMylar fixed RLE related issues in the transform module in #2535
  • @MyreMylar prevented an unnecessary warning from being raised when using SysFont and the default font in #2543
  • @Starbuck5 implemented a fix for windows webcams that don't report framerate crashing pygame.camera in #2574
  • @Starbuck5 fixed image.get_sdl_image_version incorrectly handling the linked argument in #2597

Test and examples related improvements

Docs and typing related enhancements

Other general updates

Code quality and robustness

CI and dependency related updates

  • @oddbookworm capped the sphinx version under 7.2.0 in #2407
  • @MyreMylar fixed grub-efi-amd64-signed installation failures on Ubuntu 20.04 CI builds in #2504
  • @zoldalma999 and @Starbuck5 removed old CI files in #2479 and #2460
  • @Starbuck5 managed versions of our SDL dependencies, raising our minimum build requirements and updating to SDL 2.28.5 as well as a custom build of SDL_image 2.8.0. #2464, #2584, #2580, #2595, #2596, #2474
  • @ankith26 kept improving our Mac and Linux dependency systems, and keeping our subdependencies up to date. One big win of this work is a 1.4 mb reduction in the size of the Linux wheels, achieved by making mpg123, fluidsynth and sndfile not link directly to lower-level audio playback libs! #2470, #2513, #2549, #2471

New (& returning after a time) Contributors

Thanks all

A hearty thank you to everyone involved! In addition to PR makers, we are thank the community at large. This includes issue reporters, PR reviewers, tutorial makers, admins/mods/helpers on various online forums, people who make helper libraries, and last but certainly not least, all our users including you: the person reading these notes!

Apologies in advance if we've made a mistake in these notes, do not hesitate to get in touch with us to get a correction made.

Cya, and have fun!

Full Changelog: 2.3.2...2.4.0