Make item fog be based in track fog. Remove old lighting flag comment.
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@7245 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
@@ -21,6 +21,8 @@
|
||||
|
||||
#include "graphics/irr_driver.hpp"
|
||||
#include "karts/kart.hpp"
|
||||
#include "modes/world.hpp"
|
||||
#include "tracks/track.hpp"
|
||||
#include "utils/constants.hpp"
|
||||
#include "utils/vec3.hpp"
|
||||
|
||||
@@ -48,6 +50,7 @@ Item::Item(ItemType type, const Vec3& xyz, const Vec3& normal,
|
||||
m_node->setName(debug_name.c_str());
|
||||
#endif
|
||||
|
||||
World::getWorld()->getTrack()->adjustForFog(m_node);
|
||||
m_node->setAutomaticCulling(scene::EAC_FRUSTUM_BOX);
|
||||
m_node->setPosition(xyz.toIrrVector());
|
||||
m_node->setRotation(hpr.toIrrHPR());
|
||||
|
||||
@@ -116,12 +116,6 @@ void ItemManager::loadDefaultItems()
|
||||
item_names[i].c_str());
|
||||
exit(-1);
|
||||
}
|
||||
// If items show the polygons instead of being smooth re-export with
|
||||
// normals (that was bananas' problem) but do not disable this flag
|
||||
//mesh->setMaterialFlag(video::EMF_LIGHTING, false);
|
||||
// FIXME this should check if current track uses fog or not
|
||||
// otherwise items look wrong when far away and track has no fog
|
||||
mesh->setMaterialFlag(video::EMF_FOG_ENABLE, true);
|
||||
std::string shortName =
|
||||
StringUtils::getBasename(StringUtils::removeExtension(model_filename));
|
||||
m_all_meshes[shortName] = mesh;
|
||||
|
||||
Reference in New Issue
Block a user