| 20 | |
| 21 | CCar::SCarSound::~SCarSound() {} |
| 22 | void CCar::SCarSound::Init() |
| 23 | { |
| 24 | CInifile* ini = smart_cast<IKinematics*>(pcar->Visual())->LL_UserData(); |
| 25 | if (ini->section_exist("car_sound") && ini->line_exist("car_sound", "snd_volume")) |
| 26 | { |
| 27 | volume = ini->r_float("car_sound", "snd_volume"); |
| 28 | |
| 29 | snd_engine.create(ini->r_string("car_sound", "snd_name"), st_Effect, sg_SourceType); // |
| 30 | snd_engine_start.create(READ_IF_EXISTS(ini, r_string, "car_sound", "engine_start", "car\\test_car_start"), st_Effect, sg_SourceType); |
| 31 | snd_engine_stop.create(READ_IF_EXISTS(ini, r_string, "car_sound", "engine_stop", "car\\test_car_stop"), st_Effect, sg_SourceType); |
| 32 | float fengine_start_delay = READ_IF_EXISTS(ini, r_float, "car_sound", "engine_sound_start_dellay", 0.25f); |
| 33 | engine_start_delay = iFloor((snd_engine_start._handle() ? iFloor(snd_engine_start.get_length_sec() * 1000.0f) : 1.f) * fengine_start_delay); |
| 34 | if (ini->line_exist("car_sound", "relative_pos")) |
| 35 | { |
| 36 | relative_pos.set(ini->r_fvector3("car_sound", "relative_pos")); |
| 37 | } |
| 38 | if (ini->line_exist("car_sound", "transmission_switch")) |
| 39 | { |
| 40 | snd_transmission.create(ini->r_string("car_sound", "transmission_switch"), st_Effect, sg_SourceType); |
| 41 | } |
| 42 | } |
| 43 | else |
| 44 | { |
| 45 | Msg("! Car doesn't contain sound params"); |
| 46 | } |
| 47 | eCarSound = sndOff; |
| 48 | } |
| 49 | void CCar::SCarSound::SetSoundPosition(ref_sound& snd) |
| 50 | { |
| 51 | VERIFY(!ph_world->Processing()); |
nothing calls this directly
no test coverage detected