mirror of
				https://github.com/luanti-org/luanti.git
				synced 2025-11-04 09:15:29 +01:00 
			
		
		
		
	Fall back to default when rendering mode (3d_mode) is set invalid (#10922)
This commit is contained in:
		
				
					committed by
					
						
						GitHub
					
				
			
			
				
	
			
			
			
						parent
						
							fbb9ef3818
						
					
				
				
					commit
					3ac07ad34d
				
			@@ -19,7 +19,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#include "factory.h"
 | 
			
		||||
#include <stdexcept>
 | 
			
		||||
#include "log.h"
 | 
			
		||||
#include "plain.h"
 | 
			
		||||
#include "anaglyph.h"
 | 
			
		||||
#include "interlaced.h"
 | 
			
		||||
@@ -45,5 +45,8 @@ RenderingCore *createRenderingCore(const std::string &stereo_mode, IrrlichtDevic
 | 
			
		||||
		return new RenderingCoreSideBySide(device, client, hud, true);
 | 
			
		||||
	if (stereo_mode == "crossview")
 | 
			
		||||
		return new RenderingCoreSideBySide(device, client, hud, false, true);
 | 
			
		||||
	throw std::invalid_argument("Invalid rendering mode: " + stereo_mode);
 | 
			
		||||
 | 
			
		||||
	// fallback to plain renderer
 | 
			
		||||
	errorstream << "Invalid rendering mode: " << stereo_mode << std::endl;
 | 
			
		||||
	return new RenderingCorePlain(device, client, hud);
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user