summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorA Thousand Ships <96648715+AThousandShips@users.noreply.github.com>2024-01-06 14:06:10 +0100
committerA Thousand Ships <96648715+AThousandShips@users.noreply.github.com>2024-01-07 00:44:33 +0100
commitc6a1ae78750919dfa30e8af6adf856565593cc18 (patch)
tree49169962fb4d00a53e1f257bd97b47ed0e94f6c6
parentc8c483cf57a768110fce57e509f9b855e69d34b7 (diff)
downloadredot-engine-c6a1ae78750919dfa30e8af6adf856565593cc18.tar.gz
Fix some build errors with `disable_3d=Yes`
* Some tests were incorrectly included * SCU builds with animation * Animation `switch`
-rw-r--r--scene/animation/animation_mixer.cpp15
-rw-r--r--scene/animation/root_motion_view.cpp4
-rw-r--r--scene/register_scene_types.cpp2
-rw-r--r--tests/test_main.cpp15
4 files changed, 18 insertions, 18 deletions
diff --git a/scene/animation/animation_mixer.cpp b/scene/animation/animation_mixer.cpp
index 2338c305de..ff4d529839 100644
--- a/scene/animation/animation_mixer.cpp
+++ b/scene/animation/animation_mixer.cpp
@@ -953,19 +953,12 @@ Variant AnimationMixer::post_process_key_value(const Ref<Animation> &p_anim, int
}
Variant AnimationMixer::_post_process_key_value(const Ref<Animation> &p_anim, int p_track, Variant p_value, const Object *p_object, int p_object_idx) {
- switch (p_anim->track_get_type(p_track)) {
#ifndef _3D_DISABLED
- case Animation::TYPE_POSITION_3D: {
- if (p_object_idx >= 0) {
- const Skeleton3D *skel = Object::cast_to<Skeleton3D>(p_object);
- return Vector3(p_value) * skel->get_motion_scale();
- }
- return p_value;
- } break;
-#endif // _3D_DISABLED
- default: {
- } break;
+ if (p_object_idx >= 0 && p_anim->track_get_type(p_track) == Animation::TYPE_POSITION_3D) {
+ const Skeleton3D *skel = Object::cast_to<Skeleton3D>(p_object);
+ return Vector3(p_value) * skel->get_motion_scale();
}
+#endif // _3D_DISABLED
return p_value;
}
diff --git a/scene/animation/root_motion_view.cpp b/scene/animation/root_motion_view.cpp
index 645850015b..fd520dadd6 100644
--- a/scene/animation/root_motion_view.cpp
+++ b/scene/animation/root_motion_view.cpp
@@ -28,6 +28,8 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
+#ifndef _3D_DISABLED
+
#include "root_motion_view.h"
#include "scene/animation/animation_tree.h"
@@ -203,3 +205,5 @@ RootMotionView::RootMotionView() {
RootMotionView::~RootMotionView() {
set_base(RID());
}
+
+#endif // _3D_DISABLED
diff --git a/scene/register_scene_types.cpp b/scene/register_scene_types.cpp
index baaa78f9f2..111d6447a0 100644
--- a/scene/register_scene_types.cpp
+++ b/scene/register_scene_types.cpp
@@ -78,7 +78,6 @@
#include "scene/animation/animation_node_state_machine.h"
#include "scene/animation/animation_player.h"
#include "scene/animation/animation_tree.h"
-#include "scene/animation/root_motion_view.h"
#include "scene/animation/tween.h"
#include "scene/audio/audio_stream_player.h"
#include "scene/debugger/scene_debugger.h"
@@ -273,6 +272,7 @@
#include "scene/3d/voxel_gi.h"
#include "scene/3d/world_environment.h"
#include "scene/3d/xr_nodes.h"
+#include "scene/animation/root_motion_view.h"
#include "scene/resources/environment.h"
#include "scene/resources/fog_material.h"
#include "scene/resources/importer_mesh.h"
diff --git a/tests/test_main.cpp b/tests/test_main.cpp
index 5187ebd00f..07ea9a3cd6 100644
--- a/tests/test_main.cpp
+++ b/tests/test_main.cpp
@@ -94,7 +94,6 @@
#include "tests/scene/test_arraymesh.h"
#include "tests/scene/test_audio_stream_wav.h"
#include "tests/scene/test_bit_map.h"
-#include "tests/scene/test_camera_3d.h"
#include "tests/scene/test_code_edit.h"
#include "tests/scene/test_color_picker.h"
#include "tests/scene/test_control.h"
@@ -103,16 +102,12 @@
#include "tests/scene/test_curve_3d.h"
#include "tests/scene/test_gradient.h"
#include "tests/scene/test_navigation_agent_2d.h"
-#include "tests/scene/test_navigation_agent_3d.h"
#include "tests/scene/test_navigation_obstacle_2d.h"
-#include "tests/scene/test_navigation_obstacle_3d.h"
#include "tests/scene/test_navigation_region_2d.h"
-#include "tests/scene/test_navigation_region_3d.h"
#include "tests/scene/test_node.h"
#include "tests/scene/test_node_2d.h"
#include "tests/scene/test_packed_scene.h"
#include "tests/scene/test_path_2d.h"
-#include "tests/scene/test_path_3d.h"
#include "tests/scene/test_primitives.h"
#include "tests/scene/test_sprite_frames.h"
#include "tests/scene/test_text_edit.h"
@@ -122,10 +117,18 @@
#include "tests/scene/test_window.h"
#include "tests/servers/rendering/test_shader_preprocessor.h"
#include "tests/servers/test_navigation_server_2d.h"
-#include "tests/servers/test_navigation_server_3d.h"
#include "tests/servers/test_text_server.h"
#include "tests/test_validate_testing.h"
+#ifndef _3D_DISABLED
+#include "tests/scene/test_camera_3d.h"
+#include "tests/scene/test_navigation_agent_3d.h"
+#include "tests/scene/test_navigation_obstacle_3d.h"
+#include "tests/scene/test_navigation_region_3d.h"
+#include "tests/scene/test_path_3d.h"
+#include "tests/servers/test_navigation_server_3d.h"
+#endif // _3D_DISABLED
+
#include "modules/modules_tests.gen.h"
#include "tests/display_server_mock.h"