From f416e6b792e5dda143f60b7a2724db6b3ec33d75 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Fri, 28 Dec 2012 22:55:35 +0000 Subject: Support for rendering globes with rings, removed hardcoded 'corona' prefix for corona textures, added support for projectile fire sounds. --- src/audio/buffers.cc | 2 +- src/audio/buffers.h | 2 +- src/audio/sources.cc | 12 ++++++++++++ src/audio/sources.h | 3 +++ 4 files changed, 17 insertions(+), 2 deletions(-) (limited to 'src/audio') diff --git a/src/audio/buffers.cc b/src/audio/buffers.cc index 99c9e2e..b5dc8e3 100644 --- a/src/audio/buffers.cc +++ b/src/audio/buffers.cc @@ -79,7 +79,7 @@ size_t Buffers::load(std::string name) pcm = Vorbis::load(filename); } - // try the .oga version + // try the .ogg version if (!pcm) { filename.assign("sounds/"); filename.append(name); diff --git a/src/audio/buffers.h b/src/audio/buffers.h index 149c7f7..1086a5c 100644 --- a/src/audio/buffers.h +++ b/src/audio/buffers.h @@ -23,7 +23,7 @@ namespace audio { -const size_t MAXBUFFERS = 128; +const size_t MAXBUFFERS = 1024; /// OpenAL buffers wrapper class diff --git a/src/audio/sources.cc b/src/audio/sources.cc index 241332b..a3d7a8f 100644 --- a/src/audio/sources.cc +++ b/src/audio/sources.cc @@ -85,4 +85,16 @@ void Sources::remove(size_t index) //con_debug << "removed source " << index << std::endl; } +bool Sources::is_playing(size_t index) +{ + + if ((index < MAXUISOURCES) || (MAXSOURCES <= index)) + return false; + + ALint srcstate = 0; + alGetSourcei(sources[index] , AL_SOURCE_STATE , &srcstate); + + return (srcstate == AL_PLAYING); +} + } diff --git a/src/audio/sources.h b/src/audio/sources.h index 6292ff6..9bab08c 100644 --- a/src/audio/sources.h +++ b/src/audio/sources.h @@ -42,7 +42,10 @@ public: } static size_t get(); + static void remove(size_t index); + + static bool is_playing(size_t index); private: static void clear(); -- cgit v1.2.3