void COptionsManager::SystemConfigChanged(bool silent) { //gEnv->pConsole->ExecuteString("sys_SaveCVars 1"); //gEnv->pSystem->SaveConfiguration(); //gEnv->pConsole->ExecuteString("sys_SaveCVars 0"); if(m_pPlayerProfileManager) { UpdateToProfile(); SaveProfile(); } if(!silent) { if(CFlashMenuScreen *pCurrentMenu = GetCurrentMenu()) { pCurrentMenu->Invoke("showErrorMessage", "Box1"); CryFixedStringT<128> text = "@system_spec_"; text.append(gEnv->pConsole->GetCVar("sys_spec")->GetString()); pCurrentMenu->Invoke("setErrorText", text.c_str()); text = "sys_spec_Full \0"; text.append(gEnv->pConsole->GetCVar("sys_spec")->GetString()); gEnv->pConsole->ExecuteString(text.c_str()); } } UpdateFlashOptions(); }
void COptionsManager::SetVideoMode(const char* params) { CryFixedStringT<64> resolution(params); int pos = resolution.find('x'); if(pos != CryFixedStringT<64>::npos) { CryFixedStringT<64> width = "r_width "; width.append(resolution.substr(0, pos)); CryFixedStringT<64> height = "r_height "; height.append(resolution.substr(pos+1, resolution.size())); g_pGame->GetMenu()->StartResolutionCountDown(); gEnv->pConsole->ExecuteString(width); gEnv->pConsole->ExecuteString(height); } }
void COptionsManager::SetAntiAliasingMode(const char* params) { if(params) { if(g_pGame->GetMenu()) { CFlashMenuObject::FSAAMode mode = g_pGame->GetMenu()->GetFSAAMode(params); if(mode.samples == 0) { gEnv->pConsole->ExecuteString("r_fsaa 0"); gEnv->pConsole->ExecuteString("r_fsaa_samples 0"); gEnv->pConsole->ExecuteString("r_fsaa_quality 0"); } else { gEnv->pConsole->ExecuteString("r_fsaa 1"); CryFixedStringT<32> command = "r_fsaa_samples "; char buffer[16]; itoa(mode.samples, buffer, 10); command.append(buffer); gEnv->pConsole->ExecuteString(command.c_str()); command = "r_fsaa_quality "; itoa(mode.quality, buffer, 10); command.append(buffer); gEnv->pConsole->ExecuteString(command.c_str()); // FSAA requires HDR mode on, to get consistent menu settings we switch sys_spec_shading to 3 or 4 // search for #LABEL_FSAA_HDR { bool bHDREnabled = gEnv->pRenderer->EF_Query(EFQ_HDRModeEnabled)!=0; if(!bHDREnabled) // no HDR so we either have sys_spec_Shading in 1 or 2 or user { // (it cannot be the machine is not capable of HDR as we have a list of FSAA modes) ICVar *pSpecShading = gEnv->pConsole->GetCVar("sys_spec_Shading"); assert(pSpecShading); if(pSpecShading) pSpecShading->Set(3); // starting with mode 3 we have HDR on } } } } } }
void CFlowGraphModuleManager::ScanFolder(const string& folderName, bool bGlobal) { _finddata_t fd; intptr_t handle = 0; ICryPak *pPak = gEnv->pCryPak; CryFixedStringT<512> searchString = folderName.c_str(); searchString.append("*.*"); handle = pPak->FindFirst(searchString.c_str(), &fd); CryFixedStringT<512> moduleName(""); string newFolder(""); if (handle > -1) { do { if (!strcmp(fd.name, ".") || !strcmp(fd.name, "..") || (fd.attrib & _A_HIDDEN)) continue; if (fd.attrib & _A_SUBDIR) { newFolder = folderName; newFolder = newFolder + fd.name; newFolder = newFolder + "\\"; ScanFolder(newFolder, bGlobal); } else { moduleName = fd.name; if(!strcmpi(PathUtil::GetExt(moduleName.c_str()), "xml")) { PathUtil::RemoveExtension(moduleName); PathUtil::MakeGamePath(folderName); // initial load: creates module, registers nodes CFlowGraphModule* pModule = PreLoadModuleFile(moduleName.c_str(), PathUtil::GetPath(folderName)+fd.name, bGlobal); // important: the module should be added using its internal name rather than the filename m_ModulesPathInfo.insert(TModulesPathInfo::value_type(pModule->GetName(), PathUtil::GetPath(folderName)+fd.name)); } } } while (pPak->FindNext(handle, &fd) >= 0); pPak->FindClose(handle); } }