Re: [pygame] Re: Starting the pygame 2 series

2020-10-28 Thread claudio canepa
Congratulations all off pygame team & contributors!!


On Wed, Oct 28, 2020 at 3:10 PM René Dudfield  wrote:

>
>  ,--.
> |  oo|
> |  ~~| o  o  o  o  o  o  o  o  o  o  o  o  o
> |/\/\|
>python3  -m pip install pygame==2.0.0
>
> The 28th of October 2020 is the pygame 
> 2.0 release date, because pygame turns 20 years of age.
> [image: pygame-head-party.png]
> What's the best feature of pygame 2? Maybe it's "*backwards compatibility*".
> For many, many apps pygame 2 is backwards compatible. Have an pygame app
> from the year 2000? It will probably work. We still have some known issues
> and open backwards compatibility issues(see below), but a lot of things
> work just as they did before. Yes, we still have python 2 support.
>
> How does one summarize the 3306 changes since we started the pygame 2
> series in July of 2018 based on patches going back to 2012 and even earlier?
>
>- Support for Metal, Direct 3d, Vulkan, OpenGL 3.0+ in various
>profiles (core, compatibility, debug, robust, etc), OpenGL ES, and other
>modern hardware accelerated video APIs across many platforms.
>- SSE2/Neon assembly image drawing. Much faster drawing routines,
>image loading, and alpha blending.
>- Type Hints, for code completion (and to help you make the squiggly
>lines disappear) in editors and IDEs.
>- Code cleanup, using lots of code robustness tools like static
>analyzers, and automated CI/CD. We've been able to help dozens of people
>new to community projects contribute. We have lots of work to go on code
>quality, but we're currently the highest rated Python and highest rate C
>large project on LGTM.
>- Many, many bug fixes including in our pygame.draw routines,
>pygame.math(for vectors), and pygame.mask for pixel perfect collision
>detection.
>- better support for pypy (the fast JIT based implementation of
>python).
>- libsdl version 2 support. Technically pygame 2.0 still works with
>SDL 1, but we recommend SDL2 which is vastly improved over SDL1 for most
>use cases. Probably we will remove SDL 1 support starting pygame 2.1.
>- Touch support (multitouch, gestures, etc)
>- Audio input support (make games with your microphone!).
>- Message alert boxes (Press OK, or Cancel).
>- Better keyboard support. Proper unicode input and IME support.
>- Much improved game controller support.
>- Better image and audio format support. Including: webp, 32bit wav
>files, and much more reliable mp3 support.
>- Multiple display support, and multiple window support (multi window
>support is still experimental, more will come in pygame 2.1).
>- Android support through python for android (fork of pygame subset
>for android). Better documentation, and better support will come in future
>releases.
>- to make distributing your apps easier, a built in "pyinstaller
>hook"and compatibility with cxfreeze.
>- binary "wheels" on many platforms and versions of python from the
>old python 2.7 - to the latest python 3.9 (and with pypy!).
>- lots of quality of life improvements like Surface.fill('black')
>instead of Surface.fill(pygame.Color(0, 0, 0)). Also keywords are
>supported for many more function arguments. You can draw rounded corners on
>rects.
>- plenty of new examples, like python3 -m pygame.examples.font_viewer,
>and python3 -m pygame.examples.music_drop_fade. Additionally the
>example source code has been cleaned up a lot to follow a more current
>python style.
>- Hundreds of documentation improvements, include a new Korean
>tutorial.
>- a special SCALED mode which takes low pixel games and automatically
>translates them to a larger window. Imagine your 320x200 resolution game of
>glorious pixel art... on modern screens that would be a very tiny windows.
>Now with SCALED it shows up big on a Full HD screen, or even a 4K/8K screen
>and the translation of mouse coordinates and up-scaling of pixels is done
>for you (hardware accelerated of course).
>
> That was a summary of some of the goodies in pygame 2. We will be
> releasing more articles and tutorials on new features as time goes on. You
> can also look at the previous release notes for more info (see end of this
> post).
> thank you 
>
> Probably one of the better realizations thinking about pygame on its 20th
> birthday is that there is a much larger group of people who have
> contributed to crafting pygame in recent years. Some have moved onto other
> things like jobs, family or writing cookbooks in the Canadian wilderness.
> Much respect for volunteering time to a community project like pygame.
>
> *Firstly thanks to the pygame team members* who contributed to the pygame
> 2 series, new and old...
>
> David Lönnhager (@dlon ) | René Dudfield (@illume
> ) | Charles (@charlesej
> 

Re: [pygame] Current working version of Python and pygame

2020-10-23 Thread claudio canepa
>  Question 1:  If someone already has installed Python but did not check
this box on, is there some simple command line magic to do whatever this
checkbox does?  If so, what do I need to tell my student to do?

With a python 3.X  installed  they need replace 'python' by 'py -3.X' in
the cmdline.
Examples, for a python 3.7 installation:
To invoke the interactive interpreter:
   py -3.7
To run a script:
  py -3.7 myscript.py

Another difference with unix-like OSes is that the python's Scripts
directory is not on the path, so pip (and other commands in Scripts) need a
full qualified path in the command, like
  c:\python37\Scripts\pip install ...
or the alternative form
  py -3.7 -m pip install ..

I don't know if it would be better to work from a venv:

Create venv
py -3.7 -m venv venv_path
Activate
venv_path\Scripts\activate

After that, in that console 'python' would be the python in the venv, and
venv_path\Scripts will be in the PATH, so commands like 'pip', 'pytest',
etc would work fine.

To deactivate the venv:
   deactivate

> Question 2:  If someone does not have Python installed yet (or wants to
install a newer version), what is the most recent version of Python (Mac
and Windows) that I should ask them to install today?  I understand that
there is a big effort to get the 2.0 version of Pygame out, but I want my
students to use version 1.9 for now.  If they install the current version
of Python: 3.9, will they be able to use pip to install a working version
of pygame 1.9?  (Last time I checked, this did not work correctly?

python 3.8 has been tested more time; also 3.9 is not compatible with
windows7, which maybe some students have in their house.


On Fri, Oct 23, 2020 at 7:08 PM Irv Kalb  wrote:

> I am teaching a Python class, where I use pygame to demonstrate OOP
> concepts.  I need to have my students get the proper environment to run
> Python with pygame.
>
> I use a Mac, and I have Python 3.7.3, and pygame 1.9.6 installed.
> Everything works fine for me.  But I have students who either have Python
> already installed and need to install pygame, or who need to install both
> Python and pygame.
>
> I am not a Windows user, and I typically don't use the command line for
> anything other than installations.  My understanding is that if you are on
> Windows, and you want to use pygame, then during the installation of
> Python, when the installation puts up dialog box about installing Python,
> you must check the checkbox at the bottom that says:
>
>  Add Python 3.x to PATH
>
> Question 1:  If someone already has installed Python but did not check
> this box on, is there some simple command line magic to do whatever this
> checkbox does?  If so, what do I need to tell my student to do?
>
> Question 2:  If someone does not have Python installed yet (or wants to
> install a newer version), what is the most recent version of Python (Mac
> and Windows) that I should ask them to install today?  I understand that
> there is a big effort to get the 2.0 version of Pygame out, but I want my
> students to use version 1.9 for now.  If they install the current version
> of Python: 3.9, will they be able to use pip to install a working version
> of pygame 1.9?  (Last time I checked, this did not work correctly?
>
> Thanks in advance,
>
> Irv
>
>
>


Re: [pygame] toggle between play pause and unpause

2017-05-07 Thread claudio canepa
watch your logic, unpause never executes (except in the rare cases when the
calls to get_busy gets a different response)

On Sun, May 7, 2017 at 2:34 PM, toufik  wrote:

> Hello.
> This is my first e-mail in this mailling list.
> I've a project using python 2.7 and pygame. The problem is
> I've a button when I press it the music played and when I press it again
> the music paused , but when I press the button in a third time the music
> does not unpause
> Any help please and I'm so sorry for the mistakes in writing .
>
> played = True
>
> def holder():
> time.sleep(0.001)
>
> def play(track):
> global played
> pygame.mixer.init()
> pygame.mixer.music.load(track)
> t = wx.PyTimer(holder)
> if played :
> pygame.mixer.music.play()
> played = False
> elif pygame.mixer.music.get_busy():
> pygame.mixer.music.pause()
> elif not pygame.mixer.music.get_busy():
> pygame.mixer.music.unpause()
> else:
> played = True
> t.Start(10)
>
>
>


Re: [pygame] NO MOVIE module in Pygame??

2017-04-08 Thread claudio canepa
Daniel Gillet is writing a new, python only, direct binding to ffmpeg for
pyglet [0].
>From that thread, seems promising.

Don't know how hard would be to use with pygame.


[0] https://groups.google.com/forum/#!topic/pyglet-users/u1OTO2aYFLo

On Sat, Apr 8, 2017 at 10:09 AM, Jason Marshall 
wrote:

> I think that updating the python-VLC code is more likely to work with
> pygame than using pyglet (AVbin).
> http://stackoverflow.com/questions/19748648/attempting-
> to-embed-a-video-in-pygame-using-pyglet
>
> On Fri, Apr 7, 2017 at 11:33 PM, DiliupG  wrote:
> > what about using some other python library like pyglet only for this
> > purpose?
> >
> > On 8 April 2017 at 09:24, Jason Marshall 
> wrote:
> >>
> >> Diliup,
> >>
> >> Well, there's pygame 1.9.1.
> >>
> >> Two years ago, I tried to play a video in pygame using a script called
> >> pygame-vlc.py, but I was not successful. (I guess that modern versions
> of
> >> VLC have a different interface from the one that pygame-vlc.py was
> designed
> >> to use. I don't really know though.)
> >> https://gist.github.com/smathot/1521059
> >>
> >> Jason
> >>
> >> On Apr 7, 2017 12:36 PM, "DiliupG"  wrote:
> >>>
> >>> Hi Jason!
> >>> Good to hear from you!  :)
> >>> I realized that the module has been removed But hoped that some
> miracle (
> >>> by your guys) can bring it or similar back. What options available to
> use
> >>> movies in Pygame?
> >>>
> >>>
> >>>
> >>>
> >>>
> >>> On 7 April 2017 at 03:45, Jason Marshall 
> >>> wrote:
> 
>  Diliup,
> 
>  Yes, pygame.movie was removed because it caused more trouble than it's
>  worth.
> 
>  More info:
> 
>  https://bitbucket.org/pygame/pygame/issues/238/no-module-
> named-pygamemovie
> 
>  Jason
> 
>  On Thu, Apr 6, 2017 at 2:41 PM, DiliupG  wrote:
> >
> > Has the Movie module been removed from Pygame? I get this error.
> >
> > NotImplementedError: movie module not available
> > (ImportError: No module named movie)
> >
> > --
> > Kalasuri Diliup Gabadamudalige
> >
> > https://dahamgatalu.wordpress.com/
> > http://soft.diliupg.com/
> > http://www.diliupg.com
> >
> >
> > 
> **
> > This e-mail is confidential. It may also be legally privileged. If
> you
> > are not the intended recipient or have received it in error, please
> delete
> > it and all copies from your system and notify the sender immediately
> by
> > return e-mail. Any unauthorized reading, reproducing, printing or
> further
> > dissemination of this e-mail or its contents is strictly prohibited
> and may
> > be unlawful. Internet communications cannot be guaranteed to be
> timely,
> > secure, error or virus-free. The sender does not accept liability
> for any
> > errors or omissions.
> >
> > 
> **
> >
> 
> >>>
> >>>
> >>>
> >>> --
> >>> Kalasuri Diliup Gabadamudalige
> >>>
> >>> https://dahamgatalu.wordpress.com/
> >>> http://soft.diliupg.com/
> >>> http://www.diliupg.com
> >>>
> >>>
> >>> 
> **
> >>> This e-mail is confidential. It may also be legally privileged. If you
> >>> are not the intended recipient or have received it in error, please
> delete
> >>> it and all copies from your system and notify the sender immediately by
> >>> return e-mail. Any unauthorized reading, reproducing, printing or
> further
> >>> dissemination of this e-mail or its contents is strictly prohibited
> and may
> >>> be unlawful. Internet communications cannot be guaranteed to be timely,
> >>> secure, error or virus-free. The sender does not accept liability for
> any
> >>> errors or omissions.
> >>>
> >>> 
> **
> >>>
> >
> >
> >
> > --
> > Kalasuri Diliup Gabadamudalige
> >
> > https://dahamgatalu.wordpress.com/
> > http://soft.diliupg.com/
> > http://www.diliupg.com
> >
> > 
> **
> > This e-mail is confidential. It may also be legally privileged. If you
> are
> > not the intended recipient or have received it in error, please delete it
> > and all copies from your system and notify the sender immediately by
> return
> > e-mail. Any unauthorized reading, reproducing, printing or further
> > dissemination of this e-mail or its contents is strictly prohibited and
> may
> > be unlawful. Internet communications cannot be guaranteed to be timely,
> > secure, error or virus-free. The sender does not accept liability for any
> > errors 

Re: [pygame] New pygame.org website

2016-12-22 Thread claudio canepa
@Miriam: all the examples you gave points to the hosting domain (
ibiblio.org ); we want pygame.org or similar with a hosting that allows DNS
redirection from pygame.org to the content. That way, if at some future
time we want to migrate or add a non-static part all that is needed is to
change the DNS entries.

Probably size is not a problem : pygame site provides docs, articles and
game announcements; it does not host the game downloads.



On Thu, Dec 22, 2016 at 10:45 PM, Miriam English 
wrote:

> The two repositories I mentioned, ibiblio.org and archive.org (I'm sure
> there are more) have, as far as I know, no limits on storage.
>
> Have a look, for instance at the amount stored for Puppy Linux at ibiblio:
> http://distro.ibiblio.org/puppylinux/
>
> Each of those subdirectories you see relates to a different kind of Puppy.
>
> The packages directories contain programs specifically tailored for a
> particular distribution of Puppy. The pet_packages-lucid directory alone
> contains more than 10 Gigabytes of programs, and there are more than 30
> Puppy distros with associated package collections.
>
> The puppy-528 directory contains a couple of ISO CD images for Puppy Lucid
> 528. It also contains an explanatory webpage:
> http://distro.ibiblio.org/puppylinux/puppy-5.2.8/release-Lucid-528.htm
>
> Most of the main distro directories contain such a page.
>
> There is lots more on ibiblio, as a quick wander around
> http://distro.ibiblio.org/ will show.
> They also have multiple mirrors around the world, so if one set of servers
> has a problem others are available.
>
> Cheers,
>
> - Miriam
>
>
> Charles Cossé wrote:
>
>> Hi,
>>
>> On Thu, Dec 22, 2016 at 2:02 PM, Miriam English > > wrote:
>>
>> I don't see the point of using github for the web pages and
>> keeping the content elsewhere. I don't have a lot of experience
>> using github (I find it a pain actually). Github is intended as a
>> versioning system. That has no utility for a pygame repository, as
>> far as I can see -- or at least no advantage over an ordinary
>> repository built purely with that purpose in mind.
>>
>> Wouldn't it be simpler to keep the whole thing in a repository? I
>> mentioned 2 earlier: archive.org  and
>> ibiblio.org , both of which are free and very
>>
>> secure.
>>
>>
>> I can say a little bit that might help until someone with more knowledge
>> has time to reply ... With GitHub pages your website is "just another"
>> repo.  That's the main thing I wanted to point out.  There are no storage
>> limits, and I'm pretty sure that GitHub would be happy to help pygame
>> accomodation-wise if pygame needed anything special (within reason).   I
>> also know that there is a 4 gigabyte file limit on GitHub.  (I know this
>> because I once wanted to host an 8G SD card image and had to get it down to
>> 4G in order to be housed on GitHub).
>>
>> FWIW, I have also managed to run webapps on GitHub via GitHub pages.  For
>> example http://asymptopia.github.io/TuxMathScrabble-2015/.
>>
>> And, not trying to direct traffic to my site or anything, but here's my
>> own site using GitHub pages: https://asymptopia.github.io/
>>
>> Best regards,
>> Charles
>>
>> Cheers,
>>
>> - Miriam
>>
>>
>> Thomas Kluyver wrote:
>>
>> Thanks everyone for your input. In the interests of making
>> progress, I'd like to propose:
>>
>> - The informational site will be hosted on Github pages; I've
>> used this for a number of websites before, it's reliable, we
>> can point an external domain to it, and I imagine that most of
>> the likely contributors have Github accounts already.
>> - The pages will be generated by a Python static site
>> generator. There doesn't seem to be a strong feeling between
>> Sphinx/Nikola/Pelican, so it will likely depend on who is most
>> excited to start building it.
>> - The game feed will also be generated from content in Github,
>> so /at first/ developers will need to submit a PR to add a
>> game. Once that's working, we can build a simpler submission
>> interface on Heroku/Appengine/similar which can push content
>> to Github. Ideally the data will be in a format which would
>> could move elsewhere later if necessary.
>>
>> I like the concept of drawing the game feed from an external
>> source, but I don't think any of the sources proposed match
>> what we want closely enough.
>>
>> Does anybody object to any of those proposals?
>>
>> Thanks,
>> Thomas
>>
>> On 18 December 2016 at 20:18, Miriam English
>> 
>> >
>> >> wrote:

Re: [pygame] Update on Pygame builds

2014-12-16 Thread claudio canepa
Great ! and thanks for all the work


On Wed, Dec 17, 2014 at 12:00 AM, Paul Vincent Craven p...@cravenfamily.com
 wrote:

 I spent the today continuing to work on builds and packaging.

- I can get pygame to build on Linux and push to PyPi Test server
successfully.
- I can get it to build on Travis-CI successfully and run tests. But I
haven't tried pushing it from there.
- I can get Pygame to build and work on a mac.
- I can get Pygame to build on AppVeyor and create a binary wheel.
Haven't gotten it to upload to PyPi Test successfully yet.
- While there isn't a package Pygame on the server full PyPi server,
it is reserved by someone. I'm not sure who can do the official updates.

 Tomorrow I hope to improve the packaging and pushing to the PyPi test
 server from all platforms.

 Paul Vincent Craven



Re: [pygame] New 32 bit Pygame installer for Python 3.3 on Windows

2013-10-04 Thread claudio canepa
Thanks !


On Fri, Oct 4, 2013 at 3:10 PM, Lenard Lindstrom le...@telus.net wrote:

 Updated Pygame 1.9.2a0 installer for Python 3.3 at 
 https://bitbucket.org/pygame/**pygame/downloadshttps://bitbucket.org/pygame/pygame/downloads
 .

 md5 stuff:
 60ee67037b7e9ffeca88425d8712fd**de *pygame-1.9.2a0-12de2da43ecb.**
 win32-py3.3.msi

 This addresses issues #144 https://bitbucket.org/pygame/**
 pygame/issue/144/unable-to-**render-texthttps://bitbucket.org/pygame/pygame/issue/144/unable-to-render-text,
 #175 https://bitbucket.org/pygame/**pygame/issue/175/memory-leak-**
 when-setting-pixels-withhttps://bitbucket.org/pygame/pygame/issue/175/memory-leak-when-setting-pixels-with,
 and #166 https://bitbucket.org/pygame/**pygame/issue/166/events-have-**
 a-type-attribute-which-is-nothttps://bitbucket.org/pygame/pygame/issue/166/events-have-a-type-attribute-which-is-not
 **, as well as fixes several bugs detected by CPyChecker (issue #171 
 https://bitbucket.org/pygame/**pygame/issue/171/check-pygame-**
 with-cpycheckerhttps://bitbucket.org/pygame/pygame/issue/171/check-pygame-with-cpychecker
 ).

 Enjoy,

 Lenard Lindstrom




Re: [pygame] SDL 2.0

2013-08-13 Thread claudio canepa
On Tue, Aug 13, 2013 at 5:37 AM, René Dudfield ren...@gmail.com wrote:

 Happy days...


 SDL 2.0 is released!

 http://lists.libsdl.org/pipermail/sdl-libsdl.org/2013-August/089854.html

 


 Wohoo!!!


Re: [pygame] Joystick

2012-11-22 Thread claudio canepa
On Fri, Nov 23, 2012 at 12:10 AM, Stephen Smitherman srsmither...@gmail.com
 wrote:

 Good Day,
 Does anyone know what I can do to work on this project?
 I have been able to successfully write a script to use the Playstation 3
 controller via bluetooth on a Mac implementing pygame.Joystick. I am
 loosing many functions of the controller though because the joystick class
 is limited to typical joystick definitions. How can i get a copy of the
 joystick source to improve it to allow full six axis functionality.

 Thanks

 Stephen Smitherman


pygame source lives in a public mercurial repository:
https://bitbucket.org/pygame/pygame/src

Compilation instructions are over
http://pygame.org/wiki/Compilation


Re: [pygame] Sclatron for python

2012-07-11 Thread claudio canepa
On Wed, Jul 11, 2012 at 9:39 PM, Zack Baker zbaker1...@gmail.com wrote:

 Is this project still active?


Last weekend in a nerd gathering they worked in the software. You can look
at commit dates as a hint of activity.



 Also I am  not very good with github, infact ive never used it. So, how
 would i be able to help? Sorry for the n00b question


Well, the idea for github or any other repo is:
   if you want to try, you download and try
   if you like some changes, you can ask for them in the issue tracker, or
do a branch with modifications and  do a pull request.

If you want to chat with the people behind that software, you can try IRC
irc.freenode.net , channel #pyar. That is a general python channel, but the
spacecraft people can be found there, usually 13 to 20 UTC

claudio

--



 On Jul 10, 2012, at 9:56 PM, claudio canepa wrote:



 On Tue, Jul 10, 2012 at 10:38 PM, Zachary Baker zbaker1...@gmail.comwrote:

 Hi, I am an intermediate python develpor and recently heard of 
 scalatronhttp://scalatron.github.com/.
 I think this is AWESOME!! I have been looking for something like this for
 python for awhile, as i dont really want to learn a whole new language and
 was wondering if any of you know if there is anything like this for python.
 If not, is there any chance we could make one? I would help out as much as
 i could but i am sure it would be easier for people with more experience. I
 would love to hear what you all think!

 --
 -Zack


 There is
  https://github.com/luciotorre/spacecraft

 claudio

 --





Re: [pygame] Sclatron for python

2012-07-10 Thread claudio canepa
On Tue, Jul 10, 2012 at 10:38 PM, Zachary Baker zbaker1...@gmail.comwrote:

 Hi, I am an intermediate python develpor and recently heard of 
 scalatronhttp://scalatron.github.com/.
 I think this is AWESOME!! I have been looking for something like this for
 python for awhile, as i dont really want to learn a whole new language and
 was wondering if any of you know if there is anything like this for python.
 If not, is there any chance we could make one? I would help out as much as
 i could but i am sure it would be easier for people with more experience. I
 would love to hear what you all think!

 --
 -Zack


There is
 https://github.com/luciotorre/spacecraft

claudio

--


Re: [pygame] Issue with pygame.mask

2012-05-14 Thread claudio canepa
On Mon, May 14, 2012 at 8:24 PM, Greg Ewing greg.ew...@canterbury.ac.nzwrote:

 Peter Finlayson wrote:

  Regardless, since there is code out in the wild that probably depends on
 this behaviour it is probably best to just note the quirk in the
 documentation.


 There's still a problem at the other end of the range, i.e.
 no value that you can supply will match everything. There's
 no workaround for that, so I think it should be regarded
 as a bug.

 If breakage is a concern, maybe a new function should be
 added and the old one deprecated.




 +1 to have *clean* functions

claudio

--


Re: [pygame] Hot Pink

2012-01-18 Thread claudio canepa
On Wed, Jan 18, 2012 at 2:30 PM, Lenard Lindstrom le...@telus.net wrote:

 I like the new color scheme at pygame.org. I think I will add it as an
 alternative theme for the Pygame docs.

 Lenard



My Eyes! The goggles do nothing!

:-)

--
claxo


Re: transition plan was Re: [pygame] contemplating move to bitbucket(and hg). what do you think?

2011-08-17 Thread claudio canepa
On Wed, Aug 17, 2011 at 11:17 AM, René Dudfield ren...@gmail.com wrote:

 Hi,

I've converted the repository over to bitbucket:
 https://bitbucket.org/pygame/pygame/


 [...]


wow, thats moving fast !!


Re: [pygame] Segmentation fault through taskbar minimization/restoration

2011-08-17 Thread claudio canepa
On Wed, Aug 17, 2011 at 4:49 PM, René Dudfield ren...@gmail.com wrote:

 Hi,

 Anyone else on XP able to reproduce this?

 I tried it on vista, and it's ok.




tried with the included pygame demos:
chimp.py
liquid.py
scroll.py

from slow clicking the icon to clicking as fast as I can; no problems there.

win xp sp3, python 2.6.5, pygame 1.9.1
Settings for the desktop are (translating from spanish):
Windows classic,
Control Panel | System |  Advanced | Performance - Best Performance
This means no animated effects in desktop.

Intel 945G video chipset

--
claudio


Re: transition plan was Re: [pygame] contemplating move to bitbucket(and hg). what do you think?

2011-08-06 Thread claudio canepa
On Sat, Aug 6, 2011 at 6:40 AM, René Dudfield ren...@gmail.com wrote:



 On Thu, Aug 4, 2011 at 6:44 PM, claudio canepa ccanep...@gmail.comwrote:



 On Thu, Aug 4, 2011 at 1:05 PM, René Dudfield ren...@gmail.com wrote:

 Hi,

 I've started on a migration plan for bitbucket.  If anyone has any
 feedback, please let me know :)


 About issues:

 A problem I have seen in other migrations was :

 issues text refers to some svn version, say r1054

 Before migration with 'r1054' you know how to navigate the repo html view
 to the relevant check-in info,

 After migration to hg, the repo html view uses hashes to identify that
 particular commit / state, say '252e9c8091cc' , so you don't know where to
 look.

 So, i don't know how this have been better handled in other migrations,
 but perhaps the migration could generate a table 'svn revision' - 'hash hg
 repo default'  and put that in a page.
 That page can later be embellished with search and what not, but you must
 have the info to begin with.

 --
 claudio



 Hello,

 ah, good point.  After some reading, I found out about using the --datesort
 option with hg convert.  This should let us use the commits in the same
 order that they happened in svn.  So then we can use the 'revision numbers'
 I hope to easily map between hg and svn.  I'll experiment and see what
 happens.  One problem is that it increases the repo size, so maybe another
 way to generate a mapping would be better.

 From bitbucket: there isn't a importer, we do however have an issue api
 you could use to write your own. no plans for rst..  So it looks like I'll
 have fun writing an importer.  It also looks like we'll have to settle for
 using their creol wiki markup rather than rst.




I perused the pep about the python migration posted by Lenard, and they
indeed  generated a text table with mappings. Maybe there is code to lift
there (in the python migration process) ?

Also, they talk about how EOL will be handled, and have  a link for the
server side hooks used, including the one for 'bad EOL rejection'

--
claudio


Re: transition plan was Re: [pygame] contemplating move to bitbucket(and hg). what do you think?

2011-08-04 Thread claudio canepa
On Thu, Aug 4, 2011 at 1:05 PM, René Dudfield ren...@gmail.com wrote:

 Hi,

 I've started on a migration plan for bitbucket.  If anyone has any
 feedback, please let me know :)


