本文整理匯總了C++中EnableUpdate函數的典型用法代碼示例。如果您正苦於以下問題:C++ EnableUpdate函數的具體用法?C++ EnableUpdate怎麽用?C++ EnableUpdate使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了EnableUpdate函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: NetStartFire
void CWeapon::NetUpdateFireMode(SEntityUpdateContext& ctx)
{
// CGunTurret and CVehicleWeapon overide NetAllowUpdate to perform their own checks.
if(NetAllowUpdate(true))
{
m_netNextShot -= ctx.fFrameTime;
if(IsReloading())
return; // reloading, bail
if((!m_isFiringStarted) && (m_isFiring || m_shootCounter > 0))
{
m_isFiringStarted = true;
m_netNextShot = 0.f;
NetStartFire();
EnableUpdate(true, eIUS_FireMode);
}
if(m_fm)
{
if(m_shootCounter > 0 && m_netNextShot <= 0.0f)
{
// Aside from the prediction handle, needed for the server, NetShoot/Ex parameters
// are no longer used, these will need removing when the client->server RMI's are tided up
m_fm->NetShoot(Vec3(0.f, 0.f, 0.f), 0);
m_shootCounter--;
//if fireRate == 0.0f, set m_netNextShot to 0.0f, otherwise increment by 60.f / fireRate.
// fres used to avoid microcoded instructions, fsel to avoid branching - Rich S
const float fRawFireRate = m_fm->GetFireRate();
const float fFireRateSelect = -fabsf(fRawFireRate);
const float fFireRateForDiv = (float)__fsel(fFireRateSelect, 1.0f, fRawFireRate);
const float fNextShot = (float)__fsel(fFireRateSelect, 0.0f, m_netNextShot + (60.f * __fres(fFireRateForDiv)));
m_netNextShot = fNextShot;
}
}
if(m_isFiringStarted && !m_isFiring && m_shootCounter <= 0)
{
m_isFiringStarted = false;
NetStopFire();
EnableUpdate(false, eIUS_FireMode);
}
// this needs to happen here, or NetStopFire interrupts the animation
if(m_doMelee && m_melee)
{
m_melee->NetAttack();
m_doMelee= false;
}
}
}
示例2: UpdateOriginAxes
//------------------------------------------------------------------------------
// void OnComboBoxChange()
//------------------------------------------------------------------------------
void BurnThrusterPanel::OnComboBoxChange(wxCommandEvent &event)
{
if (event.GetEventObject() == coordSysComboBox)
{
UpdateOriginAxes();
isCoordSysChanged = true;
coordSysName = coordSysComboBox->GetStringSelection().c_str();
EnableUpdate(true);
}
else if (event.GetEventObject() == tankComboBox)
{
isTankChanged = true;
tankName = tankComboBox->GetStringSelection().WX_TO_STD_STRING;
if (tankName == "No Fuel Tank Selected")
tankName = "";
// remove "No Tank Selected" once tank is selected
int pos = tankComboBox->FindString("No Fuel Tank Selected");
if (pos != wxNOT_FOUND)
tankComboBox->Delete(pos);
EnableUpdate(true);
}
else if (event.GetEventObject() == axesComboBox)
{
std::string csName = coordSysComboBox->GetStringSelection().WX_TO_STD_STRING;
if (csName == "Local")
{
std::string axisValue = axesComboBox->GetValue().WX_TO_STD_STRING;
if ((axisValue == "MJ2000Eq") || (axisValue == "SpacecraftBody"))
{
originLabel->Disable();
originComboBox->Disable();
}
else
{
originLabel->Enable();
originComboBox->Enable();
}
}
}
// thrustModelCB will be NULL if the thruster is not Electric
else if (event.GetEventObject() == thrustModelCB)
{
thrustModel = thrustModelCB->GetStringSelection().c_str();
EnableDataForThrustModel(thrustModel);
isThrustModelChanged = true;
EnableUpdate(true);
}
}
示例3: if
//------------------------------------------------------------------------------
// void OnComboBoxChange(wxCommandEvent& event)
//------------------------------------------------------------------------------
void GroundTrackPlotPanel::OnComboBoxChange(wxCommandEvent& event)
{
if (event.GetEventObject() == mSolverIterComboBox)
{
mHasDataOptionChanged = true;
}
else if (event.GetEventObject() == mCentralBodyComboBox)
{
mHasCentralBodyChanged = true;
wxString bodyTexture;
if (mCentralBodyComboBox->GetValue() == mCentralBody)
{
bodyTexture = mTextureFile;
}
else
{
// Update texture map to corresponding body
CelestialBody *body = (CelestialBody*)
theGuiInterpreter->GetConfiguredObject(mCentralBodyComboBox->GetValue().c_str());
Integer id = body->GetParameterID("TextureMapFileName");
bodyTexture = body->GetStringParameter(id).c_str();
}
#ifdef DEBUG_CENTRAL_BODY
MessageInterface::ShowMessage
("OnComboBoxChange(), bodyTexture = '%s'\n", bodyTexture.c_str());
#endif
mTextureMapTextCtrl->SetValue(bodyTexture);
mTextureMapTextCtrl->SetInsertionPointEnd();
}
EnableUpdate(true);
}
示例4: SetActionSuffix
//------------------------------------------------------------------------
void CFists::Select(bool select)
{
CWeapon::Select(select);
SetActionSuffix("");
if(select)
{
EnableUpdate(true, eIUS_General);
RequestAnimState(eFAS_FIGHT);
}
else
{
EnableUpdate(false, eIUS_General);
RequestAnimState(eFAS_NOSTATE);
}
}
示例5: assert
//------------------------------------------------------------------------
void CVehicleWeapon::StartUse(EntityId userId)
{
if (m_ownerId && userId != m_ownerId)
return;
if (GetEntity()->GetParent())
{
m_pVehicle = gEnv->pGame->GetIGameFramework()->GetIVehicleSystem()->GetVehicle(GetEntity()->GetParent()->GetId());
assert(m_pVehicle && "Using VehicleWeapons on non-vehicles may lead to unexpected behavior.");
if (m_pVehicle)
{
m_pPart = m_pVehicle->GetWeaponParentPart(GetEntityId());
m_pOwnerSeat = m_pVehicle->GetWeaponParentSeat(GetEntityId());
m_pSeatUser = m_pVehicle->GetSeatForPassenger(userId);
}
}
SetOwnerId(userId);
Select(true);
m_stats.used = true;
EnableUpdate(true, eIUS_General);
RequireUpdate(eIUS_General);
if (OutOfAmmo(false))
Reload(false);
UseManualBlending(true);
LowerWeapon(false);
SendMusicLogicEvent(eMUSICLOGICEVENT_WEAPON_MOUNT);
}
示例6: EnableUpdate
//------------------------------------------------------------------------------
// void SaveData()
//------------------------------------------------------------------------------
void TargetPanel::SaveData()
{
try
{
std::string solverName = mSolverComboBox->GetValue().WX_TO_STD_STRING;
std::string solverMode = mSolverModeComboBox->GetValue().WX_TO_STD_STRING;
std::string exitMode = mExitModeComboBox->GetValue().WX_TO_STD_STRING;
theCommand->SetStringParameter(theCommand->GetParameterID("Targeter"),
solverName);
theCommand->SetStringParameter(theCommand->GetParameterID("SolveMode"),
solverMode);
theCommand->SetStringParameter(theCommand->GetParameterID("ExitMode"),
exitMode);
if (mProgressWindowCheckBox->IsChecked())
theCommand->SetBooleanParameter("ShowProgressWindow", true);
else
theCommand->SetBooleanParameter("ShowProgressWindow", false);
EnableUpdate(false);
}
catch (BaseException &e)
{
MessageInterface::PopupMessage(Gmat::ERROR_, e.GetFullMessage());
}
}
示例7: EnableUpdate
//------------------------------------------------------------------------------
// void OnTextUpdate(wxCommandEvent& event)
//------------------------------------------------------------------------------
void ParameterSetupPanel::OnTextUpdate(wxCommandEvent& event)
{
if (mValueTextCtrl->IsModified())
{
mIsValueChanged = true;
EnableUpdate(true);
}
}
示例8: EnableUpdate
//------------------------------------------------------------------------------
// void OnTextChange()
//------------------------------------------------------------------------------
void DragInputsDialog::OnTextChange(wxCommandEvent &event)
{
if (((wxTextCtrl*)event.GetEventObject())->IsModified())
{
EnableUpdate(true);
isTextModified = true;
}
}
示例9: ReadProperties
//------------------------------------------------------------------------
void CGunTurret::OnReset()
{
if(IScriptTable *pScriptTable = GetEntity()->GetScriptTable())
{
SmartScriptTable props;
if(pScriptTable->GetValue("Properties", props))
ReadProperties(props);
}
CItem::OnReset();
Matrix34 tm = GetEntity()->GetSlotLocalTM(eIGS_Aux0,false);
tm.SetTranslation(GetSlotHelperPos(eIGS_Aux0,m_radarHelper.c_str(),false));
GetEntity()->SetSlotLocalTM(eIGS_ThirdPerson,tm);
if(GetEntity()->IsSlotValid(eIGS_Aux1))
{
tm.SetTranslation(GetSlotHelperPos(eIGS_ThirdPerson,m_barrelHelper.c_str(),false));
GetEntity()->SetSlotLocalTM(eIGS_Aux1,tm);
}
m_targetId = 0;
m_destinationId = 0;
m_updateTargetTimer = 0.0f;
m_abandonTargetTimer = 0.0f;
m_goalYaw = 0.0f;
m_goalPitch = 0.0f;
m_burstTimer = 0.0f;
m_pauseTimer = 0.0f;
m_searchHint = 0;
m_fireHint = 1;
m_deviationPos.zero();
m_randoms[eRV_UpdateTarget].Range(m_turretparams.update_target_time * m_fireparams.randomness);
m_randoms[eRV_AbandonTarget].Range(m_turretparams.abandon_target_time * m_fireparams.randomness);
m_randoms[eRV_BurstTime].Range(m_turretparams.burst_time * m_fireparams.randomness);
m_randoms[eRV_BurstPause].Range(m_turretparams.burst_pause * m_fireparams.randomness);
m_lightId = AttachLight(eIGS_ThirdPerson, m_lightId, false);
StopSound(m_lightSound);
m_lightSound = INVALID_SOUNDID;
if(m_turretparams.light_fov > 0.f)
{
m_lightId = AttachLight(eIGS_ThirdPerson, 0, true, m_turretparams.mg_range, m_searchparams.light_color*m_searchparams.light_diffuse_mul, 1.f/m_searchparams.light_diffuse_mul, m_searchparams.light_texture, m_turretparams.light_fov, m_searchparams.light_helper, Vec3(0,0,0), Vec3(-1,0,0), m_searchparams.light_material, m_searchparams.light_hdr_dyn);
m_lightSound = PlayAction(g_pItemStrings->use_light);
}
SetFiringLocator(this);
if(m_fm2)
m_fm2->Activate(true);
EnableUpdate(true, eIUS_General);
}
示例10: EnableUpdate
//------------------------------------------------------------------------------
// void OnCheckBoxChange(wxCommandEvent& event)
//------------------------------------------------------------------------------
void GroundTrackPlotPanel::OnCheckBoxChange(wxCommandEvent& event)
{
if (event.GetEventObject() == mShowPlotCheckBox)
{
mHasDataOptionChanged = true;
}
else
{
}
EnableUpdate(true);
}
示例11: UpdateLaser
void CJaw::Update(SEntityUpdateContext& ctx, int slot)
{
CWeapon::Update(ctx, slot);
if (!IsSelected())
return;
if(slot == eIUS_Zooming)
{
UpdateLaser(ctx);
}
if (slot != eIUS_General)
return;
UpdatePendingShot();
if (!IsInputFlagSet(CWeapon::eWeaponAction_Zoom) && IsInputFlagSet(CWeapon::eWeaponAction_Fire) && !IsZoomingIn())
AutoZoomOut();
if (m_controllingRocket && !IsZoomed() && !m_zoomTriggerDown)
DoAutoDrop();
if (m_autoDropping)
{
m_autoDropPendingTimer += ctx.fFrameTime;
if (CanAutoDrop())
{
m_autoDropping = false;
DoAutoDrop();
}
}
if (m_dropped)
{
m_dropTime += ctx.fFrameTime;
if (m_dropTime > g_hideTimeAfterDrop)
{
if(gEnv->bServer)
{
if(gEnv->IsEditor())
Hide(true);
else
gEnv->pEntitySystem->RemoveEntity(GetEntity()->GetId());
}
EnableUpdate(false);
}
else
{
RequireUpdate();
}
}
}
示例12: EnableUpdate
//------------------------------------------------------------------------------
void CelestialBodyPanel::SaveData()
{
#if DEBUG_CELESBODY_SAVE
MessageInterface::ShowMessage("in CBPanel, origBody = %p, theBody = %p\n",
origCelestialBody, theCelestialBody);
#endif
canClose = true;
if (properties->IsDataChanged())
{
properties->SaveData();
canClose = canClose && properties->CanClosePanel();
}
if (orbit->IsDataChanged())
{
orbit->SaveData();
canClose = canClose && orbit->CanClosePanel();
}
if (orientation->IsDataChanged())
{
orientation->SaveData();
canClose = canClose && orientation->CanClosePanel();
}
if (visualization->IsDataChanged())
{
visualization->SaveData();
canClose = canClose && visualization->CanClosePanel();
}
if (!canClose) // why do this???? spacecraft panel did this ....
{
EnableUpdate(true);
return;
}
// copy the current info into origCelestialBody
origCelestialBody->Copy(theCelestialBody);
EnableUpdate(false);
}
示例13: dialog
//------------------------------------------------------------------------------
// void OnBrowse()
//------------------------------------------------------------------------------
void DragInputsDialog::OnBrowse(wxCommandEvent &event)
{
wxFileDialog dialog(this, _T("Choose a file"), _T(""), _T(""), _T("*.*"));
if (dialog.ShowModal() == wxID_OK)
{
wxString filename;
filename = dialog.GetPath().c_str();
}
EnableUpdate(true);
}
示例14: IMPLEMENT_RMI
IMPLEMENT_RMI(CHeavyMountedWeapon, ClDropped)
{
if(!m_rippedOff)
{
SetUnMountedConfiguration();
UnlinkMountedGun();
FinishRipOff();
EnableUpdate(false);
BaseClass::Drop(5.0f);
}
return true;
}
示例15: GetEntity
//------------------------------------------------------------------------
void CItem::OnRepaired()
{
for (int i=0; i<eIGS_Last; i++)
{
ICharacterInstance *pCharacter = GetEntity()->GetCharacter(i);
if (pCharacter)
pCharacter->SetAnimationSpeed(1.0f);
}
DestroyedGeometry(false);
EnableUpdate(true);
}