static function processActiveXPlugin($ax) { if (!self::$SAMPLE_HTML) { self::readTemplate(); } $rootPhpBuildDir = getcwd(); self::$GAME_FOLDER = $rootPhpBuildDir . "/game/"; $projID = $ax->WEBGAME_PLUGINNAME . '.' . $ax->WEBGAME_CTRLNAME . '.' . '1'; self::$SAMPLE_HTML = str_replace("__PROJID__", $projID, self::$SAMPLE_HTML); self::$SAMPLE_HTML = str_replace("__CLSID__", $ax->WEBGAMELIB_UUID, self::$SAMPLE_HTML); }
function processTemplates() { $data = $this->readTemplate("safari_Info_plist.tpl"); $data = str_replace("__CFBundleExecutable__", $this->BUNDLE, $data); $data = str_replace("__CFBundleIdentifier__", $this->IDENTIFIER, $data); $data = str_replace("__WebPluginDescription__", $this->DESCRIPTION, $data); $data = str_replace("__WebPluginMIMEType__", "application/" . $this->MIMETYPE, $data); $data = str_replace("__WebPluginName__", $this->PLUGINNAME, $data); $data = str_replace("__GameName__", getGameProjectName(), $data); //TODO: handled by Toolbox $data = str_replace("__GameInstallPath__", $this->GAMEFOLDER, $data); $this->writeFile('Info.plist', $data); WebPlugin::processNPPlugin($this); }
function processTemplates() { // Make sure these come first so timestamp is oldest (for autogeneration) $gen = $this->readTemplate("activex_IEWebGamePlugin_i_h.tpl"); $this->writeFile("IEWebGamePlugin_i.h", $gen); $gen = $this->readTemplate("activex_IEWebGamePlugin_i_c.tpl"); $this->writeFile("IEWebGamePlugin_i.c", $gen); // WebGame.idl $idl = $this->readTemplate("activex_IEWebGamePlugin_idl.tpl"); $idl = str_replace("__WEBGAME_UUID__", $this->WEBGAME_UUID, $idl); $idl = str_replace("__IWEBGAMECTRL_UUID__", $this->IWEBGAMECTRL_UUID, $idl); $idl = str_replace("__WEBGAMELIB_UUID__", $this->WEBGAMELIB_UUID, $idl); $idl = str_replace("__WEBGAME_PLUGINNAME__", $this->WEBGAME_PLUGINNAME, $idl); $this->writeFile("IEWebGamePlugin.idl", $idl); // dllmain.h $dllmain = $this->readTemplate("activex_dllmain_h.tpl"); $dllmain = str_replace("__WEBGAME_PLUGINNAME__", $this->WEBGAME_PLUGINNAME, $dllmain); $dllmain = str_replace("__REGISTRY_APPID_RESOURCEID__", $this->REGISTRY_APPID_RESOURCEID, $dllmain); $this->writeFile("dllmain.h", $dllmain); //WebGameCtrl.rgs $regs = $this->readTemplate("activex_IEWebGameCtrl_rgs.tpl"); $regs = str_replace("__WEBGAME_UUID__", $this->WEBGAME_UUID, $regs); $regs = str_replace("__WEBGAMELIB_UUID__", $this->WEBGAMELIB_UUID, $regs); $regs = str_replace("__WEBGAME_PLUGINNAME__", $this->WEBGAME_PLUGINNAME, $regs); $regs = str_replace("__WEBGAME_CTRLNAME__", $this->WEBGAME_CTRLNAME, $regs); $this->writeFile("IEWebGameCtrl.rgs", $regs); //WebGamePlugin.rgs $regs = $this->readTemplate("activex_IEWebGamePlugin_rgs.tpl"); $regs = str_replace("__WEBGAME_PLUGINNAME__", $this->WEBGAME_PLUGINNAME, $regs); $regs = str_replace("__WEBGAME_CTRLNAME__", $this->WEBGAME_CTRLNAME, $regs); $this->writeFile("IEWebGamePlugin.rgs", $regs); //WebGameCtrl.rc $rc = $this->readTemplate("activex_IEWebGamePlugin_rc.tpl"); $rc = str_replace("__PLUGIN_DLL__", $this->PLUGIN_DLL, $rc); $rc = str_replace("__WEBGAME_PLUGINNAME__", $this->WEBGAME_PLUGINNAME, $rc); //versioning $rc = str_replace("__PLUGIN_VERSION_STRING__", $this->PLUGIN_VERSION, $rc); $cd = str_replace(".", ",", $this->PLUGIN_VERSION); $rc = str_replace("__PLUGIN_VERSION_COMMA_DELIMITED__", $cd, $rc); $this->writeFile("IEWebGamePlugin.rc", $rc); // handle the sample HTML (and whatever else) that is shared between plugins WebPlugin::processActiveXPlugin($this); }
// $g_cwd = realpath(dirname($_SERVER['PHP_SELF'])); echo " CWD = " . $g_cwd . "\n"; // // Load, instantiate, and configure the smarty template engine. // echo " - Loading Smarty...\n"; $tpl = new Smarty(); $tpl->template_dir = $g_cwd . "/templates"; $tpl->compile_dir = $g_cwd . "/templates_c"; $tpl->clear_all_cache(); // By default we assume that the root of the Torque SDK // is located two folders up from the CWD. That is unless // another path is passed in the command line. $torqueRoot = "../.."; if ($argc >= 3) { $torqueRoot = str_replace("\\", "/", $argv[2]); } // Kick off the generator T3D_Generator::init($torqueRoot); // Ready to read our config file. echo " - Loading config file " . realpath($argv[1]) . "\n"; require $argv[1]; // Generate all projects T3D_Generator::generateProjects($tpl); // Now the solutions (if any) $tpl->clear_all_cache(); T3D_Generator::generateSolutions($tpl); // finally write out the sample.html for web deployment (if any) WebPlugin::writeSampleHtml(); exit;
function processTemplates() { $data = $this->readTemplate("firefox_rc.tpl"); $cd = str_replace(".", ",", $this->VERSION); $data = str_replace("__PRODUCTVERSION__", $cd, $data); $data = str_replace("__FILEDESCRIPTION__", $this->DESCRIPTION, $data); $data = str_replace("__INTERNALNAME__", $this->PRODUCTNAME, $data); $data = str_replace("__MIMETYPE__", "application/" . $this->MIMETYPE, $data); $data = str_replace("__ORIGINALFILENAME__", $this->PLUGINNAME . '.dll', $data); $data = str_replace("__PRODUCTNAME__", $this->PRODUCTNAME, $data); $data = str_replace("__COMPANY__", $this->COMPANY, $data); $data = str_replace("__COMPANYKEY__", $this->COMPANYKEY, $data); $data = str_replace("__PLUGIN__", $this->PLUGIN, $data); $this->writeFile('NPWebGamePlugin.rc', $data); // handle the sample HTML (and whatever else) that is shared between plugins WebPlugin::processNPPlugin($this); }