mirror of https://github.com/OpenTTD/OpenTTD
Codechange: Allow blitter factories to decide at runtime if the blitter is usable.
parent
d62e302768
commit
01ef44fa4f
|
@ -73,6 +73,15 @@ protected:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Is the blitter usable with the current drivers and hardware config?
|
||||||
|
* @return True if the blitter can be instantiated.
|
||||||
|
*/
|
||||||
|
virtual bool IsUsable() const
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
virtual ~BlitterFactory()
|
virtual ~BlitterFactory()
|
||||||
{
|
{
|
||||||
|
@ -119,7 +128,7 @@ public:
|
||||||
for (; it != GetBlitters().end(); it++) {
|
for (; it != GetBlitters().end(); it++) {
|
||||||
BlitterFactory *b = (*it).second;
|
BlitterFactory *b = (*it).second;
|
||||||
if (strcasecmp(bname, b->name.c_str()) == 0) {
|
if (strcasecmp(bname, b->name.c_str()) == 0) {
|
||||||
return b;
|
return b->IsUsable() ? b : nullptr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|
Loading…
Reference in New Issue