| 18 | |
| 19 | using namespace Poseidon; |
| 20 | void RandomSound::Load(const ParamEntry& entry, const char* name) |
| 21 | { |
| 22 | const ParamEntry& list = entry >> name; |
| 23 | _pars.Realloc(list.GetSize() / 2); |
| 24 | _pars.Resize(0); |
| 25 | for (int i = 0; i < list.GetSize(); i += 2) |
| 26 | { |
| 27 | RString singleName = list[i]; |
| 28 | // load single sound parameter |
| 29 | SoundProbab extPars; |
| 30 | const ParamEntry& single = entry >> singleName; |
| 31 | GetValue(extPars, single); |
| 32 | extPars._probability = list[i + 1]; |
| 33 | _pars.Add(extPars); |
| 34 | } |
| 35 | _pars.Compact(); |
| 36 | } |
| 37 | |
| 38 | const SoundPars& RandomSound::SelectSound(float probab) const |
| 39 | { |