Changeset 193
- Timestamp:
- 01/01/08 22:47:59 (7 months ago)
- Files:
-
- GtkRadiant/branches/ZeroRadiant/SConscript.q3map2 (added)
- GtkRadiant/branches/ZeroRadiant/SConscript.radiant (modified) (1 diff)
- GtkRadiant/branches/ZeroRadiant/config.py (modified) (8 diffs)
- GtkRadiant/branches/ZeroRadiant/plugins/image/jpeg.cpp (modified) (3 diffs)
- GtkRadiant/branches/ZeroRadiant/tools/quake3/common/jpeg.c (added)
- GtkRadiant/branches/ZeroRadiant/tools/quake3/q3map2/q3map2.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
GtkRadiant/branches/ZeroRadiant/SConscript.radiant
r180 r193 9 9 10 10 env = Environment() 11 settings.SetupEnvironment( env, config[ 'name'], useGtk = True, useGtkGL = True )11 settings.SetupEnvironment( env, config[ 'name' ], useGtk = True, useGtkGL = True ) 12 12 proj = utils.vcproj( os.path.join( GetLaunchDir(), 'radiant/radiant.vcproj' ) ) 13 13 GtkRadiant/branches/ZeroRadiant/config.py
r192 r193 14 14 # not used atm, but useful to keep a list in mind 15 15 # may use them eventually for the 'all' and other aliases expansions? 16 target_choices = utils.Enum( 'radiant' )16 target_choices = utils.Enum( 'radiant', 'q3map2' ) 17 17 config_choices = utils.Enum( 'debug', 'release' ) 18 18 … … 23 23 def __init__( self ): 24 24 # initialize defaults 25 self.target_selected = [ 'radiant' ]25 self.target_selected = [ 'radiant', 'q3map2' ] 26 26 self.config_selected = [ 'release' ] 27 27 # those are global to each config … … 33 33 self.cc = 'gcc-4.1' 34 34 self.cxx = 'g++-4.1' 35 self.install = True 35 36 36 37 def __repr__( self ): … … 48 49 def _processCXX( self, ops ): 49 50 self.cxx = ops 51 52 def _processInstall( self, ops ): 53 ops = ops[0] 54 if ( ops == 'yes' or ops == 'true' or ops == 'True' or ops == '1' or ops == True ): 55 self.install = True 56 return 57 self.install = False 50 58 51 59 def setupParser( self, operators ): … … 54 62 operators['cc'] = self._processCC 55 63 operators['cxx'] = self._processCXX 56 57 def emit( self ): 64 operators['install'] = self._processInstall 65 66 def InstallAs( self, target, source ): 67 if ( self.install ): 68 iret = InstallAs( target, source ) 69 Default( iret ) 70 else: 71 Default( source ) 72 73 def emit_radiant( self ): 58 74 settings = self 59 75 for config_name in self.config_selected: … … 62 78 config['shared'] = False 63 79 Export( 'utils', 'settings', 'config' ) 64 build_dir = os.path.join( 'build', config_name )80 build_dir = os.path.join( 'build', config_name, 'radiant' ) 65 81 BuildDir( build_dir, '.', duplicate = 0 ) 66 82 # left out jpeg6, splines (FIXME: I think jpeg6 is not used at all, can trash?) … … 71 87 Export( 'lib_objects' ) 72 88 radiant = SConscript( os.path.join( build_dir, 'SConscript.radiant' ) ) 73 InstallAs( 'install/radiant.bin', radiant )89 self.InstallAs( 'install/radiant.bin', radiant ) 74 90 75 91 # PIC versions of the libs for the modules … … 101 117 Export( 'project', 'shlib_objects' ) 102 118 module = SConscript( os.path.join( build_dir, 'SConscript.module' ) ) 103 InstallAs( 'install/modules/%s.so' % libname, module ) 119 self.InstallAs( 'install/modules/%s.so' % libname, module ) 120 121 def emit_q3map2( self ): 122 settings = self 123 for config_name in self.config_selected: 124 config = {} 125 config['name'] = config_name 126 config['shared'] = False 127 Export( 'utils', 'settings', 'config' ) 128 build_dir = os.path.join( 'build', config_name, 'radiant' ) 129 BuildDir( build_dir, '.', duplicate = 0 ) 130 lib_objects = [] 131 for project in [ 'libs/cmdlib/cmdlib.vcproj', 'libs/mathlib/mathlib.vcproj', 'libs/l_net/l_net.vcproj', 'libs/ddslib/ddslib.vcproj', 'libs/picomodel/picomodel.vcproj', 'libs/md5lib/md5lib.vcproj' ]: 132 Export( 'project' ) 133 lib_objects += SConscript( os.path.join( build_dir, 'SConscript.lib' ) ) 134 Export( 'lib_objects' ) 135 q3map2 = SConscript( os.path.join( build_dir, 'SConscript.q3map2' ) ) 136 self.InstallAs( 'install/q3map2.bin', q3map2 ) 137 138 139 def emit( self ): 140 try: 141 self.target_selected.index( 'radiant' ) 142 except: 143 pass 144 else: 145 self.emit_radiant() 146 try: 147 self.target_selected.index( 'q3map2' ) 148 except: 149 pass 150 else: 151 self.emit_q3map2() 104 152 105 153 def SetupEnvironment( self, env, config, useGtk = False, useGtkGL = False, useJPEG = False ): GtkRadiant/branches/ZeroRadiant/plugins/image/jpeg.cpp
r191 r193 343 343 } 344 344 345 static int _LoadJPGBuff (void *src_buffer, int src_size, unsigned char **pic, int *width, int *height) 346 { 345 static int LoadJPGBuff( void *src_buffer, int src_size, unsigned char **pic, int *width, int *height ) { 347 346 struct jpeg_decompress_struct cinfo; 348 347 struct my_jpeg_error_mgr jerr; … … 393 392 } 394 393 395 void LoadJPG (const char *filename, unsigned char **pic, int *width, int *height) 396 { 394 void LoadJPG( const char *filename, unsigned char **pic, int *width, int *height ) { 397 395 unsigned char *fbuffer = NULL; 398 396 int nLen = vfsLoadFile ((char *)filename, (void **)&fbuffer, 0 ); … … 400 398 return; 401 399 402 if (_LoadJPGBuff (fbuffer, nLen, pic, width, height) != 0) 403 { 400 if ( LoadJPGBuff( fbuffer, nLen, pic, width, height ) != 0 ) { 404 401 g_FuncTable.m_pfnSysPrintf( "WARNING: JPEG library failed to load %s because %s\n", filename, *pic ); 405 402 *pic = NULL; 406 403 } 407 404 408 vfsFreeFile (fbuffer);409 } 405 vfsFreeFile( fbuffer ); 406 } GtkRadiant/branches/ZeroRadiant/tools/quake3/q3map2/q3map2.h
r183 r193 79 79 #include "vfs.h" 80 80 #include "png.h" 81 #include "radiant_jpeglib.h" 81 #include <jpeglib.h> 82 #include <jerror.h> 82 83 83 84 #include <stdlib.h>
