Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2008-07-18 10:59:23 +0000
committerStijn Buys <ingar@osirion.org>2008-07-18 10:59:23 +0000
commit415cbb44d031e0a348d937c917c629913da0afce (patch)
treeb310564128d80bd24217cc32f71d39844dae5441 /src/client/view.cc
parentd419f413daa75262cbf9ba3eb271c4028b0b6921 (diff)
parse engine sound from .map model
Diffstat (limited to 'src/client/view.cc')
-rw-r--r--src/client/view.cc12
1 files changed, 10 insertions, 2 deletions
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) {