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 | f1336fba6821591cd2a9b40d8fa4b2f6c6e2423c (patch) | |
tree | 7a9902f87091957529265ccda02342bdc7d7ae6d /src/blitter | |
parent | 1e4f8d7a236e3cdc0871fa0e102a5baa660c7060 (diff) | |
download | openttd-f1336fba6821591cd2a9b40d8fa4b2f6c6e2423c.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')
-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; |