diff options
author | peter1138 <peter1138@openttd.org> | 2007-07-05 12:23:54 +0000 |
---|---|---|
committer | peter1138 <peter1138@openttd.org> | 2007-07-05 12:23:54 +0000 |
commit | 68c6add8ccd9aa32eb799a433aa8a3b05ec84a57 (patch) | |
tree | 52e0cc5b1e4eb6cf9aed8556873ee6833662e11f /src/sound/sound_driver.hpp | |
parent | b5079071762021ebfbb66a14eaa598e48d6a3234 (diff) | |
download | openttd-68c6add8ccd9aa32eb799a433aa8a3b05ec84a57.tar.xz |
(svn r10444) -Codechange: switch to c++ classes and inheritance for sound/music/video drivers, using self-registration based on the blitter-model.
Diffstat (limited to 'src/sound/sound_driver.hpp')
-rw-r--r-- | src/sound/sound_driver.hpp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/sound/sound_driver.hpp b/src/sound/sound_driver.hpp new file mode 100644 index 000000000..de1a19ac8 --- /dev/null +++ b/src/sound/sound_driver.hpp @@ -0,0 +1,27 @@ +/* $Id$ */ + +#ifndef SOUND_SOUND_DRIVER_HPP +#define SOUND_SOUND_DRIVER_HPP + +#include "../driver.h" + +class SoundDriver: public Driver { +}; + +class SoundDriverFactoryBase: public DriverFactoryBase { +}; + +template <class T> +class SoundDriverFactory: public SoundDriverFactoryBase { +public: + SoundDriverFactory() { this->RegisterDriver(((T *)this)->GetName(), Driver::DT_SOUND); } + + /** + * Get the long, human readable, name for the Driver-class. + */ + const char *GetName(); +}; + +extern SoundDriver *_sound_driver; + +#endif /* SOUND_SOUND_DRIVER_HPP */ |