changed Generator to T3D_Generator to prevent problems with newer php versions

This commit is contained in:
Thomas Fischer 2014-03-14 19:58:23 +01:00
parent 39b893f1ca
commit 9b49f56bd6
26 changed files with 160 additions and 160 deletions

View file

@ -37,7 +37,7 @@ require_once( "NPWebPlugin.php");
require_once( "SafariWebPlugin.php");
class Generator
class T3D_Generator
{
public static $app_name;
public static $paths = array();
@ -275,14 +275,14 @@ class Generator
array_push( self::$libGuard, $lib );
// if currently in a project, delay the include
if (Generator::inProjectConfig())
if (T3D_Generator::inProjectConfig())
{
array_push( self::$project_cur->lib_includes, $lib );
return;
}
// otherwise include it immediately
require( Generator::getGeneratorLibsPath() . $lib . '.conf' );
require( T3D_Generator::getGeneratorLibsPath() . $lib . '.conf' );
}
static function addProjectDependency( $pd )
@ -335,7 +335,7 @@ class Generator
if( !self::$module_cur )
self::$module_cur = $name;
else
echo( "Generator::beginModule() - already in module!" );
echo( "T3D_Generator::beginModule() - already in module!" );
}
static function endModule()
@ -343,7 +343,7 @@ class Generator
if( self::$module_cur )
self::$module_cur = null;
else
trigger_error( "Generator::endModule() - no active module!", E_USER_ERROR );
trigger_error( "T3D_Generator::endModule() - no active module!", E_USER_ERROR );
}
static function inProjectConfig()
@ -367,7 +367,7 @@ class Generator
self::$config_projects[ $name ] = self::$project_cur;
}
else
trigger_error( "Generator::beginProjectConfig() - a project is already open!", E_USER_ERROR );
trigger_error( "T3D_Generator::beginProjectConfig() - a project is already open!", E_USER_ERROR );
}
static function endProjectConfig( $type )
@ -424,14 +424,14 @@ class Generator
// Now include any libraries included in the modules
foreach( $p->lib_includes as $libName )
require( Generator::getGeneratorLibsPath() . $libName . '.conf' );
require( T3D_Generator::getGeneratorLibsPath() . $libName . '.conf' );
}
else
trigger_error( "Generator::endProjectConfig() - closing type mismatch!", E_USER_ERROR );
trigger_error( "T3D_Generator::endProjectConfig() - closing type mismatch!", E_USER_ERROR );
}
else
trigger_error( "Generator::endProjectConfig() - no currently open project!", E_USER_ERROR );
trigger_error( "T3D_Generator::endProjectConfig() - no currently open project!", E_USER_ERROR );
}
static function beginActiveXConfig( $lib_name, $guid = '', $game_dir = 'game', $output_name = '' )
@ -571,7 +571,7 @@ class Generator
self::$solutions[ $name ] = self::$solution_cur;
}
else
trigger_error( "Generator::beginSolution() - tried to start $name but already in the ".self::$solution_cur->name." solution!", E_USER_ERROR );
trigger_error( "T3D_Generator::beginSolution() - tried to start $name but already in the ".self::$solution_cur->name." solution!", E_USER_ERROR );
}
static function addSolutionProjectRef( $pname )
@ -579,7 +579,7 @@ class Generator
if( isset( self::$solution_cur ) )
self::$solution_cur->addProjectRef( $pname );
else
trigger_error( "Generator::addSolutionProjectRef(): no such project - " . $pname . "\n", E_USER_ERROR );
trigger_error( "T3D_Generator::addSolutionProjectRef(): no such project - " . $pname . "\n", E_USER_ERROR );
}
static function addSolutionProjectRefExt( $pname, $ppath, $pguid )
@ -587,7 +587,7 @@ class Generator
if( isset( self::$solution_cur ) )
self::$solution_cur->addSolutionProjectRefExt( $pname, $ppath, $pguid );
else
trigger_error( "Generator::addSolutionProjectRefExt(): no such project - " . $pname . "\n", E_USER_ERROR );
trigger_error( "T3D_Generator::addSolutionProjectRefExt(): no such project - " . $pname . "\n", E_USER_ERROR );
}
static function endSolution()
@ -599,7 +599,7 @@ class Generator
self::$solution_cur = null;
}
else
trigger_error( "Generator::endSolution(): no active solution!\n", E_USER_ERROR );
trigger_error( "T3D_Generator::endSolution(): no active solution!\n", E_USER_ERROR );
}
static function generateSolutions( $tpl )

