Re: [pygame] Collision Resolver module

2008-01-01 Thread bhaaluu
Perhaps the collission-resolver module should be included in a Game Engine
leaving PyGame as is?

The collission-resolver is a really nice module, but adding it to PyGame seems
like the beginning of creeping feature bloat? I'd rather see it added to a Game
Engine, and have a nice tutorial written on how to implement it in several
different types of game senarios.

Happy Programming!
-- 
b h a a l u u at g m a i l dot c o m
http://www.geocities.com/ek.bhaaluu/python/index.html

On Dec 31, 2007 2:50 PM,  [EMAIL PROTECTED] wrote:


  Here's a collision resolver module I've been working on.
 
  A common problem in 2D games is trying to move a sprite in a direction
  (deltaX, deltaY) and then discovering that there is a solid object in the
  new position it wants to occupy, so you have to move it back to the edge
  of that solid object.
 
 
  This kind of problem -- checking a _sprite_ for collisions -- is why I
  don't think it's a good idea to have game objects based around sprites.
  We're trying to represent a physical space, so having objects recorded in
  terms of screen coordinates blurs the distinction between where something
  is drawn and where it _is_. What if the screen scrolls? Suddenly all the
  objects move even if they're not supposed to be moving.
 
  What I've been doing is decoupling sprites from game entities. Doing that
  has already paid off in an unexpected way. When I changed the tile size I
  was using, making one unit of space represented by fewer pixels, I noticed
  that my character seemed to run slower. It didn't, actually; its apparent
  speed had automatically adjusted to the new tile size, without my having to
  re-code it!

 If you take a look at the code, particularly at the resolve_collisions
 function, it doesn't actually care about sprites, it can work generically
 with the rects alone, or with any object that has a .rect attribute.

 -sjbrown




Re: [pygame] Collision Resolver module

2008-01-01 Thread Laura Creighton
In a message of Tue, 01 Jan 2008 04:46:08 EST, bhaaluu writes:
Perhaps the collission-resolver module should be included in a Game Engi
ne
leaving PyGame as is?

The collission-resolver is a really nice module, but adding it to PyGame 
seems
like the beginning of creeping feature bloat? I'd rather see it added to 
a Game
Engine, and have a nice tutorial written on how to implement it in severa
l
different types of game senarios.

Happy Programming!

If it isn't to go into pygame I would rather have it as another module
to load, included as a library.  Thank you for writing this sjbrown.

Laura



Re: [pygame] Collision Resolver module

