Changeset - r12277:5454d21f0c89
[Not reviewed]
master
0 2 0
rubidium - 15 years ago 2009-06-30 16:20:16
rubidium@openttd.org
(svn r16702) -Change: don't implicitly fall back to the null/dedicated (video) drivers, but show an error message that no driver could be found. You can still explicitly start the null drivers thought.
2 files changed with 3 insertions and 3 deletions:
0 comments (0 inline, 0 general)
src/driver.cpp
Show inline comments
 
@@ -52,26 +52,26 @@ int GetDriverParamInt(const char * const
 
}
 

	
 
/**
 
 * Find the requested driver and return its class.
 
 * @param name the driver to select.
 
 * @post Sets the driver so GetCurrentDriver() returns it too.
 
 */
 
Driver *DriverFactoryBase::SelectDriver(const char *name, Driver::Type type)
 
{
 
	if (GetDrivers().size() == 0) return NULL;
 

	
 
	if (StrEmpty(name)) {
 
		/* Probe for this driver */
 
		for (int priority = 10; priority >= 0; priority--) {
 
		/* Probe for this driver, but do not fall back to dedicated/null! */
 
		for (int priority = 10; priority > 0; priority--) {
 
			Drivers::iterator it = GetDrivers().begin();
 
			for (; it != GetDrivers().end(); ++it) {
 
				DriverFactoryBase *d = (*it).second;
 

	
 
				/* Check driver type */
 
				if (d->type != type) continue;
 
				if (d->priority != priority) continue;
 

	
 
				Driver *newd = d->CreateInstance();
 
				const char *err = newd->Start(NULL);
 
				if (err == NULL) {
 
					DEBUG(driver, 1, "Successfully probed %s driver '%s'", GetDriverTypeName(type), d->name);
src/video/null_v.h
Show inline comments
 
@@ -18,19 +18,19 @@ public:
 

	
 
	/* virtual */ void MakeDirty(int left, int top, int width, int height);
 

	
 
	/* virtual */ void MainLoop();
 

	
 
	/* virtual */ bool ChangeResolution(int w, int h);
 

	
 
	/* virtual */ bool ToggleFullscreen(bool fullscreen);
 
};
 

	
 
class FVideoDriver_Null: public VideoDriverFactory<FVideoDriver_Null> {
 
public:
 
	static const int priority = 1;
 
	static const int priority = 0;
 
	/* virtual */ const char *GetName() { return "null"; }
 
	/* virtual */ const char *GetDescription() { return "Null Video Driver"; }
 
	/* virtual */ Driver *CreateInstance() { return new VideoDriver_Null(); }
 
};
 

	
 
#endif /* VIDEO_NULL_H */
0 comments (0 inline, 0 general)