| 183 | } |
| 184 | |
| 185 | SoundObject::SoundObject(RString name, Object* source, bool looped, float maxTitlesDistance, float speed) |
| 186 | { |
| 187 | _index = 0; |
| 188 | _object = source; |
| 189 | _soundName = name; |
| 190 | |
| 191 | _hasObject = source != nullptr; |
| 192 | _looped = looped; |
| 193 | _paused = false; |
| 194 | |
| 195 | _forceTitles = false; |
| 196 | _titlesSize = 0; |
| 197 | |
| 198 | _maxTitlesDistance = maxTitlesDistance; |
| 199 | _speed = speed; |
| 200 | |
| 201 | _waiting = false; |
| 202 | if (source) |
| 203 | { |
| 204 | Person* person = dyn_cast<Person>(source); |
| 205 | if (person && person->Brain()) |
| 206 | { |
| 207 | _waiting = true; |
| 208 | _sender = person->Brain(); |
| 209 | SpeakingObjects.Add(this); |
| 210 | } |
| 211 | } |
| 212 | if (!_waiting) |
| 213 | { |
| 214 | LoadSound(); |
| 215 | } |
| 216 | } |
| 217 | |
| 218 | bool SoundObject::Simulate(float deltaT, SimulationImportance prec) |
| 219 | { |