diff --git a/lib/irrlicht/include/EMaterialTypes.h b/lib/irrlicht/include/EMaterialTypes.h index 364f01aaf..a6b153738 100644 --- a/lib/irrlicht/include/EMaterialTypes.h +++ b/lib/irrlicht/include/EMaterialTypes.h @@ -10,13 +10,13 @@ namespace irr namespace video { - //! Flag for karts in STK to use specific material - enum E_CUSTOM_MATERIAL_TYPE + //! Flag for mesh (mainly karts in STK) to use specific render type + enum E_RENDER_TYPE { - ECMT_DEFAULT = 0, - ECMT_TRANSPARENT, - ECMT_RED, - ECMT_BLUE + ERT_DEFAULT = 0, + ERT_TRANSPARENT, + ERT_RED, + ERT_BLUE }; //! Abstracted and easy to use fixed function/programmable pipeline material modes. diff --git a/lib/irrlicht/include/IMesh.h b/lib/irrlicht/include/IMesh.h index 2442f8ce0..33c5e2ceb 100644 --- a/lib/irrlicht/include/IMesh.h +++ b/lib/irrlicht/include/IMesh.h @@ -23,7 +23,7 @@ namespace scene class IMesh : public virtual IReferenceCounted { public: - IMesh() : cmt(video::ECMT_DEFAULT) {} + IMesh() : m_rt(video::ERT_DEFAULT) {} virtual ~IMesh() {} @@ -70,14 +70,14 @@ namespace scene on the GPU in the next render cycle. */ virtual void setDirty(E_BUFFER_TYPE buffer=EBT_VERTEX_AND_INDEX) = 0; - //! Set the mesh to use custom material type (mainly karts in STK) - /** \param m New custom material type for the mesh. */ - void setCustomMaterialType(video::E_CUSTOM_MATERIAL_TYPE m) { cmt = m; } + //! Set the mesh to use a specific render type (mainly karts in STK) + /** \param t New render type for the mesh. */ + void setRenderType(video::E_RENDER_TYPE t) { m_rt = t; } - //! Get the custom material type for the mesh(mainly karts in STK) - video::E_CUSTOM_MATERIAL_TYPE getCustomMaterialType() const { return cmt; } + //! Get the specific render type for the mesh (mainly karts in STK) + video::E_RENDER_TYPE getRenderType() const { return m_rt; } private: - video::E_CUSTOM_MATERIAL_TYPE cmt; + video::E_RENDER_TYPE m_rt; }; } // end namespace scene diff --git a/src/graphics/irr_driver.cpp b/src/graphics/irr_driver.cpp index 5c909a3b7..a1a6774ba 100644 --- a/src/graphics/irr_driver.cpp +++ b/src/graphics/irr_driver.cpp @@ -1014,7 +1014,7 @@ scene::IMesh *IrrDriver::getMesh(const std::string &filename) * need it anymore. */ scene::IAnimatedMesh *IrrDriver::copyAnimatedMesh(scene::IAnimatedMesh *orig, - video::E_CUSTOM_MATERIAL_TYPE cmt) + video::E_RENDER_TYPE rt) { using namespace scene; CSkinnedMesh *mesh = dynamic_cast(orig); @@ -1025,7 +1025,7 @@ scene::IAnimatedMesh *IrrDriver::copyAnimatedMesh(scene::IAnimatedMesh *orig, } scene::IAnimatedMesh* out = mesh->clone(); - out->setCustomMaterialType(cmt); + out->setRenderType(rt); return out; } // copyAnimatedMesh diff --git a/src/graphics/irr_driver.hpp b/src/graphics/irr_driver.hpp index 339e163f6..94d7d166a 100644 --- a/src/graphics/irr_driver.hpp +++ b/src/graphics/irr_driver.hpp @@ -354,7 +354,7 @@ public: scene::IAnimatedMesh *getAnimatedMesh(const std::string &name); scene::IMesh *getMesh(const std::string &name); scene::IAnimatedMesh *copyAnimatedMesh(scene::IAnimatedMesh *orig, - video::E_CUSTOM_MATERIAL_TYPE cmt); + video::E_RENDER_TYPE rt); video::ITexture *applyMask(video::ITexture* texture, const std::string& mask_path); void displayFPS(); diff --git a/src/graphics/stk_animated_mesh.cpp b/src/graphics/stk_animated_mesh.cpp index 94484f966..0fd1c5489 100644 --- a/src/graphics/stk_animated_mesh.cpp +++ b/src/graphics/stk_animated_mesh.cpp @@ -126,7 +126,7 @@ void STKAnimatedMesh::updateNoGL() TransparentMaterial TranspMat = getTransparentMaterialFromType(type, MaterialTypeParam, material); TransparentMesh[TranspMat].push_back(&mesh); } - else if (m->getCustomMaterialType() == video::ECMT_TRANSPARENT) + else if (m->getRenderType() == video::ERT_TRANSPARENT) { TransparentMesh[TM_ADDITIVE].push_back(&mesh); } diff --git a/src/graphics/stk_mesh_scene_node.cpp b/src/graphics/stk_mesh_scene_node.cpp index 066687ff2..35ef99d06 100644 --- a/src/graphics/stk_mesh_scene_node.cpp +++ b/src/graphics/stk_mesh_scene_node.cpp @@ -173,7 +173,7 @@ void STKMeshSceneNode::updateNoGL() GLMesh &mesh = GLmeshes[i]; Material* material = material_manager->getMaterialFor(mb->getMaterial().getTexture(0), mb); - if (Mesh->getCustomMaterialType() == video::ECMT_TRANSPARENT) + if (Mesh->getRenderType() == video::ERT_TRANSPARENT) { if (!immediate_draw) TransparentMesh[TM_ADDITIVE].push_back(&mesh); diff --git a/src/karts/abstract_kart.cpp b/src/karts/abstract_kart.cpp index 2ad7a6f5d..154e5f3c8 100644 --- a/src/karts/abstract_kart.cpp +++ b/src/karts/abstract_kart.cpp @@ -36,7 +36,7 @@ AbstractKart::AbstractKart(const std::string& ident, int world_kart_id, int position, const btTransform& init_transform, PerPlayerDifficulty difficulty, - video::E_CUSTOM_MATERIAL_TYPE cmt) + video::E_RENDER_TYPE rt) : Moveable() { m_world_kart_id = world_kart_id; @@ -60,7 +60,7 @@ AbstractKart::AbstractKart(const std::string& ident, // released when the kart is deleted, but since the original // kart_model is stored in the kart_properties all the time, // there is no risk of a mesh being deleted to early. - m_kart_model = m_kart_properties->getKartModelCopy(cmt); + m_kart_model = m_kart_properties->getKartModelCopy(rt); m_kart_width = m_kart_model->getWidth(); m_kart_height = m_kart_model->getHeight(); m_kart_length = m_kart_model->getLength(); diff --git a/src/karts/abstract_kart.hpp b/src/karts/abstract_kart.hpp index f94dfbc37..1658fd6b2 100644 --- a/src/karts/abstract_kart.hpp +++ b/src/karts/abstract_kart.hpp @@ -100,7 +100,7 @@ public: int world_kart_id, int position, const btTransform& init_transform, PerPlayerDifficulty difficulty, - video::E_CUSTOM_MATERIAL_TYPE cmt); + video::E_RENDER_TYPE rt); virtual ~AbstractKart(); virtual core::stringw getName() const; virtual void reset(); diff --git a/src/karts/ghost_kart.cpp b/src/karts/ghost_kart.cpp index e8ece7022..f592cd5c8 100644 --- a/src/karts/ghost_kart.cpp +++ b/src/karts/ghost_kart.cpp @@ -28,7 +28,7 @@ GhostKart::GhostKart(const std::string& ident, unsigned int world_kart_id, int position) : Kart(ident, world_kart_id, position, btTransform(btQuaternion(0, 0, 0, 1)), - PLAYER_DIFFICULTY_NORMAL, video::ECMT_TRANSPARENT) + PLAYER_DIFFICULTY_NORMAL, video::ERT_TRANSPARENT) { } // GhostKart diff --git a/src/karts/kart.cpp b/src/karts/kart.cpp index e7b400e2f..f472a7957 100644 --- a/src/karts/kart.cpp +++ b/src/karts/kart.cpp @@ -93,9 +93,9 @@ Kart::Kart (const std::string& ident, unsigned int world_kart_id, int position, const btTransform& init_transform, PerPlayerDifficulty difficulty, - video::E_CUSTOM_MATERIAL_TYPE cmt) + video::E_RENDER_TYPE rt) : AbstractKart(ident, world_kart_id, position, init_transform, - difficulty, cmt) + difficulty, rt) #if defined(WIN32) && !defined(__CYGWIN__) && !defined(__MINGW32__) # pragma warning(1:4355) diff --git a/src/karts/kart.hpp b/src/karts/kart.hpp index c751f72df..8e75fd3e7 100644 --- a/src/karts/kart.hpp +++ b/src/karts/kart.hpp @@ -232,7 +232,7 @@ public: Kart(const std::string& ident, unsigned int world_kart_id, int position, const btTransform& init_transform, PerPlayerDifficulty difficulty, - video::E_CUSTOM_MATERIAL_TYPE cmt = video::ECMT_DEFAULT); + video::E_RENDER_TYPE rt = video::ERT_DEFAULT); virtual ~Kart(); virtual void init(RaceManager::KartType type); virtual void kartIsInRestNow(); diff --git a/src/karts/kart_model.cpp b/src/karts/kart_model.cpp index f38b85bda..e896726a8 100644 --- a/src/karts/kart_model.cpp +++ b/src/karts/kart_model.cpp @@ -232,7 +232,7 @@ KartModel::~KartModel() { // m_wheel_model[i] can be NULL if (m_wheel_model[i] - ->getCustomMaterialType() == video::ECMT_TRANSPARENT) + ->getRenderType() == video::ERT_TRANSPARENT) { m_wheel_model[i]->drop(); } @@ -255,7 +255,7 @@ KartModel::~KartModel() // Drop the cloned model if created if (m_speed_weighted_objects[i].m_model - ->getCustomMaterialType() != video::ECMT_DEFAULT) + ->getRenderType() != video::ERT_DEFAULT) { m_speed_weighted_objects[i].m_model->drop(); } @@ -298,7 +298,7 @@ KartModel::~KartModel() * It is also marked not to be a master copy, so attachModel can be called * for this instance. */ -KartModel* KartModel::makeCopy(video::E_CUSTOM_MATERIAL_TYPE cmt) +KartModel* KartModel::makeCopy(video::E_RENDER_TYPE rt) { // Make sure that we are copying from a master objects, and // that there is indeed no animated node defined here ... @@ -311,7 +311,7 @@ KartModel* KartModel::makeCopy(video::E_CUSTOM_MATERIAL_TYPE cmt) km->m_kart_height = m_kart_height; km->m_kart_highest_point= m_kart_highest_point; km->m_kart_lowest_point = m_kart_lowest_point; - km->m_mesh = irr_driver->copyAnimatedMesh(m_mesh, cmt); + km->m_mesh = irr_driver->copyAnimatedMesh(m_mesh, rt); km->m_model_filename = m_model_filename; km->m_animation_speed = m_animation_speed; km->m_current_animation = AF_DEFAULT; @@ -329,11 +329,11 @@ KartModel* KartModel::makeCopy(video::E_CUSTOM_MATERIAL_TYPE cmt) { // Master should not have any wheel nodes. assert(!m_wheel_node[i]); - if (m_wheel_model[i] && cmt == video::ECMT_TRANSPARENT) + if (m_wheel_model[i] && rt == video::ERT_TRANSPARENT) { // Only clone the mesh if transparence is used scene::SMesh* clone = mani->createMeshCopy(m_wheel_model[i]); - clone->setCustomMaterialType(cmt); + clone->setRenderType(rt); km->m_wheel_model[i] = dynamic_cast(clone); } else @@ -353,11 +353,11 @@ KartModel* KartModel::makeCopy(video::E_CUSTOM_MATERIAL_TYPE cmt) // Master should not have any speed weighted nodes. assert(!m_speed_weighted_objects[i].m_node); km->m_speed_weighted_objects[i] = m_speed_weighted_objects[i]; - if (cmt != video::ECMT_DEFAULT) + if (rt != video::ERT_DEFAULT) { // Only clone the mesh if default type is not used km->m_speed_weighted_objects[i].m_model = irr_driver - ->copyAnimatedMesh(m_speed_weighted_objects[i].m_model, cmt); + ->copyAnimatedMesh(m_speed_weighted_objects[i].m_model, rt); } } diff --git a/src/karts/kart_model.hpp b/src/karts/kart_model.hpp index 5a6a723e4..000dd40fa 100644 --- a/src/karts/kart_model.hpp +++ b/src/karts/kart_model.hpp @@ -232,7 +232,7 @@ private: public: KartModel(bool is_master); ~KartModel(); - KartModel* makeCopy(video::E_CUSTOM_MATERIAL_TYPE cmt); + KartModel* makeCopy(video::E_RENDER_TYPE rt); void reset(); void loadInfo(const XMLNode &node); bool loadModels(const KartProperties &kart_properties); diff --git a/src/karts/kart_properties.hpp b/src/karts/kart_properties.hpp index d08c7207a..b61ac6c54 100644 --- a/src/karts/kart_properties.hpp +++ b/src/karts/kart_properties.hpp @@ -244,8 +244,8 @@ public: // ------------------------------------------------------------------------ /** Returns a pointer to the KartModel object. */ KartModel* getKartModelCopy - (video::E_CUSTOM_MATERIAL_TYPE cmt = video::ECMT_DEFAULT) const - {return m_kart_model->makeCopy(cmt); } + (video::E_RENDER_TYPE rt = video::ERT_DEFAULT) const + {return m_kart_model->makeCopy(rt); } // ------------------------------------------------------------------------ /** Returns a pointer to the main KartModel object. This copy diff --git a/src/modes/soccer_world.cpp b/src/modes/soccer_world.cpp index fe108268e..1c2750285 100644 --- a/src/modes/soccer_world.cpp +++ b/src/modes/soccer_world.cpp @@ -399,7 +399,7 @@ AbstractKart *SoccerWorld::createKart(const std::string &kart_ident, int index, AbstractKart *new_kart = new Kart(kart_ident, index, position, init_pos, difficulty, team == SOCCER_TEAM_BLUE ? - video::ECMT_BLUE : video::ECMT_RED); + video::ERT_BLUE : video::ERT_RED); new_kart->init(race_manager->getKartType(index)); Controller *controller = NULL;