On Wed, Apr 8, 2009 at 4:34 PM, DR0ID <[email protected]> wrote: > I'm sure you all know about the os.path module. There are many useful > methods like os.path.normpath(path)
I thought that if I just used normpath everything would be alright too, but the thing is that aparently pyglet uses a forward slash named path string as a key to create a dictionary index of all dirs in pyglet.resource.path. The way it was designed it looks like pyglet expect you to put all directory paths that your app use on pyglet.resource.path and them referencing everything by filename only. This would eliminate any ambiguities that occur in directory naming accross platforms. Right now, the editor references tile paths by the full path name, instead of adding the tiles dir to the pyglet.resource.path and loading images by filename only, so putting forward slashes was the less intrusive way that I found to solve this right now. Changing the way resources are loaded could break other things, so I've decided to not touch it until I hear from the other devs that's a desirable thing to do. > Well after rethinking I guess you are talking about how to store a path > (in a file) so it can be loaded on each platform correctly. If this is > the case then forward slash is the way to go as you figured out already. Using the pyglet path way could demand some changes on the saving too, because you wouldn't have the full file paths anymore, just the file name. So you should save the resource path on the level file to find your resources later or expect the user to provide the right paths to the editor wich could be a burden. -- Kao Cardoso Félix Página pessoal: http://www.inf.ufrgs.br/~kcfelix Blog: http://kaofelix.blogspot.com --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "cocos2d discuss" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/cocos-discuss?hl=en -~----------~----~----~----~------~----~------~--~---