2008-01-01 Thread [EMAIL PROTECTED]
did anyone look into box2d? (http://www.box2d.org/)
i think this also could be nice for using it with pygame. is there a python
wrapper for it? sorry for being slightly offtopic...

On 1/1/08, Laura Creighton [EMAIL PROTECTED] wrote:

 In a message of Tue, 01 Jan 2008 04:46:08 EST, bhaaluu writes:
 Perhaps the collission-resolver module should be included in a Game Engi
 ne
 leaving PyGame as is?
 
 The collission-resolver is a really nice module, but adding it to PyGame
 seems
 like the beginning of creeping feature bloat? I'd rather see it added to
 a Game
 Engine, and have a nice tutorial written on how to implement it in severa
 l
 different types of game senarios.
 
 Happy Programming!

 If it isn't to go into pygame I would rather have it as another module
 to load, included as a library.  Thank you for writing this sjbrown.

 Laura




Re: [pygame] convert() bug?

2008-01-01 Thread Brian Fisher
I load png and jpg on Linux mac and win with no problems so far. I
assume every distro of pygame has image_ext in it, and that it
provides a consistent level of format support across all platforms in
the load function. I would say if you experience something that isn't
consistent in that way, it should be reported as a bug.

On Jan 1, 2008 10:02 AM, hwg [EMAIL PROTECTED] wrote:

 Thanks for the explanation.  I have another, related question...  What image
 formats are supported cross-platform (Windows, Linux, Mac) by default in
 Pygame, without using any other modules or external graphics aupport?

 Thanks,
 hwg


 - Original Message 
 From: Brian Fisher [EMAIL PROTECTED]
 To: pygame-users@seul.org

 Sent: Friday, December 28, 2007 12:10:01 PM
 Subject: Re: [pygame] convert() bug?

 thanks for sending the example and file - it looks like Ethan was
 correct about what's going on. Most places where the image is
 transparent, it is transparent-white. The bottom line is
 transparent-black. You didn't notice the transparency being removed
 anywhere but the black line because in your example the background is
 white. This modified simple example should make all this clearer
 (magic pink background, multiple versions of beach ball image drawn):

 import pygame, sys
 pygame.init()
 screen = pygame.display.set_mode([640,480])
 screen.fill([255, 0, 255])
 my_ball_original = pygame.image.load(beach_ball.png)
 my_ball_convert = my_ball_original.convert()
 my_ball_convert_alpha = my_ball_original.convert_alpha()
 screen.blit(my_ball_original,[50, 50, 90, 90])
 screen.blit(my_ball_convert,[150, 50, 90, 90])
 screen.blit(my_ball_convert_alpha,[250, 50, 90, 90])

 my_ball_remove_column_alpha = my_ball_original.convert_alpha()
 for y in xrange(my_ball_remove_column_alpha.get_height()):
 pos = (0, y)
 pixel = my_ball_remove_column_alpha.get_at(pos)
 pixel = (pixel[0], pixel[1], pixel[2], 255)
 my_ball_remove_column_alpha.set_at(pos, pixel)
 screen.blit(my_ball_remove_column_alpha,[350, 50, 90, 90])

 pygame.display.flip()
 while True:
 for event in pygame.event.get():
 if event.type == pygame.QUIT: sys.exit()


 On Dec 28, 2007 7:10 AM, hwg [EMAIL PROTECTED] wrote:
 
  This displays a beach ball image.
  Oddly, the black is only a line at the bottom. If it was related to
  transparency, I would expect there to be black all around the ball
  If I remove the line that uses convert(), the black line goes away.   I
 tried
  convert_alpha, and that works as well, but the black line still puzzles
 me,
 
  hwg
 
 
  - Original Message 
  From: Ethan Glasser-Camp [EMAIL PROTECTED]
  To: pygame-users@seul.org
  Sent: Monday, December 17, 2007 4:50:02 PM
  Subject: Re: [pygame] convert() bug?
 
  Can you send the image? It sounds like there's a one-pixel thick line
  along the bottom of the image which is fully transparent. Since
  convert() removes transparency, the line becomes visible. If that is
  the case, you could consider using convert_alpha() to preserve alpha
  (and thus transparency on that one-pixel-thick line).
 
  Ethan
 



  
 Never miss a thing. Make Yahoo your homepage.


Re: [pygame] Collision Resolver module

2008-01-01 Thread Brian Fisher
This looks like a python binding for an extremely similar 2d physics
engine, chipmunk (it even uses some of the same algorithms from box2d)
http://www.pyweek.org/d/932/


On Jan 1, 2008 7:29 AM, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
 did anyone look into box2d? (http://www.box2d.org/)
 i think this also could be nice for using it with pygame. is there a python
 wrapper for it? sorry for being slightly offtopic...



 On 1/1/08, Laura Creighton [EMAIL PROTECTED] wrote:
  In a message of Tue, 01 Jan 2008 04:46:08 EST, bhaaluu writes:
  Perhaps the collission-resolver module should be included in a Game Engi
  ne
  leaving PyGame as is?
  
  The collission-resolver is a really nice module, but adding it to PyGame
  seems
  like the beginning of creeping feature bloat? I'd rather see it added to
  a Game
  Engine, and have a nice tutorial written on how to implement it in severa
  l
  different types of game senarios.
  
  Happy Programming!
 
  If it isn't to go into pygame I would rather have it as another module
  to load, included as a library.  Thank you for writing this sjbrown.
 
  Laura
 
 




Re: [pygame] Collision Resolver module

2008-01-01 Thread sjbrown
I don't think it's bloat, nor does it belong in a specific game engine.  A
game engine is something designed to work for a particular genre of game. 
This is a general problem that will be seen in many types of game.

Genres that this problem *must* be solved for:
Platformers, Shoot-em-up, Any top-down with a continuous map (racing,
puzzle, rpg), Any game with rectangle (as opposed to point) projectiles

Genres that could optionally use this algorithm:
Puzzles, simulations, adventure (any 2D walking game, including
beat-em-ups), etc...

In fact, I see it as the next logical step from the Rect.collide* and
Sprite.*collide* functions.

I started using Pygame because it was the only library that provided the
tools to let me think about the interesting parts of creating a game, and
took care of the boring details.  Plus, it provides a rich API that lets me
write a game *well*.  This is what attracts people to Pygame, IMHO, so we
shouldn't be content to rest, providing just a wrapper to SDL, instead,
Pygame should aspire to providing a very rich (while being consistent, lean,
and elegant) set of tools.

-sjbrown

 Perhaps the collission-resolver module should be included in a
 Game Engine leaving PyGame as is?

 The collission-resolver is a really nice module, but adding it to PyGame
 seems like the beginning of creeping feature bloat? I'd rather see
 it added to a Game Engine, and have a nice tutorial written on how to
 implement it in several different types of game senarios.

 Happy Programming!
 --
 b h a a l u u at g m a i l dot c o m
 http://www.geocities.com/ek.bhaaluu/python/index.html

 On Dec 31, 2007 2:50 PM,  [EMAIL PROTECTED] wrote:


  Here's a collision resolver module I've been working on.
 
  A common problem in 2D games is trying to move a sprite in a direction
  (deltaX, deltaY) and then discovering that there is a solid object in
 the
  new position it wants to occupy, so you have to move it back to the
 edge
  of that solid object.
 
 
  This kind of problem -- checking a _sprite_ for collisions -- is why I
  don't think it's a good idea to have game objects based around sprites.
  We're trying to represent a physical space, so having objects recorded
 in
  terms of screen coordinates blurs the distinction between where
 something
  is drawn and where it _is_. What if the screen scrolls? Suddenly all the
  objects move even if they're not supposed to be moving.
 
  What I've been doing is decoupling sprites from game entities. Doing
 that
  has already paid off in an unexpected way. When I changed the tile size
 I
  was using, making one unit of space represented by fewer pixels, I
 noticed
  that my character seemed to run slower. It didn't, actually; its
 apparent
  speed had automatically adjusted to the new tile size, without my having
 to
  re-code it!

 If you take a look at the code, particularly at the resolve_collisions
 function, it doesn't actually care about sprites, it can work generically
 with the rects alone, or with any object that has a .rect attribute.

 -sjbrown










Re: [pygame] Virtual attributes of pygame.Rect

2008-01-01 Thread Jake b
If the self argument ( sean's post ) doesn't fix the problem, it could
be that the Rect() is actually a tuple. I ran into this before.

To fix this, see:
http://www.mail-archive.com/pygame-users@seul.org/msg05338.html

On Dec 26, 2007 4:04 AM, [EMAIL PROTECTED] wrote:



 Hi everyone,

 First of all,merry Xmas!

 I would like to ask about the virtual attributes of pygame.Rect (I mean: top, 
 left,centerx...and so on)
 I have 2 classes, board() and square(). At class Square I have some methods 
 like:

 def setRect(x,y,w,z):
 self.rect=pygame.Rect(x,y,w,z)

 def getXposition():
   print value top left: , self.rect.left#this is only to check the value is 
  correct
   return self.rect.left

 And then at Board() class I have instances of Square():

 newSquare= Square()

 After that I asign rects values with newSquare.setRect(x,y,w,z), but when I 
 try to access to the left virtual attribute with newSquare.getXposition, it 
 says me that the object doesn't have a left attribute when in getXposition I 
 try to print the value.

 Does anyone know, more or less, what I'm doing wrong?

 Thanks for all!



-- 
Jake


Re: [pygame] Collision Resolver module

2008-01-01 Thread Luca
On Jan 1, 2008 7:49 PM,  [EMAIL PROTECTED] wrote:
 Pygame should aspire to providing a very rich (while being consistent, lean,
 and elegant) set of tools.


I'm not a smart pygame user yet so my opinion can be very poor, but
what I quoted here is true, and important. This is true for all engine
in general, not only pygame.
I've not tested the example and the library that generated this
thread, but for what I see and tryed from the Pygame base tutorial, a
Sprite collision is already present.
The tutorial itself says ...but probably this will be enough for you use.

So you are talking here of something that pygame already do... but not well?


Re: [pygame] controlled midi playback

2008-01-01 Thread [EMAIL PROTECTED]
thanks!

and does anyone know if there are examples somewhere? like a simple program
which allows you to play a midi instrument (best using the integrated
synthesizer on the sound card) with the computer keyboard?


On 1/1/08, Lenard Lindstrom [EMAIL PROTECTED] wrote:

 Try http://alumni.media.mit.edu/~harrison/code.html

 Lenard

 [EMAIL PROTECTED] wrote:
  thanks!
  http://sound.media.mit.edu/~harrison/pyportmidi/
  http://sound.media.mit.edu/%7Eharrison/pyportmidi/
  it sounds like it is what i need but unfortunately it doesn't seem to
  be available anymore...
 
  On 1/1/08, *Lenard Lindstrom* [EMAIL PROTECTED]
  mailto:[EMAIL PROTECTED] wrote:
 
  [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote:
   hi,
  
   i have a midi song (not polyphonic) and want to play back one note
   after another triggered by key presses. what would be the best
  way to
   do this? i guess i can't directly do this with pygame but i need
  some
   midi library? does anyone know which one would be suited for that
   (ideally it should work in linux and windows)? has anyone tried to
   do something similar?
  Check out the Python music page:
 
  http://wiki.python.org/moin/PythonInMusic
  http://wiki.python.org/moin/PythonInMusic
 
  Of the various midi packages PyPortMidi is still available.
 




Re: [pygame] controlled midi playback

2008-01-01 Thread [EMAIL PROTECTED]
awesome! :) thanks a lot...

now i only have to get pyportmidi compiled for python 2.5. i get this pyrex
error:
pypm.pyx:357:21: Type 'PmError' not acceptable as a boolean

do you have an idea what causes this?

On 1/1/08, Lenard Lindstrom [EMAIL PROTECTED] wrote:

 This was something I put together to see if pygame and PyPortMidi would
 get along. They do. It is very simple. You can use the keyboard or the
 mouse to play a four note pipe organ.

 Lenard


 [EMAIL PROTECTED] wrote:
  thanks!
 
  and does anyone know if there are examples somewhere? like a simple
  program which allows you to play a midi instrument (best using the
  integrated synthesizer on the sound card) with the computer keyboard?
 
 
  On 1/1/08, *Lenard Lindstrom* [EMAIL PROTECTED]
  mailto:[EMAIL PROTECTED] wrote:
 
  Try http://alumni.media.mit.edu/~harrison/code.html
  http://alumni.media.mit.edu/%7Eharrison/code.html
 
  Lenard
 
  [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote:
   thanks!
   http://sound.media.mit.edu/~harrison/pyportmidi/
  http://sound.media.mit.edu/%7Eharrison/pyportmidi/
   http://sound.media.mit.edu/%7Eharrison/pyportmidi/
   it sounds like it is what i need but unfortunately it doesn't
  seem to
   be available anymore...
  
   On 1/1/08, *Lenard Lindstrom* [EMAIL PROTECTED]
  mailto:[EMAIL PROTECTED]
   mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote:
  
   [EMAIL PROTECTED] mailto:[EMAIL PROTECTED]
  mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote:
hi,
   
i have a midi song (not polyphonic) and want to play back
  one note
after another triggered by key presses. what would be the
 best
   way to
do this? i guess i can't directly do this with pygame but
  i need
   some
midi library? does anyone know which one would be suited
  for that
(ideally it should work in linux and windows)? has anyone
  tried to
do something similar?
   Check out the Python music page:
  
   http://wiki.python.org/moin/PythonInMusic
   http://wiki.python.org/moin/PythonInMusic
  
   Of the various midi packages PyPortMidi is still available.
  
 
 





Re: [pygame] controlled midi playback

2008-01-01 Thread Lenard Lindstrom
Yeah. To make Pyrex compatible with C++ enumerations are no longer 
treated as integers, though assignment of an enumeration to an integer 
is still allowd. Not accepting an enumeration as a boolean value may be 
a bug. I would have to check. But then again it makes some sense. Just 
edit line 357 to be:



   while(Pm_Poll(self.midi) != pmNoError):


[EMAIL PROTECTED] wrote:

awesome! :) thanks a lot...
 
now i only have to get pyportmidi compiled for python 2.5. i get this 
pyrex error:

pypm.pyx:357:21: Type 'PmError' not acceptable as a boolean
 
do you have an idea what causes this?
 
On 1/1/08, *Lenard Lindstrom* [EMAIL PROTECTED] 
mailto:[EMAIL PROTECTED] wrote:


This was something I put together to see if pygame and PyPortMidi
would
get along. They do. It is very simple. You can use the keyboard or
the
mouse to play a four note pipe organ.

Lenard


[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote:
 thanks!

 and does anyone know if there are examples somewhere? like a simple
 program which allows you to play a midi instrument (best using the
 integrated synthesizer on the sound card) with the computer
keyboard?


 On 1/1/08, *Lenard Lindstrom*  [EMAIL PROTECTED]
mailto:[EMAIL PROTECTED]
 mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote:

 Try http://alumni.media.mit.edu/~harrison/code.html
http://alumni.media.mit.edu/%7Eharrison/code.html
 http://alumni.media.mit.edu/%7Eharrison/code.html

 Lenard

 [EMAIL PROTECTED] mailto:[EMAIL PROTECTED]
mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote:
  thanks!
  http://sound.media.mit.edu/~harrison/pyportmidi/
http://sound.media.mit.edu/%7Eharrison/pyportmidi/
 http://sound.media.mit.edu/%7Eharrison/pyportmidi/
   http://sound.media.mit.edu/%7Eharrison/pyportmidi/
  it sounds like it is what i need but unfortunately it doesn't
 seem to
  be available anymore...
 
  On 1/1/08, *Lenard Lindstrom* [EMAIL PROTECTED]
mailto:[EMAIL PROTECTED]
 mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED]
  mailto: [EMAIL PROTECTED] mailto:[EMAIL PROTECTED]
mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote:
 
  [EMAIL PROTECTED] mailto:[EMAIL PROTECTED]
mailto: [EMAIL PROTECTED] mailto:[EMAIL PROTECTED]
 mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED]
mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote:
   hi,
  
   i have a midi song (not polyphonic) and want to play
back
 one note
   after another triggered by key presses. what would
be the best
  way to
   do this? i guess i can't directly do this with
pygame but
 i need
  some
   midi library? does anyone know which one would be
suited
 for that
   (ideally it should work in linux and windows)? has
anyone
 tried to
   do something similar?
  Check out the Python music page:
 
  http://wiki.python.org/moin/PythonInMusic
  http://wiki.python.org/moin/PythonInMusic
http://wiki.python.org/moin/PythonInMusic
 
  Of the various midi packages PyPortMidi is still
available.
 









Re: [pygame] controlled midi playback

2008-01-01 Thread [EMAIL PROTECTED]
that fixed the pyrex problem. i have the .c file now but there is another
problem i ran into.

i tried to use code::blocks and the vctoolkit2003 to compile the extension.
i get this error message: fatal error LNK1104: cannot open file 'LIBCMTD.LIB
'

maybe you can give me another tip?

what compiler did python 2.5 for windows get compiled with? i read somewhere
that it can get messy if you don't use the same compiler for extensions.

On 1/2/08, Lenard Lindstrom [EMAIL PROTECTED] wrote:

 Yeah. To make Pyrex compatible with C++ enumerations are no longer
 treated as integers, though assignment of an enumeration to an integer
 is still allowd. Not accepting an enumeration as a boolean value may be
 a bug. I would have to check. But then again it makes some sense. Just
 edit line 357 to be:


while(Pm_Poll(self.midi) != pmNoError):


 [EMAIL PROTECTED] wrote:
  awesome! :) thanks a lot...
 
  now i only have to get pyportmidi compiled for python 2.5. i get this
  pyrex error:
  pypm.pyx:357:21: Type 'PmError' not acceptable as a boolean
 
  do you have an idea what causes this?
 
  On 1/1/08, *Lenard Lindstrom* [EMAIL PROTECTED]
  mailto:[EMAIL PROTECTED] wrote:
 
  This was something I put together to see if pygame and PyPortMidi
  would
  get along. They do. It is very simple. You can use the keyboard or
  the
  mouse to play a four note pipe organ.
 
  Lenard
 
 
  [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote:
   thanks!
  
   and does anyone know if there are examples somewhere? like a
 simple
   program which allows you to play a midi instrument (best using the
   integrated synthesizer on the sound card) with the computer
  keyboard?
  
  
   On 1/1/08, *Lenard Lindstrom*  [EMAIL PROTECTED]
  mailto:[EMAIL PROTECTED]
   mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote:
  
   Try http://alumni.media.mit.edu/~harrison/code.html
  http://alumni.media.mit.edu/%7Eharrison/code.html
   http://alumni.media.mit.edu/%7Eharrison/code.html
  
   Lenard
  
   [EMAIL PROTECTED] mailto:[EMAIL PROTECTED]
  mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote:
thanks!
http://sound.media.mit.edu/~harrison/pyportmidi/
  http://sound.media.mit.edu/%7Eharrison/pyportmidi/
   http://sound.media.mit.edu/%7Eharrison/pyportmidi/
 http://sound.media.mit.edu/%7Eharrison/pyportmidi/
it sounds like it is what i need but unfortunately it
 doesn't
   seem to
be available anymore...
   
On 1/1/08, *Lenard Lindstrom* [EMAIL PROTECTED]
  mailto:[EMAIL PROTECTED]
   mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED]
mailto: [EMAIL PROTECTED] mailto:[EMAIL PROTECTED]
  mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote:
   
[EMAIL PROTECTED] mailto:[EMAIL PROTECTED]
  mailto: [EMAIL PROTECTED] mailto:[EMAIL PROTECTED]
   mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED]
  mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED]
 wrote:
 hi,

 i have a midi song (not polyphonic) and want to play
  back
   one note
 after another triggered by key presses. what would
  be the best
