[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] Pygame with Windows 98



Here's how I am loading my images:

# used for loading png
def load_png(data_directory, filename):
	if data_directory:
		fullname = os.path.join(data_directory, filename)
	else:
		fullname = filename
	try:
		image = pygame.image.load(fullname)
		if image.get_alpha is None:
			image = image.convert()
		else:
			image = image.convert_alpha()
	except pygame.error, message:
		print 'Cannot load image:', fullname
		raise SystemExit, message
		
	return image, image.get_rect()

# used for loading jpgs
def loadPlain( fileName, dataDirectory=None ):
  if dataDirectory:
	fullName = os.path.join( dataDirectory, fileName)
  else:
	fullName = fileName
  try:
	image = pygame.image.load( fullName )
	image = image.convert()
  except pygame.error, message:
	print "Cannot load image:", fullName
	raise SystemExit, message

  return image, image.get_rect()


I'll post some screenshots later today when I get access to a Win98 machine.

--- Sami Hangaslammi <shang@cc.jyu.fi> wrote:
> 
> Hmm, there shouldn't be need for any porting between linux and w98 when 
> using pygame. Only differences I can think of:
> 
> Are you reading binary files (images) and opening them without the binary
> flag ('rb')? The binary flag is not needed on linux, but is critical when 
> running under Windows.
> 
> Are you converting raw binary data into images and using default screen 
> depth that happens to be different under your Linux and Window desktops 
> (24bit vs 32bit etc.)?
> 
> Or maybe there's just something broken in your W98 install. Have you 
> tested other pygame games or SDL games on it?
> 
> --
> Sami Hangaslammi
> 


=====
"'Beware of the man who works hard to learn something, learns it, and finds himself no wiser than before,' Bokonon tells us. 'He is full of murderous resentment of people who are ignorant without having come by their ignorance the hard way.'" -- Kurt Vonnegut, "Cat's Cradle"

__________________________________
Do you Yahoo!?
New Yahoo! Photos - easier uploading and sharing.
http://photos.yahoo.com/