diff options
author | rubidium <rubidium@openttd.org> | 2014-04-28 21:06:51 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2014-04-28 21:06:51 +0000 |
commit | b476086c394c6bcf893f292ef67565ef2b5496a2 (patch) | |
tree | 7bbdfcc4597cae1378070d82c5da36c8668171e0 /src/sound | |
parent | 3b634b628c8b8ce30cdd11d38a38cf2f455a1c73 (diff) | |
download | openttd-b476086c394c6bcf893f292ef67565ef2b5496a2.tar.xz |
(svn r26538) -Codechange: remove double accounting of the drivers
Diffstat (limited to 'src/sound')
-rw-r--r-- | src/sound/sound_driver.hpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/sound/sound_driver.hpp b/src/sound/sound_driver.hpp index 2b9cf145d..0df69b8b4 100644 --- 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<SoundDriver*>(*DriverFactoryBase::GetActiveDriver(Driver::DT_SOUND)); + } }; -extern SoundDriver *_sound_driver; extern char *_ini_sounddriver; #endif /* SOUND_SOUND_DRIVER_HPP */ |