About issues:

A problem I have seen in other migrations was :

issues text refers to some svn version, say r1054

Before migration with 'r1054' you know how to navigate the repo html view to
the relevant check-in info,

After migration to hg, the repo html view uses hashes to identify that
particular commit / state, say '252e9c8091cc' , so you don't know where to
look.

So, i don't know how this have been better handled in other migrations, but
perhaps the migration could generate a table 'svn revision' - 'hash hg repo
default'  and put that in a page.
That page can later be embellished with search and what not, but you must
have the info to begin with.

--
claudio


[pygame] nofollow cheated in pygame site ?

2011-04-03 Thread claudio canepa
Look at the last editions by 'alice thomas', on April 3, by example in
http://www.pygame.org/wiki/info?action=viewid=4890

Seems that it cheated the 'nofollow' thingy.

a rel=follow href=...

While follow has no sense, and probably be ignored, the links miss the
nofollow dissuader

--
claudio


[pygame] spam on pygame site

2011-03-28 Thread claudio canepa
A new wave of spam in the site.
And this time some seems more insidious: look at
http://www.pygame.org/wiki/CookBook

and try to edit-out the spam at the top of the page: the spam text don't
show in the editor.

--
claudio


[pygame] Re: spam on pygame site

2011-03-28 Thread claudio canepa
On Mon, Mar 28, 2011 at 1:03 PM, claudio canepa ccanep...@gmail.com wrote:

 A new wave of spam in the site.
 And this time some seems more insidious: look at
 http://www.pygame.org/wiki/CookBook

 and try to edit-out the spam at the top of the page: the spam text don't
 show in the editor.

 --
 claudio


disregard the babble about 'not seen in the editor', I searched for a string
from a spammer - obtained some links,- the page show spam - but in the
edit not: the link really pointed to an older version from the page, and the
'edit' moved to the current one, which in fact have not spam.
Anyway, found and removed 7 spams in the cookbook pages.

--
claudio


Re: [pygame] Re: spam on pygame site

2011-03-28 Thread claudio canepa
On Mon, Mar 28, 2011 at 1:50 PM, René Dudfield ren...@gmail.com wrote:



 The people spamming now are idiots because all the links get
 rel=nofollow added so they get negative SEO for their links.  But they
 keep coming like the hordes from hell.


 I have seen some links as:
a rel=dofollow href=http://...
by example the prev version of
http://www.pygame.org/wiki/rsslinks

--
claudio


Re: [pygame] Experimental, Classic Look, sphinx generated XHTML docs for Pygame 1.9.2a

2011-03-22 Thread claudio canepa
On Tue, Mar 22, 2011 at 6:39 PM, Lenard Lindstrom le...@telus.net wrote:

 Hi everyone,

 I have been playing with porting the Pygame document to Sphinx. Feedback
 suggested the current document format was preferred. Here is a first attempt
 at reproducing that theme with Sphinx.

 http://www3.telus.net/len_l/pygame/pygame_doc_sphinx.tar.gz

 md5sum:
 0ac88a9d8d052ce629c6625d4be52934  pygame_doc_sphinx.tar.gz

 I have tried them on IE 8, Firefox 3.x, and Epiphany 2.30.6. No serious
 problems, but anchor titles do not show up a tooltips in IE, and Epiphany
 ignores the italic font style. Unfortunately, I missed a chance to try them
 on Safari.



I checked with Opera 11.01, comparing views with IE8 and Firefox 4.0: it
looks right, including tooltips for links to other sections.

The only misbehavoir I spotted in comparison with 1.9.1 docs, is an ASCII
draw in pygame.mask.overlap which renders bad.
All three browsers show the same defect, see the snapshots taken with FF

pygame 1.9.2 sphinx rendered
http://img16.imageshack.us/img16/8173/maskoverlapff40.png

pygame 1.9.1 traditional rendered
http://img858.imageshack.us/img858/4964/maskoverlapff40pygame19.png

I appreciate that the top navigation area is retained, instead of the
lateral navigation bar used by default sphinx: it allows to better use the
screen area, and avoids nasty code scrollers.

Last but not least, thanks for your continuous work in pygame !

--
claudio


Re: [pygame] Experimental, Classic Look, sphinx generated XHTML docs for Pygame 1.9.2a

2011-03-22 Thread claudio canepa
On Tue, Mar 22, 2011 at 11:31 PM, claudio canepa ccanep...@gmail.comwrote:

 The only misbehavoir I spotted in comparison with 1.9.1 docs, is an ASCII
 draw in pygame.mask.overlap which renders bad.
 All three browsers show the same defect, see the snapshots taken with FF


sorry, here links to photobucket, Imageshack lnks have problems

sphinx rendered, 1.9.2
http://i1091.photobucket.com/albums/i393/claxo/mask_overlap_FF40.png

traditional,  1.9.1
http://i1091.photobucket.com/albums/i393/claxo/mask_overlap_FF40_pygame_191.png

--
claudio


Re: [pygame] (pyopengl) GLSL fragment shader with arrays uniform cause sporadic screen blinking

