Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/client')
-rw-r--r--src/client/input.cc1
-rw-r--r--src/client/soundext.cc13
-rw-r--r--src/client/soundext.h2
3 files changed, 16 insertions, 0 deletions
diff --git a/src/client/input.cc b/src/client/input.cc
index 50ef4da..8672284 100644
--- a/src/client/input.cc
+++ b/src/client/input.cc
@@ -713,6 +713,7 @@ void reset()
last_key = 0;
mouse_lastmoved = 0;
joystick_lastmoved = 0;
+ keyboard_modifiers = 0;
}
void frame()
diff --git a/src/client/soundext.cc b/src/client/soundext.cc
index b07cc35..5ebcd99 100644
--- a/src/client/soundext.cc
+++ b/src/client/soundext.cc
@@ -95,6 +95,7 @@ SoundExt::SoundExt(core::Entity *entity) : core::Extension(core::Extension::Soun
state_impulsestartbuffer = 0;
state_impulsestopbuffer = 0;
state_jumpstartbuffer = 0;
+ state_jumpstopbuffer = 0;
state_engineloopbuffer = 0;
state_engineloopsource = 0;
@@ -123,6 +124,7 @@ SoundExt::SoundExt(core::Entity *entity) : core::Extension(core::Extension::Soun
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_jumpstopbuffer = audio::Buffers::load("engines/jump_stop00");
state_engineloopsource = audio::Sources::get();
state_engineeventsource = audio::Sources::get();
@@ -176,6 +178,7 @@ void SoundExt::clear()
state_impulsestartbuffer = 0;
state_impulsestopbuffer = 0;
state_jumpstartbuffer = 0;
+ state_jumpstopbuffer = 0;
state_engineloopbuffer = 0;
state_engineloopsource = 0;
@@ -231,6 +234,16 @@ void SoundExt::frame(float elapsed)
state_engineeventbuffer = audio::play(state_engineeventsource, state_jumpstartbuffer);
}
+
+ } else if (entity->state() == core::Entity::Jump) {
+
+ if (state_engineeventbuffer != state_jumpstopbuffer) {
+ audio::update_source(state_engineeventsource,
+ entity->location() - entity->axis().forward() * r ,
+ entity->axis().forward() * speed);
+
+ state_engineeventbuffer = audio::play(state_engineeventsource, state_jumpstopbuffer);
+ }
} else if (entity->state() == core::Entity::Impulse) {
diff --git a/src/client/soundext.h b/src/client/soundext.h
index becaa8e..cf5585e 100644
--- a/src/client/soundext.h
+++ b/src/client/soundext.h
@@ -85,6 +85,8 @@ private:
size_t state_impulsestopbuffer;
/// index of the audio buffer containing the jump engine start sound
size_t state_jumpstartbuffer;
+ /// index of the audio buffer containing the jump engine stop sound
+ size_t state_jumpstopbuffer;
/// index of the audio buffer currently looping in enginesource
size_t state_engineloopbuffer;