Remove old code for getting straight frame

With hardware skinning it is not necessary
This commit is contained in:
Benau 2016-12-23 00:44:26 +08:00
parent bfd57659eb
commit 28841d601d
5 changed files with 11 additions and 32 deletions

View File

@ -1228,8 +1228,7 @@ scene::IMeshSceneNode *IrrDriver::addMesh(scene::IMesh *mesh,
const std::string& debug_name,
scene::ISceneNode *parent,
RenderInfo* render_info,
bool all_parts_colorized,
int frame_for_mesh)
bool all_parts_colorized)
{
#ifdef SERVER_ONLY
return m_scene_manager->addMeshSceneNode(mesh, parent);
@ -1247,8 +1246,7 @@ scene::IMeshSceneNode *IrrDriver::addMesh(scene::IMesh *mesh,
core::vector3df(0, 0, 0),
core::vector3df(1.0f, 1.0f, 1.0f),
true, render_info,
all_parts_colorized,
frame_for_mesh);
all_parts_colorized);
node->drop();
return node;

View File

@ -255,8 +255,7 @@ public:
const std::string& debug_name,
scene::ISceneNode *parent = NULL,
RenderInfo* render_info = NULL,
bool all_parts_colorized = false,
int frame_for_mesh = -1);
bool all_parts_colorized = false);
PerCameraNode *addPerCameraNode(scene::ISceneNode* node,
scene::ICameraSceneNode* cam,
scene::ISceneNode *parent = NULL);

View File

@ -52,14 +52,12 @@ STKMeshSceneNode::STKMeshSceneNode(irr::scene::IMesh* mesh, ISceneNode* parent,
irr::s32 id, const std::string& debug_name,
const irr::core::vector3df& position,
const irr::core::vector3df& rotation,
const irr::core::vector3df& scale, bool createGLMeshes, RenderInfo* render_info, bool all_parts_colorized,
int frame_for_mesh) :
const irr::core::vector3df& scale, bool createGLMeshes, RenderInfo* render_info, bool all_parts_colorized) :
CMeshSceneNode(mesh, parent, mgr, id, position, rotation, scale)
{
isDisplacement = false;
immediate_draw = false;
update_each_frame = false;
m_frame_for_mesh = frame_for_mesh;
isGlow = false;
m_got_animated_matrix = false;
@ -262,18 +260,9 @@ void STKMeshSceneNode::updateGL()
{
if (isGLInitialized)
return;
scene::IAnimatedMesh* am = dynamic_cast<scene::IAnimatedMesh*>(Mesh);
scene::IMesh* m = Mesh;
if (am && m_frame_for_mesh > -1)
for (u32 i = 0; i < Mesh->getMeshBufferCount(); ++i)
{
// Get the correct frame of animation for animated mesh
m = am->getMesh(m_frame_for_mesh);
}
for (u32 i = 0; i < m->getMeshBufferCount(); ++i)
{
scene::IMeshBuffer* mb = m->getMeshBuffer(i);
scene::IMeshBuffer* mb = Mesh->getMeshBuffer(i);
if (!mb)
continue;
GLMesh &mesh = GLmeshes[i];

View File

@ -29,7 +29,6 @@ class STKMeshSceneNode : public irr::scene::CMeshSceneNode, public STKMeshCommon
{
protected:
PtrVector<RenderInfo> m_static_render_info;
int m_frame_for_mesh;
bool m_got_animated_matrix;
std::vector<GLMesh> GLmeshes;
core::matrix4 ModelViewProjectionMatrix;
@ -60,8 +59,7 @@ public:
const irr::core::vector3df& rotation = irr::core::vector3df(0, 0, 0),
const irr::core::vector3df& scale = irr::core::vector3df(1.0f, 1.0f, 1.0f),
bool createGLMeshes = true,
RenderInfo* render_info = NULL, bool all_parts_colorized = false,
int frame_for_mesh = -1);
RenderInfo* render_info = NULL, bool all_parts_colorized = false);
virtual void render();
virtual void setMesh(irr::scene::IMesh* mesh);
virtual void OnRegisterSceneNode();

View File

@ -427,21 +427,16 @@ scene::ISceneNode* KartModel::attachModel(bool animated_models, bool always_anim
: 0;
scene::IMesh* main_frame = m_mesh;
#ifndef SERVER_ONLY
if (!CVS->isGLSL())
{
main_frame = m_mesh->getMesh(straight_frame);
main_frame->setHardwareMappingHint(scene::EHM_STATIC);
}
#endif
main_frame = m_mesh->getMesh(straight_frame);
main_frame->setHardwareMappingHint(scene::EHM_STATIC);
std::string debug_name;
#ifdef DEBUG
debug_name = m_model_filename + " (kart-model)";
debug_name = m_model_filename + " (kart-model)";
#endif
node = irr_driver->addMesh(main_frame, debug_name,
NULL /*parent*/, getRenderInfo(), false, straight_frame);
NULL /*parent*/, getRenderInfo());
#ifdef DEBUG
node->setName(debug_name.c_str());