2011-02-11 Thread claudio canepa
On Fri, Feb 11, 2011 at 3:37 PM, amdlintuxo amdlintu...@gmail.com wrote:



 Full code is here:
 http://bpaste.net/show/13615/

 Could some one test the full code or provide the idea what can cause
 sporadic screen blinking.
 Looking forwards for you support, i have nothing left to try to
 resolve this problem, struggling third day, no luck. Maybe this
 blinking is my HW config problem.


Whit the full code I got

Traceback (most recent call last):
  File E:\incomplete copia sempron sancle 2010 04
30\scode\shader_test\shader.py, line 32, in glLibTestErrors
function()
  File E:\incomplete copia sempron sancle 2010 04
30\scode\shader_test\shader.py, line 181, in main
tex0, (_w,_h) = upload_texture('data/screenshot.png', True)
  File E:\incomplete copia sempron sancle 2010 04
30\scode\shader_test\shader.py, line 72, in upload_texture
data )
File C:\Python26\lib\site-packages\OpenGL\latebind.py, line 45, in
__call__
return self._finalCall( *args, **named )
  File C:\Python26\lib\site-packages\OpenGL\wrapper.py, line 791, in
wrapperCall
  raise errGLError: GLError(
err = 1281,
description = 'valor no v\xe1lido',
baseOperation = glTexImage2D,
pyArgs = (
GL_TEXTURE_2D,
0,
4,
640,
576,
0,
GL_RGBA,
GL_UNSIGNED_BYTE,
'\x8d\x8e\xbc\xff\x8d\x8e\xbc\xff\x8d...,
),
cArgs = (
GL_TEXTURE_2D,
0,
4,
640,
576,
0,
GL_RGBA,
GL_UNSIGNED_BYTE,
'\x8d\x8e\xbc\xff\x8d\x8e\xbc\xff\x8d...,
),
cArguments = (
GL_TEXTURE_2D,
0,
4,
640,
576,
0,
GL_RGBA,
GL_UNSIGNED_BYTE,
'\x8d\x8e\xbc\xff\x8d\x8e\xbc\xff\x8d...,
)
)


windows xp, python 2.6.5,
I provided a 640 x  576 data\screenshot.png

 OpenGL.version.__version__
'3.0.1'


--
claudio


Re: [pygame] (pyopengl) GLSL fragment shader with arrays uniform cause sporadic screen blinking

2011-02-11 Thread claudio canepa
On Fri, Feb 11, 2011 at 5:01 PM, claudio canepa ccanep...@gmail.com wrote:



 On Fri, Feb 11, 2011 at 3:37 PM, amdlintuxo amdlintu...@gmail.com wrote:



 Full code is here:
 http://bpaste.net/show/13615/

 Could some one test the full code or provide the idea what can cause
 sporadic screen blinking.
 Looking forwards for you support, i have nothing left to try to
 resolve this problem, struggling third day, no luck. Maybe this
 blinking is my HW config problem.


 Whit the full code I got

 Traceback (most recent call last):
   File E:\incomplete copia sempron sancle 2010 04
 30\scode\shader_test\shader.py, line 32, in glLibTestErrors
 function()
   File E:\incomplete copia sempron sancle 2010 04
 30\scode\shader_test\shader.py, line 181, in main
 tex0, (_w,_h) = upload_texture('data/screenshot.png', True)
   File E:\incomplete copia sempron sancle 2010 04
 30\scode\shader_test\shader.py, line 72, in upload_texture
 data )
 File C:\Python26\lib\site-packages\OpenGL\latebind.py, line 45, in
 __call__
 return self._finalCall( *args, **named )
   File C:\Python26\lib\site-packages\OpenGL\wrapper.py, line 791, in
 wrapperCall
   raise errGLError: GLError(
 err = 1281,
 description = 'valor no v\xe1lido',
 baseOperation = glTexImage2D,
 pyArgs = (
 GL_TEXTURE_2D,
 0,
 4,
 640,
 576,
 0,
 GL_RGBA,
 GL_UNSIGNED_BYTE,
 '\x8d\x8e\xbc\xff\x8d\x8e\xbc\xff\x8d...,
 ),
 cArgs = (
 GL_TEXTURE_2D,
 0,
 4,
 640,
 576,
 0,
 GL_RGBA,
 GL_UNSIGNED_BYTE,
 '\x8d\x8e\xbc\xff\x8d\x8e\xbc\xff\x8d...,
 ),
 cArguments = (
 GL_TEXTURE_2D,
 0,
 4,
 640,
 576,
 0,
 GL_RGBA,
 GL_UNSIGNED_BYTE,
 '\x8d\x8e\xbc\xff\x8d\x8e\xbc\xff\x8d...,
 )
 )


 windows xp, python 2.6.5,
 I provided a 640 x  576 data\screenshot.png

  OpenGL.version.__version__
 '3.0.1'
 

 --
 claudio



after resampling to power of two (512 x 512) it passes that point, but seems
that this test machine (vga = intel 945g ) don't supports the funcionality:
I got
Traceback (most recent call last):
  File E:\incomplete copia sempron sancle 2010 04
30\scode\shader_test\shader.py, line 32, in glLibTestErrors
function()
  File E:\incomplete copia sempron sancle 2010 04
