1. Radomir Dopieralski
  2. pygame


pygame  committed 456acf5

no message

  • Participants
  • Parent commits 6be582e
  • Branches default

Comments (0)

Files changed (2)

File config_win.py

View file
         line = origsetup.readline()
     while line.find('#--EndConfig') == -1:
         line = origsetup.readline()
+    if not DEPS[0].path: #fudge SDL if not found
+        DEPS[0].line = 'SDL = -I/pathto/SDL/include -L/pathto/SDL/lib -lSDL'
+        DEPS[0].path = 'xxxx'
     if basepath:
         newsetup.write('BASE=' + basepath + '\n')
     for d in DEPS:
         newsetup.write(d.line + '\n')
     while line:
         line = origsetup.readline()
         useit = 1

File examples/zipshow.py

View file
 Also note, if your SDL_image doesn't support
 .JPG, you won't see all the images available"""
+#note, if not using SDL_image-1.1.0 or greater,
+#you will likely crash when loading a non-image
+#(don't blame me, it's a bug in older SDL_image)
 import zipfile, sys, glob, os
 import pygame, pygame.image
     zip = zipfile.ZipFile(zipfilename)
     for file in zip.namelist():
-        #curse you SDL_image for this crude hack!
-        if(os.path.splitext(file)[1] == '.txt'): continue
         #get data from zipfile
         data = zip.read(file)
+        #create stringio for data (a file-like object)
+        data_io = StringIO(data)
         #load from a stringio object
-        try: surf = pygame.image.load(StringIO(data), file)
+        try: surf = pygame.image.load(data_io, file)
         except: continue
         #get image on the screen
         showimage(surf, file)