OsgCar.cpp: Do not create SDCarShader on "none" shaders
All checks were successful
/ build (pull_request) Successful in 13m24s

Even if "none" shaders were selected, the game would still parse
car.frag and execute the shaders, which is not the expected behaviour.
This commit is contained in:
Xavier Del Campo Romero 2025-01-02 00:45:34 +01:00
parent c677c8d9e2
commit 8f230211bb
Signed by: xavi
GPG key ID: 84FF3612A9BF43F2

View file

@ -644,7 +644,8 @@ osg::ref_ptr<osg::Node> SDCar::loadCar(tCarElt *Car, bool tracktype, bool subcat
else else
this->reflectionMappingMethod = REFLECTIONMAPPING_OFF; this->reflectionMappingMethod = REFLECTIONMAPPING_OFF;
this->shader = new SDCarShader(car_shaded_body.get(), this); if (_carShader > 0)
this->shader = new SDCarShader(car_shaded_body.get(), this);
this->reflectionMapping = new SDReflectionMapping(this); this->reflectionMapping = new SDReflectionMapping(this);
this->setReflectionMap(this->reflectionMapping->getReflectionMap()); this->setReflectionMap(this->reflectionMapping->getReflectionMap());