From 56b0856541446cbafee4eed9ef0ee9fb69af565a Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Fri, 8 Aug 2008 22:17:29 +0000 Subject: improved truster indicator, impulse engine sounds --- src/core/clientstate.cc | 30 +++++++++++++++++++++++++----- src/core/clientstate.h | 18 +++++++++++++++++- 2 files changed, 42 insertions(+), 6 deletions(-) (limited to 'src/core') diff --git a/src/core/clientstate.cc b/src/core/clientstate.cc index 8e9c2e5..84e1fe0 100644 --- a/src/core/clientstate.cc +++ b/src/core/clientstate.cc @@ -16,7 +16,16 @@ ClientState::ClientState() state_detailvisible = false; state_targetable = false; - state_enginesound = 0; + state_thusterloopbuffer = 0; + state_impulseloopbuffer = 0; + state_impulsestartbuffer = 0; + state_impulsestopbuffer = 0; + + state_engineloopbuffer = 0; + state_engineloopsource = 0; + state_engineeventbuffer = 0; + state_engineeventsource = 0; + state_engine_trail_offset = 0; state_fuzz = math::randomf(); @@ -29,7 +38,16 @@ ClientState::ClientState(Entity *entity) state_detailvisible = false; state_targetable = false; - state_enginesound = 0; + state_thusterloopbuffer = 0; + state_impulseloopbuffer = 0; + state_impulsestartbuffer = 0; + state_impulsestopbuffer = 0; + + state_engineloopbuffer = 0; + state_engineloopsource = 0; + state_engineeventbuffer = 0; + state_engineeventsource = 0; + state_engine_trail_offset = 0; state_fuzz = math::randomf(); @@ -45,9 +63,11 @@ ClientState::~ClientState() void ClientState::clearsound() { - if (state_enginesound) { - application()->notify_remove_sound(state_enginesound); - state_enginesound = 0; + if (state_engineloopsource) { + application()->notify_remove_sound(state_engineloopsource); + application()->notify_remove_sound(state_engineeventsource); + state_engineloopsource = 0; + state_engineloopbuffer = 0; } } diff --git a/src/core/clientstate.h b/src/core/clientstate.h index f914d0e..ffd6331 100644 --- a/src/core/clientstate.h +++ b/src/core/clientstate.h @@ -70,7 +70,23 @@ public: /// distance from the camera eye to the entity float state_distance; - size_t state_enginesound; + /// index of the audio buffer containing the thruster sound loop + size_t state_thusterloopbuffer; + /// index of the audio buffer containing the impulse sound loop + size_t state_impulseloopbuffer; + /// index of the audio buffer containing the impulse drive start sound + size_t state_impulsestartbuffer; + /// index of the audio buffer containing the impulse drive stop sound + size_t state_impulsestopbuffer; + + /// index of the audio buffer currently looping in enginesource + size_t state_engineloopbuffer; + /// index of the audio source used to play the engine sound loop + size_t state_engineloopsource; + /// index of the audio last played on the event source + size_t state_engineeventbuffer; + /// index of the audio source used to play engine sound events + size_t state_engineeventsource; }; } -- cgit v1.2.3