36张图片打包

This commit is contained in:
xsl
2025-10-29 21:38:03 +08:00
parent 13357ab256
commit dfbef7caf1
54 changed files with 228 additions and 46 deletions
+15 -6
View File
@@ -732,7 +732,7 @@ void FaceApp::initVulkan()
loadTexture("demo0_ex.png", m_texs_ex[i], true);
}
loadTexture("out.png", tex_bg, false);
loadTexture("out.png", tex_bg, true);
createVertexBuffer();
createUniformBuffer();
setup_descriptor_pool();
@@ -1137,19 +1137,27 @@ void FaceApp::SetInitArg(const char* arg)
}
void FaceApp::changeMotion(const char* json)
{
Motion motion = json::parse(json);
changeMotion(motion);
}
void FaceApp::changeMotion(Motion& motion)
{
if (_curMotion.getMotionId() == motion.getMotionId())
{
return;
}
_curMotion = _initArg.motion;
_curMotion = motion;
for (int i = 0; i < _curMotion.png_num; ++i)
{
#ifdef _WIN32
string path = _curMotion.type + "/" + _curMotion.technique + "/" + _curMotion.step + "/" + _curMotion.show_type;
string path_name = path + "/" + _curMotion.png_name + std::to_string(i) + ".png";
//string path = _curMotion.type + "/" + _curMotion.technique + "/" + _curMotion.step + "/" + _curMotion.show_type;
string path = "pic";
string path_name = path + "/" + _curMotion.png_name;// +std::to_string(i) + ".png";
loadTextureExample(UTF8ToWideString(path_name), m_texs[i], true);
if (kThick)
{
@@ -1157,8 +1165,9 @@ void FaceApp::changeMotion(Motion& motion)
loadTextureExample(UTF8ToWideString(path_name_ex), m_texs_ex[i], true);
}
#else
string path = _curMotion.type + "/" + _curMotion.technique + "/" + _curMotion.step + "/" + _curMotion.show_type;
string path_name = path + "/" + _curMotion.png_name + std::to_string(i) + ".png";
//string path = _curMotion.type + "/" + _curMotion.technique + "/" + _curMotion.step + "/" + _curMotion.show_type;
string path = "pic";
string path_name = path + "/" + _curMotion.png_name;// +std::to_string(i) + ".png";
loadTexture(path_name, m_texs[i], true);
if (kThick)
{
+5 -3
View File
@@ -19,7 +19,7 @@ struct Motion {
string png_name;
int png_num;
string getMotionId() {
return type + technique + step + show_type;
return type + technique + step + show_type + png_name;
}
NLOHMANN_DEFINE_TYPE_INTRUSIVE(Motion, type, technique, step, show_type, png_name, png_num)
};
@@ -104,7 +104,7 @@ private:
VkPipelineLayout m_pipelineLayout = VK_NULL_HANDLE;
VkDescriptorSetLayout m_descriptorSetLayout = VK_NULL_HANDLE;
vector<VkDescriptorSet> m_descriptor_sets;
const int kMaxTexture = 20;
const int kMaxTexture = 2;
vector<Texture> m_texs;
vector<Texture> m_texs_ex;
@@ -137,8 +137,10 @@ private:
VkDescriptorSetLayout m_descriptorSetLayout_bg = VK_NULL_HANDLE;
VkDescriptorSet m_descriptor_set_bg = VK_NULL_HANDLE;
void changeMotion(Motion& motion);
public:
void changeMotion(const char* json);
void changeMotion(Motion& motion);
InitArg _initArg;
Motion _curMotion;
int _curTexIndex = 0;
+1 -1
View File
@@ -53,7 +53,7 @@ int main() {
motion.technique = "基础上妆";
motion.step = "2按压";
motion.show_type = "方向示意图";
motion.png_name = "test";
motion.png_name = "4.png";
motion.png_num = 1;
#