diff options
author | rubidium <rubidium@openttd.org> | 2009-09-05 21:26:51 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2009-09-05 21:26:51 +0000 |
commit | bc5241600a33f7271a839105c4752ad24f202c1c (patch) | |
tree | 57ec42b3a8b93498e79f3fdc26ca3e10febdaee7 | |
parent | 0be5e5935560de419283540ea6280acdff3dea9c (diff) | |
download | openttd-bc5241600a33f7271a839105c4752ad24f202c1c.tar.xz |
(svn r17428) -Codechange: add a function to get the name of a driver
-rw-r--r-- | src/driver.h | 2 | ||||
-rw-r--r-- | src/music/allegro_m.h | 1 | ||||
-rw-r--r-- | src/music/bemidi.h | 1 | ||||
-rw-r--r-- | src/music/dmusic.h | 1 | ||||
-rw-r--r-- | src/music/extmidi.h | 1 | ||||
-rw-r--r-- | src/music/libtimidity.h | 1 | ||||
-rw-r--r-- | src/music/null_m.h | 1 | ||||
-rw-r--r-- | src/music/os2_m.h | 1 | ||||
-rw-r--r-- | src/music/qtmidi.h | 1 | ||||
-rw-r--r-- | src/music/win32_m.h | 1 | ||||
-rw-r--r-- | src/sound/allegro_s.h | 1 | ||||
-rw-r--r-- | src/sound/cocoa_s.h | 1 | ||||
-rw-r--r-- | src/sound/null_s.h | 1 | ||||
-rw-r--r-- | src/sound/sdl_s.h | 1 | ||||
-rw-r--r-- | src/sound/win32_s.h | 1 | ||||
-rw-r--r-- | src/video/allegro_v.h | 1 | ||||
-rw-r--r-- | src/video/dedicated_v.h | 1 | ||||
-rw-r--r-- | src/video/null_v.h | 1 | ||||
-rw-r--r-- | src/video/sdl_v.h | 1 | ||||
-rw-r--r-- | src/video/win32_v.h | 1 |
20 files changed, 21 insertions, 0 deletions
diff --git a/src/driver.h b/src/driver.h index c32529f60..7abd4c186 100644 --- a/src/driver.h +++ b/src/driver.h @@ -36,6 +36,8 @@ public: DT_VIDEO, DT_END, }; + + virtual const char *GetName() const = 0; }; DECLARE_POSTFIX_INCREMENT(Driver::Type); diff --git a/src/music/allegro_m.h b/src/music/allegro_m.h index 80de33018..bc4d665db 100644 --- a/src/music/allegro_m.h +++ b/src/music/allegro_m.h @@ -27,6 +27,7 @@ public: /* virtual */ bool IsSongPlaying(); /* virtual */ void SetVolume(byte vol); + /* virtual */ const char *GetName() const { return "allegro"; } }; class FMusicDriver_Allegro: public MusicDriverFactory<FMusicDriver_Allegro> { diff --git a/src/music/bemidi.h b/src/music/bemidi.h index 42b0d1ba9..07b275f95 100644 --- a/src/music/bemidi.h +++ b/src/music/bemidi.h @@ -27,6 +27,7 @@ public: /* virtual */ bool IsSongPlaying(); /* virtual */ void SetVolume(byte vol); + /* virtual */ const char *GetName() const { return "bemidi"; } }; class FMusicDriver_BeMidi: public MusicDriverFactory<FMusicDriver_BeMidi> { diff --git a/src/music/dmusic.h b/src/music/dmusic.h index 77ba15771..74368de23 100644 --- a/src/music/dmusic.h +++ b/src/music/dmusic.h @@ -27,6 +27,7 @@ public: /* virtual */ bool IsSongPlaying(); /* virtual */ void SetVolume(byte vol); + /* virtual */ const char *GetName() const { return "dmusic"; } }; class FMusicDriver_DMusic: public MusicDriverFactory<FMusicDriver_DMusic> { diff --git a/src/music/extmidi.h b/src/music/extmidi.h index b3df9eaea..260dbdeb8 100644 --- a/src/music/extmidi.h +++ b/src/music/extmidi.h @@ -35,6 +35,7 @@ public: /* virtual */ bool IsSongPlaying(); /* virtual */ void SetVolume(byte vol); + /* virtual */ const char *GetName() const { return "extmidi"; } }; class FMusicDriver_ExtMidi: public MusicDriverFactory<FMusicDriver_ExtMidi> { diff --git a/src/music/libtimidity.h b/src/music/libtimidity.h index fd7163eaa..7839462dd 100644 --- a/src/music/libtimidity.h +++ b/src/music/libtimidity.h @@ -27,6 +27,7 @@ public: /* virtual */ bool IsSongPlaying(); /* virtual */ void SetVolume(byte vol); + /* virtual */ const char *GetName() const { return "libtimidity"; } }; class FMusicDriver_LibTimidity: public MusicDriverFactory<FMusicDriver_LibTimidity> { diff --git a/src/music/null_m.h b/src/music/null_m.h index 8c1a7a558..a98cdf679 100644 --- a/src/music/null_m.h +++ b/src/music/null_m.h @@ -27,6 +27,7 @@ public: /* virtual */ bool IsSongPlaying() { return true; } /* virtual */ void SetVolume(byte vol) { } + /* virtual */ const char *GetName() const { return "null"; } }; class FMusicDriver_Null: public MusicDriverFactory<FMusicDriver_Null> { diff --git a/src/music/os2_m.h b/src/music/os2_m.h index 8337c3f0b..87c45873c 100644 --- a/src/music/os2_m.h +++ b/src/music/os2_m.h @@ -27,6 +27,7 @@ public: /* virtual */ bool IsSongPlaying(); /* virtual */ void SetVolume(byte vol); + /* virtual */ const char *GetName() const { return "os2"; } }; class FMusicDriver_OS2: public MusicDriverFactory<FMusicDriver_OS2> { diff --git a/src/music/qtmidi.h b/src/music/qtmidi.h index 904ff527b..8ad7c4762 100644 --- a/src/music/qtmidi.h +++ b/src/music/qtmidi.h @@ -27,6 +27,7 @@ public: /* virtual */ bool IsSongPlaying(); /* virtual */ void SetVolume(byte vol); + /* virtual */ const char *GetName() const { return "qt"; } }; class FMusicDriver_QtMidi: public MusicDriverFactory<FMusicDriver_QtMidi> { diff --git a/src/music/win32_m.h b/src/music/win32_m.h index ba1d2d643..d596d3a9f 100644 --- a/src/music/win32_m.h +++ b/src/music/win32_m.h @@ -27,6 +27,7 @@ public: /* virtual */ bool IsSongPlaying(); /* virtual */ void SetVolume(byte vol); + /* virtual */ const char *GetName() const { return "win32"; } }; class FMusicDriver_Win32: public MusicDriverFactory<FMusicDriver_Win32> { diff --git a/src/sound/allegro_s.h b/src/sound/allegro_s.h index b59b8527f..5eeeae248 100644 --- a/src/sound/allegro_s.h +++ b/src/sound/allegro_s.h @@ -21,6 +21,7 @@ public: /* virtual */ void Stop(); /* virtual */ void MainLoop(); + /* virtual */ const char *GetName() const { return "allegro"; } }; class FSoundDriver_Allegro: public SoundDriverFactory<FSoundDriver_Allegro> { diff --git a/src/sound/cocoa_s.h b/src/sound/cocoa_s.h index dd893cc3e..7492164c5 100644 --- a/src/sound/cocoa_s.h +++ b/src/sound/cocoa_s.h @@ -19,6 +19,7 @@ public: /* virtual */ const char *Start(const char * const *param); /* virtual */ void Stop(); + /* virtual */ const char *GetName() const { return "cocoa"; } }; class FSoundDriver_Cocoa: public SoundDriverFactory<FSoundDriver_Cocoa> { diff --git a/src/sound/null_s.h b/src/sound/null_s.h index 26239ae18..050f39fc9 100644 --- a/src/sound/null_s.h +++ b/src/sound/null_s.h @@ -19,6 +19,7 @@ public: /* virtual */ const char *Start(const char * const *param) { return NULL; } /* virtual */ void Stop() { } + /* virtual */ const char *GetName() const { return "null"; } }; class FSoundDriver_Null: public SoundDriverFactory<FSoundDriver_Null> { diff --git a/src/sound/sdl_s.h b/src/sound/sdl_s.h index e664c4eb5..d8a4d587d 100644 --- a/src/sound/sdl_s.h +++ b/src/sound/sdl_s.h @@ -19,6 +19,7 @@ public: /* virtual */ const char *Start(const char * const *param); /* virtual */ void Stop(); + /* virtual */ const char *GetName() const { return "sdl"; } }; class FSoundDriver_SDL: public SoundDriverFactory<FSoundDriver_SDL> { diff --git a/src/sound/win32_s.h b/src/sound/win32_s.h index 0659ead34..c75d07594 100644 --- a/src/sound/win32_s.h +++ b/src/sound/win32_s.h @@ -19,6 +19,7 @@ public: /* virtual */ const char *Start(const char * const *param); /* virtual */ void Stop(); + /* virtual */ const char *GetName() const { return "win32"; } }; class FSoundDriver_Win32: public SoundDriverFactory<FSoundDriver_Win32> { diff --git a/src/video/allegro_v.h b/src/video/allegro_v.h index d9c3a985f..2cac11dd8 100644 --- a/src/video/allegro_v.h +++ b/src/video/allegro_v.h @@ -27,6 +27,7 @@ public: /* virtual */ bool ChangeResolution(int w, int h); /* virtual */ bool ToggleFullscreen(bool fullscreen); + /* virtual */ const char *GetName() const { return "allegro"; } }; class FVideoDriver_Allegro: public VideoDriverFactory<FVideoDriver_Allegro> { diff --git a/src/video/dedicated_v.h b/src/video/dedicated_v.h index 1f0d2cafa..7fd0c5391 100644 --- a/src/video/dedicated_v.h +++ b/src/video/dedicated_v.h @@ -27,6 +27,7 @@ public: /* virtual */ bool ChangeResolution(int w, int h); /* virtual */ bool ToggleFullscreen(bool fullscreen); + /* virtual */ const char *GetName() const { return "dedicated"; } }; class FVideoDriver_Dedicated: public VideoDriverFactory<FVideoDriver_Dedicated> { diff --git a/src/video/null_v.h b/src/video/null_v.h index 3a8eb7298..f9329d2d6 100644 --- a/src/video/null_v.h +++ b/src/video/null_v.h @@ -30,6 +30,7 @@ public: /* virtual */ bool ChangeResolution(int w, int h); /* virtual */ bool ToggleFullscreen(bool fullscreen); + /* virtual */ const char *GetName() const { return "null"; } }; class FVideoDriver_Null: public VideoDriverFactory<FVideoDriver_Null> { diff --git a/src/video/sdl_v.h b/src/video/sdl_v.h index 3fb6526c9..4d2faf9fe 100644 --- a/src/video/sdl_v.h +++ b/src/video/sdl_v.h @@ -27,6 +27,7 @@ public: /* virtual */ bool ChangeResolution(int w, int h); /* virtual */ bool ToggleFullscreen(bool fullscreen); + /* virtual */ const char *GetName() const { return "sdl"; } }; class FVideoDriver_SDL: public VideoDriverFactory<FVideoDriver_SDL> { diff --git a/src/video/win32_v.h b/src/video/win32_v.h index b83051fa5..efd82671c 100644 --- a/src/video/win32_v.h +++ b/src/video/win32_v.h @@ -27,6 +27,7 @@ public: /* virtual */ bool ChangeResolution(int w, int h); /* virtual */ bool ToggleFullscreen(bool fullscreen); + /* virtual */ const char *GetName() const { return "win32"; } }; class FVideoDriver_Win32: public VideoDriverFactory<FVideoDriver_Win32> { |