本文整理汇总了C++中idCVar::GetInteger方法的典型用法代码示例。如果您正苦于以下问题:C++ idCVar::GetInteger方法的具体用法?C++ idCVar::GetInteger怎么用?C++ idCVar::GetInteger使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类idCVar
的用法示例。
在下文中一共展示了idCVar::GetInteger方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Init
/*
========================
idParallelJobManagerLocal::Init
========================
*/
void idParallelJobManagerLocal::Init()
{
// on consoles this will have specific cores for the threads, but on PC they will all be CORE_ANY
core_t cores[] = JOB_THREAD_CORES;
assert( sizeof( cores ) / sizeof( cores[0] ) >= MAX_JOB_THREADS );
for( int i = 0; i < MAX_JOB_THREADS; i++ )
{
threads[i].Start( cores[i], i );
}
maxThreads = jobs_numThreads.GetInteger();
Sys_CPUCount( numPhysicalCpuCores, numLogicalCpuCores, numCpuPackages );
}
示例2: RecordPlayback
void idGameEdit::RecordPlayback( const usercmd_t &cmd, idEntity *source )
{
// Not recording - so instantly exit
if( !g_recordPlayback.GetInteger() && !gamePlayback )
{
return;
}
if( !gamePlayback )
{
gamePlayback = new rvGamePlayback();
}
if( g_recordPlayback.GetInteger() )
{
gamePlayback->RecordData( cmd, source );
}
else
{
delete gamePlayback;
gamePlayback = NULL;
}
}
示例3: GetCurrentResolutionScale
/*
========================
idResolutionScale::GetCurrentResolutionScale
========================
*/
void idResolutionScale::GetCurrentResolutionScale( float& x, float& y )
{
assert( currentResolution >= MINIMUM_RESOLUTION_SCALE );
assert( currentResolution <= MAXIMUM_RESOLUTION_SCALE );
x = MAXIMUM_RESOLUTION_SCALE;
y = MAXIMUM_RESOLUTION_SCALE;
// foresthale 2014-05-28: don't allow resolution scaling with editors, we don't really care about framerate and we don't refresh constantly anyway
if (com_editors)
return;
switch( rs_enable.GetInteger() )
{
case 0:
return;
case 1:
x = currentResolution;
break;
case 2:
y = currentResolution;
break;
case 3:
{
const float middle = ( MINIMUM_RESOLUTION_SCALE + MAXIMUM_RESOLUTION_SCALE ) * 0.5f;
if( currentResolution >= middle )
{
// First scale horizontally from max to min
x = MINIMUM_RESOLUTION_SCALE + ( currentResolution - middle ) * 2.0f;
}
else
{
// Then scale vertically from max to min
x = MINIMUM_RESOLUTION_SCALE;
y = MINIMUM_RESOLUTION_SCALE + ( currentResolution - MINIMUM_RESOLUTION_SCALE ) * 2.0f;
}
break;
}
}
float forceFrac = rs_forceFractionX.GetFloat();
if( forceFrac > 0.0f && forceFrac <= MAXIMUM_RESOLUTION_SCALE )
{
x = forceFrac;
}
forceFrac = rs_forceFractionY.GetFloat();
if( forceFrac > 0.0f && forceFrac <= MAXIMUM_RESOLUTION_SCALE )
{
y = forceFrac;
}
}
示例4: GetConnectInfo
/*
========================
idLobbyBackendDirect::GetConnectInfo
========================
*/
lobbyConnectInfo_t idLobbyBackendDirect::GetConnectInfo() {
lobbyConnectInfo_t connectInfo;
// If we aren't the host, this lobby should have been joined through JoinFromConnectInfo
if ( IsHost() ) {
// If we are the host, give them our ip address
const char * ip = Sys_GetLocalIP( 0 );
Sys_StringToNetAdr( ip, &address, false );
address.port = net_port.GetInteger();
}
connectInfo.netAddr = address;
return connectInfo;
}
示例5: ReceiveAndPlayVoiceData
void idMultiplayerGame::ReceiveAndPlayVoiceData( const idBitMsg &inMsg )
{
int clientNum;
if( !gameLocal.serverInfo.GetBool( "si_voiceChat" ) )
{
return;
}
clientNum = inMsg.ReadByte();
soundSystem->PlayVoiceData( clientNum, inMsg.GetReadData(), inMsg.GetRemainingData() );
if( g_voiceChatDebug.GetInteger() & 4 )
{
common->Printf( "VC: Playing %d bytes\n", inMsg.GetRemainingData() );
}
}
示例6: JoinFromConnectInfo
/*
========================
idLobbyBackendDirect::JoinFromConnectInfo
========================
*/
void idLobbyBackendDirect::JoinFromConnectInfo( const lobbyConnectInfo_t& connectInfo )
{
if( lobbyToSessionCB->CanJoinLocalHost() )
{
Sys_StringToNetAdr( "localhost", &address, true );
address.port = net_port.GetInteger();
}
else
{
address = connectInfo.netAddr;
}
state = STATE_READY;
isLocal = false;
isHost = false;
}
示例7: GetCurrentResolutionScale
/*
========================
idResolutionScale::GetCurrentResolutionScale
========================
*/
void idResolutionScale::GetCurrentResolutionScale( float& x, float& y )
{
assert( currentResolution >= MINIMUM_RESOLUTION_SCALE );
assert( currentResolution <= MAXIMUM_RESOLUTION_SCALE );
x = MAXIMUM_RESOLUTION_SCALE;
y = MAXIMUM_RESOLUTION_SCALE;
switch( rs_enable.GetInteger() )
{
case 0:
return;
case 1:
x = currentResolution;
break;
case 2:
y = currentResolution;
break;
case 3:
{
const float middle = ( MINIMUM_RESOLUTION_SCALE + MAXIMUM_RESOLUTION_SCALE ) * 0.5f;
if( currentResolution >= middle )
{
// First scale horizontally from max to min
x = MINIMUM_RESOLUTION_SCALE + ( currentResolution - middle ) * 2.0f;
}
else
{
// Then scale vertically from max to min
x = MINIMUM_RESOLUTION_SCALE;
y = MINIMUM_RESOLUTION_SCALE + ( currentResolution - MINIMUM_RESOLUTION_SCALE ) * 2.0f;
}
break;
}
}
float forceFrac = rs_forceFractionX.GetFloat();
if( forceFrac > 0.0f && forceFrac <= MAXIMUM_RESOLUTION_SCALE )
{
x = forceFrac;
}
forceFrac = rs_forceFractionY.GetFloat();
if( forceFrac > 0.0f && forceFrac <= MAXIMUM_RESOLUTION_SCALE )
{
y = forceFrac;
}
}
示例8: CreateOpenGLContextOnDC
static HGLRC CreateOpenGLContextOnDC( const HDC hdc, const bool debugContext ) {
HGLRC m_hrc = NULL;
int useOpenGL32 = r_useOpenGL32.GetInteger();
for ( int i = 0; i < 2; i++ ) {
const int glMajorVersion = ( useOpenGL32 != 0 ) ? 3 : 2;
const int glMinorVersion = ( useOpenGL32 != 0 ) ? 2 : 0;
const int glDebugFlag = debugContext ? WGL_CONTEXT_DEBUG_BIT_ARB : 0;
const int glProfileMask = ( useOpenGL32 != 0 ) ? WGL_CONTEXT_PROFILE_MASK_ARB : 0;
const int glProfile = ( useOpenGL32 == 1 ) ? WGL_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB : ( ( useOpenGL32 == 2 ) ? WGL_CONTEXT_CORE_PROFILE_BIT_ARB : 0 );
const int attribs[] =
{
WGL_CONTEXT_MAJOR_VERSION_ARB, glMajorVersion,
WGL_CONTEXT_MINOR_VERSION_ARB, glMinorVersion,
WGL_CONTEXT_FLAGS_ARB, glDebugFlag,
glProfileMask, glProfile,
0
};
m_hrc = wglCreateContextAttribsARB( hdc, 0, attribs );
if ( m_hrc != NULL ) {
idLib::Printf( "created OpenGL %d.%d context\n", glMajorVersion, glMinorVersion );
break;
}
idLib::Printf( "failed to create OpenGL %d.%d context\n", glMajorVersion, glMinorVersion );
useOpenGL32 = 0; // fall back to OpenGL 2.0
}
if ( m_hrc == NULL ) {
int err = GetLastError();
switch( err ) {
case ERROR_INVALID_VERSION_ARB:
idLib::Printf( "ERROR_INVALID_VERSION_ARB\n" );
break;
case ERROR_INVALID_PROFILE_ARB:
idLib::Printf( "ERROR_INVALID_PROFILE_ARB\n" );
break;
default:
idLib::Printf( "unknown error: 0x%x\n", err );
break;
}
}
return m_hrc;
}
示例9: UnPause
/*
========================
idSoundWorldLocal::UnPause
========================
*/
void idSoundWorldLocal::UnPause() {
if ( isPaused ) {
isPaused = false;
accumulatedPauseTime += soundSystemLocal.SoundTime() - pausedTime;
pauseFade.SetVolume( DB_SILENCE );
pauseFade.Fade( 0.0f, s_unpauseFadeInTime.GetInteger(), GetSoundTime() );
// just unpause all unmutable voices (normally just voice overs)
for ( int e = emitters.Num() - 1; e > 0; e-- ) {
for ( int i = 0; i < emitters[e]->channels.Num(); i++ ) {
idSoundChannel * channel = emitters[e]->channels[i];
if ( !channel->CanMute() && channel->hardwareVoice != NULL ) {
channel->hardwareVoice->UnPause();
}
}
}
}
}
示例10: Submit
/*
========================
idParallelJobManagerLocal::Submit
========================
*/
void idParallelJobManagerLocal::Submit( idParallelJobList_Threads* jobList, int parallelism )
{
if( jobs_numThreads.IsModified() )
{
maxThreads = idMath::ClampInt( 0, MAX_JOB_THREADS, jobs_numThreads.GetInteger() );
jobs_numThreads.ClearModified();
}
// determine the number of threads to use
int numThreads = maxThreads;
if( parallelism == JOBLIST_PARALLELISM_DEFAULT )
{
numThreads = maxThreads;
}
else if( parallelism == JOBLIST_PARALLELISM_MAX_CORES )
{
numThreads = numLogicalCpuCores;
}
else if( parallelism == JOBLIST_PARALLELISM_MAX_THREADS )
{
numThreads = MAX_JOB_THREADS;
}
else if( parallelism > MAX_JOB_THREADS )
{
numThreads = MAX_JOB_THREADS;
}
else
{
numThreads = parallelism;
}
if( numThreads <= 0 )
{
threadJobListState_t state( jobList->GetVersion() );
jobList->RunJobs( 0, state, false );
return;
}
for( int i = 0; i < numThreads; i++ )
{
threads[i].AddJobList( jobList );
threads[i].SignalWork();
}
}
示例11: JoinFromConnectInfo
/*
========================
idLobbyBackendDirect::JoinFromConnectInfo
========================
*/
void idLobbyBackendDirect::JoinFromConnectInfo( const lobbyConnectInfo_t& connectInfo )
{
if( lobbyToSessionCB->CanJoinLocalHost() )
{
// TODO: "CanJoinLocalHost" == *must* join LocalHost ?!
Sys_StringToNetAdr( "localhost", &address, true );
address.port = net_port.GetInteger();
NET_VERBOSE_PRINT( "NET: idLobbyBackendDirect::JoinFromConnectInfo(): canJoinLocalHost\n" );
}
else
{
address = connectInfo.netAddr;
NET_VERBOSE_PRINT( "NET: idLobbyBackendDirect::JoinFromConnectInfo(): %s\n", Sys_NetAdrToString( address ) );
}
state = STATE_READY;
isLocal = false;
isHost = false;
}
示例12: UpdateSubtitle
/*
==============================================
idSWFTextInstance::UpdateSubtitle
==============================================
*/
bool idSWFTextInstance::UpdateSubtitle( int time ) {
if ( subForceKillQueued ) {
subForceKillQueued = false;
subForceKill = true;
subKillTimeDelay = time + swf_subtitleExtraTime.GetInteger();
}
if ( subUpdating && !subForceKill ) {
if ( ( time >= subSwitchTime && !subNeedsSwitch ) || ( !subNeedsSwitch && subInitialLine ) ) {
//idLib::Printf( "SWITCH TIME %d / %d \n", time, subSwitchTime );
if ( subInitialLine && subtitleTimingInfo.Num() > 0 ) {
if ( subStartTime == -1 ) {
subStartTime = time - 600;
}
if ( time < subStartTime + subtitleTimingInfo[0].startTime ) {
return true;
} else {
text = subtitleText;//subtitleText = "";
subInitialLine = false;
}
}
if ( subNextStartIndex + 1 >= text.Length( ) ) {
subForceKillQueued = true;
} else {
subCharStartIndex = subNextStartIndex;
//subtitleText.CopyRange( text, subCharStartIndex, subCharEndIndex );
subNeedsSwitch = true;
}
}
}
if ( subForceKill ) {
if ( time >= subKillTimeDelay ) {
subForceKill = false;
return false;
}
}
return true;
}
示例13:
/*
========================
idMenuScreen_Shell_SystemOptions::idMenuDataSource_SystemSettings::IsRestartRequired
========================
*/
bool idMenuScreen_Shell_SystemOptions::idMenuDataSource_SystemSettings::IsRestartRequired() const
{
if( originalAntialias != r_antiAliasing.GetInteger() )
{
return true;
}
if( originalFramerate != com_engineHz.GetInteger() )
{
return true;
}
if( originalShadowMapping != r_useShadowMapping.GetInteger() )
{
return true;
}
return false;
}
示例14: SendSnapshots
/*
===============
idCommonLocal::SendSnapshots
===============
*/
void idCommonLocal::SendSnapshots() {
if ( !mapSpawned ) {
return;
}
int currentTime = Sys_Milliseconds();
if ( currentTime < nextSnapshotSendTime ) {
return;
}
idLobbyBase & lobby = session->GetActingGameStateLobbyBase();
if ( !lobby.IsHost() ) {
return;
}
if ( !lobby.HasActivePeers() ) {
return;
}
idSnapShot ss;
game->ServerWriteSnapshot( ss );
session->SendSnapshot( ss );
nextSnapshotSendTime = MSEC_ALIGN_TO_FRAME( currentTime + net_snapRate.GetInteger() );
}
示例15: va
/*
========================
idMenuScreen_Shell_SystemOptions::idMenuDataSource_SystemSettings::GetField
========================
*/
idSWFScriptVar idMenuScreen_Shell_SystemOptions::idMenuDataSource_SystemSettings::GetField( const int fieldIndex ) const {
switch ( fieldIndex ) {
case SYSTEM_FIELD_FULLSCREEN: {
const int fullscreen = r_fullscreen.GetInteger();
const int vidmode = r_vidMode.GetInteger();
if ( fullscreen == 0 ) {
return "#str_swf_disabled";
}
if ( fullscreen < 0 || vidmode < 0 || vidmode >= modeList.Num() ) {
return "???";
}
if ( modeList[vidmode].displayHz == 60 ) {
return va( "%4i x %4i", modeList[vidmode].width, modeList[vidmode].height );
} else {
return va( "%4i x %4i @ %dhz", modeList[vidmode].width, modeList[vidmode].height, modeList[vidmode].displayHz );
}
}
case SYSTEM_FIELD_FRAMERATE:
return va( "%d FPS", com_engineHz.GetInteger() );
case SYSTEM_FIELD_VSYNC:
if ( r_swapInterval.GetInteger() == 1 ) {
return "#str_swf_smart";
} else if ( r_swapInterval.GetInteger() == 2 ) {
return "#str_swf_enabled";
} else {
return "#str_swf_disabled";
}
case SYSTEM_FIELD_ANTIALIASING:
if ( r_multiSamples.GetInteger() == 0 ) {
return "#str_swf_disabled";
}
return va( "%dx", r_multiSamples.GetInteger() );
case SYSTEM_FIELD_MOTIONBLUR:
if ( r_motionBlur.GetInteger() == 0 ) {
return "#str_swf_disabled";
}
return va( "%dx", idMath::IPow( 2, r_motionBlur.GetInteger() ) );
case SYSTEM_FIELD_LODBIAS:
return LinearAdjust( r_lodBias.GetFloat(), -1.0f, 1.0f, 0.0f, 100.0f );
case SYSTEM_FIELD_BRIGHTNESS:
return LinearAdjust( r_lightScale.GetFloat(), 2.0f, 4.0f, 0.0f, 100.0f );
case SYSTEM_FIELD_VOLUME: {
return 100.0f * Square( 1.0f - ( s_volume_dB.GetFloat() / DB_SILENCE ) );
}
}
return false;
}