From 73a7cbcda0b2d5a20859a189797dba594d4d2489 Mon Sep 17 00:00:00 2001 From: Xiao Qi Date: Mon, 27 Feb 2023 03:44:12 +0800 Subject: [PATCH] Changed string literal to string_view --- src/AssetMacros.h | 4 ++++ src/Libraries/MeshCompiler.hpp | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/AssetMacros.h b/src/AssetMacros.h index 62324d4..6a9d904 100644 --- a/src/AssetMacros.h +++ b/src/AssetMacros.h @@ -100,6 +100,10 @@ constexpr std::string_view SCALE_PATH{ "scale" }; constexpr std::string_view ROTATION_PATH{ "rotation" }; constexpr std::string_view WEIGHTS_PATH{ "weights" }; +constexpr std::string_view LINEAR_INTERPOLATION{ "LINEAR" }; +constexpr std::string_view STEP_INTERPOLATION{ "STEP" }; +constexpr std::string_view CUBICSPLINE_INTERPOLATION{ "CUBICSPLINE" }; + //Directory #ifdef _PUBLISH constexpr std::string_view ASSET_ROOT{ "Assets" }; diff --git a/src/Libraries/MeshCompiler.hpp b/src/Libraries/MeshCompiler.hpp index 3a99c6d..56cf9d1 100644 --- a/src/Libraries/MeshCompiler.hpp +++ b/src/Libraries/MeshCompiler.hpp @@ -240,9 +240,9 @@ namespace SH_COMP FetchChannelKeyFrame(channel.target_node, sampler.input, sampler.output, channel.target_node, anim.nodes[channel.target_node].rotationKeys); anim.nodes[channel.target_node].interpolation = - sampler.interpolation == "LINEAR" ? AnimationInterpolation::LINEAR : - sampler.interpolation == "STEP" ? AnimationInterpolation::STEP : - sampler.interpolation == "CUBICSPLINE" ? AnimationInterpolation::CUBICSPLINE : + sampler.interpolation == LINEAR_INTERPOLATION.data() ? AnimationInterpolation::LINEAR : + sampler.interpolation == STEP_INTERPOLATION.data() ? AnimationInterpolation::STEP : + sampler.interpolation == CUBICSPLINE_INTERPOLATION.data() ? AnimationInterpolation::CUBICSPLINE : AnimationInterpolation::DEFAULT; }