Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
path: root/src/audio
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2012-12-28 22:55:35 +0000
committerStijn Buys <ingar@osirion.org>2012-12-28 22:55:35 +0000
commitf416e6b792e5dda143f60b7a2724db6b3ec33d75 (patch)
tree553ddcaa6c60489904a8db818eff688c0b85a437 /src/audio
parentfe96eee5db2acbef1ea0f360b180fd9f8f990444 (diff)
Support for rendering globes with rings,
removed hardcoded 'corona' prefix for corona textures, added support for projectile fire sounds.
Diffstat (limited to 'src/audio')
-rw-r--r--src/audio/buffers.cc2
-rw-r--r--src/audio/buffers.h2
-rw-r--r--src/audio/sources.cc12
-rw-r--r--src/audio/sources.h3
4 files changed, 17 insertions, 2 deletions
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();