diff options
author | truelight <truelight@openttd.org> | 2007-09-13 12:28:53 +0000 |
---|---|---|
committer | truelight <truelight@openttd.org> | 2007-09-13 12:28:53 +0000 |
commit | ca161c8e72efc673c23662d62be05a9f5e16da0e (patch) | |
tree | 7a9902f87091957529265ccda02342bdc7d7ae6d /src/blitter/factory.hpp | |
parent | 495c07cd08b46295002350c770389d780c5f2a5f (diff) | |
download | openttd-ca161c8e72efc673c23662d62be05a9f5e16da0e.tar.xz |
(svn r11092) -Add: allow 'blitter=<value>' in openttd.cfg to set the blitter (so you don't have to keep on doing 'openttd -b 32bpp-optimized'..)
Diffstat (limited to 'src/blitter/factory.hpp')
-rw-r--r-- | src/blitter/factory.hpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/blitter/factory.hpp b/src/blitter/factory.hpp index beb35cba5..3e7fc954a 100644 --- a/src/blitter/factory.hpp +++ b/src/blitter/factory.hpp @@ -4,6 +4,7 @@ #define BLITTER_FACTORY_HPP #include "base.hpp" +#include "../string.h" #include <string> #include <map> @@ -61,12 +62,15 @@ public: */ static Blitter *SelectBlitter(const char *name) { + const char *default_blitter = "8bpp-optimized"; + if (GetBlitters().size() == 0) return NULL; + const char *bname = (StrEmpty(name)) ? default_blitter : name; Blitters::iterator it = GetBlitters().begin(); for (; it != GetBlitters().end(); it++) { BlitterFactoryBase *b = (*it).second; - if (strcasecmp(name, b->name) == 0) { + if (strcasecmp(bname, b->name) == 0) { Blitter *newb = b->CreateInstance(); delete *GetActiveBlitter(); *GetActiveBlitter() = newb; |