From 238a78f13f337c8d86a0b7a7af1c752b274e54a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Sun, 19 Aug 2018 12:09:41 +0200 Subject: [PATCH] Fix compiling SkeletonIK with disable_3d Fixes #20825. --- scene/animation/skeleton_ik.cpp | 4 ++++ scene/animation/skeleton_ik.h | 4 ++++ scene/register_scene_types.cpp | 6 +++--- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/scene/animation/skeleton_ik.cpp b/scene/animation/skeleton_ik.cpp index 4991cedfabd..9b1cb1369a7 100644 --- a/scene/animation/skeleton_ik.cpp +++ b/scene/animation/skeleton_ik.cpp @@ -34,6 +34,8 @@ #include "skeleton_ik.h" +#ifndef _3D_DISABLED + FabrikInverseKinematic::ChainItem *FabrikInverseKinematic::ChainItem::find_child(const BoneId p_bone_id) { for (int i = childs.size() - 1; 0 <= i; --i) { if (p_bone_id == childs[i].bone) { @@ -549,3 +551,5 @@ void SkeletonIK::_solve_chain() { return; FabrikInverseKinematic::solve(task, interpolation, use_magnet, magnet_position); } + +#endif // _3D_DISABLED diff --git a/scene/animation/skeleton_ik.h b/scene/animation/skeleton_ik.h index 366c599c01c..08fb00e7981 100644 --- a/scene/animation/skeleton_ik.h +++ b/scene/animation/skeleton_ik.h @@ -31,6 +31,8 @@ #ifndef SKELETON_IK_H #define SKELETON_IK_H +#ifndef _3D_DISABLED + /** * @author AndreaCatania */ @@ -209,4 +211,6 @@ private: void _solve_chain(); }; +#endif // _3D_DISABLED + #endif // SKELETON_IK_H diff --git a/scene/register_scene_types.cpp b/scene/register_scene_types.cpp index 382bddfb4e2..d066814069a 100644 --- a/scene/register_scene_types.cpp +++ b/scene/register_scene_types.cpp @@ -51,7 +51,6 @@ #include "scene/2d/parallax_background.h" #include "scene/2d/parallax_layer.h" #include "scene/2d/particles_2d.h" - #include "scene/2d/path_2d.h" #include "scene/2d/physics_body_2d.h" #include "scene/2d/polygon_2d.h" @@ -366,14 +365,12 @@ void register_scene_types() { ClassDB::register_class(); ClassDB::register_virtual_class(); ClassDB::register_class(); - ClassDB::register_class(); ClassDB::register_class(); ClassDB::register_class(); OS::get_singleton()->yield(); //may take time to init #ifndef _3D_DISABLED - ClassDB::register_class(); ClassDB::register_virtual_class(); ClassDB::register_virtual_class(); ClassDB::register_class(); @@ -438,6 +435,9 @@ void register_scene_types() { ClassDB::register_class(); ClassDB::register_class(); + ClassDB::register_class(); + ClassDB::register_class(); + ClassDB::register_class(); ClassDB::register_class(); ClassDB::register_class();