way to
 do this? i guess i can't directly do this with
  pygame but
   i need
some
 midi library? does anyone know which one would be
  suited
   for that
 (ideally it should work in linux and windows)? has
  anyone
   tried to
 do something similar?
Check out the Python music page:
   
http://wiki.python.org/moin/PythonInMusic
http://wiki.python.org/moin/PythonInMusic
  http://wiki.python.org/moin/PythonInMusic
   
Of the various midi packages PyPortMidi is still
  available.
   
  
  
 
 
 




Re: [pygame] controlled midi playback

2008-01-01 Thread Lenard Lindstrom
Python 2.5 extensions are compiled on Windows with vctoolkit2003 by 
default. It is the same compiler used on Python 2.5. When I compile with 
MinGW I get these warnings:


Warning: .drectve `-defaultlib:LIBCMT ' unrecognized
Warning: .drectve `-defaultlib:OLDNAMES ' unrecognized
Warning: .drectve `-defaultlib:uuid.lib ' unrecognized
Warning: .drectve `-defaultlib:uuid.lib ' unrecognized
Warning: .drectve `-defaultlib:LIBCMT ' unrecognized
Warning: .drectve `-defaultlib:OLDNAMES ' unrecognized
Warning: .drectve `-defaultlib:LIBCMT ' unrecognized
Warning: .drectve `-defaultlib:OLDNAMES ' unrecognized
Warning: .drectve `-defaultlib:uuid.lib ' unrecognized
Warning: .drectve `-defaultlib:uuid.lib ' unrecognized
Warning: .drectve `-defaultlib:LIBCMT ' unrecognized
Warning: .drectve `-defaultlib:OLDNAMES ' unrecognized

which appear to be related to the libraries portmidi.lib and 
porttime.lib. Maybe the VC linker can ignore -defaultlib directives in a 
library. I find there is a /NODEFAULTLIB:library linker option. Maybe 
add something like the following to setup.py after libraries =  [] 
for win32:


 extra_link_args=[NODEFAULTLIB:LIBCMT, 
NODEFAULTLIB:OLDNAMES, NODEFAULTLIB:uuid.lib]


Or try running vcvars32.bat (is there one for the 2003 toolkit) before 
executing setup.py.


If you wish you may try the pypm.pyd I compiled MinGW. It links to 
msvcr71.dll, which is the big issue with Python 2.5, and works with my 
small test program.



Lenard


[EMAIL PROTECTED] wrote:
that fixed the pyrex problem. i have the .c file now but there is 
another problem i ran into.
 
i tried to use code::blocks and the vctoolkit2003 to compile the 
extension. i get this error message: fatal error LNK1104: cannot open 
file 'LIBCMTD.LIB'
 
maybe you can give me another tip?
 
what compiler did python 2.5 for windows get compiled with? i read 
somewhere that it can get messy if you don't use the same compiler for 
extensions.
 
On 1/2/08, *Lenard Lindstrom* [EMAIL PROTECTED] 
mailto:[EMAIL PROTECTED] wrote:


Yeah. To make Pyrex compatible with C++ enumerations are no longer
treated as integers, though assignment of an enumeration to an
integer
is still allowd. Not accepting an enumeration as a boolean value
may be
a bug. I would have to check. But then again it makes some sense. Just
edit line 357 to be:


   while(Pm_Poll(self.midi) != pmNoError):


[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote:
 awesome! :) thanks a lot...

 now i only have to get pyportmidi compiled for python 2.5. i get
this
 pyrex error:
 pypm.pyx:357:21: Type 'PmError' not acceptable as a boolean

 do you have an idea what causes this?

 On 1/1/08, *Lenard Lindstrom* [EMAIL PROTECTED]
mailto:[EMAIL PROTECTED]
 mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote:

 This was something I put together to see if pygame and
PyPortMidi
 would
 get along. They do. It is very simple. You can use the
keyboard or
 the
 mouse to play a four note pipe organ.

 Lenard


 [EMAIL PROTECTED] mailto:[EMAIL PROTECTED]
mailto: [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote:
  thanks!
 
  and does anyone know if there are examples somewhere? like
a simple
  program which allows you to play a midi instrument (best
using the
  integrated synthesizer on the sound card) with the computer
 keyboard?
 
 
  On 1/1/08, *Lenard Lindstrom*  [EMAIL PROTECTED]
mailto:[EMAIL PROTECTED]
 mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED]
  mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED]
mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote:
 
  Try http://alumni.media.mit.edu/~harrison/code.html
http://alumni.media.mit.edu/%7Eharrison/code.html
  http://alumni.media.mit.edu/%7Eharrison/code.html
  http://alumni.media.mit.edu/%7Eharrison/code.html
 
  Lenard
 
  [EMAIL PROTECTED] mailto:[EMAIL PROTECTED]
mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED]
 mailto: [EMAIL PROTECTED]
mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED]
mailto:[EMAIL PROTECTED] wrote:
   thanks!
   http://sound.media.mit.edu/~harrison/pyportmidi/
http://sound.media.mit.edu/%7Eharrison/pyportmidi/
 http://sound.media.mit.edu/%7Eharrison/pyportmidi/
   http://sound.media.mit.edu/%7Eharrison/pyportmidi/
http://sound.media.mit.edu/%7Eharrison/pyportmidi/
   it sounds like it is what i need but unfortunately
it doesn't
  seem to
   be available anymore...
  
   On 1/1/08, *Lenard Lindstrom* [EMAIL PROTECTED]
mailto:[EMAIL PROTECTED]
 mailto:[EMAIL PROTECTED] mailto:[EMAIL 

Re: [pygame] Collision Resolver module

2008-01-01 Thread David Gowers
This is awesome; it certainly will save me a lot of trouble, and I
agree that including it as part of PyGame would be a smart move.


Re: [pygame] controlled midi playback

2008-01-01 Thread Lenard Lindstrom
I guess it is getting late. LIBCMT.LIB is one version of the VC 6.0 C 
library, so apparently isn't present in VC 7.1. I expect uuid.lib is 
still be available. I am not so sure about OLDNAMES.LIB, but then you 
did not mention a LNK1104 for it so I assume it is also available. So 
try replacing line 34 in setup.py with the following two lines:


 libraries = [portmidi, winmm, porttime],
 extra_link_args = [NODEFAULTLIB:LIBCMT])

If it the linker complains about an invalid argument try adding a 
forward slash / before NODEFAULTLIB.


Lenard


Lenard Lindstrom wrote:
Python 2.5 extensions are compiled on Windows with vctoolkit2003 by 
default. It is the same compiler used on Python 2.5. When I compile 
with MinGW I get these warnings:


Warning: .drectve `-defaultlib:LIBCMT ' unrecognized
Warning: .drectve `-defaultlib:OLDNAMES ' unrecognized
Warning: .drectve `-defaultlib:uuid.lib ' unrecognized
Warning: .drectve `-defaultlib:uuid.lib ' unrecognized
Warning: .drectve `-defaultlib:LIBCMT ' unrecognized
Warning: .drectve `-defaultlib:OLDNAMES ' unrecognized
Warning: .drectve `-defaultlib:LIBCMT ' unrecognized
Warning: .drectve `-defaultlib:OLDNAMES ' unrecognized
Warning: .drectve `-defaultlib:uuid.lib ' unrecognized
Warning: .drectve `-defaultlib:uuid.lib ' unrecognized
Warning: .drectve `-defaultlib:LIBCMT ' unrecognized
Warning: .drectve `-defaultlib:OLDNAMES ' unrecognized

which appear to be related to the libraries portmidi.lib and 
porttime.lib. Maybe the VC linker can ignore -defaultlib directives in 
a library. I find there is a /NODEFAULTLIB:library linker option. 
Maybe add something like the following to setup.py after libraries =  
[] for win32:


 extra_link_args=[NODEFAULTLIB:LIBCMT, 
NODEFAULTLIB:OLDNAMES, NODEFAULTLIB:uuid.lib]


Or try running vcvars32.bat (is there one for the 2003 toolkit) before 
executing setup.py.


If you wish you may try the pypm.pyd I compiled MinGW. It links to 
msvcr71.dll, which is the big issue with Python 2.5, and works with my 
small test program.



Lenard


[EMAIL PROTECTED] wrote:
that fixed the pyrex problem. i have the .c file now but there is 
another problem i ran into.
 
i tried to use code::blocks and the vctoolkit2003 to compile the 
extension. i get this error message: fatal error LNK1104: cannot open 
file 'LIBCMTD.LIB'
 
maybe you can give me another tip?
 
what compiler did python 2.5 for windows get compiled with? i read 
somewhere that it can get messy if you don't use the same compiler 
for extensions.