Skip to content

Commit

Permalink
Fix some build errors with disable_3d=Yes
Browse files Browse the repository at this point in the history
* Some tests were incorrectly included
* SCU builds with animation
* Animation `switch`
  • Loading branch information
AThousandShips committed Jan 6, 2024
1 parent c8c483c commit c6a1ae7
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 18 deletions.
15 changes: 4 additions & 11 deletions scene/animation/animation_mixer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
4 changes: 4 additions & 0 deletions scene/animation/root_motion_view.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -203,3 +205,5 @@ RootMotionView::RootMotionView() {
RootMotionView::~RootMotionView() {
set_base(RID());
}

#endif // _3D_DISABLED
2 changes: 1 addition & 1 deletion scene/register_scene_types.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down
15 changes: 9 additions & 6 deletions tests/test_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand All @@ -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"
Expand Down

0 comments on commit c6a1ae7

Please sign in to comment.