0 ) T3D_Generator::addProjectDefines( $args ); else echo( "addProjectDefines() - no arguments passed!" ); } /// Has a preprocessor directive been defined? function isDefined( $d ) { return T3D_Generator::isDefined( $d ); } function setProjectGUID( $guid ) { T3D_Generator::setProjectGUID( $guid ); } function setProjectModuleDefinitionFile( $mdef ) { T3D_Generator::setProjectModuleDefinitionFile( $mdef ); } function addProjectLibDir( $dir ) { T3D_Generator::addProjectLibDir( $dir ); } function addProjectLibInput( $lib_name, $libDebug = null ) { T3D_Generator::addProjectLibInput( $lib_name, $libDebug ); } function addProjectIgnoreDefaultLib( $lib ) { T3D_Generator::addProjectIgnoreDefaultLib( $lib ); } function copyFileToProject( $sourcePath, $projPath ) { T3D_Generator::copyFileToProject( $sourcePath, $projPath ); } function addProjectDependency( $pd ) { T3D_Generator::addProjectDependency( $pd ); } function removeProjectDependency( $pd ) { T3D_Generator::removeProjectDependency( $pd ); } function addProjectReference( $refName, $version = "" ) { T3D_Generator::addProjectReference( $refName, $version ); } // disable a specific project compiler warning function disableProjectWarning( $warning ) { T3D_Generator::disableProjectWarning( $warning ); } function setGameProjectName($name) { T3D_Generator::setGameProjectName($name); } function getGameProjectName() { return T3D_Generator::getGameProjectName(); } function setToolBuild($tb) { T3D_Generator::setToolBuild($tb); } function getToolBuild() { return T3D_Generator::getToolBuild(); } function setWatermarkBuild($wb) { T3D_Generator::setWatermarkBuild($wb); } function getWatermarkBuild() { return T3D_Generator::getWatermarkBuild(); } function setPurchaseScreenBuild($psb) { T3D_Generator::setPurchaseScreenBuild($psb); } function getPurchaseScreenBuild() { return T3D_Generator::getPurchaseScreenBuild(); } function setDemoBuild($db) { T3D_Generator::setDemoBuild($db); } function getDemoBuild() { return T3D_Generator::getDemoBuild(); } function setObjectLimitBuild($olb) { T3D_Generator::setObjectLimitBuild($olb); } function getObjectLimitBuild() { return T3D_Generator::getObjectLimitBuild(); } function setTimeOutBuild($tob) { T3D_Generator::setTimeOutBuild($tob); } function getTimeOutBuild() { return T3D_Generator::getTimeOutBuild(); } function inProjectConfig() { return T3D_Generator::inProjectConfig(); } // On Windows, 1 - Console, 2 - Windows function setProjectSubSystem( $subSystem ) { T3D_Generator::setProjectSubSystem( $subSystem ); } // Sets whether to use /MT or /MD code generation/runtime on Windows // /MD plays better with multiple dynamic libraries in a project (and with certain libraries (like Qt) // /MD also generates smaller binaries as the runtime isn't included in each module, memory is handled consistently, etc // You must include or install via the redistributable package the appropriate VS runtime for end users. function setDLLRuntime ($val) { T3D_Generator::setDLLRuntime( $val ); } //-------------------------------------------------------------------------------- UTIL // Some versions of PHP4 are unable to recusively create directories. // The version of PHP that is distributed with Mac OS 10.4 suffers from this. function mkdir_r($path, $mode) { if( @mkdir( $path, $mode ) or file_exists( $path ) ) return true; return ( mkdir_r( dirname( $path ), $mode ) and mkdir( $path, $mode ) ); } // This is used inside an if statement in the smarty templates function dontCompile( $string, $output ) { // Skip marking header files to be excluded from the // build. It confuses VS2010 and it will not put the // file into the correct filter folder. // if ( preg_match( '#^.*\.(h|hpp|hh|inc)$#i', $string ) ) return false; if( !is_array( $output->dont_compile_patterns ) ) return false; foreach( $output->dont_compile_patterns as $pattern ) if( preg_match( $pattern, $string ) ) return true; return false; } /// Generates and returns a randomly generated uuid in the form: /// /// {xxxxxxxx-xxxx-4xxx-Yxxx-xxxxxxxxxxxx} /// /// Where Y is either 8, 9, A, or B. This is known as /// a v4 UUID. See... /// /// http://en.wikipedia.org/wiki/Universally_Unique_Identifier#Version_4_.28random.29 /// function gen_uuid() { return sprintf( '{%04x%04x-%04x-%04x-%04x-%04x%04x%04x}', // 32 bits for "time_low" mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ), // 16 bits for "time_mid" mt_rand( 0, 0xffff ), // 16 bits for "time_hi_and_version", // four most significant bits holds version number 4 mt_rand( 0, 0x0fff ) | 0x4000, // 16 bits, 8 bits for "clk_seq_hi_res", // 8 bits for "clk_seq_low", // two most significant bits holds zero and one for variant DCE1.1 mt_rand( 0, 0x3fff ) | 0x8000, // 48 bits for "node" mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ) ); } ?>