Better function name

This commit is contained in:
Benau 2016-04-03 13:59:10 +08:00
parent 508ddfcd45
commit 224bd277b3
15 changed files with 37 additions and 37 deletions

View File

@ -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.

View File

@ -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

View File

@ -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<CSkinnedMesh*>(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

View File

@ -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();

View File

@ -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);
}

View File

@ -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);

View File

@ -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();

View File

@ -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();

View File

@ -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

View File

@ -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)

View File

@ -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();

View File

@ -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<scene::IMesh*>(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);
}
}

View File

@ -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);

View File

@ -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

View File

@ -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;