Changeset 193

Show
Ignore:
Timestamp:
01/01/08 22:47:59 (7 months ago)
Author:
timo
Message:

add q3map2 build to scons

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • GtkRadiant/branches/ZeroRadiant/SConscript.radiant

    r180 r193  
    99 
    1010env = Environment() 
    11 settings.SetupEnvironment( env, config['name'], useGtk = True, useGtkGL = True ) 
     11settings.SetupEnvironment( env, config[ 'name' ], useGtk = True, useGtkGL = True ) 
    1212proj = utils.vcproj( os.path.join( GetLaunchDir(), 'radiant/radiant.vcproj' ) ) 
    1313 
  • GtkRadiant/branches/ZeroRadiant/config.py

    r192 r193  
    1414        # not used atm, but useful to keep a list in mind 
    1515        # may use them eventually for the 'all' and other aliases expansions? 
    16         target_choices = utils.Enum( 'radiant'
     16        target_choices = utils.Enum( 'radiant', 'q3map2'
    1717        config_choices = utils.Enum( 'debug', 'release' ) 
    1818 
     
    2323        def __init__( self ): 
    2424                # initialize defaults 
    25                 self.target_selected = [ 'radiant'
     25                self.target_selected = [ 'radiant', 'q3map2'
    2626                self.config_selected = [ 'release' ] 
    2727                # those are global to each config 
     
    3333                        self.cc = 'gcc-4.1' 
    3434                        self.cxx = 'g++-4.1' 
     35                self.install = True 
    3536 
    3637        def __repr__( self ): 
     
    4849        def _processCXX( self, ops ): 
    4950                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 
    5058 
    5159        def setupParser( self, operators ): 
     
    5462                operators['cc'] = self._processCC 
    5563                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 ): 
    5874                settings = self 
    5975                for config_name in self.config_selected: 
     
    6278                        config['shared'] = False 
    6379                        Export( 'utils', 'settings', 'config' ) 
    64                         build_dir = os.path.join( 'build', config_name
     80                        build_dir = os.path.join( 'build', config_name, 'radiant'
    6581                        BuildDir( build_dir, '.', duplicate = 0 ) 
    6682                        # left out jpeg6, splines (FIXME: I think jpeg6 is not used at all, can trash?) 
     
    7187                        Export( 'lib_objects' ) 
    7288                        radiant = SConscript( os.path.join( build_dir, 'SConscript.radiant' ) ) 
    73                         InstallAs( 'install/radiant.bin', radiant ) 
     89                        self.InstallAs( 'install/radiant.bin', radiant ) 
    7490 
    7591                        # PIC versions of the libs for the modules 
     
    101117                                Export( 'project', 'shlib_objects' ) 
    102118                                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() 
    104152 
    105153        def SetupEnvironment( self, env, config, useGtk = False, useGtkGL = False, useJPEG = False ): 
  • GtkRadiant/branches/ZeroRadiant/plugins/image/jpeg.cpp

    r191 r193  
    343343} 
    344344 
    345 static int _LoadJPGBuff (void *src_buffer, int src_size, unsigned char **pic, int *width, int *height)  
    346 
     345static int LoadJPGBuff( void *src_buffer, int src_size, unsigned char **pic, int *width, int *height ) { 
    347346  struct jpeg_decompress_struct cinfo; 
    348347  struct my_jpeg_error_mgr jerr; 
     
    393392} 
    394393 
    395 void LoadJPG (const char *filename, unsigned char **pic, int *width, int *height) 
    396 
     394void LoadJPG( const char *filename, unsigned char **pic, int *width, int *height ) { 
    397395  unsigned char *fbuffer = NULL; 
    398396  int nLen = vfsLoadFile ((char *)filename, (void **)&fbuffer, 0 ); 
     
    400398    return; 
    401399 
    402   if (_LoadJPGBuff (fbuffer, nLen, pic, width, height) != 0) 
    403   { 
     400  if ( LoadJPGBuff( fbuffer, nLen, pic, width, height ) != 0 ) { 
    404401    g_FuncTable.m_pfnSysPrintf( "WARNING: JPEG library failed to load %s because %s\n", filename, *pic ); 
    405402    *pic = NULL; 
    406403  } 
    407404 
    408   vfsFreeFile (fbuffer); 
    409 } 
     405  vfsFreeFile( fbuffer ); 
     406} 
  • GtkRadiant/branches/ZeroRadiant/tools/quake3/q3map2/q3map2.h

    r183 r193  
    7979#include "vfs.h" 
    8080#include "png.h" 
    81 #include "radiant_jpeglib.h" 
     81#include <jpeglib.h> 
     82#include <jerror.h> 
    8283 
    8384#include <stdlib.h>