void bsp_init() { build_set_variable("RadiantPath", AppPath_get()); build_set_variable("ExecutableType", RADIANT_EXECUTABLE); build_set_variable("EnginePath", EnginePath_get()); build_set_variable("UserEnginePath", g_qeglobals.m_userEnginePath.c_str()); build_set_variable("MonitorAddress", (g_WatchBSP_Enabled) ? "127.0.0.1:39000" : ""); build_set_variable("GameName", gamename_get()); build_set_variable("MapFile", Map_Name(g_map)); }
void CGameDialog::ScanForGames(){ StringOutputStream strGamesPath( 256 ); strGamesPath << AppPath_get() << "games/"; const char *path = strGamesPath.c_str(); globalOutputStream() << "Scanning for game description files: " << path << '\n'; /*! \todo FIXME LINUX: do we put game description files below AppPath, or in ~/.radiant i.e. read only or read/write? my guess .. readonly cause it's an install we will probably want to add ~/.radiant/<version>/games/ scanning on top of that for developers (if that's really needed) */ Directory_forEach( path, LoadGameFile( mGames, path ) ); }
CGameDescription::CGameDescription(xmlDocPtr pDoc, const CopiedString& gameFile) { // read the user-friendly game name xmlNodePtr pNode = pDoc->children; while (strcmp((const char*)pNode->name, "game") && pNode != 0) { pNode=pNode->next; } if (!pNode) { Error("Didn't find 'game' node in the game description file '%s'\n", pDoc->URL); } for(xmlAttrPtr attr = pNode->properties; attr != 0; attr = attr->next) { m_gameDescription.insert(GameDescription::value_type(xmlAttr_getName(attr), xmlAttr_getValue(attr))); } { StringOutputStream path(256); path << AppPath_get() << gameFile.c_str() << "/"; mGameToolsPath = path.c_str(); } ASSERT_MESSAGE(file_exists(mGameToolsPath.c_str()), "game directory not found: " << makeQuoted(mGameToolsPath.c_str())); mGameFile = gameFile; { GameDescription::iterator i = m_gameDescription.find("type"); if(i == m_gameDescription.end()) { globalErrorStream() << "Warning, 'type' attribute not found in '" << reinterpret_cast<const char*>(pDoc->URL) << "'\n"; // default mGameType = "q3"; } else { mGameType = (*i).second.c_str(); } } }