Fixed --no-graphics option.
This commit is contained in:
parent
4833659085
commit
9b9fc2ee35
@ -27,6 +27,7 @@
|
|||||||
#include "graphics/shaders.hpp"
|
#include "graphics/shaders.hpp"
|
||||||
#include "io/file_manager.hpp"
|
#include "io/file_manager.hpp"
|
||||||
#include "io/xml_node.hpp"
|
#include "io/xml_node.hpp"
|
||||||
|
#include "modes/profile_world.hpp"
|
||||||
#include "modes/world.hpp"
|
#include "modes/world.hpp"
|
||||||
#include "tracks/track.hpp"
|
#include "tracks/track.hpp"
|
||||||
#include "utils/string_utils.hpp"
|
#include "utils/string_utils.hpp"
|
||||||
@ -127,11 +128,16 @@ Material* MaterialManager::getDefaultMaterial(video::E_MATERIAL_TYPE shader_type
|
|||||||
|
|
||||||
// TODO: workaround, should not hardcode these material types here?
|
// TODO: workaround, should not hardcode these material types here?
|
||||||
// Try to find a cleaner way
|
// Try to find a cleaner way
|
||||||
if (shader_type == Shaders::getShader(ShaderType::ES_OBJECT_UNLIT))
|
// If graphics are disabled, shaders should not be accessed (getShader
|
||||||
|
// asserts that shaders are initialised).
|
||||||
|
if(!ProfileWorld::isNoGraphics() &&
|
||||||
|
shader_type == Shaders::getShader(ShaderType::ES_OBJECT_UNLIT))
|
||||||
default_material->setShaderType(Material::SHADERTYPE_SOLID_UNLIT);
|
default_material->setShaderType(Material::SHADERTYPE_SOLID_UNLIT);
|
||||||
else if (shader_type == Shaders::getShader(ShaderType::ES_OBJECTPASS_REF))
|
else if (!ProfileWorld::isNoGraphics() &&
|
||||||
|
shader_type == Shaders::getShader(ShaderType::ES_OBJECTPASS_REF))
|
||||||
default_material->setShaderType(Material::SHADERTYPE_ALPHA_TEST);
|
default_material->setShaderType(Material::SHADERTYPE_ALPHA_TEST);
|
||||||
//else if (shader_type == Shaders::getShader(ShaderType::ES_OBJECTPASS))
|
//else if (!ProfileWorld::isNoGraphics() &&
|
||||||
|
// shader_type == Shaders::getShader(ShaderType::ES_OBJECTPASS))
|
||||||
// default_material->setShaderType(Material::SHADERTYPE_ALPHA_BLEND);
|
// default_material->setShaderType(Material::SHADERTYPE_ALPHA_BLEND);
|
||||||
else
|
else
|
||||||
default_material->setShaderType(Material::SHADERTYPE_SOLID);
|
default_material->setShaderType(Material::SHADERTYPE_SOLID);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user