chore: handle iw4 technique flags

This commit is contained in:
Jan Laupetin
2026-03-14 09:09:57 +01:00
parent 503fe89251
commit 161ab45306
8 changed files with 112 additions and 54 deletions
@@ -24,6 +24,34 @@ namespace
namespace techset
{
std::optional<bool> HasOptionalSourceByName(const std::string& name, const CommonStreamRoutingInfos& routingInfos)
{
size_t currentOffset = 0u;
std::string sourceAbbreviation;
while (NextAbbreviation(name, sourceAbbreviation, currentOffset))
{
std::string destinationAbbreviation;
if (!NextAbbreviation(name, destinationAbbreviation, currentOffset))
{
con::error("Failed to detect vertex decl destination abbreviation: {}", name);
return std::nullopt;
}
const auto maybeSource = routingInfos.GetSourceByAbbreviation(sourceAbbreviation);
if (!maybeSource)
{
con::error("Unknown vertex decl source abbreviation: {}", sourceAbbreviation);
return std::nullopt;
}
if (routingInfos.IsSourceOptional(*maybeSource))
return true;
}
return false;
}
std::optional<CommonVertexDeclaration> CreateVertexDeclFromName(const std::string& name, const CommonStreamRoutingInfos& routingInfos)
{
CommonVertexDeclaration result;
@@ -7,5 +7,6 @@
namespace techset
{
std::optional<bool> HasOptionalSourceByName(const std::string& name, const CommonStreamRoutingInfos& routingInfos);
std::optional<CommonVertexDeclaration> CreateVertexDeclFromName(const std::string& name, const CommonStreamRoutingInfos& routingInfos);
}
} // namespace techset