Changeset - r24907:50a084473088
[Not reviewed]
master
0 1 0
Michael Lutz - 3 years ago 2021-01-16 15:43:40
michi@icosahedron.de
Codechange: Allow blitter factories to decide at runtime if the blitter is usable.
1 file changed with 10 insertions and 1 deletions:
0 comments (0 inline, 0 general)
src/blitter/factory.hpp
Show inline comments
 
@@ -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:
 
	virtual ~BlitterFactory()
 
	{
 
@@ -119,7 +128,7 @@ public:
 
		for (; it != GetBlitters().end(); it++) {
 
			BlitterFactory *b = (*it).second;
 
			if (strcasecmp(bname, b->name.c_str()) == 0) {
 
				return b;
 
				return b->IsUsable() ? b : nullptr;
 
			}
 
		}
 
		return nullptr;
0 comments (0 inline, 0 general)