Wednesday, August 15, 2007

Pygame weekly mini sprint 2007/08/15

There's been a few new things going into pygame recently.

Today two things came off the 'todo before release list'.

The first was the pygame.mask module was finished - the remaining from_surface function was implemented. It is 128x faster than the version written in python. It could still be optimized more, but I think it should be fast enough.

The second was the new sprite code from DR0ID. This has been a long time in development, and allows some pretty useful functionality for the pygame.sprite module. Like support for layers, blend modes, as well as automatic detection of what is faster - full screen update, or dirty rect update.

Now the 'todo before release list' is a lot shorter:

  • windows+mingw compilation instructions
  • remove current C based surfarray which uses Numeric. Replace it with a PixelArray C type. Then implement Numeric and Numpy support in python.
  • Mac OSX scrap fixes - using the new scrap api for clip board support.

    Marcus has the basics of the PixelArray code done, and we have figured out a way to get it all working with numeric, and numpy. It's kind of like implementing a Surface.tobuffer() function - but more general purpose. We are aiming for a situation where people can do quick transfers of data to libraries like PIL, opengl etc without requiring Numeric, like is currently required. We also want to support Numeric, and Numpy without requiring them at C compilation time.

    The mingw compilation instructions are already on the wiki... but are not 100% complete. We want to make it so people can basically do python install. Right now there are 100 or so steps to do before that will work. We want to be able to download mingw, download all the source dependencies, and download all patches required. Then build and install all the separate pieces. Each step will be optional, so for people who have mingw installed, or SDL installed will be able to skip those steps.

    Hopefully then we can get more people on windows able to modify pygame if they need too. Without spending a week trying to get it to compile.

    On the documentation front I'm thinking of a few things to improve. The first is
    a pygame glossary. Where terms that are used in pygame, graphics, and game programming are explained. At the moment there's only one term described... 'Dirty Rects'... but hopefully more will be added over time.

    The next one is being able to type in module, function, and classes after the url. Like for example: -> . It won't do any searching (for now), but will just be a little easier to find the docs online.

    The other documentation thing will be something like the pyopengl api guide. For each function and constant it has a link to the use of it in the Demo programs that come with pyopengl. This is really useful when trying to see how a function is used.

    Here's the top of the WHATSNEW file from recent checkins.

    Aug 15, 2007
  • The sprite module has had some big changes from DR0ID. It now has a LayeredUpdates, and LayeredDirty groups. For using layers when rendering the sprites. LayeredDirty is an alternative to RenderUpdates that automatically finds the best display method (either full screen updates, or dirty rect updates). It's faster if you have sprites that don't move. Thanks DR0ID!
  • Added pygame.mask.from_surface which can make a Mask object from a surface. It's 128x faster than the python version!
  • bug fix. Thanks Lenard Lindstrom!

    Jun 25, 2007
  • Removed QNX support from scrap module. Thanks Marcus!
  • Added smoothscale(with MMX!) function from Richard Goedeken

    Jun 27, 2007
  • Fixes from Marcus for ref counting bugs.
  • Also using METH_NOARGS for functions with no arguments. Which should make some functions slightly faster. Thanks Marcus, and thanks Campbell Barton for spotting them.

    It turns out there's some SSE instructions in the mmx scaling code - so they need to be fixed too. I think Lendard Lindstrom has those fixed though - but it still needs testing.
  • 1 comment:

    benji said...

    In your quest for automated and reproducible builds, I suggest you look at buildout: