Re: [pygame] font.get_fonts and OS X

2009-05-20 Thread René Dudfield
hi,

the tests pass on 10.5.7... which just uses the unix function... (which uses
fc-list).

I think it should be easier to figure out what to do for when fc-list isn't
there (pre 10.5.x machines)...  by looking at the out put that the fc-list
using function uses.

cu,



On Wed, May 20, 2009 at 3:33 PM, Lenard Lindstrom le...@telus.net wrote:

 I committed what I have so far. If OS X has an fc-list equivalent take a
 look at the updates I made to the Unix section of sysfont.py for Python 3
 and unicode. Some of it may be relevant.

 Lenard



 René Dudfield wrote:

 hello,

 ah, nice catch!   That's annoying... all this time and it hasn't been
 working on OSX.

 Can you commit your tests?

 I can have a go at it... unless Brian you want to have a go?


 Here are the main font paths... the X11 one isn't there on most
 installs for 10.4.x ... but should be there on most 10.5.x installs.
 The last path is where OS9 used to install fonts, and some people
 still use that directory apparently.

 ~/Library/Fonts/
 /Library/Fonts/
 /System/Library/Fonts/
 /usr/X11/lib/X11/fonts/TTF/
 /Network/Library/Fonts/
 /System Folder/Fonts/


 cheers,




 On Wed, May 20, 2009 at 7:55 AM, Lenard Lindstrom le...@telus.net
 wrote:


 Currently I am filling in the font unit tests. For OS X I noticed that
 sysfont.py does not hunt down installed fonts. The relevant function is a
 stub. I have no OS X access, so can't write it myself. Is someone else
 willing to take care of it. Otherwise when I commit the completed unit
 tests
 they will fail for OS X.

 Lenard








Re: [SPAM: 3.500] Re: [pygame] This one baffles me

2009-05-20 Thread Chris McCormick
 On Wed, May 20, 2009 at 9:13 AM, Yanom Mobis ya...@rocketmail.com wrote:
  i guess i'll use spaces for my next program. But why exactly are spaces
  better? the article just said that was the standard
 
On Wed, May 20, 2009 at 09:20:16AM +1000, René Dudfield wrote:
 At this point, it's because most python code, and python programmers
 are using spaces, instead of tabs.

However, be aware that it is a matter of taste/religion, and it's an age old
internet argument, and so you're always going to get different people saying
that one style is better than the other.

For me, spaces are like mp3 files whilst tabs are like mod files. I like mod
files better than mp3 files, but the problem is that sometimes mod files sound
different when you play them on different platforms.

Best,

Chris.

---
http://mccormick.cx


Re: [SPAM: 3.500] Re: [pygame] This one baffles me

2009-05-20 Thread don

Both, tabs and spaces, work. mixing them doesn't. So you must make sure you 
only use one. which one you choose is more or less a matter of taste as Chris 
wrote.

However, since mixing spaces and tabs is a bad idea it would be good if all 
(python) programmers could agree on one or the other. I believe that's why 
there is the python style guide I linked to earlier. It sets a 
precedent/convention.
 
You can of course say you don't care and follow your own style but it will make 
it harder and more annoying for others.

Therefore I would urge you to use spaces in python programs.

yours,
//Lorenz



On Wed, 20 May 2009 11:38:18 +0100, Chris McCormick ch...@mccormick.cx wrote:
 On Wed, May 20, 2009 at 9:13 AM, Yanom Mobis ya...@rocketmail.com
 wrote:
  i guess i'll use spaces for my next program. But why exactly are
 spaces
  better? the article just said that was the standard
 
 On Wed, May 20, 2009 at 09:20:16AM +1000, René Dudfield wrote:
 At this point, it's because most python code, and python programmers
 are using spaces, instead of tabs.
 
 However, be aware that it is a matter of taste/religion, and it's an age
 old
 internet argument, and so you're always going to get different people
 saying
 that one style is better than the other.
 
 For me, spaces are like mp3 files whilst tabs are like mod files. I like
 mod
 files better than mp3 files, but the problem is that sometimes mod files
 sound
 different when you play them on different platforms.
 
 Best,
 
 Chris.
 



[pygame] Adding new dependencies for pygame

2009-05-20 Thread Tyler Laing
Okay, so I have some code that looks like it will work, so now is when I
need to start testing it. But to get it to compile and install with pygame,
I've been trying to figure out how to add the necessary stuff to config.py
and config_unix.py.

Does anyone have some information on how to do this?

For reference, right now I'm including these:
#include ffmpeg/avstring.h
#include ffmpeg/rtsp.h
#include ffmpeg/swscale.h
#include ffmpeg/opt.h
#include libavdevice/avdevice.h

#include SDL.h
#include SDL_thread.h
#include ffmpeg/avformat.h

in my code.

I've already tried to find the relevant info, but no luck there. Thanks for
any and all help!

-Tyler

-- 
Visit my blog at http://oddco.ca/zeroth/zblog


[pygame] Spaces And Tabs Pointlessly Time-Wasting Religious Schism

2009-05-20 Thread Bill Coderre


On May 20, 2009, at 4:24 AM, d...@amberfisharts.com wrote:
Both, tabs and spaces, work. mixing them doesn't. So you must make  
sure you only use one. which one you choose is more or less a matter  
of taste as Chris wrote.


However, since mixing spaces and tabs is a bad idea it would be good  
if all (python) programmers could agree on one or the other. I  
believe that's why there is the python style guide I linked to  
earlier. It sets a precedent/convention.


You can of course say you don't care and follow your own style but  
it will make it harder and more annoying for others.


Therefore I would urge you to use spaces in python programs.


With no disrespect to either my exceedingly learned colleagues from  
Lilliput who use spaces, or my sublimely enlightened colleagues from  
Blefuscu who use tabs[1], this is Yet Another Pointlessly Time-Wasting  
Religious Schism.[2]


The only problem is that our computers, which can be so lightning-fast  
at replacing characters, cannot seem, even at this late date in their  
evolution, to figure out when two lines are similarly indented and  
therefore execute our code without complaint. Their text-editing  
programs are only confounding the matter.


My meager solution has been to turn on an option that displays a faint  
glyph representing each tab. Therefore, when I open a file, I somewhat  
subliminally see which lines have an indenting problem, and I fix them.


Perhaps a better solution would be to agree on a spaces-tabs exchange  
rates, but this, also has its zealots. Some people use a tab to mean  
eight spaces, some four, and some two.


Is there some unix magic cookie format to explicate this exchange  
rate? If so, then the battle is mostly won, and we merely have to  
convince the myriad text editors to publish, honor, and obey the  
cookies, silently sorting out the indentations and replacing whichever  
with whatever.


If not, we just have to add the cookie format to Python's spec.

[1]  cf. http://en.wikipedia.org/wiki/Endianness#Etymology
[2] See also Endianness, above, Emacs versus vi, brackets on new  
lines, etc.


Re: [pygame] Adding new dependencies for pygame

2009-05-20 Thread Lenard Lindstrom
Nothing needs to be done to config.py. But for config_unix.py a new 
Dependency needs to be added to the DEPS list in main(). Also an FFMPEG 
= line should be added to Setup.in, giving some Unix defaults, and add 
a new build line in the optional modules section for the new movie 
module. As for providing paths, if ffmpeg was installed as a package 
then the compiler should find it.


Lenard

Tyler Laing wrote:
Okay, so I have some code that looks like it will work, so now is when 
I need to start testing it. But to get it to compile and install with 
pygame, I've been trying to figure out how to add the necessary stuff 
to config.py and config_unix.py.


Does anyone have some information on how to do this?

For reference, right now I'm including these:
#include ffmpeg/avstring.h
#include ffmpeg/rtsp.h
#include ffmpeg/swscale.h
#include ffmpeg/opt.h
#include libavdevice/avdevice.h

#include SDL.h
#include SDL_thread.h
#include ffmpeg/avformat.h

in my code.

I've already tried to find the relevant info, but no luck there. 
Thanks for any and all help!


-Tyler

--
Visit my blog at http://oddco.ca/zeroth/zblog




Re: [pygame] Spaces And Tabs Pointlessly Time-Wasting Religious Schism

2009-05-20 Thread James Paige
And Lo, the LORD looked upon the grave sins of the evil tabbites, and 
through the prophet James, he called upon the the wise and peaceful 
fourspacians to take up plowshares and text editors and to hammer them 
into swords, and to fall upon the wicked tabbites and rend them asunder 
with vicious bloody smiting. And when the deed had been done, the LORD 
looked down and spake so it shall be for now and for always, the 
fourspacians shall import and subclass over all the earth. But a 
certain fourspacian indented his code with only two spaces, and was 
well-pleased with himself, saying what I have done is good, and will 
please the LORD, and so the twospacians were born, and they strove 
against the fourspacians, and chaos continued in the lands of pythonia.

On Wed, May 20, 2009 at 08:58:10AM -0700, Bill Coderre wrote:
 
 With no disrespect to either my exceedingly learned colleagues from  
 Lilliput who use spaces, or my sublimely enlightened colleagues from  
 Blefuscu who use tabs[1], this is Yet Another Pointlessly Time-Wasting  
 Religious Schism.[2]
 
 The only problem is that our computers, which can be so lightning-fast  
 at replacing characters, cannot seem, even at this late date in their  
 evolution, to figure out when two lines are similarly indented and  
 therefore execute our code without complaint. Their text-editing  
 programs are only confounding the matter.
 
 My meager solution has been to turn on an option that displays a faint  
 glyph representing each tab. Therefore, when I open a file, I somewhat  
 subliminally see which lines have an indenting problem, and I fix them.
 
 Perhaps a better solution would be to agree on a spaces-tabs exchange  
 rates, but this, also has its zealots. Some people use a tab to mean  
 eight spaces, some four, and some two.
 
 Is there some unix magic cookie format to explicate this exchange  
 rate? If so, then the battle is mostly won, and we merely have to  
 convince the myriad text editors to publish, honor, and obey the  
 cookies, silently sorting out the indentations and replacing whichever  
 with whatever.
 
 If not, we just have to add the cookie format to Python's spec.
 
 [1]  cf. http://en.wikipedia.org/wiki/Endianness#Etymology
 [2] See also Endianness, above, Emacs versus vi, brackets on new  
 lines, etc.
 
 


[pygame] Surface.get_buffer() pygame2exe

2009-05-20 Thread meticulos.slac...@gmail.com
I compiled this code use pygame2exe script, and output *.exe file
crashed at started. Script without compile work normally.
How to fix it?

import pygame
pygame.init()
s = pygame.Surface((10, 10), 0, 24)
print s.get_buffer()

Version:
Python 2.6.2
pygame1.8.1release

PS. Surface.get_buffer() need for
http://www.pygame.org/wiki/ShadowEffects?parent=CookBook. Maybe exists
other module for make shadow which don't use this method?


[pygame] PyGameSF meetup Thursday May 21st 6pm @ Main San Francisco Public Library

2009-05-20 Thread Harry Tormey
Hi All,
The May PyGameSF meet up will be at the STONG conference room on the
first floor of the main San Francisco public library beside civic
center BART. The library closes at 8pm so we will reconvene to frjtz
on hayes street for dinner/drinks afterwards. This months presentations 
are:

 -Jared Sohn: All About My Flocking Project. This talk will give an
overview of flocking and demonstrate a C++/Maya flocking implementation
used to animate rats for a college computer animation project.

-Brad Busse, Colin Bean, Harry Tormey : CampDivisible, an overview
of the PyGameSF teams pyweek 8 entry. This presentation will cover the
concept, design and implementation of our entry, which was written with
pyglet. This is also an open invitation to any teams who participated
in pyweek from around the bay to come on down talk about your game and
celebrate the end of another fun pyweek.

PyGameSF is an informal group meet up in San Francisco for Software
engineers interested in python, OpenGL, audio, pygame, SDL,
programming and generally anything to do with multimedia development.
The format of our meetings typically involve several people giving
presentations on projects they are developing followed by group
discussion and feedback.

If anyone else would like to give a micro presentation, show demos or
just talk about what they are doing or generally give examples of any
relevant software they are working on please feel free to head along.

To subscribe to the pygamesf mailing list simply email
pygame-sf+subscribe at unworkable.org

-- 
Harry Tormey
Co Founder P2P Research
http://p2presearch.com
Founder PyGameSF
http://pygamesf.org
Software Engineer Digidesign
http://digidesign.com


Re: [pygame] Adding new dependencies for pygame

2009-05-20 Thread Tyler Laing
Thanks Lenard. But what do I put specifically for the dependencies? Do I do
a different dependency object for each of the header files I need?

-Tyler

On Wed, May 20, 2009 at 12:02 PM, Lenard Lindstrom le...@telus.net wrote:

 Nothing needs to be done to config.py. But for config_unix.py a new
 Dependency needs to be added to the DEPS list in main(). Also an FFMPEG =
 line should be added to Setup.in, giving some Unix defaults, and add a new
 build line in the optional modules section for the new movie module. As for
 providing paths, if ffmpeg was installed as a package then the compiler
 should find it.

 Lenard


 Tyler Laing wrote:

 Okay, so I have some code that looks like it will work, so now is when I
 need to start testing it. But to get it to compile and install with pygame,
 I've been trying to figure out how to add the necessary stuff to config.py
 and config_unix.py.

 Does anyone have some information on how to do this?

 For reference, right now I'm including these:
 #include ffmpeg/avstring.h
 #include ffmpeg/rtsp.h
 #include ffmpeg/swscale.h
 #include ffmpeg/opt.h
 #include libavdevice/avdevice.h

 #include SDL.h
 #include SDL_thread.h
 #include ffmpeg/avformat.h

 in my code.

 I've already tried to find the relevant info, but no luck there. Thanks
 for any and all help!

 -Tyler

 --
 Visit my blog at http://oddco.ca/zeroth/zblog





-- 
Visit my blog at http://oddco.ca/zeroth/zblog


Re: [pygame] Adding new dependencies for pygame

2009-05-20 Thread Lenard Lindstrom
Your shouldn't need anything special for the includes if the headers are 
in /usr/include or /usr/local/include. The dependency is primarily for 
passing extra libraries to the linker: -lavcodec -lavdevice -lavformat 
-lavutil -lswscale. For config_unix.py try adding:


Dependency('FFMPEG', 'avformat.h', 'libavformat', ['avcodec', 
'avdevice', 'avformat', 'avutil', 'swscale']),


though you may have to shuffle the library order to get it to link. The 
'avformat.h' and 'libavformat' are merely files the config_unit.py 
searches for to determine if ffmpeg is available.


In Setup.in add:

FFMPEG = -lavcodec -lavdevice -lavformat -lavutil -lswscale

after the PORTTIME = entry. Again put the libraries in the order 
required to link. But for the most part this line will be ignored and 
replaced by config_unix.py.


After the gfxdraw entry add

moviemodname src/movemodname.c $(SDL) $(FFMPEG) $(DEBUG)

It should be commented as experimental for now. Hopefully by the end of 
summer any such qualifiers can be removed.


Lenard


Tyler Laing wrote:
Thanks Lenard. But what do I put specifically for the dependencies? Do 
I do a different dependency object for each of the header files I need?


-Tyler

On Wed, May 20, 2009 at 12:02 PM, Lenard Lindstrom le...@telus.net 
mailto:le...@telus.net wrote:


Nothing needs to be done to config.py. But for config_unix.py a
new Dependency needs to be added to the DEPS list in main(). Also
an FFMPEG = line should be added to Setup.in, giving some Unix
defaults, and add a new build line in the optional modules section
for the new movie module. As for providing paths, if ffmpeg was
installed as a package then the compiler should find it.

Lenard


Tyler Laing wrote:

Okay, so I have some code that looks like it will work, so now
is when I need to start testing it. But to get it to compile
and install with pygame, I've been trying to figure out how to
add the necessary stuff to config.py and config_unix.py.

Does anyone have some information on how to do this?

For reference, right now I'm including these:
#include ffmpeg/avstring.h
#include ffmpeg/rtsp.h
#include ffmpeg/swscale.h
#include ffmpeg/opt.h
#include libavdevice/avdevice.h

#include SDL.h
#include SDL_thread.h
#include ffmpeg/avformat.h

in my code.

I've already tried to find the relevant info, but no luck
there. Thanks for any and all help!

-Tyler

-- 
Visit my blog at http://oddco.ca/zeroth/zblog






--
Visit my blog at http://oddco.ca/zeroth/zblog



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



Re: [pygame] Surface.get_buffer() pygame2exe

2009-05-20 Thread Lenard Lindstrom
It's not including the bufferproxy module. Try adding import 
pygame.bufferproxy after import pygame. Hopefully this is fixed in 
Pygame 1.9.


Lenard

meticulos.slac...@gmail.com wrote:

I compiled this code use pygame2exe script, and output *.exe file
crashed at started. Script without compile work normally.
How to fix it?

import pygame
pygame.init()
s = pygame.Surface((10, 10), 0, 24)
print s.get_buffer()

Version:
Python 2.6.2
pygame1.8.1release

PS. Surface.get_buffer() need for
http://www.pygame.org/wiki/ShadowEffects?parent=CookBook. Maybe exists
other module for make shadow which don't use this method?
  



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



Re: [pygame] font.get_fonts and OS X

2009-05-20 Thread Lenard Lindstrom

Hi,

I see there are problems with Windows XP. Apparently the default fonts 
aren't showing up in the usual registry place:


HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts

I guess that is just for additional fonts, which Brian's build machine 
apparently does not have. Would there be any other places in the 
registry to search? Or must one start with a list of default Windows 
fonts then check for each in the \windows\fonts directory?


Lenard


René Dudfield wrote:

hi,

the tests pass on 10.5.7... which just uses the unix function... 
(which uses fc-list).


I think it should be easier to figure out what to do for when fc-list 
isn't there (pre 10.5.x machines)...  by looking at the out put that 
the fc-list using function uses.


cu,



On Wed, May 20, 2009 at 3:33 PM, Lenard Lindstrom le...@telus.net 
mailto:le...@telus.net wrote:


I committed what I have so far. If OS X has an fc-list equivalent
take a look at the updates I made to the Unix section of
sysfont.py for Python 3 and unicode. Some of it may be relevant.

Lenard



René Dudfield wrote:

hello,

ah, nice catch!   That's annoying... all this time and it
hasn't been
working on OSX.

Can you commit your tests?

I can have a go at it... unless Brian you want to have a go?


Here are the main font paths... the X11 one isn't there on most
installs for 10.4.x ... but should be there on most 10.5.x
installs.
The last path is where OS9 used to install fonts, and some people
still use that directory apparently.

~/Library/Fonts/
/Library/Fonts/
/System/Library/Fonts/
/usr/X11/lib/X11/fonts/TTF/
/Network/Library/Fonts/
/System Folder/Fonts/


cheers,




On Wed, May 20, 2009 at 7:55 AM, Lenard Lindstrom
le...@telus.net mailto:le...@telus.net wrote:
 


Currently I am filling in the font unit tests. For OS X I
noticed that
sysfont.py does not hunt down installed fonts. The
relevant function is a
stub. I have no OS X access, so can't write it myself. Is
someone else
willing to take care of it. Otherwise when I commit the
completed unit tests
they will fail for OS X.

Lenard


   







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



Re: [pygame] Spaces And Tabs Pointlessly Time-Wasting Religious Schism

2009-05-20 Thread René Dudfield
surely 8 half spaces is better than 4 spaces.

cu,




On Thu, May 21, 2009 at 2:26 AM, Michael George mdgeo...@cs.cornell.eduwrote:

 Bill Coderre wrote:

 Is there some unix magic cookie format to explicate this exchange rate? If
 so, then the battle is mostly won, and we merely have to convince the
 myriad text editors to publish, honor, and obey the cookies, silently
 sorting out the indentations and replacing whichever with whatever.

 Sure!  We should just use vim modelines: vim: ts=4 sw=4 et

 That will surely avoid any pointless time-wasting religious fervor.


 --Mike



Re: [pygame] Spaces And Tabs Pointlessly Time-Wasting Religious Schism

2009-05-20 Thread Yanom Mobis
my two cents: tab = 4 spaces

also a --converttabs numberOfSpaces option on the python interpreter would be 
neat, automaticly converting all tabs in the module being opened to 
numberOfSpaces spaces. So

python --converttabs 4

would convert all spaces to 4 tabs.

--- On Wed, 5/20/09, Bill Coderre b...@mac.com wrote:

From: Bill Coderre b...@mac.com
Subject: [pygame] Spaces And Tabs Pointlessly Time-Wasting Religious Schism
To: pygame-users@seul.org
Date: Wednesday, May 20, 2009, 10:58 AM


On May 20, 2009, at 4:24 AM, d...@amberfisharts.com wrote:
 Both, tabs and spaces, work. mixing them doesn't. So you must make sure you 
 only use one. which one you choose is more or less a matter of taste as Chris 
 wrote.
 
 However, since mixing spaces and tabs is a bad idea it would be good if all 
 (python) programmers could agree on one or the other. I believe that's why 
 there is the python style guide I linked to earlier. It sets a 
 precedent/convention.
 
 You can of course say you don't care and follow your own style but it will 
 make it harder and more annoying for others.
 
 Therefore I would urge you to use spaces in python programs.

With no disrespect to either my exceedingly learned colleagues from Lilliput 
who use spaces, or my sublimely enlightened colleagues from Blefuscu who use 
tabs[1], this is Yet Another Pointlessly Time-Wasting Religious Schism.[2]

The only problem is that our computers, which can be so lightning-fast at 
replacing characters, cannot seem, even at this late date in their evolution, 
to figure out when two lines are similarly indented and therefore execute our 
code without complaint. Their text-editing programs are only confounding the 
matter.

My meager solution has been to turn on an option that displays a faint glyph 
representing each tab. Therefore, when I open a file, I somewhat subliminally 
see which lines have an indenting problem, and I fix them.

Perhaps a better solution would be to agree on a spaces-tabs exchange rates, 
but this, also has its zealots. Some people use a tab to mean eight spaces, 
some four, and some two.

Is there some unix magic cookie format to explicate this exchange rate? If so, 
then the battle is mostly won, and we merely have to convince the myriad text 
editors to publish, honor, and obey the cookies, silently sorting out the 
indentations and replacing whichever with whatever.

If not, we just have to add the cookie format to Python's spec.

[1]  cf. http://en.wikipedia.org/wiki/Endianness#Etymology
[2] See also Endianness, above, Emacs versus vi, brackets on new lines, etc.



  

Re: [pygame] Adding new dependencies for pygame

2009-05-20 Thread Tyler Laing
Thanks Lenard, that worked. Now, just fixing bugs that are stopping
compilation.

One problem I ran into and solved was that I was using the wrong version of
the header files. However, in solving that, it seems to be trying to include
both the versions, which end up conflicting and generating a huge list of
conflict reports. Is there anyway to tell setup not to use the header files
in /usr/include, and instead use the headers in /usr/local/include in the
dependency?

-Tyler

On Wed, May 20, 2009 at 1:28 PM, Lenard Lindstrom le...@telus.net wrote:

 Your shouldn't need anything special for the includes if the headers are in
 /usr/include or /usr/local/include. The dependency is primarily for passing
 extra libraries to the linker: -lavcodec -lavdevice -lavformat -lavutil
 -lswscale. For config_unix.py try adding:

 Dependency('FFMPEG', 'avformat.h', 'libavformat', ['avcodec', 'avdevice',
 'avformat', 'avutil', 'swscale']),

 though you may have to shuffle the library order to get it to link. The
 'avformat.h' and 'libavformat' are merely files the config_unit.py searches
 for to determine if ffmpeg is available.

 In Setup.in add:

 FFMPEG = -lavcodec -lavdevice -lavformat -lavutil -lswscale

 after the PORTTIME = entry. Again put the libraries in the order required
 to link. But for the most part this line will be ignored and replaced by
 config_unix.py.

 After the gfxdraw entry add

 moviemodname src/movemodname.c $(SDL) $(FFMPEG) $(DEBUG)

 It should be commented as experimental for now. Hopefully by the end of
 summer any such qualifiers can be removed.

 Lenard


 Tyler Laing wrote:

 Thanks Lenard. But what do I put specifically for the dependencies? Do I
 do a different dependency object for each of the header files I need?

 -Tyler

 On Wed, May 20, 2009 at 12:02 PM, Lenard Lindstrom le...@telus.netmailto:
 le...@telus.net wrote:

Nothing needs to be done to config.py. But for config_unix.py a
new Dependency needs to be added to the DEPS list in main(). Also
an FFMPEG = line should be added to Setup.in, giving some Unix
defaults, and add a new build line in the optional modules section
for the new movie module. As for providing paths, if ffmpeg was
installed as a package then the compiler should find it.

Lenard


Tyler Laing wrote:

Okay, so I have some code that looks like it will work, so now
is when I need to start testing it. But to get it to compile
and install with pygame, I've been trying to figure out how to
add the necessary stuff to config.py and config_unix.py.

Does anyone have some information on how to do this?

For reference, right now I'm including these:
#include ffmpeg/avstring.h
#include ffmpeg/rtsp.h
#include ffmpeg/swscale.h
#include ffmpeg/opt.h
#include libavdevice/avdevice.h

#include SDL.h
#include SDL_thread.h
#include ffmpeg/avformat.h

in my code.

I've already tried to find the relevant info, but no luck
there. Thanks for any and all help!

-Tyler

--Visit my blog at http://oddco.ca/zeroth/zblog





 --
 Visit my blog at http://oddco.ca/zeroth/zblog



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




-- 
Visit my blog at http://oddco.ca/zeroth/zblog


Re: [pygame] Spaces And Tabs Pointlessly Time-Wasting Religious Schism

2009-05-20 Thread Greg Ewing

Bill Coderre wrote:

Perhaps a better solution would be to agree on a spaces-tabs exchange  
rates


That would negate the main benefit of using tabs (only),
which is precisely that they *don't* represent any fixed
amount of indentation. You can set your editor to display
them using whatever spacing you prefer.

Unfortunately, the totally haphazard way that the various
tools out there handle tabs makes it impractical to use
them this way outside of a controlled environment.

Given that, the convention of four-space indents makes
sense as an *interchange* format. Use whatever works best
for you internally, but convert to four-space indents
when sharing code with others.

Cookies wouldn't really help unless all the tools out
there (not just text editors, but print formatters,
mail and news handlers, etc.) understood them. And if we
had the power to make them do that, we could make them
handle tabs in a consistent way in the first place, and
we wouldn't have a problem.

--
Greg


Re: [pygame] Adding new dependencies for pygame

2009-05-20 Thread René Dudfield
hi,

that likely depends on your include paths.  Generally /usr/local/include/
comes first.

You might need to put in your own head guards if ffmpeg isn't putting them
in themselves.

Like so:

#ifndef MY_BLA
#define MY_BLA
#include bla.h
#endif

Hopefully then things only get included once.

What is the gcc line of something that fails?


cu,




On Thu, May 21, 2009 at 10:07 AM, Tyler Laing trinio...@gmail.com wrote:

 Thanks Lenard, that worked. Now, just fixing bugs that are stopping
 compilation.

 One problem I ran into and solved was that I was using the wrong version of
 the header files. However, in solving that, it seems to be trying to include
 both the versions, which end up conflicting and generating a huge list of
 conflict reports. Is there anyway to tell setup not to use the header files
 in /usr/include, and instead use the headers in /usr/local/include in the
 dependency?

 -Tyler


 On Wed, May 20, 2009 at 1:28 PM, Lenard Lindstrom le...@telus.net wrote:

 Your shouldn't need anything special for the includes if the headers are
 in /usr/include or /usr/local/include. The dependency is primarily for
 passing extra libraries to the linker: -lavcodec -lavdevice -lavformat
 -lavutil -lswscale. For config_unix.py try adding:

 Dependency('FFMPEG', 'avformat.h', 'libavformat', ['avcodec', 'avdevice',
 'avformat', 'avutil', 'swscale']),

 though you may have to shuffle the library order to get it to link. The
 'avformat.h' and 'libavformat' are merely files the config_unit.py searches
 for to determine if ffmpeg is available.

 In Setup.in add:

 FFMPEG = -lavcodec -lavdevice -lavformat -lavutil -lswscale

 after the PORTTIME = entry. Again put the libraries in the order
 required to link. But for the most part this line will be ignored and
 replaced by config_unix.py.

 After the gfxdraw entry add

 moviemodname src/movemodname.c $(SDL) $(FFMPEG) $(DEBUG)

 It should be commented as experimental for now. Hopefully by the end of
 summer any such qualifiers can be removed.

 Lenard


 Tyler Laing wrote:

 Thanks Lenard. But what do I put specifically for the dependencies? Do I
 do a different dependency object for each of the header files I need?

 -Tyler

 On Wed, May 20, 2009 at 12:02 PM, Lenard Lindstrom le...@telus.netmailto:
 le...@telus.net wrote:

Nothing needs to be done to config.py. But for config_unix.py a
new Dependency needs to be added to the DEPS list in main(). Also
an FFMPEG = line should be added to Setup.in, giving some Unix
defaults, and add a new build line in the optional modules section
for the new movie module. As for providing paths, if ffmpeg was
installed as a package then the compiler should find it.

Lenard


Tyler Laing wrote:

Okay, so I have some code that looks like it will work, so now
is when I need to start testing it. But to get it to compile
and install with pygame, I've been trying to figure out how to
add the necessary stuff to config.py and config_unix.py.

Does anyone have some information on how to do this?

For reference, right now I'm including these:
#include ffmpeg/avstring.h
#include ffmpeg/rtsp.h
#include ffmpeg/swscale.h
#include ffmpeg/opt.h
#include libavdevice/avdevice.h

#include SDL.h
#include SDL_thread.h
#include ffmpeg/avformat.h

in my code.

I've already tried to find the relevant info, but no luck
there. Thanks for any and all help!