View file

@ -165,7 +165,7 @@ class Project
foreach( $this->dependencies as $pname )
{
$p = Generator::lookupProjectByName( $pname );
$p = T3D_Generator::lookupProjectByName( $pname );
if( $p )
array_push( $pguids, $p->guid );
@ -200,10 +200,10 @@ class Project
{
// This could be consolidated into a single OR statement but it is easier to
// read as two separate if's
if ( !Generator::$absPath )
if ( !T3D_Generator::$absPath )
$newEntry->path = $output->project_rel_path . $newEntry->path;
if ( Generator::$absPath && !stristr($newEntry->path, Generator::$absPath) )
if ( T3D_Generator::$absPath && !stristr($newEntry->path, T3D_Generator::$absPath) )
$newEntry->path = $output->project_rel_path . $newEntry->path;
}
@ -230,10 +230,10 @@ class Project
$curPath = FileUtil::collapsePath( $output->base_dir . $dir );
$pathWalk = &$projectFiles[ $projName ];
if ( Generator::$absPath )
if ( T3D_Generator::$absPath )
{
if ( stristr($curPath, getEngineSrcDir()) || stristr($curPath, getLibSrcDir()) )
$curPath = Generator::$absPath . "/". str_replace("../", "", $curPath);
$curPath = T3D_Generator::$absPath . "/". str_replace("../", "", $curPath);
}
// Check if its a file or a directory.
@ -344,7 +344,7 @@ class Project
$tpl->assign_by_ref( 'projModuleDefinitionFile', $this->moduleDefinitionFile );
$tpl->assign_by_ref( 'projSubSystem', $this->projSubSystem );
if (Generator::$useDLLRuntime)
if (T3D_Generator::$useDLLRuntime)
{
// /MD and /MDd
$tpl->assign( 'projRuntimeRelease', 2 );
@ -381,7 +381,7 @@ class Project
foreach ($this->dependencies as $pname)
{
$p = Generator::lookupProjectByName( $pname );
$p = T3D_Generator::lookupProjectByName( $pname );
$projectDepends[$pname] = $p;
if ( $p )
@ -394,18 +394,18 @@ class Project
// Assign some handy paths for the template to reference
$tpl->assign( 'projectOffset', $output->project_rel_path );
if ( Generator::$absPath )
$tpl->assign( 'srcDir', Generator::$absPath . "/". str_replace("../", "", getAppEngineSrcDir()) );
if ( T3D_Generator::$absPath )
$tpl->assign( 'srcDir', T3D_Generator::$absPath . "/". str_replace("../", "", getAppEngineSrcDir()) );
else
$tpl->assign( 'srcDir', $output->project_rel_path . getAppEngineSrcDir() );
if ( Generator::$absPath )
$tpl->assign( 'libDir', Generator::$absPath . "/". str_replace("../", "", getAppLibSrcDir()) );
if ( T3D_Generator::$absPath )
$tpl->assign( 'libDir', T3D_Generator::$absPath . "/". str_replace("../", "", getAppLibSrcDir()) );
else
$tpl->assign( 'libDir', $output->project_rel_path . getAppLibSrcDir() );
if ( Generator::$absPath )
$tpl->assign( 'binDir', Generator::$absPath . "/". str_replace("../", "", getAppEngineBinDir()) );
if ( T3D_Generator::$absPath )
$tpl->assign( 'binDir', T3D_Generator::$absPath . "/". str_replace("../", "", getAppEngineBinDir()) );
else
$tpl->assign( 'binDir', $output->project_rel_path . getAppEngineBinDir() );
@ -427,18 +427,18 @@ class Project
$libDirs = $output->project_rel_path . $libDirs;
}
if ( Generator::$absPath )
if ( T3D_Generator::$absPath )
{
foreach ($this->includes as &$include)
{
if ( stristr($include, getEngineSrcDir()) || stristr($include, getLibSrcDir()) )
$include = Generator::$absPath . "/". str_replace("../", "", $include);
$include = T3D_Generator::$absPath . "/". str_replace("../", "", $include);
}
foreach ($this->lib_dirs as &$libDirs)
{
if ( stristr($libDirs, getEngineSrcDir()) || stristr($libDirs, getLibSrcDir()) )
$libDirs = Generator::$absPath . "/". str_replace("../", "", $libDirs);
$libDirs = T3D_Generator::$absPath . "/". str_replace("../", "", $libDirs);
}
}
}

View file

@ -85,7 +85,7 @@ class Solution
// Look up each project ref and add its info to the list
foreach( $refs as $pname )
{
$project = Generator::lookupProjectByName( $pname );
$project = T3D_Generator::lookupProjectByName( $pname );
if( isset( $project ) )
{

View file

@ -45,7 +45,7 @@ class Torque3D
includeLib( 'convexDecomp' );
// Use FMOD on consoles
if ( Generator::$platform != "360" && Generator::$platform != "ps3" )
if ( T3D_Generator::$platform != "360" && T3D_Generator::$platform != "ps3" )
{
includeLib( 'libvorbis' );
includeLib( 'libogg' );
@ -63,12 +63,12 @@ class Torque3D
self::includeDefaultLibs();
$ext = "DLL";
if ( Generator::$platform == "mac" )
if ( T3D_Generator::$platform == "mac" )
$ext = "Bundle";
//some platforms will not want a shared config
if ( Generator::$platform == "360" || Generator::$platform == "ps3" )
if ( T3D_Generator::$platform == "360" || T3D_Generator::$platform == "ps3" )
self::$sharedConfig = false;
//begin either a shared lib config, or a static app config
@ -105,7 +105,7 @@ class Torque3D
addLibIncludePath( "squish" );
addLibIncludePath( 'convexDecomp' );
if ( Generator::$platform != "360" && Generator::$platform != "ps3" )
if ( T3D_Generator::$platform != "360" && T3D_Generator::$platform != "ps3" )
{
addLibIncludePath( "libvorbis/include" );
addLibIncludePath( "libogg/include" );
@ -121,13 +121,13 @@ class Torque3D
includeModule( 'basicLighting' );
includeModule( 'collada' );
if ( Generator::$platform != "360" && Generator::$platform != "ps3" )
if ( T3D_Generator::$platform != "360" && T3D_Generator::$platform != "ps3" )
{
includeModule( 'vorbis' );
includeModule( 'theora' );
}
if(Generator::$platform == "mac" || Generator::$platform == "win32")
if(T3D_Generator::$platform == "mac" || T3D_Generator::$platform == "win32")
includeModule( 'openal' );
@ -145,20 +145,20 @@ class Torque3D
addProjectDependency( 'pcre' );
addProjectDependency( 'convexDecomp' );
if ( Generator::$platform != "360" && Generator::$platform != "ps3" )
if ( T3D_Generator::$platform != "360" && T3D_Generator::$platform != "ps3" )
{
addProjectDependency( 'libvorbis' );
addProjectDependency( 'libogg' );
addProjectDependency( 'libtheora' );
}
if ( Generator::$platform == "mac" )
if ( T3D_Generator::$platform == "mac" )
{
addProjectDefine( '__MACOSX__' );
addProjectDefine( 'LTM_DESC' );
}
if (Generator::$platform == "win32")
if (T3D_Generator::$platform == "win32")
{
setProjectModuleDefinitionFile('../../' . getLibSrcDir() . 'Torque3D/msvc/torque3d.def');
@ -209,13 +209,13 @@ class Torque3D
addEngineSrcDir( 'main' );
if (Generator::$platform == "win32")
if (T3D_Generator::$platform == "win32")
{
addProjectDefine( 'WIN32' );
addProjectDependency( getGameProjectName() . ' DLL' );
}
if (Generator::$platform == "mac")
if (T3D_Generator::$platform == "mac")
{
addProjectDefine( '__MACOSX__' );
addProjectDependency( getGameProjectName() . ' Bundle' );
@ -226,7 +226,7 @@ class Torque3D
}
// Add solution references for Visual Studio projects
if (Generator::$platform == "win32" || Generator::$platform == "360" || Generator::$platform == "ps3")
if (T3D_Generator::$platform == "win32" || T3D_Generator::$platform == "360" || T3D_Generator::$platform == "ps3")
{
if ( !self::$sharedConfig )
beginSolutionConfig( getGameProjectName(), '{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}' );
@ -247,7 +247,7 @@ class Torque3D
addSolutionProjectRef( 'zlib' );
addSolutionProjectRef( 'convexDecomp' );
if (Generator::$platform == "win32")
if (T3D_Generator::$platform == "win32")
{
addSolutionProjectRef( 'libogg' );
addSolutionProjectRef( 'libvorbis' );