Remove irrlicht item node in no graphics STK

This commit is contained in:
Benau 2020-02-20 11:00:49 +08:00
parent c0a350fe6e
commit 96541cf8af

View File

@ -23,6 +23,7 @@
#include "graphics/lod_node.hpp"
#include "graphics/sp/sp_mesh.hpp"
#include "graphics/sp/sp_mesh_node.hpp"
#include "guiengine/engine.hpp"
#include "items/item_manager.hpp"
#include "karts/abstract_kart.hpp"
#include "modes/world.hpp"
@ -201,6 +202,9 @@ Item::Item(ItemType type, const Vec3& xyz, const Vec3& normal,
initItem(type, xyz, normal);
m_graphical_type = getGrahpicalType();
m_node = NULL;
if (!GUIEngine::isNoGraphics())
{
LODNode* lodnode =
new LODNode("item", irr_driver->getSceneManager()->getRootSceneNode(),
irr_driver->getSceneManager());
@ -220,9 +224,12 @@ Item::Item(ItemType type, const Vec3& xyz, const Vec3& normal,
lodnode->add(100, meshnode, true);
}
m_node = lodnode;
}
setType(type);
handleNewMesh(getGrahpicalType());
if (!m_node)
return;
#ifdef DEBUG
std::string debug_name("item: ");
debug_name += getType();