MCPcopy Create free account
hub / github.com/BohemiaInteractive/CWR / PlaySound

Method PlaySound

engine/Poseidon/UI/Controls/UIControlsBase.cpp:181–195  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

179
180 float dz = 0.5 * (posTL.Z() + posBR.Z() - 2.0 * position.Z());
181 float scale = (posBase.Z() + dz) / (position.Z() + dz);
182
183 DrawCoord pt1 = SceneToScreen(posTL);
184 DrawCoord pt2 = SceneToScreen(posBR);
185 float w = pt2.x - pt1.x;
186 float h = pt2.y - pt1.y;
187 info._control->SetPos(pt1.x + info.x * w, pt1.y + info.y * h, info.w * w, info.h * h);
188 info._control->SetScale(scale);
189}
190
191void IControl::PlaySound(SoundPars& pars)
192{
193 if (pars.name.GetLength() > 0)
194 {
195 // float volume = GSoundsys->GetSpeechVolCoef();
196 IWave* wave = GSoundScene->OpenAndPlayOnce2D(pars.name, pars.vol, pars.freq, false);
197 if (wave)
198 {

Callers

nothing calls this directly

Calls 7

OpenAndPlayOnce2DMethod · 0.80
SetStickyMethod · 0.80
AddSoundMethod · 0.80
AdvanceAllMethod · 0.80
GetLengthMethod · 0.45
SetKindMethod · 0.45
IsSimulationEnabledMethod · 0.45

Tested by

no test coverage detected