From 9e90bd251d6c9282ee4f2732776ddb346002ff7f Mon Sep 17 00:00:00 2001 From: Benau Date: Sat, 13 Jan 2018 15:16:16 +0800 Subject: [PATCH] Use hardware skinning GR in sp_mesh_node --- src/graphics/sp/sp_mesh_node.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/graphics/sp/sp_mesh_node.cpp b/src/graphics/sp/sp_mesh_node.cpp index c4ca6bb76..aaa9d8c4d 100644 --- a/src/graphics/sp/sp_mesh_node.cpp +++ b/src/graphics/sp/sp_mesh_node.cpp @@ -21,6 +21,7 @@ #include "graphics/sp/sp_mesh.hpp" #include "graphics/sp/sp_mesh_buffer.hpp" #include "graphics/sp/sp_shader.hpp" +#include "graphics/graphics_restrictions.hpp" #include "graphics/irr_driver.hpp" #include "graphics/material.hpp" #include "graphics/render_info.hpp" @@ -68,7 +69,11 @@ void SPMeshNode::setAnimationState(bool val) { return; } - m_animated = !m_mesh->isStatic() && val; +#ifndef SERVER_ONLY + m_animated = !m_mesh->isStatic() && val && + !GraphicsRestrictions::isDisabled + (GraphicsRestrictions::GR_HARDWARE_SKINNING); +#endif } // setAnimationState // ---------------------------------------------------------------------------- @@ -86,7 +91,11 @@ void SPMeshNode::setMesh(irr::scene::IAnimatedMesh* mesh) m_texture_matrices.resize(m_mesh->getMeshBufferCount()); if (!m_mesh->isStatic()) { - m_animated = !m_mesh->isStatic(); +#ifndef SERVER_ONLY + m_animated = !m_mesh->isStatic() && + !GraphicsRestrictions::isDisabled + (GraphicsRestrictions::GR_HARDWARE_SKINNING); +#endif unsigned bone_idx = 0; m_skinning_matrices.resize(m_mesh->getJointCount()); for (Armature& arm : m_mesh->getArmatures())