2
0
mirror of https://github.com/Laupetin/OpenAssetTools.git synced 2026-01-24 08:53:04 +00:00

chore: make sure TechsetCompilerT6 sets proper worldVertFormat

This commit is contained in:
Jan Laupetin
2026-01-22 21:43:06 +00:00
parent d714afbcdd
commit d4a95d046e
16 changed files with 255 additions and 17 deletions

View File

@@ -46,4 +46,10 @@ namespace techset
m_technique_names(std::move(techniqueNames))
{
}
CommonTechset::CommonTechset(std::string name, const size_t techniqueTypeCount)
: m_name(std::move(name)),
m_technique_names(techniqueTypeCount)
{
}
} // namespace techset

View File

@@ -28,6 +28,7 @@ namespace techset
CommonTechset() = default;
explicit CommonTechset(size_t techniqueTypeCount);
CommonTechset(std::string name, std::vector<std::string> techniqueNames);
CommonTechset(std::string name, size_t techniqueTypeCount);
std::string m_name;
std::vector<std::string> m_technique_names;

View File

@@ -18,4 +18,28 @@ namespace techset
{
return std::format("techsets/{}.techset", assetName);
}
void CountWorldVertFormatParameters(const std::string& assetName, size_t& texCount, size_t& normalCount)
{
texCount = 0;
normalCount = 0;
if (assetName.empty())
return;
const auto nameLen = assetName.size();
for (auto pos = 1u; pos < nameLen - 1u; pos++)
{
if (assetName[pos - 1] != '_' && !isdigit(assetName[pos - 1]))
continue;
if (!isdigit(assetName[pos + 1]))
continue;
const auto c = tolower(assetName[pos]);
if (c == 'c')
texCount++;
else if (c == 'n')
normalCount++;
}
}
} // namespace techset

View File

@@ -7,4 +7,6 @@ namespace techset
std::string GetFileNameForStateMapName(const std::string& stateMapName);
std::string GetFileNameForTechniqueName(const std::string& assetName);
std::string GetFileNameForTechsetName(const std::string& assetName);
void CountWorldVertFormatParameters(const std::string& assetName, size_t& texCount, size_t& normalCount);
} // namespace techset