-Tyler

--Visit my blog at http://oddco.ca/zeroth/zblog





 --
 Visit my blog at http://oddco.ca/zeroth/zblog



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




 --
 Visit my blog at http://oddco.ca/zeroth/zblog



Re: [pygame] Adding new dependencies for pygame

2009-05-20 Thread Tyler Laing
What do you mean by gcc line of something that fails?

Something like this:

In file included from /usr/local/include/libavutil/avutil.h:56,
 from /usr/local/include/libavcodec/avcodec.h:30,
 from /usr/local/include/libavformat/avformat.h:45,
 from src/ff_movie.h:5,
 from src/ff_movie.c:18:
/usr/local/include/libavutil/common.h:134: error: redefinition of ‘av_log2’
/usr/include/ffmpeg/common.h:98: error: previous definition of ‘av_log2’ was
here


Thats the first error that comes up.

-Tyler

On Wed, May 20, 2009 at 5:18 PM, René Dudfield ren...@gmail.com wrote:

 hi,

 that likely depends on your include paths.  Generally /usr/local/include/
 comes first.

 You might need to put in your own head guards if ffmpeg isn't putting them
 in themselves.

 Like so:

 #ifndef MY_BLA
 #define MY_BLA
 #include bla.h
 #endif

 Hopefully then things only get included once.

 What is the gcc line of something that fails?


 cu,





 On Thu, May 21, 2009 at 10:07 AM, Tyler Laing trinio...@gmail.com wrote:

 Thanks Lenard, that worked. Now, just fixing bugs that are stopping
 compilation.

 One problem I ran into and solved was that I was using the wrong version
 of the header files. However, in solving that, it seems to be trying to
 include both the versions, which end up conflicting and generating a huge
 list of conflict reports. Is there anyway to tell setup not to use the
 header files in /usr/include, and instead use the headers in
 /usr/local/include in the dependency?

 -Tyler


 On Wed, May 20, 2009 at 1:28 PM, Lenard Lindstrom le...@telus.netwrote:

 Your shouldn't need anything special for the includes if the headers are
 in /usr/include or /usr/local/include. The dependency is primarily for
 passing extra libraries to the linker: -lavcodec -lavdevice -lavformat
 -lavutil -lswscale. For config_unix.py try adding:

 Dependency('FFMPEG', 'avformat.h', 'libavformat', ['avcodec', 'avdevice',
 'avformat', 'avutil', 'swscale']),

 though you may have to shuffle the library order to get it to link. The
 'avformat.h' and 'libavformat' are merely files the config_unit.py searches
 for to determine if ffmpeg is available.

 In Setup.in add:

 FFMPEG = -lavcodec -lavdevice -lavformat -lavutil -lswscale

 after the PORTTIME = entry. Again put the libraries in the order
 required to link. But for the most part this line will be ignored and
 replaced by config_unix.py.

 After the gfxdraw entry add

 moviemodname src/movemodname.c $(SDL) $(FFMPEG) $(DEBUG)

 It should be commented as experimental for now. Hopefully by the end of
 summer any such qualifiers can be removed.

 Lenard


 Tyler Laing wrote:

 Thanks Lenard. But what do I put specifically for the dependencies? Do I
 do a different dependency object for each of the header files I need?

 -Tyler

 On Wed, May 20, 2009 at 12:02 PM, Lenard Lindstrom le...@telus.netmailto:
 le...@telus.net wrote:

Nothing needs to be done to config.py. But for config_unix.py a
new Dependency needs to be added to the DEPS list in main(). Also
an FFMPEG = line should be added to Setup.in, giving some Unix
defaults, and add a new build line in the optional modules section
for the new movie module. As for providing paths, if ffmpeg was
installed as a package then the compiler should find it.

Lenard


Tyler Laing wrote:

Okay, so I have some code that looks like it will work, so now
is when I need to start testing it. But to get it to compile
and install with pygame, I've been trying to figure out how to
add the necessary stuff to config.py and config_unix.py.

Does anyone have some information on how to do this?

For reference, right now I'm including these:
#include ffmpeg/avstring.h
#include ffmpeg/rtsp.h
#include ffmpeg/swscale.h
#include ffmpeg/opt.h
#include libavdevice/avdevice.h

#include SDL.h
#include SDL_thread.h
#include ffmpeg/avformat.h

in my code.

I've already tried to find the relevant info, but no luck
there. Thanks for any and all help!

-Tyler

--Visit my blog at http://oddco.ca/zeroth/zblog





 --
 Visit my blog at http://oddco.ca/zeroth/zblog



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




 --
 Visit my blog at http://oddco.ca/zeroth/zblog





-- 
Visit my blog at http://oddco.ca/zeroth/zblog


[pygame] Sluggish movement

2009-05-20 Thread Yanom Mobis
so i wrote this program, but the bullets coming out of the player's ship move 
at an irregular speed, first fast, then slow, then fast again... but they're 
supposed to move at a regular 12 pixels per frame. What am i doing wrong?



  

Re: [pygame] Adding new dependencies for pygame

2009-05-20 Thread René Dudfield
hi,

