diff --git a/src/sound/sound_driver.hpp b/src/sound/sound_driver.hpp --- a/src/sound/sound_driver.hpp +++ b/src/sound/sound_driver.hpp @@ -19,9 +19,15 @@ class SoundDriver : public Driver { public: /** Called once every tick */ virtual void MainLoop() {} + + /** + * Get the currently active instance of the sound driver. + */ + static SoundDriver *GetInstance() { + return static_cast(*DriverFactoryBase::GetActiveDriver(Driver::DT_SOUND)); + } }; -extern SoundDriver *_sound_driver; extern char *_ini_sounddriver; #endif /* SOUND_SOUND_DRIVER_HPP */