| 273 | } |
| 274 | |
| 275 | void 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 | |
| 303 | SoundOnVehicle::SoundOnVehicle(const char* name, Object* source, float maxTitlesDistance, float speed) |
| 304 | : Vehicle(Shapes.New("data3d\\empty.p3d", false, true), VehicleTypes.New("SoundOnVehicle"), -1) |
nothing calls this directly
no test coverage detected