save code

This commit is contained in:
xsl
2025-12-19 13:47:16 +08:00
parent e38da96e37
commit 6bbbb3c3ef
8 changed files with 137 additions and 102 deletions
+4 -7
View File
@@ -1370,7 +1370,7 @@ void FaceApp::drawFrame(long long frameTime)
// changeMotion(motion);
//}
string FaceApp::preLoadMotionList(const vector<string>& motions, Callback callback)
string FaceApp::preLoadMotionList(string motion_list_str, Callback callback)
{
if (_isLoadMotion)
{
@@ -1379,12 +1379,9 @@ string FaceApp::preLoadMotionList(const vector<string>& motions, Callback callba
_isLoadMotion = true;
_callback_loadfinish = callback;
_preLoadMotions.clear();
for (auto s : motions)
{
json j = json::parse(s);
Motion motion = j.get<Motion>();
_preLoadMotions.push_back(motion);
}
json j = json::parse(motion_list_str);
MotionList motion_list = j.get<MotionList>();
_preLoadMotions = motion_list.motions;
worker_ = std::thread(&FaceApp::loadMotionThread, this);
return "ok";
}