本文整理汇总了C++中GetProfile函数的典型用法代码示例。如果您正苦于以下问题:C++ GetProfile函数的具体用法?C++ GetProfile怎么用?C++ GetProfile使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GetProfile函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AFTER_LoadScript
static void AFTER_LoadScript(KonohaContext *kctx, const char *filename)
{
int stdlog_count = 0;
if(stdlog2 != NULL) {
stdlog_count = 1;
fprintf(stdlog2, "Q.E.D.\n"); // Q.E.D.
fclose(stdlog2);
}
//if(PLATAPI exitStatus != 0) return;
if(stdlog_count != 0) {
//filename = (filename == NULL) ? "shell" : filename;
char proof_file[256];
char result_file[256];
PLATAPI snprintf_i(proof_file, sizeof(proof_file), "%s.%s_proof", filename, GetProfile());
PLATAPI snprintf_i(result_file, sizeof(result_file), "%s.%s_tested", filename, GetProfile());
FILE *fp = fopen(proof_file, "r");
if(fp == NULL) {
fprintf(stdout, "no proof file: %s\n", proof_file);
((KonohaFactory *)kctx->platApi)->exitStatus = 1;
return;
}
FILE *fp2 = fopen(result_file, "r");
DBG_ASSERT(fp2 != NULL);
int ret = check_result2(fp, fp2);
if(ret != 0) {
fprintf(stdout, "proof file mismatched: %s\n", proof_file);
((KonohaFactory *)kctx->platApi)->exitStatus = 78;
}
else {
((KonohaFactory *)kctx->platApi)->exitStatus = 0;
}
fclose(fp);
fclose(fp2);
}
}
示例2: dir
void CCSBot::Panic(CBasePlayer *pEnemy)
{
if (IsSurprised())
return;
Vector2D dir(BotCOS(pev->v_angle.y), BotSIN(pev->v_angle.y));
Vector2D perp(-dir.y, dir.x);
Vector spot;
if (GetProfile()->GetSkill() >= 0.5f)
{
Vector2D toEnemy = (pEnemy->pev->origin - pev->origin).Make2D();
toEnemy.NormalizeInPlace();
float along = DotProduct(toEnemy, dir);
float c45 = 0.7071f;
float size = 100.0f;
real_t shift = RANDOM_FLOAT(-75.0, 75.0);
if (along > c45)
{
spot.x = pev->origin.x + dir.x * size + perp.x * shift;
spot.y = pev->origin.y + dir.y * size + perp.y * shift;
}
else if (along < -c45)
{
spot.x = pev->origin.x - dir.x * size + perp.x * shift;
spot.y = pev->origin.y - dir.y * size + perp.y * shift;
}
else if (DotProduct(toEnemy, perp) > 0.0)
{
spot.x = pev->origin.x + perp.x * size + dir.x * shift;
spot.y = pev->origin.y + perp.y * size + dir.y * shift;
}
else
{
spot.x = pev->origin.x - perp.x * size + dir.x * shift;
spot.y = pev->origin.y - perp.y * size + dir.y * shift;
}
}
else
{
const float offset = 200.0f;
real_t side = RANDOM_FLOAT(-offset, offset) * 2.0f;
spot.x = pev->origin.x - dir.x * offset + perp.x * side;
spot.y = pev->origin.y - dir.y * offset + perp.y * side;
}
spot.z = pev->origin.z + RANDOM_FLOAT(-50.0, 50.0);
// we are stunned for a moment
m_surpriseDelay = RANDOM_FLOAT(0.1, 0.2);
m_surpriseTimestamp = gpGlobals->time;
SetLookAt("Panic", &spot, PRIORITY_HIGH, 0, 0, 5.0);
PrintIfWatched("Aaaah!\n");
}
示例3: SaveSettingsAsync
/*
========================
idProfileMgr::SaveSettingsAsync
========================
*/
void idProfileMgr::SaveSettingsAsync()
{
if( !saveGame_enable.GetBool() )
{
idLib::Warning( "Skipping profile save because saveGame_enable = 0" );
}
if( GetProfile() != NULL )
{
// Issue the async save...
if( profileSaveProcessor->InitSaveProfile( profile, "" ) )
{
profileSaveProcessor->AddCompletedCallback( MakeCallback( this, &idProfileMgr::OnSaveSettingsCompleted, &profileSaveProcessor->GetParmsNonConst() ) );
handle = session->GetSaveGameManager().ExecuteProcessor( profileSaveProcessor.get() );
profile->SetState( idPlayerProfile::SAVING );
}
}
else
{
idLib::Warning( "Not saving profile, profile is NULL." );
}
}
示例4: UBTAuditLog
void UBTAuditLog(const char *pzText, bool bNewLine)
{
if (g_pchLogFile == LOGGING_UNASSIGNED)
{
try
{
g_pchLogFile = (char *)GetProfile().GetString("Debug", "DebugTraceXML",false);
if (g_pchLogFile && g_pchLogFile[0])
{
// g_pchLogFile is valid and logging is turned ON
}
else
{
// Turn off logging and don't check the environment variable anymore (it's slow)
g_pchLogFile = (char *)LOGGING_OFF;
}
}
catch (GException &)
{
// If this fails once, don't try in the future
g_pchLogFile = (char *)LOGGING_OFF;
}
}
if (g_pchLogFile != LOGGING_OFF)
{
if (pzText && pzText[0])
{
GString str(pzText);
if (bNewLine)
str << "\n";
str.ToFileAppend(g_pchLogFile,0);
}
}
}
示例5: LOGTEXT
TInt CGprsQoSDGprsTsy::ExtFunc(const TTsyReqHandle aTsyReqHandle,const TInt aIpc,
const TDataPackage& aPackage)
/**
* ExtFunc is called by the server when it has an "extended", i.e. non-core ETel request
* for the TSY to process.
* A request handle, request type and request data are passed to the TSY.
*/
{
LOGTEXT(_L8("CGprsQoSDGprsTsy: ExtFunc() method"));
switch (aIpc)
{
case EPacketQoSSetProfileParams:
return SetProfile(aTsyReqHandle, aPackage.Des1n());
case EPacketQoSSetProfileParamsCancel:
return SetProfileCancel(aTsyReqHandle);
case EPacketQoSGetProfileParams:
return GetProfile(aTsyReqHandle, aPackage.Des1n());
case EPacketQoSGetProfileParamsCancel:
return GetProfileCancel(aTsyReqHandle);
case EPacketQoSNotifyProfileChanged:
return NotifyProfileChanged(aTsyReqHandle, aPackage.Des1n());
case EPacketQoSNotifyProfileChangedCancel:
return NotifyProfileChangedCancel(aTsyReqHandle);
case EPacketQoSGetProfileCaps:
return GetProfileCaps(aTsyReqHandle, aPackage.Des1n());
case EPacketQoSGetProfileCapsCancel:
return GetProfileCapsCancel(aTsyReqHandle);
default:
return KErrNotSupported;
}
}
示例6: fd
void ProfileDlg::OnExportProfile()
{
CString name;
int sel = m_profiles.GetCurSel();
if(sel<0) return;
CString tmp;
tmp.LoadString(IDS_PROFILE_FILEDIALOG);
CFileDialog fd( FALSE, _T("xpas"), name, OFN_ENABLESIZING, tmp + " (*.xpas)|*.xpas||", this);
tmp.LoadString(IDS_PROFILE_SAVE);
fd.m_ofn.lpstrTitle = tmp;
if(fd.DoModal() == IDOK)
{
CFile file(fd.GetPathName(), CFile::modeCreate|CFile::modeWrite);
m_profiles.GetLBText(sel, name);
SettingVec vec = GetProfile(name);
CArchive* ar=new CArchive(&file,CArchive::store);
for(int i=0; i<vec.size(); ++i)
{
*ar<<vec[i].settingID<<vec[i].checked;
}
ar->Close();
if(ar) delete ar;
file.Close();
}
}
示例7: GString
GProfile &GetErrorProfile()
{
if (g_strErrorFile.IsEmpty())
{
if (g_pzStaticErrMap)
{
g_strErrorFile = "Static Load";
g_pstrErrorFileContents = new GString(g_pzStaticErrMap,strlen(g_pzStaticErrMap));
}
else
{
const char *pzErrFile = GetProfile().GetString("System", "Errors", 0);
if (pzErrFile && pzErrFile[0])
{
g_pstrErrorFileContents = new GString();
if (!g_pstrErrorFileContents->FromFile(pzErrFile,0))
{
pzErrFile = 0;
}
g_strErrorFile = pzErrFile;
}
// if the error file could not be found, default to a minimal error file
if (!pzErrFile)
{
g_pstrErrorFileContents = new GString();
(*g_pstrErrorFileContents) = "[Exception]\nSubSystem=0\n[Profile]\nSubSystem=1\n0=[%s.%s]Error Description File Not loaded.\n1=[%s]Error Description File Not loaded. Call SetErrorDescriptions().\n";
g_strErrorFile = "Static";
}
}
}
static GProfile ErrorProfile(g_pstrErrorFileContents->StrVal(), (int)g_pstrErrorFileContents->Length(), 0);
return ErrorProfile;
}
示例8: CopyProfileSettings
void __stdcall CopyProfileSettings()
{
ProfileTag* p = GetProfile(g_ProfileSettings.m_Group, g_ProfileSettings.m_Profile);
ProfileTarget* t = GetProfileTarget(g_ProfileSettings.m_Group, g_ProfileSettings.m_Profile, g_ProfileSettings.m_Target);
StringCchCopy(g_enc_opt.m_Format, 64, p->m_Format);
StringCchCopy(g_enc_opt.m_Target, 64, t->m_Name);
g_enc_opt.m_VideoDisable = g_ProfileSettings.m_VCodec == -1;
g_enc_opt.m_AudioDisable = g_ProfileSettings.m_ACodec == -1;
if (g_enc_opt.m_VideoDisable == 0)
{
StringCchCopy(g_enc_opt.m_VideoCodec, 64, t->m_Video.m_Codec[g_ProfileSettings.m_VCodec].m_Codec);
g_enc_opt.m_VideoBitrate = t->m_Video.m_BitRate[g_ProfileSettings.m_VBitRate];
g_enc_opt.m_FrameNum = t->m_Video.m_FrameRate[g_ProfileSettings.m_FrameRate].m_Num;
g_enc_opt.m_FrameDen = t->m_Video.m_FrameRate[g_ProfileSettings.m_FrameRate].m_Den;
g_enc_opt.m_VideoWidth = g_ProfileSettings.m_ResCustom.m_Width;
g_enc_opt.m_VideoHeight = g_ProfileSettings.m_ResCustom.m_Height;
}
if (g_enc_opt.m_AudioDisable == 0)
{
StringCchCopy(g_enc_opt.m_AudioCodec, 64, t->m_Audio.m_Codec[g_ProfileSettings.m_ACodec].m_Codec);
g_enc_opt.m_AudioBitrate = t->m_Audio.m_BitRate[g_ProfileSettings.m_ABitRate];
g_enc_opt.m_AudioSampleRate = t->m_Audio.m_SampleRate[g_ProfileSettings.m_SampleRate];
g_enc_opt.m_AudioChannels = t->m_Audio.m_Channel[g_ProfileSettings.m_Channel];
}
}
示例9: SelectPeers
bool TunnelPool::SelectPeers (std::vector<std::shared_ptr<const i2p::data::IdentityEx> >& peers, bool isInbound)
{
if (m_ExplicitPeers) return SelectExplicitPeers (peers, isInbound);
auto prevHop = i2p::context.GetSharedRouterInfo ();
int numHops = isInbound ? m_NumInboundHops : m_NumOutboundHops;
if (i2p::transport::transports.GetNumPeers () > 25)
{
auto r = i2p::transport::transports.GetRandomPeer ();
if (r && !r->GetProfile ()->IsBad ())
{
prevHop = r;
peers.push_back (r->GetRouterIdentity ());
numHops--;
}
}
for (int i = 0; i < numHops; i++)
{
auto hop = SelectNextHop (prevHop);
if (!hop)
{
LogPrint (eLogError, "Tunnels: Can't select next hop for ", prevHop->GetIdentHashBase64 ());
return false;
}
prevHop = hop;
peers.push_back (hop->GetRouterIdentity ());
}
return true;
}
示例10: r3d_assert
int CClientUserProfile::ApiChangeBackpack(__int64 InventoryID)
{
r3d_assert(SelectedCharID >= 0 && SelectedCharID < wiUserProfile::MAX_LOADOUT_SLOTS);
wiCharDataFull& w = ProfileData.ArmorySlots[SelectedCharID];
r3d_assert(w.LoadoutID > 0);
// no need to validate InventoryID - server will do that
char strInventoryID[128];
sprintf(strInventoryID, "%I64d", InventoryID);
CWOBackendReq req(this, "api_CharBackpack.aspx");
req.AddParam("CharID", w.LoadoutID);
req.AddParam("op", 16); // inventory operation code
req.AddParam("v1", strInventoryID); // value 1
req.AddParam("v2", 0);
req.AddParam("v3", 0);
if(!req.Issue())
{
r3dOutToLog("ApiChangeBackpack failed: %d", req.resultCode_);
return req.resultCode_;
}
// reread profile, as inventory/backpack is changed
GetProfile();
return 0;
}
示例11: UBTAuditLogIsEnabled
bool UBTAuditLogIsEnabled()
{
if (g_pchLogFile == LOGGING_OFF)
return false;
if (g_pchLogFile == LOGGING_UNASSIGNED)
{
try
{
g_pchLogFile = (char *)GetProfile().GetString("Debug", "DebugTraceXML",false);
if (g_pchLogFile && g_pchLogFile[0])
{
// g_pchLogFile is valid and logging is turned ON
}
else
{
// Turn off logging and don't check the environment variable anymore (it's slow)
g_pchLogFile = (char *)LOGGING_OFF;
}
}
catch (GException &)
{
}
}
if (g_pchLogFile == (char *)LOGGING_OFF)
return false;
return true;
}
示例12: while
void EffectNoiseRemoval::ProcessSamples(sampleCount len, float *buffer)
{
int i;
while(len && mOutSampleCount < mInSampleCount) {
int avail = wxMin(len, mWindowSize - mInputPos);
for(i = 0; i < avail; i++)
mInWaveBuffer[mInputPos + i] = buffer[i];
buffer += avail;
len -= avail;
mInputPos += avail;
if (mInputPos == mWindowSize) {
FillFirstHistoryWindow();
if (mDoProfile)
GetProfile();
else
RemoveNoise();
RotateHistoryWindows();
// Rotate halfway for overlap-add
for(i = 0; i < mWindowSize / 2; i++) {
mInWaveBuffer[i] = mInWaveBuffer[i + mWindowSize / 2];
}
mInputPos = mWindowSize / 2;
}
}
}
示例13: RandomFloat
/**
* Prepare bot for action
*/
bool CCFBot::Initialize( const BotProfile *profile, int team )
{
// extend
BaseClass::Initialize( profile, team );
// CF bot initialization
m_diedLastRound = false;
m_morale = POSITIVE; // starting a new round makes everyone a little happy
m_combatRange = RandomFloat( 325.0f, 425.0f );
// set initial safe time guess for this map
m_safeTime = 15.0f + 5.0f * GetProfile()->GetAggression();
m_name[0] = '\000';
ResetValues();
m_desiredTeam = team;
if (GetTeamNumber() <= LAST_SHARED_TEAM)
{
ChangeTeam(m_desiredTeam);
}
Buy();
return true;
}
示例14: GetProfile
/*
========================
idLocalUser::SetStatFloat
========================
*/
void idLocalUser::SetStatFloat( int s, float v )
{
idPlayerProfile* profile = GetProfile();
if( profile != NULL )
{
return profile->StatSetFloat( s, v );
}
}
示例15: SetSourceCode
void FragmentShaderCg::RestoreDeviceData(uint8 **ppBackup)
{
// Restore data
if (*ppBackup) {
// The string class takes over the control of the string memory and also deletes it
SetSourceCode(String(reinterpret_cast<char*>(*ppBackup), false), GetProfile(), m_sArguments, m_sEntry);
}
}