MCPcopy Create free account
hub / github.com/OGSR/OGSR-Engine / SetVisible

Method SetVisible

ogsr_engine/xrGame/Artifact.cpp:681–711  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

679
680SArtefactDetectorsSupport::~SArtefactDetectorsSupport() { m_sound.destroy(); }
681void SArtefactDetectorsSupport::SetVisible(bool b)
682{
683 m_switchVisTime = Device.dwTimeGlobal;
684 if (b == !!m_parent->getVisible())
685 return;
686
687 if (b)
688 m_parent->StartLights();
689 else
690 m_parent->StopLights();
691
692 if (b)
693 {
694 LPCSTR curr = pSettings->r_string(m_parent->cNameSect().c_str(), (b) ? "det_show_particles" : "det_hide_particles");
695
696 IKinematics* K = smart_cast<IKinematics*>(m_parent->Visual());
697 R_ASSERT2(K, m_parent->cNameSect().c_str());
698 LPCSTR bone = pSettings->r_string(m_parent->cNameSect().c_str(), "particles_bone");
699 u16 bone_id = K->LL_BoneID(bone);
700 R_ASSERT2(bone_id != BI_NONE, bone);
701
702 m_parent->CParticlesPlayer::StartParticles(curr, bone_id, Fvector().set(0, 1, 0), m_parent->ID());
703
704 curr = pSettings->r_string(m_parent->cNameSect().c_str(), (b) ? "det_show_snd" : "det_hide_snd");
705 m_sound.create(curr, st_Effect, sg_SourceType);
706 m_sound.play_at_pos(0, m_parent->Position(), 0);
707 }
708
709 m_parent->setVisible(b);
710 m_parent->SwitchAfParticles(b);
711}
712
713void SArtefactDetectorsSupport::Blink()
714{

Callers 1

SwitchVisibilityMethod · 0.45

Calls 12

VisualMethod · 0.80
LL_BoneIDMethod · 0.80
PositionMethod · 0.80
SwitchAfParticlesMethod · 0.80
StartLightsMethod · 0.45
StopLightsMethod · 0.45
r_stringMethod · 0.45
c_strMethod · 0.45
setMethod · 0.45
createMethod · 0.45
play_at_posMethod · 0.45
setVisibleMethod · 0.45

Tested by

no test coverage detected