Anonymous avatar Anonymous committed 456acf5

no message

Comments (0)

Files changed (2)

         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

examples/zipshow.py

 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)
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.