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>2011-07-05 18:36:37 +0000
committerStijn Buys <ingar@osirion.org>2011-07-05 18:36:37 +0000
commit2c10d5b9b8a9f651006e4f7b376b21ee0713b398 (patch)
treea9a143202980ce8f16b7ea0ab05d9cb3e7b05cae
parent91356abaf6cb09a1c72f9a8c374487ab66ecde13 (diff)
Added support for a jump engine start sound, correted a typo in client.h.
-rw-r--r--doc/attributions.html17
-rw-r--r--src/client/client.h2
-rw-r--r--src/client/soundext.cc18
-rw-r--r--src/client/soundext.h2
4 files changed, 31 insertions, 8 deletions
diff --git a/doc/attributions.html b/doc/attributions.html
index e0f71ef..3c837b3 100644
--- a/doc/attributions.html
+++ b/doc/attributions.html
@@ -19,8 +19,7 @@
of the <a href="http://creativecommons.org/licenses/by-sa/3.0/">Create Commons Attribution-Share Alike 3.0 License</a>.
</p>
<p>
- Files by <a href="http://freesound.iua.upf.edu/usersViewSingle.php?id=731">nathanshadow</a>
- are distributed under the terms of the
+ Sound effects from the Freesound project are distributed under the terms and conditions of the
<a href="http://creativecommons.org/licenses/sampling+/1.0/">Creative Commons Sampling Plus 1.0</a> license.
</p>
</div>
@@ -385,21 +384,29 @@
<td>sounds/engines</td>
<td>loop00.wav</td>
<td>
- <a href="http://freesound.iua.upf.edu/samplesViewSingle.php?id=22454">nathanshadow</a>
+ <a href="http://freesound.iua.upf.edu/samplesViewSingle.php?id=22454">nathanshadow</a> (Freesound)
</td>
</tr>
<tr>
<td>sounds/engines</td>
<td>loop01.wav</td>
<td>
- <a href="http://freesound.iua.upf.edu/samplesViewSingle.php?id=22455">nathanshadow</a>
+ <a href="http://freesound.iua.upf.edu/samplesViewSingle.php?id=22455">nathanshadow</a> (Freesound)
</td>
</tr>
<tr>
<td>sounds/engines</td>
<td>loop02.wav</td>
<td>
- <a href="http://freesound.iua.upf.edu/samplesViewSingle.php?id=22456">nathanshadow</a>
+ <a href="http://freesound.iua.upf.edu/samplesViewSingle.php?id=22456">nathanshadow</a> (Freesound)
+ </td>
+ </tr>
+
+ <tr>
+ <td>sounds/engines</td>
+ <td>jump_start00.wav</td>
+ <td>
+ <a href="http://www.freesound.org/samplesViewSingle.php?id=70044">juskiddink</a> (Freesound)
</td>
</tr>
diff --git a/src/client/client.h b/src/client/client.h
index ddc6dd5..19a760f 100644
--- a/src/client/client.h
+++ b/src/client/client.h
@@ -73,7 +73,7 @@ public:
return client_testmodelview;
}
- /// local client seds a chat message
+ /// local client sends a chat message
inline void say(std::string const &text) {
func_say(text);
}
diff --git a/src/client/soundext.cc b/src/client/soundext.cc
index fbed639..b07cc35 100644
--- a/src/client/soundext.cc
+++ b/src/client/soundext.cc
@@ -94,6 +94,7 @@ SoundExt::SoundExt(core::Entity *entity) : core::Extension(core::Extension::Soun
state_impulseloopbuffer = 0;
state_impulsestartbuffer = 0;
state_impulsestopbuffer = 0;
+ state_jumpstartbuffer = 0;
state_engineloopbuffer = 0;
state_engineloopsource = 0;
@@ -116,11 +117,12 @@ SoundExt::SoundExt(core::Entity *entity) : core::Extension(core::Extension::Soun
soundname << "engines/loop" << std::setfill('0') << std::setw(2) << enginesoundset;
state_thusterloopbuffer = audio::Buffers::load(soundname.str());
- // load impulse sound
- // FIXME load impulse sound set
+ // load sound set
+ // FIXME alway sound set 0 for now
state_impulseloopbuffer = audio::Buffers::load("engines/impulse_loop00");
state_impulsestartbuffer = audio::Buffers::load("engines/impulse_start00");
state_impulsestopbuffer = audio::Buffers::load("engines/impulse_stop00");
+ state_jumpstartbuffer = audio::Buffers::load("engines/jump_start00");
state_engineloopsource = audio::Sources::get();
state_engineeventsource = audio::Sources::get();
@@ -173,6 +175,7 @@ void SoundExt::clear()
state_impulseloopbuffer = 0;
state_impulsestartbuffer = 0;
state_impulsestopbuffer = 0;
+ state_jumpstartbuffer = 0;
state_engineloopbuffer = 0;
state_engineloopsource = 0;
@@ -218,6 +221,17 @@ void SoundExt::frame(float elapsed)
state_engineeventbuffer = audio::play(state_engineeventsource, state_impulsestartbuffer);
}
+
+ } else if (entity->state() == core::Entity::JumpInitiate) {
+
+ if (state_engineeventbuffer != state_jumpstartbuffer) {
+ audio::update_source(state_engineeventsource,
+ entity->location() - entity->axis().forward() * r ,
+ entity->axis().forward() * speed);
+
+ state_engineeventbuffer = audio::play(state_engineeventsource, state_jumpstartbuffer);
+ }
+
} else if (entity->state() == core::Entity::Impulse) {
state_engineeventbuffer = state_impulseloopbuffer;
diff --git a/src/client/soundext.h b/src/client/soundext.h
index 9991b69..becaa8e 100644
--- a/src/client/soundext.h
+++ b/src/client/soundext.h
@@ -83,6 +83,8 @@ private:
size_t state_impulsestartbuffer;
/// index of the audio buffer containing the impulse drive stop sound
size_t state_impulsestopbuffer;
+ /// index of the audio buffer containing the jump engine start sound
+ size_t state_jumpstartbuffer;
/// index of the audio buffer currently looping in enginesource
size_t state_engineloopbuffer;