本文整理汇总了C++中idCVar::ClearModified方法的典型用法代码示例。如果您正苦于以下问题:C++ idCVar::ClearModified方法的具体用法?C++ idCVar::ClearModified怎么用?C++ idCVar::ClearModified使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类idCVar
的用法示例。
在下文中一共展示了idCVar::ClearModified方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: R_CheckCvars
/*
=============
R_CheckCvars
See if some cvars that we watch have changed
=============
*/
static void R_CheckCvars() {
// gamma stuff
if ( r_gamma.IsModified() || r_brightness.IsModified() ) {
r_gamma.ClearModified();
r_brightness.ClearModified();
R_SetColorMappings();
}
// filtering
if ( r_maxAnisotropicFiltering.IsModified() || r_useTrilinearFiltering.IsModified() || r_lodBias.IsModified() ) {
idLib::Printf( "Updating texture filter parameters.\n" );
r_maxAnisotropicFiltering.ClearModified();
r_useTrilinearFiltering.ClearModified();
r_lodBias.ClearModified();
for ( int i = 0 ; i < globalImages->images.Num() ; i++ ) {
if ( globalImages->images[i] ) {
globalImages->images[i]->Bind();
globalImages->images[i]->SetTexParameters();
}
}
}
extern idCVar r_useSeamlessCubeMap;
if ( r_useSeamlessCubeMap.IsModified() ) {
r_useSeamlessCubeMap.ClearModified();
if ( glConfig.seamlessCubeMapAvailable ) {
if ( r_useSeamlessCubeMap.GetBool() ) {
qglEnable( GL_TEXTURE_CUBE_MAP_SEAMLESS );
} else {
qglDisable( GL_TEXTURE_CUBE_MAP_SEAMLESS );
}
}
}
extern idCVar r_useSRGB;
if ( r_useSRGB.IsModified() ) {
r_useSRGB.ClearModified();
if ( glConfig.sRGBFramebufferAvailable ) {
if ( r_useSRGB.GetBool() ) {
qglEnable( GL_FRAMEBUFFER_SRGB );
} else {
qglDisable( GL_FRAMEBUFFER_SRGB );
}
}
}
if ( r_multiSamples.IsModified() ) {
if ( r_multiSamples.GetInteger() > 0 ) {
qglEnable( GL_MULTISAMPLE_ARB );
} else {
qglDisable( GL_MULTISAMPLE_ARB );
}
}
// check for changes to logging state
GLimp_EnableLogging( r_logFile.GetInteger() != 0 );
}
示例2: Sys_GetConsoleKey
/*
===============
Sys_GetConsoleKey
===============
*/
unsigned char Sys_GetConsoleKey(bool shifted) {
static unsigned char keys[2] = { '`', '~' };
if (in_kbd.IsModified()) {
idStr lang = in_kbd.GetString();
if (lang.Length()) {
if (!lang.Icmp("french")) {
keys[0] = '<';
keys[1] = '>';
} else if (!lang.Icmp("german")) {
keys[0] = '^';
keys[1] = 176; // °
} else if (!lang.Icmp("italian")) {
keys[0] = '\\';
keys[1] = '|';
} else if (!lang.Icmp("spanish")) {
keys[0] = 186; // º
keys[1] = 170; // ª
} else if (!lang.Icmp("turkish")) {
keys[0] = '"';
keys[1] = 233; // é
}
}
in_kbd.ClearModified();
}
return shifted ? keys[1] : keys[0];
}
示例3: 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();
}
}
示例4: DrawModel
/*
================
idCollisionModelManagerLocal::DrawModel
================
*/
void idCollisionModelManagerLocal::DrawModel( cmHandle_t handle, const idVec3& modelOrigin, const idMat3& modelAxis,
const idVec3& viewOrigin, const float radius )
{
cm_model_t* model;
idVec3 viewPos;
if( handle < 0 && handle >= numModels )
{
return;
}
if( cm_drawColor.IsModified() )
{
sscanf( cm_drawColor.GetString(), "%f %f %f %f", &cm_color.x, &cm_color.y, &cm_color.z, &cm_color.w );
cm_drawColor.ClearModified();
}
model = models[ handle ];
viewPos = ( viewOrigin - modelOrigin ) * modelAxis.Transpose();
checkCount++;
DrawNodePolygons( model, model->node, modelOrigin, modelAxis, viewPos, radius );
}
示例5: Frame
/*
=================
idCommonLocal::Frame
=================
*/
void idCommonLocal::Frame() {
try {
SCOPED_PROFILE_EVENT( "Common::Frame" );
// This is the only place this is incremented
idLib::frameNumber++;
// allow changing SIMD usage on the fly
if ( com_forceGenericSIMD.IsModified() ) {
idSIMD::InitProcessor( "doom", com_forceGenericSIMD.GetBool() );
com_forceGenericSIMD.ClearModified();
}
// Do the actual switch between Doom 3 and the classics here so
// that things don't get confused in the middle of the frame.
PerformGameSwitch();
// pump all the events
Sys_GenerateEvents();
// write config file if anything changed
WriteConfiguration();
eventLoop->RunEventLoop();
// Activate the shell if it's been requested
if ( showShellRequested && game ) {
game->Shell_Show( true );
showShellRequested = false;
}
// if the console or another gui is down, we don't need to hold the mouse cursor
bool chatting = false;
if ( console->Active() || Dialog().IsDialogActive() || session->IsSystemUIShowing() || ( game && game->InhibitControls() && !IsPlayingDoomClassic() ) ) {
Sys_GrabMouseCursor( false );
usercmdGen->InhibitUsercmd( INHIBIT_SESSION, true );
chatting = true;
} else {
Sys_GrabMouseCursor( true );
usercmdGen->InhibitUsercmd( INHIBIT_SESSION, false );
}
const bool pauseGame = ( !mapSpawned || ( !IsMultiplayer() && ( Dialog().IsDialogPausing() || session->IsSystemUIShowing() || ( game && game->Shell_IsActive() ) ) ) ) && !IsPlayingDoomClassic();
// save the screenshot and audio from the last draw if needed
if ( aviCaptureMode ) {
idStr name = va("demos/%s/%s_%05i.tga", aviDemoShortName.c_str(), aviDemoShortName.c_str(), aviDemoFrameCount++ );
renderSystem->TakeScreenshot( com_aviDemoWidth.GetInteger(), com_aviDemoHeight.GetInteger(), name, com_aviDemoSamples.GetInteger(), NULL );
// remove any printed lines at the top before taking the screenshot
console->ClearNotifyLines();
// this will call Draw, possibly multiple times if com_aviDemoSamples is > 1
renderSystem->TakeScreenshot( com_aviDemoWidth.GetInteger(), com_aviDemoHeight.GetInteger(), name, com_aviDemoSamples.GetInteger(), NULL );
}
//--------------------------------------------
// wait for the GPU to finish drawing
//
// It is imporant to minimize the time spent between this
// section and the call to renderSystem->RenderCommandBuffers(),
// because the GPU is completely idle.
//--------------------------------------------
// this should exit right after vsync, with the GPU idle and ready to draw
// This may block if the GPU isn't finished renderng the previous frame.
frameTiming.startSyncTime = Sys_Microseconds();
const emptyCommand_t * renderCommands = NULL;
if ( com_smp.GetBool() ) {
renderCommands = renderSystem->SwapCommandBuffers( &time_frontend, &time_backend, &time_shadows, &time_gpu );
} else {
// the GPU will stay idle through command generation for minimal
// input latency
renderSystem->SwapCommandBuffers_FinishRendering( &time_frontend, &time_backend, &time_shadows, &time_gpu );
}
frameTiming.finishSyncTime = Sys_Microseconds();
//--------------------------------------------
// Determine how many game tics we are going to run,
// now that the previous frame is completely finished.
//
// It is important that any waiting on the GPU be done
// before this, or there will be a bad stuttering when
// dropping frames for performance management.
//--------------------------------------------
// input:
// thisFrameTime
// com_noSleep
// com_engineHz
// com_fixedTic
// com_deltaTimeClamp
// IsMultiplayer
//
// in/out state:
// gameFrame
//.........这里部分代码省略.........