本文整理匯總了C++中Deactivate函數的典型用法代碼示例。如果您正苦於以下問題:C++ Deactivate函數的具體用法?C++ Deactivate怎麽用?C++ Deactivate使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了Deactivate函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: Deactivate
int Menu_LightEditor::Update()
{
if (LightObject && (PrevLightObject != LightObject))
{
PrevLightObject = LightObject;
obj_LampBulb *L = (obj_LampBulb *)LightObject;
Light_R = (float)L->Color.R;
Light_G = (float)L->Color.G;
Light_B = (float)L->Color.B;
Light_Radius = L->Radius;
}
// NOTE: process all logic (button clicks & keyboard) here
// if Update() return 0 - menu will become inactive in floating menu manager
if (!bLightEditorActive)
{
Deactivate();
layerVisible = false;
return 0;
}
switch(released_id)
{
case bClose:
Deactivate();
layerVisible = false;
bLightEditorActive = 0;
return 0;
case bButton1:
{
FILE *f;
char FName[256];
sprintf(FName,"Levels\\%s\\Light.dat", MissionInfo.MissionDir);
f = fopen(FName, "wt");
for(const GameObject* obj = GameWorld.GetFirstObject(); obj; obj = GameWorld.GetNextObject(obj))
{
if(obj->Class->Name == "obj_LampBulb")
{
obj_LampBulb *L = (obj_LampBulb *)obj;
fprintf(f,"%d %d %d %d %d %d %d\n", int(L->Position.X), int(L->Position.Y), int(L->Position.Z),
L->Color.R, L->Color.G, L->Color.B, int(L->Radius));
}
}
fclose (f);
}
break;
}
return 1;
}
示例2: NewNode
void APathFollower::Tick ()
{
if (!bActive)
return;
if (bJustStepped)
{
bJustStepped = false;
if (CurrNode->args[2])
{
HoldTime = gametic + CurrNode->args[2] * TICRATE / 8;
x = CurrNode->x;
y = CurrNode->y;
z = CurrNode->z;
}
}
if (HoldTime > gametic)
return;
// Splines must have a previous node.
if (PrevNode == NULL && !(args[2] & 1))
{
bActive = false;
return;
}
// All paths must have a current node.
if (CurrNode->Next == NULL)
{
bActive = false;
return;
}
if (Interpolate ())
{
Time += 8.f / ((float)CurrNode->args[1] * (float)TICRATE);
if (Time > 1.f)
{
Time -= 1.f;
bJustStepped = true;
PrevNode = CurrNode;
CurrNode = CurrNode->Next;
if (CurrNode != NULL)
NewNode ();
if (CurrNode == NULL || CurrNode->Next == NULL)
Deactivate (this);
if ((args[2] & 1) == 0 && CurrNode->Next->Next == NULL)
Deactivate (this);
}
}
}
示例3: Deactivate
void Resource::Set(unsigned int aSourceId, float aValue)
{
const ResourceTemplate &resource = Database::resourcetemplate.Get(mId).Get(mSubId);
// if empty...
if (aValue <= 0)
{
aValue = 0;
// notify all empty listeners
Database::resourceempty.Get(mId).Get(mSubId)(mId, mSubId, aSourceId);
if (resource.mAdd < 0)
Deactivate();
}
// if full...
if (aValue >= resource.mMaximum)
{
aValue = resource.mMaximum;
// notify all full listeners
Database::resourcefull.Get(mId).Get(mSubId)(mId, mSubId, aSourceId);
if (resource.mAdd > 0)
Deactivate();
}
if (mValue != aValue)
{
// if something dropped the value...
if ((mValue - aValue) * (resource.mAdd) > 0)
{
// reset timer
mTimer = Database::resourcetemplate.Get(mId).Get(mSubId).mDelay;
Activate();
}
#ifdef DEBUG_RESOURCE
DebugPrint("\"%s\" resource=\"%s\" value=%f->%f\n", Database::name.Get(mId).c_str(), Database::name.Get(mSubId).c_str(), mValue, aValue);
#endif
// update the value
mValue = aValue;
// notify all change listeners
Database::resourcechange.Get(mId).Get(mSubId)(mId, mSubId, aSourceId, aValue);
}
}
示例4: switch
void AndroidEventLoop::ProcessAppEvent(int32_t pCommand)
{
switch (pCommand)
{
case APP_CMD_CONFIG_CHANGED:
m_pActivityHandler->onConfigurationChanged();
break;
case APP_CMD_INIT_WINDOW:
m_pActivityHandler->onCreateWindow();
break;
case APP_CMD_DESTROY:
m_pActivityHandler->onDestroy();
break;
case APP_CMD_GAINED_FOCUS:
Activate();
m_pActivityHandler->onGainFocus();
break;
case APP_CMD_LOST_FOCUS:
m_pActivityHandler->onLostFocus();
Deactivate();
break;
case APP_CMD_LOW_MEMORY:
m_pActivityHandler->onLowMemory();
break;
case APP_CMD_PAUSE:
m_pActivityHandler->onPause();
Deactivate();
break;
case APP_CMD_RESUME:
m_pActivityHandler->onResume();
break;
case APP_CMD_SAVE_STATE:
m_pActivityHandler->onSaveState(&Global::pAndroidApp->savedState,
&Global::pAndroidApp->savedStateSize);
break;
case APP_CMD_START:
m_pActivityHandler->onStart();
break;
case APP_CMD_STOP:
m_pActivityHandler->onStop();
break;
case APP_CMD_TERM_WINDOW:
m_pActivityHandler->onDestroyWindow();
Deactivate();
break;
default:
break;
}
}
示例5: Deactivate
void Turret::HandleDeactivateMsg( HOBJECT hSender, const CParsedMsg &crParsedMsg )
{
if( IsInUse( ))
{
Deactivate( );
}
}
示例6: Deactivate
void
GAddressBookTreeDir::Receive
(
JBroadcaster* sender,
const Message& message
)
{
if (sender == itsCloseButton && message.Is(JXButton::kPushed))
{
Deactivate();
}
else if (sender == itsTimerTask && message.Is(JXTimerTask::kTimerWentOff))
{
itsWidget->Update();
}
else if (sender == itsHelpMenu && message.Is(JXMenu::kItemSelected))
{
const JXMenu::ItemSelected* selection =
dynamic_cast<const JXMenu::ItemSelected*>(&message);
assert( selection != NULL );
HandleHelpMenu(selection->GetIndex());
}
else
{
GMManagedDirector::Receive(sender, message);
}
}
示例7: Deactivate
//-----------------------------------------------------------------------------
// Destructor
//-----------------------------------------------------------------------------
CPhysicObjSimple::~CPhysicObjSimple (void)
{
if ( IsActivated() )
{
Deactivate();
}
}
示例8: ATLTRACE
LRESULT
CContextSamplePropPage::OnInitDialog( UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled )
{
ATLTRACE( "== CContextSamplePropPage::OnInitDialog\n" );
EnableThemeDialogTexture( m_hWnd, ETDT_ENABLETAB );
HRESULT hr = S_OK;
m_fInitializing = TRUE;
hr = Connect();
if ( FAILED( hr ) )
{
MessageBox( IDS_SERVER_CONNECT_ERROR );
Deactivate();
return( m_fInitializing = FALSE );
}
hr = GetPluginSetting();
if( SUCCEEDED( hr ) )
{
hr = PopulateControls();
}
return( m_fInitializing = FALSE );
} //end of OnInitDialog.
示例9: Deactivate
CSnowFXAirspace::~CSnowFXAirspace()
{
Deactivate();
if( m_Effect )
m_Parent->m_pClientDE->RemoveObject( m_Effect );
}
示例10: Deactivate
void CPHCapture::RemoveConnection(IPhysicsShellHolder* O)
{
if( m_taget_object==O )
{
Deactivate();
}
}
示例11: UnMapSharedbuffers
vncVideoDriver::~vncVideoDriver()
{
UnMapSharedbuffers();
Deactivate();
_ASSERTE(!m_fIsActive);
_ASSERTE(!m_fDirectAccessInEffect);
}
示例12: Deactivate
void CPlayAreaEntity::Destroy()
{
Deactivate();
m_dRTRadius=0;
m_EntityType.Detach();
CPlayAreaElementBase::Destroy();
}
示例13: Deactivate
//
// IFVar::Done
//
// Release the memory used by the var
//
void IFaceVar::Done()
{
// Dipose of var pointer
if (varPtr)
{
Deactivate();
switch (varType)
{
case VarSys::VI_INTEGER:
{
delete varInteger;
varInteger = NULL;
break;
}
case VarSys::VI_FPOINT:
{
delete varFloat;
varFloat = NULL;
break;
}
case VarSys::VI_STRING:
{
delete varString;
varString = NULL;
break;
}
}
varPtr = NULL;
}
}
示例14: Update
void Update(float aStep)
{
if (Capturable *capturable =Database::capturable.Get(mId))
capturable->Capture();
Deactivate();
delete this;
}
示例15: Deactivate
void CSoundAnimationObject::CheckActivation(unsigned int dwCurrentTime)
{
unsigned int dwRelativeTime=dwCurrentTime-m_piAnimation->GetCurrentTimeBase();
if(m_piSound==NULL)
{
if(m_pType->m_SoundType.m_piSoundType && dwRelativeTime>=m_pType->m_nStartTime)
{
m_piSound=m_pType->m_SoundType.m_piSoundType->CreateInstance();
if(m_piSound)
{
m_piSound->SetVolume(m_pType->m_dVolume);
m_piSound->SetLoop(m_pType->m_bLoop);
m_piSound->Play();
}
}
}
else
{
if(m_pType->m_SoundType.m_piSoundType && m_pType->m_nEndTime && dwRelativeTime>=m_pType->m_nEndTime)
{
if(m_piSound){m_piSound->Stop();}
Deactivate();
}
}
}