30\scode\shader_test\shader.py, line 239, in main
''')
  File E:\incomplete copia sempron sancle 2010 04
30\scode\shader_test\shader.py, line 101, in compile_program
program = glCreateProgram()
File C:\Python26\lib\site-packages\OpenGL\platform\baseplatform.py, line
340
, in __call__
self.__name__, self.__name__,
NullFunctionError: Attempt to call an undefined function
glCreateProgramObjectARB, check for bool(glCreateProgramObjectARB) before
calling

--
claudio


Re: [pygame] blit image

2010-12-01 Thread claudio canepa
On Wed, Dec 1, 2010 at 6:10 PM, Nathan BIAGINI nathan.o...@gmail.comwrote:

 Hi everyone,

 i currently have a really weird problem. I want to blit a background image
 on my screen. It s a really simple operation and i ve done it so many times
 in this case, the image only appear when i move the screen with my mouse
 cursor... I definitively don't understand...
 Here is the paste of the concerned source code :

 http://bpaste.net/show/11826/

 The image to print is loaded in the map instance of Map class. I get the
 whole path of the image from a file and then i load the image and blit it in
 the main. The image should be properly loaded because it appears when i move
 the window, maybe i ll paste you the concerned part of my class :

 http://bpaste.net/show/11827/

 i use those two print call to check if the image do no take a while a be
 loaded but it s not the case.


the line

pygame.display.update(map.map_sprites_group.draw(screen))

can be the problem ?

pygame.display.update(arg) ,
where arg a rect or a list of rects will only refresh the rects area;
so, is map.map_sprites_group.draw returning the expected rects ?

--
claudio


Re: [pygame] moving a box diagnally

2010-09-19 Thread claudio canepa
On Sun, Sep 19, 2010 at 5:08 AM, kevin hayes kevino...@gmail.com wrote:

 Hi, I'm just beginning to learn python and pygame. I've gone through the
 first four chapters of Game Programming, The L-line, the Express Line to
 Learning.  Right now I'm working on an exercise that asks me to make a box
 that moves in a diagonal path. Can someone tell me why when I run the code
 the program only executes while I move the mouse? Also, can you tell me how
 i can change my code to avoid this? Thanks, Kevin

 here is my code:

 import pygame
 pygame.init()

 screen = pygame.display.set_mode((640, 480))
 pygame.display.set_caption(Diagonal Red Square)

 background = pygame.Surface(screen.get_size())
 background = background.convert()
 background.fill((0, 0, 0))

 box = pygame.Surface((20, 20))
 box = box.convert()
 box.fill((255, 0, 0))

 box_x = 0   #box variable for the x-axis
 box_y = 0   #  y-axis

 clock = pygame.time.Clock()
 keepGoing = True

 while keepGoing:
 clock.tick(30)
 for event in pygame.event.get():
 if event.type == pygame.QUIT:
 keepGoing = False

 box_x += 5
 box_y += 5

 if box_y  screen.get_height():  #checking for screen boundaries
 box_y = 0
 if box_x  screen.get_width():
 box_x = 0


 screen.blit(background, (0, 0))
 screen.blit(box, (box_x, box_y))
 pygame.display.flip()

 pygame.quit()


You change the box position only if an event is present, so you need to move
the mouse or press keys to move.

Move out of the event loop the lines that change the position, that is,
dedent one level the lines:
box_x += ...
box_y += ...

--
claudio


Re: [pygame] Problem with mouse going back to the center of the screen

2010-07-20 Thread claudio canepa
On Tue, Jul 20, 2010 at 6:32 PM, SurferIX olivier.p...@gmail.com wrote:

 Hi!

 I've got a problem with the mouse: it's going back to the center of
 the screen!
 I don't know where it could come from because it does this only in
 full screen.
 It's exactly the same problem with the game Enigma.




A known difference in other pygame versions was that in fullscreen a lot
more mouse events were generated.
If you retire only one mouse event in each frame, then this is were your
problem kicks.
In each frame, you can retire all the mouse move events and process only the
last ( and process all clicks)

--
claxo


Re: [pygame] informal poll on Windows python version

2010-04-28 Thread claudio canepa
Windows Version: Windows XP
 Pygame Version: 1.9.1 and 1.8.1 and 1.7.1
 Python Version: 2.4 and 2.6 (I have both installed)

 Reason : 2.4 for some old libs, pygame old versions for compatibility
checks and run the ocasional gamae that wont work in newer

 --
claxo


Re: [pygame] Running Python 2.5 alongside 2.6

2010-04-27 Thread claudio canepa
On Tue, Apr 27, 2010 at 10:13 PM, Julian Marchant onp...@gmail.com wrote:

 The pygame download page's message that python 2.5 is the best for
 Windows probably made him think that Pygame was for Python 2.5.


That was a very old sugestion.
I run pygame with python 2.6, and a lot of people in the pyweek event, with
diferent operating systems the same.
There are no problems.
In the download select the the file for your operating system marked with
the py2.6

--
claudio


Re: [pygame] sprite module optimizations have been uploaded

2010-04-17 Thread claudio canepa
On Sat, Apr 17, 2010 at 2:51 PM, Jason M. Marshall j...@yahoo.com wrote:

 I finished making optimizations to the sprite module. The new sprite.py has
 been uploaded to the Subversion repository. I am pleased to announce that on
 my Mac with Python 2.5, sprite_test.py now runs in 0.038 seconds rather than
 0.076 seconds, and on my PC with Python 3.1, sprite_test.py now runs in
 0.016 seconds rather than 0.031 seconds. If I have inadvertently broken your
 code or made it slower, let me know and I'll undo the optimization that
 doesn't work for you.

 Jason


The automated build site will provide binaries for this revision?

--
claxo


Re: [pygame] Bug: Python crash after switch to directx fullscreen quit

2009-12-09 Thread claudio canepa
On Wed, Dec 9, 2009 at 10:28 PM, Jason M. Marshall j...@yahoo.com wrote:

 Hello pygame core developers,

 Attached to this e-mail is my tool for rapidly trying different display
 configurations. I use it to determine which display settings are optimal
 for a
 given platform. I've found that when I toggle from directx windowed mode to
 directx
 fullscreen mode and then exit, Python crashes. Do you suppose that this is
 a
 pygame bug, an SDL bug, a Python 2.5.4 bug, an Intel GMA X4500 driver bug,
 or
 PEBKAC error?

 To reproduce the error, launch the jason_test_6.py script. If the driver is
 windib, toggle the driver to
 directx by pressing F4. Next, press F2 to switch to fullscreen, and then
 press Esc to quit. On
 my computer, a Windows error message is displayed immediately.

 Thanks,
 Jason

 When Python crashes,
 Windows provides this Error signature:
 AppName: python.exe
 AppVer: 0.0.0.0
 ModName: sdl.dll
 ModVer: 1.2.13.0
 Offset: 00028bea

 Software:
 Windows XP Pro SP3
 Python 2.5.4
 pygame 1.9.2pre-svn2696
 SDL 1.2.13

 Hardware:
 Intel Core 2 Duo E8400 @ 3.0 GHz
 Intel GMA X4500
 2 GB o' RAM





My system does the same.
Unhandled Exception in python.exe (SDL.exe) 0xC005 : Access Violation.
Even If I add the as last line for your script
pygame.quit()

windows xp sp3
nvidia gforce 6200
python 2.6
pygame 1.9.1release-svn2575
SDL 1.2.13

--
claxo


Re: [pygame] Bug: Python crash after switch to directx fullscreen quit

2009-12-09 Thread claudio canepa
On Wed, Dec 9, 2009 at 11:29 PM, claudio canepa ccanep...@gmail.com wrote:




 My system does the same.
 Unhandled Exception in python.exe (SDL.exe) 0xC005 : Access Violation.
 Even If I add the as last line for your script
 pygame.quit()

 windows xp sp3
 nvidia gforce 6200
 python 2.6
 pygame 1.9.1release-svn2575
 SDL 1.2.13

 --
 claxo


it also happens with python 2.4 and

pygame 1.8.1release
SDL 1.2.13

pygame 1.7.1release
SDL 1.2.8

(you must set some real screen_size for the script to run in 1.7.1)

My DX version, as reported by the diagnostic tool for DX in windows is
DirectX 9.0c (4.09..0904)

--
claxo


Re: [pygame] Need names and nationalities for AI playes in new sport-game

2009-11-12 Thread claudio canepa
Claudio Canepa , from  Argentina

good programing !

--
claudio

On Thu, Nov 12, 2009 at 9:19 AM, John Eriksson j...@arainyday.se wrote:

 Hi fellow pygame developers!

 I'm developing a sports game. It's a fictive sport played one-on-one,
 on ice against another human player or against a rather advanced AI.

  As part of the game it is possible to create a career in the World
 Series against 40 (or so) AI controlled players.

 I started to search the net to find inspiration for names and
 nationalities to the AI-players. But then I thought it would be much
 nicer to use the names and nationalities of pygame developers instead
 of just using fictive names.

 All AI-players will have different skill levels wich is randomly set
 in the begining of a new World Series career. In one career your named
 character will be the best in the world, and in another it might be a
 rookie in Division 4.

 The game will be released as Freeware for both Linux and Windows. The
 source code will (as allways for my projects) be available once the
 game is done.

 If you wan't your name to apear as a AI-player in the game, please
 send me your name (first + last) and your nationality.

 Best Regards
 /John Eriksson
 http://arainyday.se



Re: [pygame] Memory leak...

2009-10-14 Thread claudio canepa
On Wed, Oct 14, 2009 at 2:59 PM, RB[0] roeb...@gmail.com wrote:

 I am getting a nasty mem leak when using pygame.image.tostring

 As shown here:

 import pygame
 from pygame.locals import *

 pygame.display.set_mode((100,100))
 while 1:
 pygame.image.tostring(pygame.Surface((8,8)).convert_alpha(), RGBA, 1)


 NOTE: run this in a console or something where you can crash it to close it
 ;)
 I am running windows Vista (SP1) - using the task manager to view the
 memory usage.
 I also am running Pygame 1.8.1 - is this fixed in 1.9.1?
 When I run this, the memory seems to jump and just keep growing, quite
 quickly...

 Has anyone else had this problem?


in win XP, pygame 1.9.0rc3 theres no leak: memory usage tops at 12.5 MB
--
claxo


Re: [pygame] 3rd Pyggy Awards Open

2009-09-21 Thread claudio canepa
On Mon, Sep 21, 2009 at 11:58 PM, Greg Ewing greg.ew...@canterbury.ac.nzwrote:

 The 3rd Pyggy Awards is now open for entries. Judging will be during the
 first two weeks of December.

 http://pyggy.pyweek.org/1009/

 The Pyggy Awards is a follow-up event to the PyWeek competition, for
 authors who would like to develop their games further. It provides an
 extended period for development at a more leisurely pace, an environment in
 which to try out each others' works in progress and share feedback, an an
 occasion at which to show off the results to an audience of like-minded
 people.

 --
 Greg


Yipiii!!!
I am in.

--
claxo


Re: [pygame] Standard methodology for different game screens

2009-09-19 Thread claudio canepa
On Sat, Sep 19, 2009 at 3:13 PM, Pablo Moleri pmol...@gmail.com wrote:

 Hello,

 I'm going through a game 
 codehttp://dev.laptop.org/git/activities/conozco-uruguay/tree/conozco-uruguay.activity/conozcouy.pywritten
  in pygame, the game shows different screens:
 - an introduction
 - a menu
 - and then it enters to different game modes.

 For each of these parts there's a different pygame loop, which doesn't seem
 right.
 I would like to know if there's a standard way to use pygame in this
 scenario.

 Thanks in advance,
 Pablo


I see no problem with that:
each screen/scene has it own update style.
intro - stepped script
menu -  gui events handling
gamescreen - world simulation dt updating, IO feed player actor

By keeping separate what is different, the code is more clear.
Anyway, in my code usually I group the code related to a screen/scene in an
appropriate class, by example

class LevelPlay(object):
def __ init__(self,..):
def start(self):
def update(self,dt):
def draw(self)
...

--
claxo


Re: [pygame] event getting corrupted

2009-09-16 Thread claudio canepa
On Wed, Sep 16, 2009 at 3:36 PM, Bo Jangeborg b...@softwave.se wrote:

 I have seen a troubling error for some time now.
 Occasionally I get a segmentation error with no indication of what
 went wrong. The error is not repeatable in a reliable way and I get
 no error trace. Repeating the error can take hours.

 After seeing this I have tried to pin down, with the debugger running,
 what's going wrong but the nearest I can get is that the event object
 gets turned into a long at different times.

 Running with a debugger I got this trace. I have included the calling
 line were you can see that the event seem to be correct, but at some
 point the event object seem to become corrupted.
 Included is also the code between the call and the eventual point
 of error. I am at loss at what may be going wrong.

 Bo)

 Traceback (most recent call last):
  File C:\Program
 Files\eclipse\plugins\org.python.pydev.debug_1.4.7.2843\pysrc\pydevd.py,
 line 881, in module
   debugger.run(setup['file'], None, None)
  File C:\Program
 Files\eclipse\plugins\org.python.pydev.debug_1.4.7.2843\pysrc\pydevd.py,
 line 710, in run
   execfile(file, globals, locals) #execute the script
  File C:\Projekt\eclipse\Pyos\Program\Solitaire\solitaire.py, line 761,
 in module
   main()
  File C:\Projekt\eclipse\Pyos\Program\Solitaire\solitaire.py, line 80, in
 main
   if screen.main_loop(app):
  File C:\Projekt\eclipse\Pyos\System\widgets\gui.py, line 328, in
 main_loop
   = self.mouse_button_up(event, mob_pos, mousemove)
  File C:\Projekt\eclipse\Pyos\System\widgets\gui.py, line 573, in
 mouse_button_up
   if event.button == 1:
 AttributeError: 'long' object has no attribute 'button'






 elif event.type is MOUSEBUTTONUP:
mob_pos, mousemove, mouse_pos, hit_pos \
= self.mouse_button_up(event, mob_pos, mousemove)




 a ha

def mouse_button_up(self, event, mob_pos, mousemove):

  ''' handle mouse button up events'''
   mousebtn_event = False
   mouse_pos = event.pos
   widget, hit_pos = self.mouse_hit_widget(mouse_pos[0],
   mouse_pos[1])
   if widget is None or not widget.enabled:
   self.moving_object = None
   self.repeating_object = None
   self.last_over_drop_widget = None
   else:
   event_data = {'hit_pos':hit_pos, 'over_widget':widget}
   event_data['gui'] = self
   if widget and widget.exists('event_click_release_data'):
   event_data.update(widget.event_click_release_data)
   #InsideButton  (Left)
   if event.button == 1:


a ha
Well, from where comes event ?

--
claudio


Re: [pygame] pygame parachute and inconsistent interned sting state - but only on Slackware 13.0 32 bit

2009-09-16 Thread claudio canepa
On Wed, Sep 16, 2009 at 3:15 PM, Peter Chant p...@petezilla.co.uk wrote:

 On Wednesday 16 September 2009, René Dudfield wrote:
  I guess the next step is to try and put print debugging in.
 
  You start by putting a few print statements in, and see where it gets
  up to.  Then you refine until you get really close to it... doing a
  binary search of your source until you find the place/places that make
  it crash.
 

 D'oh so obvious.  What I regularly do whilst developing things, but not
 when
 bugs suddenly appear.

 FOUND IT!
 self.screen.blit(clear,(0,0))


  - look for the exclamation marks

def clearScreen(self):
print In clearScreen
print About to call pygame.display_get_surface()
clear = pygame.display.get_surface()
print About to fill surface to clear it
clear.fill((0,0,0))
print About to self.screen.blit -  this crashes
self.screen.blit(clear,(0,0))
print just blitted - ! does not get to here


 self.screen is initialised by the output of another class.
  self.screen = h.screen

 in class h

  self.screen=pygame.display.get_surface()


 Only fails on 32 bit Slack 13.0.



 --
 Peter Chant
  http://www.petezilla.co.uk


so functionally

surf = pygame.dispay.get_surface()
surf.fill((0,0,0))
surf.blit(surf,(0,0))

fails.

From your app point of view, the blit line is superfluous.

your code will be

def clearScreen(self):
self.screen.fill((0,0,0))

From the pygame point of view, there is a possible bug, there is a bug: it
should work or it should raise some meaningful error.

--
claxo


Re: [pygame] event getting corrupted

2009-09-16 Thread claudio canepa
On Wed, Sep 16, 2009 at 5:18 PM, Bo Jangeborg b...@softwave.se wrote:


  a ha
 Well, from where comes event ?


 event = pyg_event.poll()

 but note that a long can't have attributes and 13 lines above the
 error point I do :

 mouse_pos = event.pos

 and it works at that time


pyg_event.poll is pygame.event.poll ?
If the only fountain for events were the pygame event queue, the traceback
coulnt happen:

a)
elif event.type is MOUSEBUTTONUP:
   - dont, raises, so is not a long

b) the flow comes to
_,_,_ = self.mouse_button_up(event, mob_pos, mousemove)

c)into method mouse_button_up event will become a local variable. That
variable is not assigned, at least in the code you show here.

d) the flow progress to the line
if event.button == 1:
where it raises AttributeError: 'long' object has no attribute 'button'

I see two possibilities here:

1. You snipped some code where event is assigned

2. ( wild possibility) the functions called in mouse_button_up will produce
a *second* call with other parameters to the same function, and that call
has a wrong event parameter. But, why the traceback not show additional
calls in that case?

--
claxo


Re: [pygame] event getting corrupted

2009-09-16 Thread claudio canepa
On Wed, Sep 16, 2009 at 6:33 PM, Bo Jangeborg b...@softwave.se wrote:

 claudio canepa skrev:



 On Wed, Sep 16, 2009 at 5:18 PM, Bo Jangeborg b...@softwave.se mailto:
 b...@softwave.se wrote:


a ha
Well, from where comes event ?


event = pyg_event.poll()

but note that a long can't have attributes and 13 lines above the
error point I do :

mouse_pos = event.pos

and it works at that time


 pyg_event.poll is pygame.event.poll ?

 Yes

  If the only fountain for events were the pygame event queue, the traceback
 coulnt happen:

 a)
 elif event.type is MOUSEBUTTONUP:
   - dont, raises, so is not a long

 b) the flow comes to
 _,_,_ = self.mouse_button_up(event, mob_pos, mousemove)

 c)into method mouse_button_up event will become a local variable. That
 variable is not assigned, at least in the code you show here.
 d) the flow progress to the line
 if event.button == 1:
 where it raises AttributeError: 'long' object has no attribute 'button'

 I see two possibilities here:

 1. You snipped some code where event is assigned

  No , you can see all the code, and event is not being assigned to.

 2. ( wild possibility) the functions called in mouse_button_up will
 produce a *second* call with other parameters to the same function, and that
 call has a wrong event parameter. But, why the traceback not show additional
 calls in that case?

 No , there are no such recursive calls to mouse_button_up
 besides if the incoming event parameter was a long it should fail at
 mouse_pos = event.pos

 My guess is that there is something over writing the event object at a
 lower level, possibly
 caused by something I am doing.
 Bo)


well, there is code after mouse_pos = event_pos.
I would add a
assert type(event) is not long
after any function call in mouse_button_up to know when event is changed,
then drill down the offending function.

--
claxo


Re: [pygame] Picking monitor...

2009-08-28 Thread claudio canepa
On Fri, Aug 28, 2009 at 12:43 PM, Gene Buckle ge...@deltasoft.com wrote:

 On Fri, 28 Aug 2009, James Paige wrote:

  On Thu, Aug 27, 2009 at 08:13:56PM -0700, Gene Buckle wrote:


 Is it possible to choose which display pygame uses for full screen
 mode?
 If so, how is it done?

 thanks!
 g.


 SDL version 1.3 adds commands like SDL_GetNumVideoDisplays() and
 SDL_SelectVideoDisplay()

 SDL 1.3 is actually a testing version, and when it matures to a public
 release, it will be renamed SDL 2.0. After that point, maybe pygame will
 migrate to it (and correct me if I am wrong, but I think somebody is
 already working on this, right?)


 Thanks James.  Not exactly the news I was hoping for. :(  I'm working on a
 glass cockpit display called RJGlass that's written in Python and uses both
 pygame and PyOpenGL.  I'm going to use it in a cockpit project I'm working
 on, but I need to make it run on a 7 LCD panel I've got connected to a USB
 VGA adapter.

 Is there a bleeding-edge version of pygame that is available and uses the
 SDL 1.3 libraries?  I don't know if it matters, but I'm using Windows for
 this.

 Thanks again for you reply.

 g.


 --




If you don't find anything usinng SDL 1.3, you can have a look at pyglet:
http://code.google.com/p/pyglet/

it handles multiple monitors.

--
claxo


Re: [pygame] ANNOUNCE: pygame 1.9.1 released.

2009-08-07 Thread claudio canepa
On Thu, Aug 6, 2009 at 9:00 PM, Paul plh...@gmail.com wrote:

 Just so you know, the release announcements (both for pygame 1.9.0 and
 1.9.1) are automatically placed in the Spam folder by Gmail. The following
 message is displayed:

 Warning: This message may not be from whom it claims to be. Beware of
 following any links in it or of providing the sender with any personal
 information.

 The headers appear as follows:
 from:  René Dudfield ren...@gmail.com
 reply-to:  pygame-users@seul.org
 to:  pygame-users@seul.org
 date:  Thu, Aug 6, 2009 at 8:48 AM
 subject:  [pygame] ANNOUNCE: pygame 1.9.1 released.



I see the same for some René posts, mostly pygame releases announcements.

--
claxo


Re: [pygame] Scrolling

2009-08-03 Thread claudio canepa
On Mon, Aug 3, 2009 at 3:30 PM, Yanom Mobis ya...@rocketmail.com wrote:

 well i need it to work with a BIG surface at 30 fps. and i need
 something that would work with Rabbyt
 --
 **

That changes all: you really are working with openGL,  not standart pygame.
It not comes to my mind scrolling examples with pygame+pyopenGL, I remember
some pyweek7 entries (with scrolling) using pyglet, by example:
make_me (pyweek6 winner) http://www.pyweek.org/e/gamebyalex2/
littlest_goddess  (pyweek7) http://www.pyweek.org/e/CS-L/
and one that can interest you: gondola, in pyweek7,
http://www.pyweek.org/e/yat/
wich uses pyglet + rabbyt ( and was a very polished game )
Also Cocos ( wich uses pyglet ) can do scrolling, albeit there are not so
much examples:
flatbot (pyweek6) http://www.pyweek.org/e/flatbot/
aiamsori (pyweek8) http://www.pyweek.org/e/aiamsori/
--
claxo


Re: [pygame] Pygame 1.9.0 release candidate 3 for Python 2.6 on Windows

2009-07-09 Thread claudio canepa
On Thu, Jul 9, 2009 at 8:55 PM, René Dudfield ren...@gmail.com wrote:

 Hello,

 awesome.  I'll put it up with the other rc3 stuff.

 typo with the link:
 http://www3.telus.net/len_l/pygame/pygame-1.9.0b03.win32-py2.6.msi

 cheers!


 On Fri, Jul 10, 2009 at 8:15 AM, Lenard Lindstrom le...@telus.net wrote:

 Hi everyone,

 Here is the latest Pygame 1.9.0 (rev 2500) for Python 2.6 on Windows.
 Though the machine this was compiled on has a firewall and active antivirus
 program, it uses XP and is not mine, so take whatever precautions you feel
 necessary. The msi installer is:

 http://www3.telus.net/len_l/pygame/pygame-1.9.0b03win32-py2.6.msi

 md5sum:
 e247f69466be1f847c875794cc01d173

 There is no corresponding Python 3.1 version. A distutils bug, absent in
 Python 3.0 and fixed in Python 2.6.2, prevents compilation with MinGW.

 Enjoy,

 Lenard Lindstrom


 Thanks for the build !!!
1. In the section 'Tests', the docs tells:

A quick way to run the test suite package from the command line is to
import the go submodule

with the Python -m option:

  python -m pygame.tests [test options]


but in winXP, python 2.6.1 this not works:


D:\tmpc:\python26\python.exe -m pygame.tests
c:\python26\python.exe: pygame.tests is a package and cannot be directly
executed


Making a script pygame19rc3_starter.py with the contents:

#test starter
from pygame.tests import run
run()
#script ends

and running with

D:\tmpc:\python26\python.exe -m pygame19rc3_starter.py

the tests runs.

--
2. The test run goes ok:
...
Ran 412 tests in 62.766s

OK

--
3. playtested some games and old bugdemos, no problems
--
thanks !
--
claxo


Re: [pygame] Pygame 1.9.0 release candidate 3 for Python 2.6 on Windows

2009-07-09 Thread claudio canepa
On Thu, Jul 9, 2009 at 11:48 PM, René Dudfield ren...@gmail.com wrote:


 ...

 Maybe we should use:

 python -m pygame.tests.main
 python -m pygame.examples.main

 A bit uglier, but it will at least work!


 cheers,

just FYI:
D:\tmpc:\python26\python.exe -m pygame.tests.main
c:\python26\python.exe: No module named pygame.tests.main
--
claxo


Re: [pygame] pygweb milestone 1 released

2009-06-01 Thread claudio canepa
On Mon, Jun 1, 2009 at 6:24 AM, Marcus von Appen m...@sysfault.org wrote:

 pygweb 1.0 (milestone 1) was released.
 Testing
 ---
 You can browse http://pygameweb.no-ip.org/ to visit a current test
 installation of pygweb.

 Regards
 Marcus


registration is supposed to be functional ? I tried, got an activation email
with the content:

hi,
you registered at pygameweb.no-ip.org
To complete your registration, you have to verify your email address.
Just click the following link within the next 3 days
to finish registration:

pygameweb.no-ip.orgaccounts/activate/c14e95cc7d780dfc3e02c7f6a6ebe472713b2a79/
Regards,
   The pygameweb team

Note that link is not clickable (at least in gmail).
Copy  paste to the adress bar : page not found.
prefixing with http:// or http://www. : page not found
..
works:
http://pygameweb.no-ip.org/accounts/activate/c14e95cc7d780dfc3e02c7f6a6ebe472713b2a79/

In the Edit profile screen: typo passoworld  -password

In the Edit your profile | description field: tabs are intercepted by the
navigator (IE7 here).

In the Edit your profile | description field: being in plaintext mode,
filled some text. After hitting change, the text layout goes to hell.
Please, dont do that.
Example:
entered in the description field:
begin --
Ok, this is plaintext.
What about tabs ?
Tabs are intercepted by navigator - IE7 here.
Pasting:
def foo(z):
if x3 and 1:
print 'happy'
Pasting ok.
-- end

After save changes:
Ok, this is plaintext. What about tabs ? Tabs are intercepted by navigator -
IE7 here. Pasting: def foo(z): if x3 and 1: print 'happy' Pasting ok.
Background Color:  the white background is too hard on the eyes.

Will test more later.

--
claxo


Re: [pygame] 2nd Pyggy Awards Open

2009-05-14 Thread claudio canepa
On Thu, May 14, 2009 at 7:00 AM, Greg Ewing greg.ew...@canterbury.ac.nzwrote:

 The Second Pyggy Awards is now open for entries.

  http://pyggy.pyweek.org/1008/

 Greg


Great !!


Re: [pygame] [Pygame] Key Configuration

2009-05-11 Thread claudio canepa
On Mon, May 11, 2009 at 9:31 PM, Fawkes fawkesga...@gmail.com wrote:

 Hello again

 I was wondering what would be the best way to do a key configuration
 for my game? One of the comments from our recent release (
 http://pygame.org/project/1106/ ) was that we ought to have the
 controls configurable by the player for instance if they have a non
 QWERTY keyboard. Right now all the controls are hard coded (e.g. the
 game looks to see if Z is pressed, do something). I was thinking of
 using a dictionary like the following.

 controls{
 confirm:K_z,
 cancel:K_x
 prev_ally:K_a,
 next_ally:K_s,
 prev_enemy:K_q,
 next_enemy:K_w}

 The values within the dictionary would be changeable by the player
 within the game. Is this a good way to go about doing this?

 Thanks in advance
 -Fawkes




That is fine to hold default keybinding, but into the game loop is more
usefull the inverse dictionay: when you receive a key from pygame, you get
the command
by indexing the dict with the key.

--
claxo


Re: [pygame] Pgu not working in 1.8.1; is a patch available?

2009-01-15 Thread claudio canepa
Yes, look at this thread (first and last message are what you want)

http://thread.gmane.org/gmane.comp.python.pygame/15580

--
claxo
On Thu, Jan 15, 2009 at 3:49 AM, The Music Guy music...@alphaios.netwrote:

 Hi,

 I'm working on a game SDK (http://code.google.com/p/scrollback) and
 things are going more or less smoothly, but I would like to experiment
 with Pgu to see if/how I can make it work with my SDK. Unfortunately,
 Pgu tools and examples keep raising weird exceptions in relation to
 trying to access the `get_width` attribute of a pygame.Color object,
 which doesn't make any sense to me. I'm assuming this is because Pgu
 isn't compatible with Pygame 1.8.1.

 My question is, are there any patches out there to make Pgu work with
 Pygame 1.8.1+, assuming that's the problem? If not, how can this be
 fixed?


 --
 http://Alphaios.net http://alphaios.net/ - Tracked Module Music, Blog,
 and Links.




Re: [pygame] New Python 2.6 stuff for Windows

2008-12-30 Thread claudio canepa
On Tue, Dec 23, 2008 at 9:14 PM, Lenard Lindstrom le...@telus.net wrote:

 Hi everyone,

 I am making available a new Pygame 1.9.0a0 (rev 1772) installer for Python
 2.6 on Windows. This Pygame version uses a newer SDL and related libraries,
 so fixes some bugs reported for Pygame 1.8.1. Also this version has René's
 first efforts at wrapping pyportmidi, so includes pyportmidi itself. And
 that is not all. At no extra cost I through in numpy 1.2.1 for Python 2.6 as
 well. It doesn't pass all its unit tests, but those failed tests involve
 compiling with fortran and changed output formats. It is good enough for
 Pygame though. Finally, the Windows prebuilts used with 1.9.0a0 are
 available for those do-it-yourselfers.

 location: http://www3.telus.net/len_l/pygame/

 md5sums:
 03ba8b9ff99b6db6a4d87a0edc43f817 *pygame-1.9.0a0.win32-py2.6.msi
 b791f5c4b620da21f779b53252b5932e *numpy-1.2.1.win32-py2.6.msi
 8dcd7e7c840d656c3ca7576095777c81 *prebuilt-pygame1.9.0-msvcr90-win32.zip
 4b4aec226d03f1d8465336a88d7183c4 *nose-0.10.4.tar.gz

 Have fun and a happy holiday,

 Lenard

 --
 Lenard Lindstrom
 le...@telus.net



A Christmas gift from Lenard !!!
Just FYI, I tried it, on win XP sp3, with a handful of games and bugdemos
for 1.7 - 1.8 , seems to run fine.
The only complain was in one game, about  unable to load pygame.surfarray (
but this is a fresh python 2.6 + pygame installation, without any extra
modules )

--
claxo


Re: [pygame] sound crackle fix? update version?

2008-12-25 Thread claudio canepa
On Thu, Dec 25, 2008 at 6:53 AM, Jake b ninmonk...@gmail.com wrote:

 I think I found the problem, but it leads me to a new question:

 I was using .mp3 file and it seems it cannot read that format.

 However, I tried a different, unsupported file format, and it gave an
 exception.

 Attempting to load .mp3 file doesn't give an exception --- If it's not
 supported, shouldn't it say failed?
 --
 Jake



In pygame 1.7.1 under windows the mp3 reproduction was bugged; ogg support
was fine.
I don't know if the mp3 problems were fixed in the 1.8 series.

--
claxo


Re: [pygame] Trouble signing in

2008-12-12 Thread claudio canepa
On Fri, Dec 12, 2008 at 8:18 AM, Chris Smith maximi...@gmail.com wrote:

 I can't seem to sign in at pygame.org

 Username and password, son;t work, even after resetting the password.

 I also tried setting up a new user, but that didn't work either.

 Username is maximinus.

 Any ideas?



Last year with browser Opera there was trouble to login ( if you enter
correctly the usr/pwd in the news page you got login, but if you mismatch
there, then the trying to log from the failure page was a no-no ).
Maybe you can try from another browser ?

hth

--
claxo


Re: [pygame] detecting pymunk collisions (was Re: QuickDraw warning on Mac OS X)

2008-11-30 Thread claudio canepa
On Sat, Nov 29, 2008 at 3:02 AM, Joe Strout [EMAIL PROTECTED] wrote:

 On Nov 28, 2008, at 9:48 PM, René Dudfield wrote:

  Also see the C documentation... as some of it applies to pymunk :)
 http://code.google.com/p/chipmunk-physics/wiki/Documentation


 Yes, I found that -- apparently in C, you can register a collision pair
 function to get a callback when two things collide.  But I haven't been
 able to see how you do that in pymunk.  But I've posted to 
 http://www.slembcke.net/forums/viewtopic.php?f=6t=8p=1544, so we'll see
 if anybody there or here has an idea.  Hopefully it's doable somehow.

 I also looked in the pygame game archive, but there was only one project
 there tagged with pymunk (So long - A love story).  Does anyone know
 other pygames using pymunk?

 Thanks,
 - Joe



The last Pyweek has seen some pymunk games; go
http://www.pyweek.org/7/entries/
and look for:
StreetSurf
snake_rpg_final
Monkey_In_a_Tangle
TimmysWeirdAdventures
solo_solo-so_long

--
claxo


Re: [pygame] Crazy Machine type game?

2008-11-30 Thread claudio canepa
On Fri, Nov 28, 2008 at 2:44 PM, Joe Strout [EMAIL PROTECTED] wrote:

 Hi all,

 I'm new to pygame, and only recently returned to Python after nearly a
 decade in the REALbasic world.  So I hope you'll speak slowly and use small
 words.  :)

 I've got the bug to create a game similar to the classic games Incredible
 Machine and Crazy Machine.  For those not familiar, it amounts to giving
 the player a palette of pieces that they can arrange in a 2D grid to make
 Rube Goldberg-style machine that accomplishes some goal.  Pieces include
 weights, balls, balloons, electrical components, fans, candles, rockets,
 ropes, pulles, gears, monkeys on bicycles, and so on.  It's a little like
 the Flash game Fantastic Contraption [1], but with far more (and more fun)
 parts.

 As an open-source networked game, it could be especially fun, as anyone
 could contribute their own challenges, and we could keep stats online
 regarding how many people have attempted or solved each one.

 Is there already anything like this started in Python?  (I searched the
 pygame archives, but didn't see anything.)

 If not, have you any advice on how to approach it in the Pygame world?  I
 was thinking of trying PyODE for the physics simulation (hopefully that will
 run cleanly on all platforms, and not just Windows, as that is a firm
 constraint for me).  For the graphics, all I need is basically 2D sprites
 that can move, rotate, and change their image -- from the Pygame examples
 I've seen, that should be no problem.  But what do y'all think?

 Thanks,
 - Joe

 [1] http://fantasticcontraption.com/



There is an old clone like in pygame site, look at

http://www.pygame.org/projects/21/139/

Last time I tried , with pygame 1.7.1 on win xp,  I got tracebacks, seems
developed for an earlier pygame version.



--

claxo


Re: [pygame] [Ann] Win32 prebuilt Pygame 1.9.0 dependencies for Pythons 2.4 and 2.5 (SDL.dll, SDL_image.dll, ...)

2008-11-26 Thread claudio canepa
On Wed, Nov 26, 2008 at 6:56 PM, Lenard Lindstrom [EMAIL PROTECTED] wrote:

 The Windows dependencies for Pygame 1.9.0 are now available as:

 http://www3.telus.net/len_l/pygame/prebuilt-pygame1.9.0-msvcr71-win32.zip

 size: 1,620,018 bytes
 ms5sum: 55d6fc42358d3be932b2a9721934c06a

 The corresponding source bundle is:

 http://www3.telus.net/len_l/pygame/Pygame-1.9.0-deps-src.zip

 size: 28,755,046 bytes
 md5sum: 7a5bc6e5667520112c9f198f8c32ebd1

 These are the support libraries used by Pygame. The dependency binaries
 work with the latest Pygame in SVN. They are not backward compatible with
 Pygame 1.8.1 Windows binaries.

 --
 Lenard Lindstrom
 [EMAIL PROTECTED]

 Any tentative timeline for pygame 1.9 ?


Re: [pygame] Pygame and windows managers

2008-11-12 Thread claudio canepa
On Wed, Nov 12, 2008 at 6:02 PM, Bram Cymet [EMAIL PROTECTED] wrote:

 Thanks for the response,

 I have tried just using pygame regardless. I only actually found out
 about the info stuff while trying to debug problems.

 The actual problem I am having is that the only mode that pygame seems
 to see is 640X480 even though the screen in the eee pc can do 1200X800
 and I am using it with an external display and I need it to do 1360X768
 which is outputting just fine with other applications.

 Patrick Mullen wrote:
  It looks like your eee pc is using directfb or some sort rather than
  standard x11.  fbcon = framebuffer console maybe?  Not sure.
 
  I did some googling and found some reports of people having trouble in
  this regard, with other reports of it working.
 
  By the way, have you tried skipping the display.info and just trying
  to use pygame anyway?  Also an actual error log might be helpful.
 


 --
 Bram Cymet
 Software Developer
 Centre For Technological Innovation
 Canadian Bank Note Co. Ltd.
 Cell: 613-608-9752


 Found by google, seems that this person has managed to setting pygame in
the eeepc, maybe you can ask him:
http://eis.comp.lancs.ac.uk/~carl/blog/2008/09/eeepc-headaches/
A link from him also points to a page about how to configure the xandros
display for certain resolutions:
http://www.thinkwiki.org/wiki/Xorg_RandR_1.2#Using_xrandr_to_do_useful_things
hth
--
claxo


Re: [pygame] No alpha-blending for Surface.fill?

2008-11-03 Thread claudio canepa
On Mon, Nov 3, 2008 at 11:02 AM, Jørgen P. Tjernø [EMAIL PROTECTED]wrote:

 Is there no alpha-blending for Surface.fill? The blendmodes are poorly
 documented, but AFAICT from the source, the blend modes only do
 channel-channel operations (dst_r = ra+rb, dst_g = ga+gb, etc) - nothing to
 do alpha blending?

 If not, are there plans to add new modes to fill? :)

 --
 Kindest regards, Jørgen P. Tjernø

pygame 1.8.1release has a bug relating to fill, maybe fixed in svn. Look at
this thread for details:

http://thread.gmane.org/gmane.comp.python.pygame/15808/focus=15869

--
claxo


Re: [pygame] help

2008-10-30 Thread claudio canepa
On Thu, Oct 30, 2008 at 5:30 PM, Ian Mallett [EMAIL PROTECTED] wrote:

 Yes, I was thinking that, but the error seems to be a Python exception
 (indeed that's what sys.exit() does).  Perhaps the error is Python 2.6
 specific? Ian

No, it hapens also with 2.4 .
I usually edit with IDLE an run the prog from an OS console to avoid
problems.
--
claxo


Re: [pygame] help

2008-10-30 Thread claudio canepa
On Thu, Oct 30, 2008 at 6:51 PM, Matt Pearson [EMAIL PROTECTED] wrote:

 srry it does not clear the exception, i meant to say that it only clears
 the
 exception when i put the loop in a function, still closing problem remains

 On Thu, Oct 30, 2008 at 3:49 PM, Matt Pearson [EMAIL PROTECTED]wrote:

 i have done that and while it clears IDLE of the exception it still
 has a problem closing the window correctly

  On Thu, Oct 30, 2008 at 2:21 PM, pymike [EMAIL PROTECTED] wrote:

 Call pygame.quit()  right before the exit() function

 hth

 On Thu, Oct 30, 2008 at 1:49 PM, Matt Pearson [EMAIL PROTECTED]wrote:

 srry, just seeing if i have the right address,
 so im using python 2.6 and pygame 1.8

 When i write out a script and save it, I run it, and all is fine
 until i try to close the window, and it freezes and goes to an
 unresponsive program, then IDLE tells me this

 Traceback (most recent call last):
   File C:\Python26\RectTest.py, line 15, in module
 exit()
 SystemExit
  On Thu, Oct 30, 2008 at 1:36 PM, Ian Mallett [EMAIL PROTECTED]wrote:

 You'll have to be more specific.





 --
 - pymike
 Stop loling into a false sense of hilarity



 You can try this:
bContinue = True
while bContinue:
...
if xxx:
bContinue=False
pygame.quit()
...
# dont use sys.exit, let execution find the end of file.
EOF
If even that has problems, then out of the loop and before the EOF do
something as
import time
time.wait(1)
that for give pygame some time to do cleanup.
-- untested --
hth
--
claxo


Re: [pygame] help

2008-10-30 Thread claudio canepa
On Thu, Oct 30, 2008 at 7:32 PM, Matt Pearson [EMAIL PROTECTED] wrote:

 where do i put bContinue, before my main loop, or do i intergrate it with
 the loop

 On Thu, Oct 30, 2008 at 4:05 PM, claudio canepa [EMAIL PROTECTED]wrote:



  On Thu, Oct 30, 2008 at 6:51 PM, Matt Pearson [EMAIL PROTECTED]wrote:

 srry it does not clear the exception, i meant to say that it only clears
 the
 exception when i put the loop in a function, still closing problem
 remains

  On Thu, Oct 30, 2008 at 3:49 PM, Matt Pearson [EMAIL PROTECTED]wrote:

 i have done that and while it clears IDLE of the exception it still
 has a problem closing the window correctly

  On Thu, Oct 30, 2008 at 2:21 PM, pymike [EMAIL PROTECTED] wrote:

 Call pygame.quit()  right before the exit() function

 hth

 On Thu, Oct 30, 2008 at 1:49 PM, Matt Pearson [EMAIL PROTECTED]wrote:

 srry, just seeing if i have the right address,
 so im using python 2.6 and pygame 1.8

 When i write out a script and save it, I run it, and all is fine
 until i try to close the window, and it freezes and goes to an
 unresponsive program, then IDLE tells me this

 Traceback (most recent call last):
   File C:\Python26\RectTest.py, line 15, in module
 exit()
 SystemExit
  On Thu, Oct 30, 2008 at 1:36 PM, Ian Mallett [EMAIL PROTECTED]wrote:

 You'll have to be more specific.





 --
 - pymike
 Stop loling into a false sense of hilarity



  You can try this:
 bContinue = True
 while bContinue:
 ...
 if xxx:
 bContinue=False
 pygame.quit()
 ...
 # dont use sys.exit, let execution find the end of file.
 EOF
 If even that has problems, then out of the loop and before the EOF do
 something as
 import time
 time.wait(1)
 that for give pygame some time to do cleanup.
 -- untested --
 hth
 --
 claxo



 probably you had solved it, but if not: replace your
while True:
with
bContinue = True
while bContinue:
and replace your
exit()
with
bContinue = False
pygame.quit()
--
claxo


Re: [pygame] help

2008-10-30 Thread claudio canepa
On Thu, Oct 30, 2008 at 9:37 PM, pymike [EMAIL PROTECTED] wrote:

 If you do that you might get a display error if your drawing code is after
 the input code.- pymike

You are totally right, pymike.
So...

ok, lets forget about bContinue, lets the  while as in the original code,

while True:

and replace in the original code:

if blah:
exit()

by:

if blah:
pygame.quit()
break

--

claxo


Re: [pygame] Pyggy Awards are Go, Almost

2008-10-24 Thread claudio canepa
On Wed, Oct 22, 2008 at 10:28 PM, Greg Ewing [EMAIL PROTECTED]wrote:

 Richard and I have been working on setting up a web site
 for the Pyggy Awards, and it's very nearly ready to go!
 ...
 So I'm asking for feedback on this -- what would you
 prefer? More time, or more breathing space before the
 next PyWeek?

 --
 Greg

Greg, maybe you can post also at pyweek messages and / or pyglet-users (
http://groups.google.com/group/pyglet-users ) to reach the teams using
pyglet.
pyweek messages are death between competitions but probably the RSS feed
will reach people.
--
claxo


Re: [pygame] Shaders and Examples not Working

2008-10-23 Thread claudio canepa
On Thu, Oct 23, 2008 at 12:03 PM, Mike C. Fletcher
[EMAIL PROTECTED]wrote:

 Ian Mallett wrote:

 Hi,

 I get (adding the necessary import ctypes at the top):
 AttributeError: function 'glCreateShader' not found

 Thanks,
 Ian

 You'll likely need to use the extension-based version (ARB.shader_objects).
  If you have a modern Nvidia/ATI card it will almost certainly have shader
 support available in an extension.  Note that some older cards (e.g.
 integrated graphics chips) only support the lower-level APIs (i.e. you can't
 use GLSL with them).

 BTW just tested this demo, it works fine with PyOpenGL bzr head (on Linux,
 with a reasonable Nvidia card):


 http://bazaar.launchpad.net/~mcfletch/pyopengl-demo/trunk/annotate/2?file_id=shader_test.py-20080923005140-67c17kywpwxa2usj-25

 HTH,
 Mike

 --
 
  Mike C. Fletcher
  Designer, VR Plumber, Coder
  http://www.vrplumber.com
  http://blog.vrplumber.com

 just FYI, it works also in windows ( win xp sp3 ), pyOpenGL-3.0.0b6, nvidia
geforce 6600.
--
claxo


Re: [pygame] Pyggy Awards are Go, Almost

2008-10-22 Thread claudio canepa
On Wed, Oct 22, 2008 at 10:28 PM, Greg Ewing [EMAIL PROTECTED]wrote:

 Richard and I have been working on setting up a web site
 for the Pyggy Awards, and it's very nearly ready to go!

 In case you've forgotten, the Pyggy Awards is going to be
 a showcase event for games based on a previous PyWeek entry.
 If you want to polish one of your PyWeek games and have
 somewhere to show off the result, this is it.

 The Pyggy Awards will be run in a very similar way to
 the PyWeek competition, with the following differences:

 * You can start working immediately, or even in the past,
 i.e. any further work you've already done on an existing
 PyWeek entry is eligible.

 * Any library code can be used, as long as it's open
 source.

 The only thing remaining to be decided is the dates for
 the judging period. The possibilities are:

 a) Early December, probably the first 2 weeks.

 b) Some time in February or March next year.

 Option (b) obviously allows more coding time, but the
 next PyWeek is going to be in early April, so it wouldn't
 leave much time for people to recover their energy.

 So I'm asking for feedback on this -- what would you
 prefer? More time, or more breathing space before the
 next PyWeek?

 --
 Greg

I think december is better, but can use either.
Greg, in your response to Charlie you seem to _allow_ older games, but the
page you point in the first post tells _previus pyweek_ . Update the page ?
Glad libraries restriction dropped, this will allow to grow libraries along
the game refactor.
--
claxo


Re: [pygame] Shaders and Examples not Working

2008-10-22 Thread claudio canepa
On Tue, Oct 21, 2008 at 10:15 PM, Ian Mallett [EMAIL PROTECTED] wrote:

 Hi,

 On Tue, Oct 21, 2008 at 12:28 PM, claudio canepa [EMAIL PROTECTED]wrote:

 Searching the pygame site with 'shaders + opengl' got many hits. Can you
 point to the specif script(s) in trouble ?

 I was referring to these tutorials:
 http://www.pygame.org/wiki/GLSLExample?parent=CookBook
 http://www.pygame.org/wiki/GLSL_ARB_Example?parent=GLSLExample
 Which when modified give me this error:
 ValueError: glShaderSource requires 2 arguments (shaderObj, string),
 received 4: (2L, 1, cparam 'P' (046cc5f8), cparam 'P' (046cc4b8))

I got away with this, only to get a:
(1) : error C: syntax error, unexpected '(' at token (
(1) : error C0501: type name expected at token (
ValueError: Shader compilation failed
Esentially, instehad to try to bind directly with ctypes I used the ~new
modules OpenGL.GL.ARB.shader_objects  and OpenGL.GL.ARB.vertex_shader.
If you want to look at the code (the cookbook modified one), I pasted at
http://python.pastebin.com/m209c67af
The problem is that I dont know enough about pyOpenGL, probably the
preparation phase before calls to compile must be done.
Using grep / find in files for 'shader' over pyglet 1.1.1 I see some
promising calls, like:
glShaderSourceARB
glCompileShaderARB
...
Maybe you can look how pyglet calls the shader related code ? Its a pure
python library, as you probably knows.
--
claxo


Re: [pygame] Shaders and Examples not Working

2008-10-21 Thread claudio canepa
On Mon, Oct 20, 2008 at 11:42 PM, Ian Mallett [EMAIL PROTECTED] wrote:

 Hi,

 I've been doing lots of cool stuff with PyOpenGL, but frankly, with cooler
 effects comes more complexity, and when things get more complex
 [...]
 The solution, I've gathered from day 1, is to use shaders, which are
 programs run on the GPU.  They're faster, simpler to use, more powerful and
 flexible, and all-around just cool.  That's great and everything, but
 shaders, simplifying and inherently simple though they are, seem immune to
 implementation in PyGame, by which I mean, no one seems to know how to do
 it.  Which brings me to my point, or rather my exception.  There *are*shader 
 examples on our very own
 pygame.org http://www.pygame.org/wiki/GLSLExample?parent=CookBook.
 However, neither of the shader examples work for me, even after I made the
 obvious modifications.
 Ian

Searching the pygame site with 'shaders + opengl' got many hits. Can you
point to the specif script(s) in trouble ?
--
claxo


[pygame] BUG?: clip and Rect anomalies when width or height negative

2008-10-17 Thread claudio canepa
1. Clip Anomaly:
when a surface .set_clip is called with a rect which have negative width or
height,

seems natural that following fills or blits don't touch at all the surface.
But
width0 -- surface.get_clip().width == surface.get_width()
height0 -- surface.get_clip().height == surface.get_height()
so if the left,top of the clip area is not too far you get the surface
partially

blited/filled.

The attached clip_test.py demoes this.

Use case:
resizing the clip area in a loop can get the last loop iteration with a

degenerated clip rect.
The natural control variable for the loop is not the width.
Expectation on set_clip behavior with negative width was that nothing would
write

to the surface, hence garbage in the screen. Because of unexpected, toke
some time

to find the problem.

there is any rationale for the current behavior ?
wouldn't be better my expected behavior ?

If the current behavior will be kept, please mention it in the docs for
set_clip

and get_clip, and maybe blit / fill


2. Rect anomaly when width or height is negative:

Look at this:

 clip_rect = pygame.Rect(1,1,-100,-100)
 clip_rect.width
-100
 clip_rect.left
1
 clip_rect.right
-99


Its reasonable that a Rect can serve a width0 ?
Its reasonable that rect.leftrect.right ?

To me, this behavior broke the user expectations. Even if the 1.8.1 docs
tells

that The size values can be programmed to have negative values, but these
are

considered illegal Rects for most operations. 

Much better would be: Accept width or height negative, BUT convert to 0
before

store it internally.
With that, the prev interpreter session would look:

 clip_rect = pygame.Rect(1,1,-100,-100)
 clip_rect.width
0
 clip_rect.left
1
 clip_rect.right
1


As a side effect, opers that uses rects like blit, fill, set_clip... don't
need to

be extended to the degenerate cases.

comments ?

--
claxo
# clip_test.py begin

import pygame
from pygame.constants import *

def main():
pygame.init()
screen = pygame.display.set_mode((800,600))
screen.fill((109,152,6))

dst_surf = pygame.Surface((400,400))
dst_surf.fill((0,0,255))
src_surf = pygame.Surface((200,200))
src_surf.fill((255,0,0))

print 'Initial, undisturbed dst_surf real clip rect:',dst_surf.get_clip()
clip_rect = pygame.Rect(0,0,200,100)
dst_surf.set_clip(clip_rect)
print After set_clip with a 'good' rect:,dst_surf.get_clip()

clip_rect = pygame.Rect(0,0,-100,-100) # not ok , negative width or height ignored 
print 'setting dst_surf clip rect to:',clip_rect
dst_surf.set_clip(clip_rect) 
print 'results in dst_surf real clip rect:',dst_surf.get_clip()
dst_surf.blit(src_surf, (0,0))
screen.blit(dst_surf,(0,0))

pygame.display.flip()

bRun = True
while bRun:
pygame.event.pump()
for ev in pygame.event.get():
if (ev.type == pygame.KEYDOWN
and ev.key == pygame.K_ESCAPE):
bRun = False
pygame.quit()

if __name__ == '__main__':
main()

# clip_test.py ends



Re: [pygame] Watch for problems building pygame.transform on non-Windows operating systems.

2008-10-15 Thread claudio canepa
On Wed, Oct 15, 2008 at 10:26 PM, Lenard Lindstrom [EMAIL PROTECTED] wrote:

 It's alive! It's alive! My monster lives. A VC body with a MinGW heart.
 HaHaHaHaHa...

 Cheers !!!

gmail don't like ascii art, so it is atacched

--

claxo
..
..
..
.   *   *.
.*~* .
. * .  .  *  .
.  *   . *   .
.   *   *.
.*  .  * .
. *   *  .
.  * *   .
.   *.
.   *.
.   *.
.   *.
.   *.
.   *.
.   *.
.*** .
..
..
..
   

Re: [pygame] Unexpected behavior from BLEND_RGBA_SUB

2008-10-07 Thread claudio canepa
On Tue, Oct 7, 2008 at 7:18 PM, Yumiko Shirasagi [EMAIL PROTECTED]wrote:

 Hello,

 When I blit an image such as this (generated dynamically with PIL, and
 saved here by pygame.image.save)-
 http://xs432.xs.to/xs432/08412/mask808.png
 to this screen, using the line screen.blit(mask, (0, 0), None,
 BLEND_RGBA_SUB)-
 http://xs432.xs.to/xs432/08412/screen136.png
 it results in this-
 http://xs432.xs.to/xs432/08411/tsukiyo3634.jpg

 Is this what is supposed to happen? It seems to me that BLEND_RGBA_SUB
 should respect the the alpha of the surface being blitted and avoid
 subtracting the fully transparent gray pixels. Of course an alternate
 solution is to get rid of those gray pixels, but I'm wondering whether
 it is a bug in pygame, or if there is a solution that doesn't require
 altering the way the surface is generated.

a quick test tells that , at pixel level, pygame 1.8.1release:

sf1 sf2sf1.blit(sf2,None,'BLEND_RGBA_SUB')

(r1,g1,b1,a1)  (r2,g2,b2,a2)   (clamp(r1-r2),clamp(g1-g2), clamp(b1-b2),
255)

Looks wrong to me, but there are not specs for the oper.

--

claxo


Re: [pygame] Unexpected behavior from BLEND_RGBA_SUB

2008-10-07 Thread claudio canepa
...

a quick test tells that , at pixel level, pygame 1.8.1release:

 sf1 sf2sf1.blit(sf2,None,'BLEND_RGBA_SUB')

 (r1,g1,b1,a1)  (r2,g2,b2,a2)   (clamp(r1-r2),clamp(g1-g2), clamp(b1-b2),
 255)

 Looks wrong to me, but there are not specs for the oper.

 --

 claxo

sorry, the prev aplies if both surfaces has no alpha channel.

When both surfaces have alpha channel ,the current behavoir is

sf1 sf2sf1.blit(sf2,None,'BLEND_RGBA_SUB')

(r1,g1,b1,a1)  (r2,g2,b2,a2)   (clamp(r1-r2),clamp(g1-g2), clamp(b1-b2),
clamp(a1-a2))

Seems to follow the pattern of the BLEND_RGB , meaning an oper aplied per
channel ion a separable fashion.

Not so usefull ?


Re: [pygame] Game Maker but with Python?

2008-10-01 Thread claudio canepa
On Wed, Oct 1, 2008 at 6:12 PM, Nathan Whitehead [EMAIL PROTECTED] wrote:

 I just saw 100 Game Maker Games, a cool 10 minute video that shows
 the wide variety of cool games you can make with Game Maker.

 http://playthisthing.com/100-game-maker-games

 There should be something like this but with Python and pygame!

 My friends at UCSC have taught intro programming using Game Maker, and
 it went well but they were ultimately unhappy with GML (the Game Maker
 scripting language) as a first programming language.  When I taught
 game programming I went straight for pygame and Python (of course).
 It worked out pretty well, but the students had to spend quite a bit
 of time figuring out programming concepts before they could even get a
 square moving around on the screen.

Yes, using pygame as a backend certainly would take plenty of time before
people new to progamation could do something. But what about a very
restricted engine, based in pygame ? Pygame not exposed at all. Call it
mrgame, and use python + mrgame at start of the course. Let me sketch a
little this mrgame:
Target games: one screen arcade-like levels, fixed resolution 800x600, up-
to16 same size actors, up-to 16 bullets. Terrain. 16 Stock sfx. Can play
music. controllers1 and 2.
Terrain:
based on 1 .png file for backgrounds, 1 .map.png file given solid-air
info
The student only inits it by providing a fname.
Actors:
   mrgame knows up-to 16 actors, equal sized  at 32x32
   Typical use is player, monsters, pickables, triggers, patrol points
   Visible primary attributes for actors:
 name,heading, centerpos, vel, visuals, flag_visible.
 Note: visuals is 64x32 .png , two cell animation, heading W.
mrgame derives the remaining visuals N,S,E , and handles internally the
loading.
Actors Functionality:
 autoupdates centerpos
 autoupdates the [internal] image from heading and visuals.
 .spawn()
 .can_move(direction) [ this internally uses terrain ]
 .touches_actor(other_actor_name) # the hull is a fixed rect
,say 30x30, centered at centerpos
 .touches_bullet()
 .die()
Bullets:
mrgame knows up-to 16 bullets, wich really are like actors but small
size, say 8x8
The visual can be a fixed ball, harcoded in mrgame.
Bullets Functionality:
.spawn()
.time_to_live()
.die_on()
.autobounce() # terrain interaction
autoupdates centerpos ,
Controllers:
   a suitable( meaning no frills, no options) proxy for player input.
Now, the code for this engine seems doable. At the very first can be exposed
with a functional style API :you use python, but calls to mrgame dont even
 need to know about classes.
Example program writen to the functional API:
from mrgame_f import *
spawn_level('pacmano')
player = spawn_actor('player',...)
badguy = spawn_actor('badguy',...)
exit = spawn_actor('exit',...)
while 1:
   if touch( player, exit):
   # you win
   if touch( player, badguy):
  # game over !
...
When the group manages classes, you can show the underlaying, more pythonic
API based on a few classes: level, actor, bullet.
Do some game using the class API, but not digging into the engine.
If justifiable from an educational POV, in paralel a small subset of pygame
can be taught, aiming to later do small customizations on the mrgame
functionallity.
...


 Would you use a graphical tool like Game Maker to make your games if
 it used pygame and was extensible using Python?  Why or why not?  What
 would such a tool have to do to be useful?
 --
 Nathan

You are talking about a RAD for games. Basically, a flexible RAD for games
is probably imposible: You must limit the flexibility, or the API will go
really barroque, unusable. Or, you restrict heavily the flexibility, and
come with something usable in this small scope.

The last can be wortwhile, if its scope coincides with what you want to
write, but if you need to learn other languaje, is less appealing.

So, would I use...?

If the script language is not python, near sure no.

If the script language is python, and have interesting high level features,
and there is a

clear, appealling API to use them , probably yes. But this looks more like a
high level library built on top of pygame (or pyglet), maybe with
alternative APIs for simple works.

Interesting theme you has throw, Nathan.

--

claxo


Re: [pygame] question about transparent surfaces and alpha-value

2008-09-24 Thread claudio canepa
sorry, the blit musty be

tmp.blit(surf, (0,0), surf.get_rect(), BLEND_RGBA_MULT)

--

claxo

On Wed, Sep 24, 2008 at 2:58 AM, claudio canepa [EMAIL PROTECTED] wrote:


 something like:

 def get_alphaed( surf, alpha):

 tmp = Pygame.Surface( surf.get_size(), SRCALPHA, 32)

 tmp.fill( (alpha,alpha,alpha,alpha) )

 tmp.blit( surf, (0,0), surf.get_size(), BLEND_RGBA_MULT)

 return tmp

 (untested)

 --

 claxo



Re: [pygame] question about transparent surfaces and alpha-value

2008-09-23 Thread claudio canepa
Well, .set_alpha() docs tells that per pixel alpha overrides surface alpha,
so you can set the alpha but will have no effect.

If you are on pygame 1.8.1, you can blit to a temporary surface with
BLEND_MULT flags, the final pixel - channel will go as:

tmp = a*b/256 where a.blit(b,.., BLEND_MULT)

( interpret the formula as per-pixel per channel)

then blit the tmp to the desired surface.

--

claxo


On Wed, Sep 24, 2008 at 2:04 AM, Horst JENS [EMAIL PROTECTED] wrote:


 Hi List,
 just want to make sure i got this right, please correct me if i'm wrong:

 if i have a jpg-file, i can set the transparency with the command

 pygame.Surface.set_alpha(alpha-value).

 but if i hav a .png-file with already transparent background, i can not
 set the alpha-value of that picture ? Of the visible pixels of
 that .png-file, of course.

 Here is a demo , what i want is the second face (right) also to become
 more and more transparent:

 http://www.spielend-programmieren.at/wiki/doku.php?id=code:colordemo1.py


 greetings,
 -Horst



Re: [pygame] Bug fixes - New Pygame 1.8 DLLs

2008-08-23 Thread claudio canepa
Excellent !!.
Just for confirmation, I tied the relevant bugdemos in my system, they come
clear.

--
claxo

On Sat, Aug 23, 2008 at 4:25 AM, Lenard Lindstrom [EMAIL PROTECTED] wrote:

 I have prepared a new SDL.dll and SDL_mixer.dll to address several SDL
 related bugs. They can be downloaded as a zip file from:

 http://www3.telus.net/len_l/pygame

 under the prebuilts section.

 md5sum:
 45ce81085f94c6c8baebaa1f7b973b7e *replacement-1.8-dlls.zip

 Closed bugs:
 1) Blit to self bug involving non-alpha surfaces.
 2) Mixer quit / restart bug.
 3) Music bug involving replacing music that is playing.

 Open bugs:
 1) For pygame.mixer.music and Python files or file like objects,
 pygame.mixer.quit() will hang after playing an Ogg/Vorbis file. For certain
 wav files the music will not play and pygame.mixer.music.get_busy() will
 hang. The interpreter freezes in both cases.
 2) F10 key is not properly captured for directx video driver.

 Bonus feature:
 pygame.mixer.music now plays 16bit plain FLAC files.

 --
 Lenard Lindstrom
 [EMAIL PROTECTED]




Re: [pygame] BUG:? pygame.mixer.music crash

2008-08-22 Thread claudio canepa
Fantastic !!!
/ launching a swarm of fireworks to honor Lenard work

--
claxo

On Thu, Aug 21, 2008 at 7:53 PM, Lenard Lindstrom [EMAIL PROTECTED] wrote:

 Typo correction: The test cases run *without* crashing.

 Lenard


 Lenard Lindstrom wrote:


 This SDL_mixer bug was fixed in SVN. The test cases attached to the
 original post run with crashing for a new SDL_mixer.dll built fresh from
 SVN. The new SDL_mixer for Windows will be included in the next Pygame
 release, hopefully a 1.8 bug fix coming shortly.

 Lenard






[pygame] pygame color slice difference between 1.8.0 and 1.8.1 ?

2008-08-19 Thread claudio canepa
pygame color slice difference between 1.8.0 and 1.8.1release ?

with pygame 1.8.1release the app BezierLoops
http://www.pygame.org/project/848/?release_id=1474

 crashes with TypeError: sequence index must be integer, not 'slice'
when it  tries to slice a pygame.color.Color instance

In the comments the author tells that he developed in 1.8.0 , so it seems
that there is a difference between 1.8.0 and 1.8.1
Intended ? Unintended ?

--
claxo


[pygame] BUG:? color incompatibility in pygame 1.8.1release versus 1.7.1release

2008-08-17 Thread claudio canepa
color incompatibility in pygame 1.8.1release versus 1.7.1release

 import pygame
 print pygame.version.ver
1.8.1release
 c=pygame.color.Color('#00')
 print c
(0, 0, 0, 0)



 import pygame
 print pygame.version.ver
1.7.1release
 c = pygame.color.Color('#00')
 print c
(0, 0, 0, 255)



--
claxo


[pygame] Re: pgu broken with pygame 1.8.1release ? - patch for one bug(crash)

2008-08-17 Thread claudio canepa
Ok, the gui9.py misbehavior comes from a color incompatibility between
pygame version 1.7.1 versus 1.8.1:

 import pygame
 print pygame.version.ver
1.8.1release
 c=pygame.color.Color('#00')
 print c
(0, 0, 0, 0)



 import pygame
 print pygame.version.ver
1.7.1release
 c = pygame.color.Color('#00')
 print c
(0, 0, 0, 255)


A color is initialized in gui9.py to '#00' wich was black in 1.7.1 and
is transparent in 1.8.1. Besides, the color picker do not change alpha, so
any color selected will maintain the original alpha, 0 in this case.
Fix: specify the alpha, in this case : '#00FF'

Pygame bug additional impact:
Seems that in pgu.gui there are no other instances of colors as '#xxyyzz',
but the config.txt file in the themes\default and themes\gray directories
used colors without explicit alpha. To be safe probably it would be better
to specify the alpha desired ( -- untested -- )

A patch for gui9.py, against pgu from imitation pickles r38 is included.

--
claxo
Index: gui9.py
===
--- gui9.py (revisi¢n: 38)
+++ gui9.py (copia de trabajo)
@@ -280,7 +280,7 @@
 mode.rect.w,mode.rect.h = mode.resize()
 #mode._resize()
 
-default = #00
+default = #00FF
 self.color = color = 
gui.Color(default,width=mode.rect.w,height=mode.rect.w)
 self.color_d = ColorDialog(default)
 


[pygame] pgu broken with pygame 1.8.1release ? - patch for one bug(crash)

2008-08-14 Thread claudio canepa
Knowing that a number of pygame games used pgu, and on top of that pyweek is
near, I take the liberty to re-post at pygame-users.

pgu broken with pygame 1.8.1release ? - patch for one bug(crash)
Nine of the demos crash with the same (except script name) traceback:

Traceback (most recent call last):
  File F:\cla 2008 08 13\trunk\examples\gui11.py, line 67, in ?
app.run(main)
  File ..\pgu\gui\app.py, line 207, in run
self.loop()
  File ..\pgu\gui\app.py, line 163, in loop
us = self.update(s)
  File ..\pgu\gui\app.py, line 188, in update
self.paint(screen)
  File ..\pgu\gui\app.py, line 174, in paint
container.Container.paint(self,screen)
  File ..\pgu\gui\container.py, line 100, in paint
w.paint(sub)
  File ..\pgu\gui\theme.py, line 288, in func
r = m(surface.subsurface(s,w._rect_content))
  File ..\pgu\gui\container.py, line 100, in paint
w.paint(sub)
  File ..\pgu\gui\theme.py, line 288, in func
r = m(surface.subsurface(s,w._rect_content))
  File ..\pgu\gui\container.py, line 100, in paint
w.paint(sub)
  File ..\pgu\gui\theme.py, line 288, in func
r = m(surface.subsurface(s,w._rect_content))
  File ..\pgu\gui\container.py, line 100, in paint
w.paint(sub)
  File ..\pgu\gui\theme.py, line 286, in func
w.background.paint(surface.subsurface(s,w._rect_border))
  File ..\pgu\gui\theme.py, line 473, in paint
self.theme.render(s,v,r)
  File ..\pgu\gui\theme.py, line 404, in render
ww,hh=box.get_width()/3,box.get_height()/3
AttributeError: 'pygame.Color' object has no attribute 'get_width'

The offending scripts are:
gui6.py
gui11.py
gui13.py
gui15.py
gui16.py
gui17.py

html2.py
html3.py
html5.py

Besides, gui9.py don't crash but misbehaves: with pygame 1.7.1 you can draw
boxes and circles but with pygame 1.8.1release no boxes and circles.

I tried pgu '0.10.6' ( checked out from imitation pickles, rev 38 ), also
pgu-0.10.6.tar.gz from sourceforge and pgu 0.10.3, same results.

The demos run fine with pygame 1.7.1

Extra info:
win xp + sp2, python 2.4.3

Okay, found the problem for the crashes: will manifest in widgets with solid
color background.
Cause: color was a tuple, now it is a pygame.colors.Color instance. See
patch for details.
A patch (against pgu svn imitation pickles r38) is attached.
It is pygame 1.7.1 and 1.8.1 compatible.

The other problem (gui9.py misbehaving with pygame 1.8.1release) remains.


--
claxo

-
Index: theme.py
===
--- theme.py(revisi¢n: 38)
+++ theme.py(copia de trabajo)
@@ -396,7 +396,7 @@
 
 if box == 0: return
 
-if type(box) == tuple:
+if not isinstance(box,pygame.Surface):
 s.fill(box,r)
 return
 
@@ -467,7 +467,7 @@
 def paint(self,s):
 r = pygame.Rect(0,0,s.get_width(),s.get_height())
 v = self.value.style.background
-if type(v) == tuple:
+if not isinstance(v,pygame.Surface):
 s.fill(v)
 else: 
 self.theme.render(s,v,r)


[pygame] blit anomalies in pygame 1.8.1release

2008-08-11 Thread claudio canepa
Two (unrelated) anomalies in pygame.Surface.blit(), bugs or what ?

Tests in windows XP + sp2
Python 2.4.3 (#69, Mar 29 2006, 17:35:34) [MSC v.1310 32 bit (Intel)] on
win32
pygame 1.8.1release ( installed from pygame-1.8.1release.win32-py2.4.msi )

1. The pygame documentation and help(pygame.Surface.blit) tells
Surface.blit(source, dest, area=None, special_flags = 0): return Rect

but
surf.blit(sf2,(0,0),special_flags = op)

crashes with traceback:
[...]
  File F:\newcode\_minitest\pygame blit\eblit.py, line 23, in blend
surf.blit(sf2,(0,0),special_flags = op) # crash
TypeError: blit() takes no keyword arguments

Replacing with:
surf.blit(sf2,(0,0),None,op)
there is no crash.

On the other side, dst1.blit(src1, (0,0)) is acceptable.

Looks like a bug or that the real signature is
Surface.blit(source, dest, *args ): return Rect ?


( eblit.py demoes this problem )



2. When blitting (with no blend flags) an opaque pixel ( alpha channel at
255 ) over any other pixel, seems natural that the resulting color be the
src color. (opaque is opaque, right ?). In most cases pygame is off by one,
by example:
.   dst is filled with (x,0,0,128)
.   src is filled with (0,z,0,255)
.   dst.blit(src,(0,0)) will be filled with ( 0, z-1, 0, 255)

( minusblit.py demoes this )
--
claxo


[pygame] blit anomalies in pygame 1.8.1release (2)

2008-08-11 Thread claudio canepa
Opps, now really with the test files.



Two (unrelated) anomalies in pygame.Surface.blit(), bugs or what ?

Tests in windows XP + sp2
Python 2.4.3 (#69, Mar 29 2006, 17:35:34) [MSC v.1310 32 bit (Intel)] on
win32
pygame 1.8.1release ( installed from pygame-1.8.1release.win32-py2.4.msi )

1. The pygame documentation and help(pygame.Surface.blit) tells
Surface.blit(source, dest, area=None, special_flags = 0): return Rect

but
surf.blit(sf2,(0,0),special_flags = op)

crashes with traceback:
[...]
  File F:\newcode\_minitest\pygame blit\eblit.py, line 23, in blend
surf.blit(sf2,(0,0),special_flags = op) # crash
TypeError: blit() takes no keyword arguments

Replacing with:
surf.blit(sf2,(0,0),None,op)
there is no crash.

On the other side, dst1.blit(src1, (0,0)) is acceptable.

Looks like a bug or that the real signature is
Surface.blit(source, dest, *args ): return Rect ?


( eblit.py demoes this problem )



2. When blitting (with no blend flags) an opaque pixel ( alpha channel at
255 ) over any other pixel, seems natural that the resulting color be the
src color. (opaque is opaque, right ?). In most cases pygame is off by one,
by example:
.   dst is filled with (x,0,0,128)
.   src is filled with (0,z,0,255)
.   dst.blit(src,(0,0)) will be filled with ( 0, z-1, 0, 255)

( minusblit.py demoes this )

--
claxo
# -- begin file eblit.py
# Surface.blit signature seems to be wrong or there is a bug

import sys, os, time
import pygame
from pygame.locals import *

print'pygame version:',pygame.version.ver
pygame.init()
pygame.display.set_mode((300,300),0,32)
screen = pygame.display.get_surface()
pygame.display.update()

# no alpha
def sf(i):
surf = pygame.Surface((32,32), SWSURFACE ,32)
color = (i,i,i)
surf.fill(color)
return surf

def blend( sf1, sf2, op):
surf = sf1.copy()
surf.blit(sf2,(0,0),special_flags = op) # crash
#surf.blit(sf2,(0,0),None,op) # no crash
return surf

d={ 'ovr':0, 'add':BLEND_ADD, 'sub':BLEND_SUB, 'mult':BLEND_MULT,
'min':BLEND_MIN, 'max':BLEND_MAX }


def show( i, j, op):
global screen,d
print i,j,op
##try:
sf1 = sf(i)
sf2 = sf(j)
res = blend(sf1,sf2,d[op])
print 'sample:',res.get_at((0,0))
screen.blit( sf1,(10,10))
screen.blit( sf2,(10+32,10))
screen.blit( res, (10+32+32,10))
pygame.display.update()
pygame.event.pump()
##except:
##print '* exception'


show( 0,255, 'ovr')
time.sleep(2)

pygame.quit()

##  File F:\newcode\_minitest\pygame blit\eblit.py, line 23, in blend
##surf.blit(sf2,(0,0),special_flags = op) # crash
##TypeError: blit() takes no keyword arguments

##---
##Python 2.4.3 (#69, Mar 29 2006, 17:35:34) [MSC v.1310 32 bit (Intel)] on win32
##Type help, copyright, credits or license for more information.
##pygame 1.8.1release from pygame-1.8.1release.win32-py2.4.msi
# -- end file eblit.py
# -- file minusblit.py begins
# opaque blits seems off by one
import sys, os, time
import pygame
from pygame.locals import *

print'pygame version:',pygame.version.ver
pygame.init()
pygame.display.set_mode((300,300),0,32)
screen = pygame.display.get_surface()
pygame.display.update()

dst = pygame.Surface( (256,256), SRCALPHA ,32)
for j in xrange(256):
for i in xrange(256):
dst.set_at((i,j),(i,0,0,j))

src = pygame.Surface( (256,256), SRCALPHA ,32)
for j in xrange(256):
for i in xrange(256):
src.set_at((i,j),(0,i,0,255))

res = dst.copy()
res.blit(src,(0,0))

cntEquals = 0
cntMinusOne = 0

for j in xrange(256):
for i in xrange(256):
res_sample = res.get_at((i,j))
assert( res_sample[3]==255 )
assert( res_sample[0]==0 )
res_sample1 = res_sample[1]
src_sample1 = src.get_at((i,j))[1]
if res_sample1==src_sample1:
cntEquals += 1
elif res_sample1==(src_sample1-1):
cntMinusOne += 1

print 'cntEquals:',cntEquals
print 'cntMinusOne:',cntMinusOne
print 'other:', 256*256-(cntEquals+cntMinusOne)
pygame.quit()

##Python 2.4.3 (#69, Mar 29 2006, 17:35:34) [MSC v.1310 32 bit (Intel)] on win32
##Type help, copyright, credits or license for more information.
##pygame 1.8.1release from pygame-1.8.1release.win32-py2.4.msi
# -- file minusblit.py ends


Re: [pygame] blit anomalies in pygame 1.8.1release (2)

2008-08-11 Thread claudio canepa
Lenard wrote:
[...]
The documentation is vague on this point. The argument names are descriptive
only in most cases. The actual arguments are strictly positional. While
technically the argument signature for Surface.blit is (*args), this is also
misleading as blit has only fixed aguments. Such documenting practices also
show up in Python builtins:
[...]
/end quote

Lenard, thanks for the extensive explanation about documentation.
Certainly this style for documentation is more readable that the syntax
correct:
.   pygame.Surface( source, dest [, area [, special_flags]] )
Unambiguous alternative can be:
.   pygame.Surface( source, dest, area - None , special_flags - 0 )
But probably a brief 'conventions' section in the documentation can be
enought (and wellcomed).

--
claxo


Re: [pygame] blit anomalies in pygame 1.8.1release (2)

2008-08-11 Thread claudio canepa
On 8/11/08, René Dudfield [EMAIL PROTECTED] wrote:

 hi,

 have you added a test case?

 I'm pretty sure this changes the behavior of previous pygame, so we
 decided to keep the behavior.



 On Tue, Aug 12, 2008 at 8:34 AM, Lenard Lindstrom [EMAIL PROTECTED] wrote:
  Lenard Lindstrom wrote:
 
  claudio canepa wrote:
 
  2. When blitting (with no blend flags) an opaque pixel ( alpha channel
 at
  255 ) over any other pixel, seems natural that the resulting color be
 the
  src color. (opaque is opaque, right ?). In most cases pygame is off by
 one,
  by example:
  .   dst is filled with (x,0,0,128)
  .   src is filled with (0,z,0,255)
  .   dst.blit(src,(0,0)) will be filled with ( 0, z-1, 0, 255)   (
  minusblit.py demoes this )
 
 
  Thanks for bringing it to our attention. This was a known bug in Pygame
  1.7 and was fixed previous to Pygame 1.8. Apparently the bug was
  reintroduced in an attempt to optimize the code. I will repair it.
 
  Bug fixed in SVN revision 1608.
 
  --
  Lenard Lindstrom
  [EMAIL PROTECTED]
 
 


Can developers add a brief note to documentation when a bug is intentionally
kept ?
It is a waste of time to perpetually build 'bug demos' (users) , add  -
remove code (developers).
Besides, undocumented wrong behavior is awfull when writing tests !

--
claxo


Re: [pygame] Another blitting surface to itself crash

2008-08-08 Thread claudio canepa
On 8/7/08, René Dudfield [EMAIL PROTECTED] wrote:

 A summary of what has been found out so far:

 * it doesn't seem to crash on linux/osx.
 * It never crashed for SDL 1.2.7 through 1.2.9 (but crashes with 1.2.9
 build Lenard made)
 * For SDL 1.2.10 and 1.2.11 it crashes after like 2-6 passes, and it
 crashes in the blit from surface to screen
 * for SDL 1.2.12 and 1.2.13 it crashes immediately on first blit of a
 surface to itself, everytime
 * crashes with windib, and directx drivers.
 * works with a replacement 1.2.13 SDL.dll built with MSVC by brian.
 * crashes with assembly disabled.
 * -O compilation also fails.
 * 1.2.9 SDL fails for Lenard, built with minGW


Err, it crashes with SDL 1.2.7 and pygame 1.7.1 (windows)


Re: [pygame] Another blitting surface to itself crash

2008-08-03 Thread claudio canepa
On 8/2/08, Brian Fisher [EMAIL PROTECTED] wrote:

 There's another instance of blitting a surface to itself crashing on
 Windows for a user, it's believed to be a 1.8.1 thing by the poster
 http://pygame.motherhamster.org/bugzilla/show_bug.cgi?id=19

 last time it came up marcus was thinking about making pygame throw an
 exception on blitting a surface to itself, which still seems like a decent
 solution to me. Anybody know any more background?




time ago I reported this, see
http://article.gmane.org/gmane.comp.python.pygame/12087

At the time it was a pygame 1.7.1 bug, looking windows specific ( developers
on Linux got no problem with blit over itself ), and the SDL version was
wathever linked - recomended at pygame site ( the binaries readme tells it
is 1.2.7 )


[pygame] Re: BUG:? pygame.mixer.music crash

2008-08-01 Thread claudio canepa
The crashes persist with 1.8.1release ( downloaded from the pygame link,
unistall 1.8.1.rc3, verified  site-packages/pygame disapeared, installed
1.8.1release, run the tests that come with the docs, all passed OK)

A workaround enought good for me:

Instehad of calling directly pygame.mixer.music.play, I stop the music, then
wait till pygame.mixer.music is not busy, then wait 0.1 second, finally play
the new song. Yeah, clunky, but better than a crash !


Attached are the tests modified to use the workaround; you can look at the
code for the details.
Warn: 50 runs with 50 changes take some time.

Also, I noticed that getting sample data files from sourceforge can be
inconvenient at present time ( there are migrating datacenter ) so in the
short time you can get the files from

 http://rapidshare.com/files/134104315/media_test_claxo.rar.html

The stats where:

 pygame 1.7.1
using clock.tick(50) - using mode0 ( no wait after unbusy )

initial song: 0
change mode is toggle: 1
time_sleep: 0.5
runs: 50
changes per runs: 50
success: 42
failed: 8


using clock.tick(50) - using mode1 ( wait 0.1 sec after unbusy)

initial song: 0
change mode is toggle: 1
time_sleep: 0.5
runs: 50
changes per runs: 50
success: 50
failed: 0

 pygame 1.8.1release
clock.tick(50) , using mode0 (no wait after unbusy)

initial song: 0
change mode is toggle: 1
time_sleep: 0.5
runs: 50
changes per runs: 50
success: 50
failed: 0

clock.tick(50) - using mode1 ( wait 0.1 sec after unbusy)

initial song: 0
change mode is toggle: 1
time_sleep: 0.5
runs: 50
changes per runs: 50
success: 50
failed: 0


@Lenard: glad you are investigating !


--
claxo

# begin file mtest2b.py
import pygame
import pygame.mixer
import time


##key1 : togle song
##key2 : reload same song
##key3 : quit
qsong = None
qvol = None
qmusic_state = 0 # 0: not in transition 1: waiting not busy 2: waiting 1 sec 
delay
qtime = None

def play_music( song, musicVol ):
global qsong, qvol, qmusic_state
tmp = pygame.mixer.music.get_busy()
print 'busy:',tmp,'  ==0?:',tmp==0
if pygame.mixer.music.get_busy():
qsong = song
qvol = musicVol
qmusic_state = 1
stop_music()
else:
print '*** unbusy ***'
_play_music( song, musicVol )

def _play_music( song, musicVol ):
print 'About to start song:',song
pygame.mixer.music.set_volume(musicVol*0.01)
pygame.mixer.music.load( song )
pygame.mixer.music.play(-1) # looped

def stop_music():
if pygame.mixer.get_init():
pygame.mixer.music.stop()


def play_music_delayed1():  # wait some time after unbusy
global qmusic_state, qtime
if not qmusic_state:
return
if pygame.mixer.music.get_busy():
return
if qmusic_state == 1:
qtime = time.time()+0.1 # wait 0.1 sec after unbusy
qmusic_state = 2
else:
if qtimetime.time():
print '---delayed kicks in the song'
_play_music(qsong, qvol)
qmusic_state = 0

def play_music_delayed0():  # play when unbusy
global qmusic_state
if not qmusic_state:
return
if pygame.mixer.music.get_busy():
print 'wait...'
return
if qmusic_state == 1:
print '---delayed kicks in the song'
_play_music(qsong, qvol)
qmusic_state = 0



pygame.display.init()
pygame.mixer.init(44100, -16, True, 4096)
pygame.mixer.set_num_channels(8)

soundVol = 100
musicVol = 100
songs = ['menu.xm', 'egyptian-trance.xm']
selected = 0

print 
\nUse:
\t t: toggle song
\t r: restart song
\t esc: quit

pygame.display.set_mode((300,300))
screen = pygame.display.get_surface()
screen.fill((0,0,255))
clock = pygame.time.Clock()

print 'pygame.mixer.music.get_busy():',pygame.mixer.music.get_busy()
print 'pygame.mixer.music.get_busy():',pygame.mixer.music.get_busy()
print 'pygame.mixer.music.get_busy():',pygame.mixer.music.get_busy()

bContinue = True
while bContinue:
#pygame.event.pump()
for ev in pygame.event.get():
if (ev.type == pygame.KEYDOWN):
if ev.key == pygame.K_ESCAPE:
bContinue = False
elif ev.key == pygame.K_t:
selected = not selected
play_music( songs[selected], musicVol)
elif ev.key == pygame.K_r:
play_music( songs[selected], musicVol)
else:
pass
play_music_delayed1()
pygame.display.update()
clock.tick(25)

pygame.quit() 
# end file mtest2b.py

#begin file mtest4b.py
import pygame
import pygame.mixer
import sys, time
import subprocess

qsong = None
qvol = None
qmusic_state = 0 # 0: not in transition 1: waiting not busy 2: waiting delay 
after unbusy
qtime = None

def play_music( song, musicVol ):
global qsong, qvol, qmusic_state
tmp = pygame.mixer.music.get_busy()
print 'busy:',tmp,'  ==0?:',tmp==0
if pygame.mixer.music.get_busy():
qsong = song
qvol = musicVol

Re: [pygame] BUG:? pygame.mixer.music crash

2008-08-01 Thread claudio canepa


 Okay, I can confirm that mtest2.py consistently crashes for me on the third
 toggle. Also the attached music.py test program crashes on the third
 iteration of the for loop. There is no crash for ogg-vorbis and midi (using
 timidity) files. Neither does music.c, the C version of music.py, crash. So
 I will compare the C test program with Pygame.mixer for differences. It can
 still be an SDL_mixer/mikmod bug though.

 --
 Lenard Lindstrom
 [EMAIL PROTECTED]


Lenard, can you give a try to the tests with the workarounds to see if it
will come clear ?

--
claxo


[pygame] BUG:? pygame.mixer.music crash

2008-07-30 Thread claudio canepa
Problem:

pygame.mixer.music crash while changing song

pygame versions with problems:

1.7.1 : got from pygame site maybe two years ago, the binary dependencies at
same time , the binaries readme tells it is SDL - 1.2.7 , with SDL_mixer -
1.2.3, built with MSVC 6. Lots of pygame games run with no problems.

1.8.1.rc3 : test 1 both with the telus build and the 'automated build',
tests 2 and 3 only tested against telus build

Other info:
winXP + sp2, python 2.4.3, integrated audio nvidia nforce2, audio drivers
version 5.10.2917.0
Tested on more than a single machine, but same hardware.

Problem - bugdemos history:

1. I am one of the magicor (http://magicor.sourceforge.net) developers,
working in windows; with pygame 1.7.1 no real problems with the game, but
trying the pygame 1.8.1.rc3 crashes begin.
I tracked the problem to the moment pygame.mixer.music is instructed to
change the current song.
The crash is a GPF, not even a 'pygame parachute', and the OS tell the fault
is at sdl_mixer.dll , vs 1.2.8.0 ( provided with the windows installer for
pygame 1.8.1.rc3 )
The specific fail moment is when in the levelselect menu the user gives an
'esc', wich normally will change to the main menu.
I tryied with both the telus build and the 'automated build', same problem.
1.8.1.rc3 installed after unistall 1.7.1 and deleting the remaining
site-packages\pygame dir



2. Then I wrote mtest2.py (atached) to demo the problem in short code; it
responds to keypresess changing or restarting the song played.
( to try it you must get two songs from the magicor repo, data\music\menu.xm
and data\levels\egypt\egyptian-trance.xm )
All right, at first seemed to worked as expected: no fail in 1.7.1, fail in
1.8.1.rc3.
With more runs, they start to appear crashes in 1.7.1, albeit mostly 'pygame
parachute's.
Failures not so consistent. Maybe sensitive to the timming of keypresses,
sometimes closing a console and starting other seems to help to get
failures.
Restarting ( keypress 'r' ) seems more prone to crash than toggle song (
keypress 't' ) in pygame 1.7.1, the other way with 1.8.1.rc3
the song 'egyptian-trance.xm' seems to crash more than menu.xm ( in repeat
mode )
Two or tree toggles in 1.8.1.rc3 usually suffice to crash, 1.7.1 seems les
prone to crash.

3. To have a better testbed for posible workarounds, I wrote a test that
colects some stats.
trunner2.py (the test runner) and ,mtest4.py ( the test ) - both atached.

trunner2 will run k-times mtest4.py as a subprocess, counting the crashes.
mtest4.py is an automated mtest2.py, it attempts to do a programable count
of song changes, be it by restarting the same sound or changing to the
other. If not crashed, will add a line to a log file. ( Note: that works
well with 1.7.1, but in 1.8.1.rc3 you must close manually the OS messagebox
that informs about the gpf )
Finally trunner will report the stats.

That was better, but I suspect the test is introducing some artifacts.
Specifically, the failure ratio for 1.7.1 seems too high ( 22/25 , 24/25 for
song 'egyptian-trance.xm , 12/25 for 'menu.xm', change_mode as restart same
song ). And seems that if run k fails then run k+1 probably will fail.
Suspecting an OS cleanup after crash can interfere, I added a litle wait
between test runs, thats the time_sleep in trunner2.py . With it, failures
goes down to 1/25 , 0/25 , more reasonable in the light that magicor doenst
crash with 1.7.1


Some results:

---
Trunner2 results wwith pygame 1.7.1
run1:
initial song: 1
change mode is toggle: 1
time_sleep: None
runs: 25
changes per runs: 10
success: 3
failed: 22

run2:
initial song: 1
change mode is toggle: 1
time_sleep: 0.5
runs: 25
changes per runs: 10
success: 25
failed: 0

initial song: 1
change mode is toggle: 0
time_sleep: 0.5
runs: 25
changes per runs: 10
success: 25
failed: 0

initial song: 1
change mode is toggle: 0
time_sleep: None
runs: 25
changes per runs: 10
success: 3
failed: 22


Trunner2 results wwith pygame 1.8.1.rc3
initial song: 1
change mode is toggle: 1
time_sleep: None
runs: 25
changes per runs: 10
success: 0
failed: 25

initial song: 1
change mode is toggle: 1
time_sleep: 0.5
runs: 25
changes per runs: 10
success: 0
failed: 25

initial song: 1
change mode is toggle: 0
time_sleep: 0.5
runs: 25
changes per runs: 10
success: 25
failed: 0

-

Allright, I will try to build some workaround and report.
If there is some sugestion from the pygame builders I will be glad to test.
Be patient with the mail, Im working out of town and checking mail at a
cybercafe once a day.

--
claxo
import subprocess, time

# params test run
maxruns = 25
ch_per_run = 10

# 
bToggle = 0
initial_song = 1
time_sleep = None # use None for no sleep beetwen runs

cntruns = 0
cntfailed = 0

#clean stats
f = open('tstats.txt','w')
f.write('Start.\n')
f.close()

sl = ['python.exe','mtest4.py','%d'%ch_per_run,'%d'%bToggle,'%d'%initial_song ]
for i in xrange(maxruns):
cntruns +=1 
ret = subprocess.call(sl)
if time_sleep: