From 415cbb44d031e0a348d937c917c629913da0afce Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Fri, 18 Jul 2008 10:59:23 +0000 Subject: parse engine sound from .map model --- src/client/view.cc | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/client/view.cc') diff --git a/src/client/view.cc b/src/client/view.cc index 56c692e..34fe3fa 100644 --- a/src/client/view.cc +++ b/src/client/view.cc @@ -315,8 +315,16 @@ void render_sound() float pitch = 0.2f + entitycontrolable->thrust() * 0.8f; if (!state->state_enginesound) { - if ((state->state_enginesound = audio::Sources::get()) > 0 ) - audio::loop(state->state_enginesound, "engines/loop01", pitch, 0); + if ((state->state_enginesound = audio::Sources::get()) > 0 ) { + + size_t enginesound = 0; + if (entity->model()) + enginesound = entity->model()->enginesound(); + + std::stringstream soundname; + soundname << "engines/loop" << std::setfill('0') << std::setw(2) << enginesound; + audio::loop(state->state_enginesound, soundname.str().c_str(), pitch, 0); + } } if (state->state_enginesound) { -- cgit v1.2.3