Anonymous avatar Anonymous committed 099d998

PNG support!

Comments (0)

Files changed (5)

symbian/BuildPygameRelease.py

         # Copy the sis to current directory
         import shutil
         shutil.copyfile(pys60_sis, sisname)
-    
+        
+        args['pythondll'] =  args['basename']
+         
     else:
         sisname = config.pys60_sis
-    
+        if config.pythondll is not None:
+            args['pythondll'] = config.pythondll
      
     # Build pygame
     args["pythonsis"]  = sisname
     args['sdluid'] = hex(UID_SDL).replace("L","")
     args['jpeguid']= hex(UID_JPEG).replace("L","")
     
-    if config.pythondll is not None:
-        args['pythondll'] = config.pythondll
-    
     dobuild(args)
     
     

symbian/SConscript.SDL.py

 
 # Configure SDL_image
 sources += Glob('deps/SDL_image/IMG*.c',)
+[sources.remove(x) for x in Glob('deps/SDL_image/IMG_png*c') ]
+
 defines += [
             'LOAD_JPG',
             'LOAD_BMP',
             'LOAD_GIF',
-            'LOAD_TGA'
-            #'LOAD_PNG' # requires glib. We need OpenC
+            'LOAD_TGA',            
             ]
 sysincludes += [
-    'deps/jpeg/', 
+    'deps/jpeg/',    
 ]
 
+# png.h does not like __DLL__ define
+SymbianProgram( "pygame_SDL_libpng", TARGETTYPE_LIB,
+                sources = ["deps/SDL_Image/IMG_png.c"],
+                includes = includes,
+                sysincludes = sysincludes + ["deps/libpng"],
+                defines = ["LOAD_PNG"],                
+                )
+staticlibs += ["pygame_SDL_libpng.lib", "pygame_libpng.lib"]
+libraries  += ["ezlib"] # For libpng
 
-
-defines     +=['SYMBIANC', 'SYMBIAN_SERIES60', 
+defines += ['SYMBIANC', 'SYMBIAN_SERIES60', 
                'NO_SIGNAL_H', 'ENABLE_EPOC', 
                'DISABLE_JOYSTICK', 'DISABLE_CDROM',                
                ]

symbian/SConscript.pygame.py

 for x in glob( "lib/*.py"): 
     to_package( source = x, target = pygame_lib )
     
-#sdl_path = "/epoc32/release/%s/%s/sdl.dll" % ( COMPILER, RELEASE ) 
-#to_package( source = sdl_path, target = "sys/bin/") 
-
 # Install default font
 to_package( source = "../lib/freesansbold.ttf", target = pygame_lib )

symbian/SConstruct

 SDL_DLL_NAME = ARGUMENTS.get( "sdldll", "pygame_sdl" )
 #: Name of the used jpeg.dll
 JPEG_DLL_NAME = ARGUMENTS.get( "jpegdll", "pygame_libjpeg" )
+#: Name of the used libpng.dll
+PNG_DLL_NAME = ARGUMENTS.get( "pngdll", "pygame_libpng" )
 
 UID_PACKAGE    = ARGUMENTS.get( "sisuid" )
 UID_PYGAMEAPP  = ARGUMENTS.get( "appuid" )
 UID_SDL        = ARGUMENTS.get( "sdluid" )
 UID_JPEG       = ARGUMENTS.get( "jpeguid" )
+UID_PNG        = ARGUMENTS.get( "pnguid" )
 
 CAPABILITIES  = ARGUMENTS.get( "capabilities", "").split("+")
 if len(CAPABILITIES) == 0: CAPABILITIES = CAPS_SELF_SIGNED
     Export("TARGET_NAME UID3")
     SConscript( "SConscript.jpeg.py" )  
     
+    UID3 = UID_PNG
+    TARGET_NAME = PNG_DLL_NAME  
+    Export("TARGET_NAME UID3")
+    SConscript( "SConscript.libpng.py" )  
+    
     TARGET_NAME = SDL_DLL_NAME  
     UID3        = UID_SDL     
     Export( "TARGET_NAME UID3" )

symbian/how_to_build.txt

 Checkout jpeg library to symbian/deps/jpeg
 - https://movino.svn.sourceforge.net/svnroot/movino/libjpeg/trunk
 
-
+Checkout PNG library to symbian/deps/libpng
+- http://pamp.svn.sourceforge.net/svnroot/pamp/libpng/trunk/libpng-1.2.18
 
 - The build scripts use SCons for Symbian. 
 -- http://code.google.com/p/scons-for-symbian/
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.