Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/audio/audio.cc')
-rw-r--r--src/audio/audio.cc19
1 files changed, 15 insertions, 4 deletions
diff --git a/src/audio/audio.cc b/src/audio/audio.cc
index 81a260c..ca30590 100644
--- a/src/audio/audio.cc
+++ b/src/audio/audio.cc
@@ -18,13 +18,13 @@ ALCcontext *audio_context = 0;
void init()
{
- con_print << "^BInitializing audio...";
+ con_print << "^BInitializing audio..." << std::endl;
// open the default audio device
audio_device = alcOpenDevice(0);
if (!audio_device) {
- con_warn << "Could not initialize audio!";
+ con_warn << "Could not initialize audio!" << std::endl;
return;
}
@@ -34,7 +34,7 @@ void init()
if (!audio_context) {
alcCloseDevice(audio_device);
audio_device = 0;
- con_warn << "Could not create audio context!";
+ con_warn << "Could not create audio context!" << std::endl;
return;
}
@@ -56,6 +56,17 @@ void init()
load("ui/console");
}
+void reset()
+{
+ con_print << "^BReloading audio..." << std::endl;
+
+ Sources::reset();
+ Buffers::reset();
+
+ load("ui/nosnd");
+ load("ui/console");
+}
+
void load (const char *name)
{
Buffers::load(std::string(name));
@@ -63,7 +74,7 @@ void load (const char *name)
void shutdown()
{
- con_print << "^BShutting down audio...";
+ con_print << "^BShutting down audio..." << std::endl;
Sources::shutdown();