From 4a2bad92171ff8a9a248599f47087cfe39e93653 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Sun, 18 May 2008 09:21:20 +0000 Subject: OpenAL support --- src/client/client.cc | 39 ++++++++++++++++----------------------- 1 file changed, 16 insertions(+), 23 deletions(-) (limited to 'src/client/client.cc') diff --git a/src/client/client.cc b/src/client/client.cc index 85dec27..ed31c65 100644 --- a/src/client/client.cc +++ b/src/client/client.cc @@ -10,6 +10,7 @@ #include #include +#include "audio/audio.h" #include "client/chat.h" #include "client/client.h" #include "client/video.h" @@ -23,26 +24,6 @@ namespace client { core::Cvar *cl_framerate = 0; - -//--- private definition ------------------------------------------ - -/// client application implementation -class Client : public core::Application -{ -public: - /// initialize the client Client - virtual void init(int count, char **arguments); - - /// run the client Client - virtual void run(); - - /// shutdown the client Client - virtual void shutdown(); - - /// quit the client Client - virtual void quit(int status); -}; - Client app; //--- engine functions -------------------------------------------- @@ -71,6 +52,11 @@ void client_main(int count, char **arguments) app.shutdown(); } +Client *client() +{ + return &app; +} + //--- private ----------------------------------------------------- void Client::quit(int status) @@ -112,6 +98,9 @@ void Client::init(int count, char **arguments) // initialize input input::init(); + + // initialize audio + audio::init(); // add engine functions core::Func *func = 0; @@ -147,8 +136,6 @@ void Client::run() } }; - //con_debug << "tick " << std::setw(8) << chrono << " " << std::setw(8) << current << " " << elapsed; - } } @@ -157,11 +144,12 @@ void Client::shutdown() { con_print << "^BShutting down client..." << std::endl; - // remove engine functions core::Func::remove("r_restart"); chat::shutdown(); + audio::shutdown(); + Console::shutdown(); input::shutdown(); @@ -173,5 +161,10 @@ void Client::shutdown() quit(0); } +void Client::notify_sound(const char * name) +{ + audio::play(name); +} + } // namespace client -- cgit v1.2.3