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

Method SimulateTitles

engine/Poseidon/Audio/DynSound.cpp:275–301  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

273}
274
275void SoundObject::SimulateTitles()
276{
277 if (_index >= _titles.Size())
278 {
279 return;
280 }
281 if (Glob.time >= _titles[_index].time)
282 {
283 // titles show only within a limited distance
284 if (!_object || !GScene->GetCamera() || _maxTitlesDistance == 0 ||
285 GScene->GetCamera()->Position().Distance2(_object->WorldTransform().Position()) <=
286 Square(_maxTitlesDistance))
287 {
288 TitleEffect* effect = nullptr;
289 if (_titlesFont)
290 {
291 effect = CreateTitleEffect(TitPlainDown, _titles[_index].text, _speed, _titlesFont, _titlesSize);
292 }
293 else
294 {
295 effect = CreateTitleEffect(TitPlainDown, _titles[_index].text, _speed);
296 }
297 GWorld->SetTitleEffect(effect);
298 }
299 _index++;
300 }
301}
302
303SoundOnVehicle::SoundOnVehicle(const char* name, Object* source, float maxTitlesDistance, float speed)
304 : Vehicle(Shapes.New("data3d\\empty.p3d", false, true), VehicleTypes.New("SoundOnVehicle"), -1)

Callers

nothing calls this directly

Calls 8

CreateTitleEffectFunction · 0.85
GetCameraMethod · 0.80
SetTitleEffectMethod · 0.80
SquareFunction · 0.50
SizeMethod · 0.45
Distance2Method · 0.45
PositionMethod · 0.45
WorldTransformMethod · 0.45

Tested by

no test coverage detected