summaryrefslogtreecommitdiff
path: root/src/video
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2007-07-07 20:31:23 +0000
committerpeter1138 <peter1138@openttd.org>2007-07-07 20:31:23 +0000
commit8b81cdd2a602d63b6b7f595383cedecf54046650 (patch)
tree0bd6f98a4074b190b9e2d63d8410f76306430377 /src/video
parent0543657b75fe3191d4232c2ebbac80f8b860617f (diff)
downloadopenttd-8b81cdd2a602d63b6b7f595383cedecf54046650.tar.xz
(svn r10471) -Codechange: implement driver probing priority so that 'preferred' drivers are loaded first
Diffstat (limited to 'src/video')
-rw-r--r--src/video/cocoa_v.h3
-rw-r--r--src/video/dedicated_v.h3
-rw-r--r--src/video/null_v.h3
-rw-r--r--src/video/sdl_v.h3
-rw-r--r--src/video/video_driver.hpp2
-rw-r--r--src/video/win32_v.h2
6 files changed, 5 insertions, 11 deletions
diff --git a/src/video/cocoa_v.h b/src/video/cocoa_v.h
index a6fd41871..bb980ad91 100644
--- a/src/video/cocoa_v.h
+++ b/src/video/cocoa_v.h
@@ -7,8 +7,6 @@
class VideoDriver_Cocoa: public VideoDriver {
public:
- /* virtual */ bool CanProbe() { return true; }
-
/* virtual */ const char *Start(const char * const *param);
/* virtual */ void Stop();
@@ -24,6 +22,7 @@ public:
class FVideoDriver_Cocoa: public VideoDriverFactory<FVideoDriver_Cocoa> {
public:
+ static const int priority = 10;
/* virtual */ const char *GetName() { return "cocoa"; }
/* virtual */ const char *GetDescription() { return "Cocoa Video Driver"; }
/* virtual */ Driver *CreateInstance() { return new VideoDriver_Cocoa(); }
diff --git a/src/video/dedicated_v.h b/src/video/dedicated_v.h
index d1dccd0c9..a2de1c275 100644
--- a/src/video/dedicated_v.h
+++ b/src/video/dedicated_v.h
@@ -7,8 +7,6 @@
class VideoDriver_Dedicated: public VideoDriver {
public:
- /* virtual */ bool CanProbe() { return false; }
-
/* virtual */ const char *Start(const char * const *param);
/* virtual */ void Stop();
@@ -24,6 +22,7 @@ public:
class FVideoDriver_Dedicated: public VideoDriverFactory<FVideoDriver_Dedicated> {
public:
+ static const int priority = 0;
/* virtual */ const char *GetName() { return "dedicated"; }
/* virtual */ const char *GetDescription() { return "Dedicated Video Driver"; }
/* virtual */ Driver *CreateInstance() { return new VideoDriver_Dedicated(); }
diff --git a/src/video/null_v.h b/src/video/null_v.h
index 0e65933e8..b5b21bbbb 100644
--- a/src/video/null_v.h
+++ b/src/video/null_v.h
@@ -7,8 +7,6 @@
class VideoDriver_Null: public VideoDriver {
public:
- /* virtual */ bool CanProbe() { return false; }
-
/* virtual */ const char *Start(const char * const *param);
/* virtual */ void Stop();
@@ -24,6 +22,7 @@ public:
class FVideoDriver_Null: public VideoDriverFactory<FVideoDriver_Null> {
public:
+ static const int priority = 1;
/* virtual */ const char *GetName() { return "null"; }
/* virtual */ const char *GetDescription() { return "Null Video Driver"; }
/* virtual */ Driver *CreateInstance() { return new VideoDriver_Null(); }
diff --git a/src/video/sdl_v.h b/src/video/sdl_v.h
index ff494919d..fdfded49c 100644
--- a/src/video/sdl_v.h
+++ b/src/video/sdl_v.h
@@ -7,8 +7,6 @@
class VideoDriver_SDL: public VideoDriver {
public:
- /* virtual */ bool CanProbe() { return true; }
-
/* virtual */ const char *Start(const char * const *param);
/* virtual */ void Stop();
@@ -24,6 +22,7 @@ public:
class FVideoDriver_SDL: public VideoDriverFactory<FVideoDriver_SDL> {
public:
+ static const int priority = 5;
/* virtual */ const char *GetName() { return "sdl"; }
/* virtual */ const char *GetDescription() { return "SDL Video Driver"; }
/* virtual */ Driver *CreateInstance() { return new VideoDriver_SDL(); }
diff --git a/src/video/video_driver.hpp b/src/video/video_driver.hpp
index eab438491..048c233b9 100644
--- a/src/video/video_driver.hpp
+++ b/src/video/video_driver.hpp
@@ -22,7 +22,7 @@ class VideoDriverFactoryBase: public DriverFactoryBase {
template <class T>
class VideoDriverFactory: public VideoDriverFactoryBase {
public:
- VideoDriverFactory() { this->RegisterDriver(((T *)this)->GetName(), Driver::DT_VIDEO); }
+ VideoDriverFactory() { this->RegisterDriver(((T *)this)->GetName(), Driver::DT_VIDEO, ((T *)this)->priority); }
/**
* Get the long, human readable, name for the Driver-class.
diff --git a/src/video/win32_v.h b/src/video/win32_v.h
index 0b05ff5db..1f412ecb0 100644
--- a/src/video/win32_v.h
+++ b/src/video/win32_v.h
@@ -7,8 +7,6 @@
class VideoDriver_Win32: public VideoDriver {
public:
- /* virtual */ bool CanProbe() { return true; }
-
/* virtual */ const char *Start(const char * const *param);
/* virtual */ void Stop();