Skip to content

Commit

Permalink
optimize
Browse files Browse the repository at this point in the history
  • Loading branch information
NicoMico authored and NicoMico committed Jun 22, 2024
1 parent c92fa97 commit d438c76
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 42 deletions.
60 changes: 30 additions & 30 deletions 3Dmigoto-Wheel-GUI/MainForm/Main.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions MMT/ExtractFromBuffer_VS_WW_Object.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ void ExtractFromBuffer_VS_WW_Object(std::wstring DrawIB, std::wstring GameType)
//注意:鸣潮中出现了部分物体类型多次Draw时,有些Draw不使用贴图槽位且顶点数量也无法对上,Hash值也不同的情况
//所以我们提取物体Mod类型时,必须要确保ps-t0槽位的贴图确实存在
//如果不存在则说明不是真正渲染贴图的那个槽位。
std::vector<std::wstring> Pst0_TextureDDSFileList = FAData.FindFrameAnalysisFileNameListWithCondition(ibFileData.Index + L"-ps-t0=", L".dds");
std::vector<std::wstring> Pst0_TextureJPGFileList = FAData.FindFrameAnalysisFileNameListWithCondition(ibFileData.Index + L"-ps-t0=", L".jpg");
std::vector<std::wstring> Pst0_TextureDDSFileList = FAData.FindFrameAnalysisFileNameListWithCondition(ibFileData.Index + L"-ps-t1=", L".dds");
std::vector<std::wstring> Pst0_TextureJPGFileList = FAData.FindFrameAnalysisFileNameListWithCondition(ibFileData.Index + L"-ps-t1=", L".jpg");
if (Pst0_TextureDDSFileList.size() == 0 && Pst0_TextureJPGFileList.size() == 0) {
LOG.Info(L"Can't find ps-t0 or jpg texture for index:" + ibFileData.Index + L" it will not be a valid object type, so skip this.");
LOG.Warning(L"Can't find ps-t1 or jpg texture for index:" + ibFileData.Index + L" it will not be a valid object type, so skip this.");
continue;
}

Expand Down
23 changes: 14 additions & 9 deletions MMT/ExtractFromWW.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,15 +147,7 @@ void ExtractFromWW() {
}

IndexBufferTxtFile ibFileData(G.WorkFolder + filename, false);
//注意:鸣潮中出现了部分物体类型多次Draw时,有些Draw不使用贴图槽位且顶点数量也无法对上,Hash值也不同的情况
//所以我们提取物体Mod类型时,必须要确保ps-t0槽位的贴图确实存在
//如果不存在则说明不是真正渲染贴图的那个槽位。
std::vector<std::wstring> Pst0_TextureDDSFileList = FAData.FindFrameAnalysisFileNameListWithCondition(ibFileData.Index + L"-ps-t0=", L".dds");
std::vector<std::wstring> Pst0_TextureJPGFileList = FAData.FindFrameAnalysisFileNameListWithCondition(ibFileData.Index + L"-ps-t0=", L".jpg");
if (Pst0_TextureDDSFileList.size() == 0 && Pst0_TextureJPGFileList.size() == 0) {
LOG.Info(L"Can't find ps-t0 or jpg texture for index:" + ibFileData.Index + L" it will not be a valid object type, so skip this.");
continue;
}


VSExtractIndex = ibFileData.Index;
PositionExtractFileName = FAData.FindFrameAnalysisFileNameListWithCondition(VSExtractIndex + L"-vb0=", L".buf")[0];
Expand All @@ -169,6 +161,19 @@ void ExtractFromWW() {
LOG.Info("Can't find FirstIndex attribute in this file, so skip this.");
continue;
}


//注意:鸣潮中出现了部分物体类型多次Draw时,有些Draw不使用贴图槽位且顶点数量也无法对上,Hash值也不同的情况
//所以我们提取物体Mod类型时,必须要确保ps-t0槽位的贴图确实存在
//如果不存在则说明不是真正渲染贴图的那个槽位。
std::vector<std::wstring> Pst0_TextureDDSFileList = FAData.FindFrameAnalysisFileNameListWithCondition(ibFileData.Index + L"-ps-t1=", L".dds");
std::vector<std::wstring> Pst0_TextureJPGFileList = FAData.FindFrameAnalysisFileNameListWithCondition(ibFileData.Index + L"-ps-t1=", L".jpg");
if (Pst0_TextureDDSFileList.size() == 0 && Pst0_TextureJPGFileList.size() == 0) {
LOG.Warning(L"Can't find ps-t1 or jpg texture for index:" + ibFileData.Index + L" it will not be a valid object type, so skip this.");
continue;
}

//TODO 这里不管是用ps-t0还是ps-t1都无法做到通用兼容,并不是最优解,后面有空可以优化一下
}

LOG.NewLine();
Expand Down
14 changes: 14 additions & 0 deletions MMT/Reverse_Lv4_3Dmigoto_Simulator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,20 @@
// Notice:This method may take a lot of time if you use it in large mod folder.
//TODO Lv3已经过时了,完成这个之前需要先Toggle的解析支持
void Reverse_Lv4_3Dmigoto_Simulator() {
LOG.Info("Start to batch reverse by 3Dmigoto Simulator.");

//在Release中,要从json文件中读取逆向ini的路径
json reverseJsonObject = MMTJson_ReadJsonFromFile(G.Path_RunInputJson);
std::wstring reverseFilePath = MMTString_ToWideString(reverseJsonObject["ReverseFilePath"]);

//创建逆向输出路径
std::wstring reverseFolderPath = MMTString_GetFolderPathFromFilePath(reverseFilePath) + L"-Reverse\\";
std::filesystem::create_directories(reverseFolderPath);
LOG.Info(L"ReverseFilePath: " + reverseFilePath);
LOG.NewLine();

//TODO 递归获取目录下以.ini结尾的文件路径列表

//TODO

}

0 comments on commit d438c76

Please sign in to comment.