try including all your .h files in that one .h file.

Not all versions of ffmpeg guard against multiple inclusion... and you're
including some files multiple times.
So either make sure you're only including once, or put your own guards
around them (as detailed above).

that should fix it... I hope.


cu.




On Thu, May 21, 2009 at 10:43 AM, Tyler Laing trinio...@gmail.com wrote:

 Sorry, just figured it out:

 gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall
 -Wstrict-prototypes -fPIC -D_REENTRANT -I/usr/X11R6/include
 -I/usr/include/SDL -I/usr/local/include -I/usr/include/python2.5 -c
 src/ff_movie.c -o build/temp.linux-x86_64-2.5/src/ff_movie.o



 On Wed, May 20, 2009 at 5:35 PM, Tyler Laing trinio...@gmail.com wrote:

 What do you mean by gcc line of something that fails?

 Something like this:

 In file included from /usr/local/include/libavutil/avutil.h:56,
  from /usr/local/include/libavcodec/avcodec.h:30,
  from /usr/local/include/libavformat/avformat.h:45,
  from src/ff_movie.h:5,
  from src/ff_movie.c:18:
 /usr/local/include/libavutil/common.h:134: error: redefinition of
 ‘av_log2’
 /usr/include/ffmpeg/common.h:98: error: previous definition of ‘av_log2’
 was here


 Thats the first error that comes up.

 -Tyler


 On Wed, May 20, 2009 at 5:18 PM, René Dudfield ren...@gmail.com wrote:

 hi,

 that likely depends on your include paths.  Generally /usr/local/include/
 comes first.

 You might need to put in your own head guards if ffmpeg isn't putting
 them in themselves.

 Like so:

 #ifndef MY_BLA
 #define MY_BLA
 #include bla.h
 #endif

 Hopefully then things only get included once.

 What is the gcc line of something that fails?


 cu,





 On Thu, May 21, 2009 at 10:07 AM, Tyler Laing trinio...@gmail.comwrote:

 Thanks Lenard, that worked. Now, just fixing bugs that are stopping
 compilation.

 One problem I ran into and solved was that I was using the wrong version
 of the header files. However, in solving that, it seems to be trying to
 include both the versions, which end up conflicting and generating a huge
 list of conflict reports. Is there anyway to tell setup not to use the
 header files in /usr/include, and instead use the headers in
 /usr/local/include in the dependency?

 -Tyler


 On Wed, May 20, 2009 at 1:28 PM, Lenard Lindstrom le...@telus.netwrote:

 Your shouldn't need anything special for the includes if the headers
 are in /usr/include or /usr/local/include. The dependency is primarily for
 passing extra libraries to the linker: -lavcodec -lavdevice -lavformat
 -lavutil -lswscale. For config_unix.py try adding:

 Dependency('FFMPEG', 'avformat.h', 'libavformat', ['avcodec',
 'avdevice', 'avformat', 'avutil', 'swscale']),

 though you may have to shuffle the library order to get it to link. The
 'avformat.h' and 'libavformat' are merely files the config_unit.py 
 searches
 for to determine if ffmpeg is available.

 In Setup.in add:

 FFMPEG = -lavcodec -lavdevice -lavformat -lavutil -lswscale

 after the PORTTIME = entry. Again put the libraries in the order
 required to link. But for the most part this line will be ignored and
 replaced by config_unix.py.

 After the gfxdraw entry add

 moviemodname src/movemodname.c $(SDL) $(FFMPEG) $(DEBUG)

 It should be commented as experimental for now. Hopefully by the end of
 summer any such qualifiers can be removed.

 Lenard


 Tyler Laing wrote:

 Thanks Lenard. But what do I put specifically for the dependencies? Do
 I do a different dependency object for each of the header files I need?

 -Tyler

 On Wed, May 20, 2009 at 12:02 PM, Lenard Lindstrom 
 le...@telus.netmailto:
 le...@telus.net wrote:

Nothing needs to be done to config.py. But for config_unix.py a
new Dependency needs to be added to the DEPS list in main(). Also
an FFMPEG = line should be added to Setup.in, giving some Unix
defaults, and add a new build line in the optional modules section
for the new movie module. As for providing paths, if ffmpeg was
installed as a package then the compiler should find it.

Lenard


Tyler Laing wrote:

Okay, so I have some code that looks like it will work, so now
is when I need to start testing it. But to get it to compile
and install with pygame, I've been trying to figure out how to
add the necessary stuff to config.py and config_unix.py.

Does anyone have some information on how to do this?

For reference, right now I'm including these:
#include ffmpeg/avstring.h
#include ffmpeg/rtsp.h
#include ffmpeg/swscale.h
#include ffmpeg/opt.h
#include libavdevice/avdevice.h

#include SDL.h
#include SDL_thread.h
#include ffmpeg/avformat.h

in my code.

I've already tried to find the relevant info, but no luck
there. Thanks for any and all help!

-Tyler

--Visit my 

Re: [pygame] Sluggish movement

2009-05-20 Thread Ian Mallett
We need more information, for one thing.  It could be anything ranging from
jerky framerate, to a user error.  Code?