mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-05-07 13:04:58 +00:00
Merge pull request #423 from Laupetin/refactor/asset-struct-for-zcg
refactor: asset struct for zcg
This commit is contained in:
commit
f4870de1a7
@ -13,12 +13,22 @@
|
||||
|
||||
namespace
|
||||
{
|
||||
bool IsStringizeParameterForwardLookup(const std::string& value, size_t pos)
|
||||
constexpr auto DEFINE_DIRECTIVE = "define";
|
||||
constexpr auto UNDEF_DIRECTIVE = "undef";
|
||||
constexpr auto IF_DIRECTIVE = "if";
|
||||
constexpr auto ELIF_DIRECTIVE = "elif";
|
||||
constexpr auto IFDEF_DIRECTIVE = "ifdef";
|
||||
constexpr auto IFNDEF_DIRECTIVE = "ifndef";
|
||||
constexpr auto ELSE_DIRECTIVE = "else";
|
||||
constexpr auto ENDIF_DIRECTIVE = "endif";
|
||||
constexpr auto DEFINED_KEYWORD = "defined";
|
||||
|
||||
bool IsStringizeParameterForwardLookup(const std::string& value, const size_t pos)
|
||||
{
|
||||
return pos + 1 && (isalpha(value[pos + 1]) || value[pos + 1] == '_');
|
||||
}
|
||||
|
||||
bool IsTokenPastingOperatorForwardLookup(const std::string& value, size_t pos)
|
||||
bool IsTokenPastingOperatorForwardLookup(const std::string& value, const size_t pos)
|
||||
{
|
||||
return pos + 1 < value.size() && value[pos + 1] == '#';
|
||||
}
|
||||
@ -31,7 +41,7 @@ DefinesStreamProxy::DefineParameterPosition::DefineParameterPosition()
|
||||
{
|
||||
}
|
||||
|
||||
DefinesStreamProxy::DefineParameterPosition::DefineParameterPosition(const unsigned index, const size_t position, const bool stringize)
|
||||
DefinesStreamProxy::DefineParameterPosition::DefineParameterPosition(const unsigned index, const unsigned position, const bool stringize)
|
||||
: m_parameter_index(index),
|
||||
m_parameter_position(position),
|
||||
m_stringize(stringize)
|
||||
@ -591,7 +601,6 @@ bool DefinesStreamProxy::FindNextMacro(const std::string& input, unsigned& input
|
||||
{
|
||||
const auto inputSize = input.size();
|
||||
auto wordStart = 0u;
|
||||
auto lastWordEnd = 0u;
|
||||
auto inWord = false;
|
||||
auto inString = false;
|
||||
auto stringEscape = false;
|
||||
@ -763,8 +772,7 @@ namespace
|
||||
}
|
||||
} // namespace
|
||||
|
||||
void DefinesStreamProxy::ProcessTokenPastingOperators(
|
||||
const ParserLine& line, const unsigned& linePos, std::vector<const Define*>& callstack, std::string& input, unsigned& inputPos)
|
||||
void DefinesStreamProxy::ProcessTokenPastingOperators(const ParserLine& line, const unsigned& linePos, std::string& input)
|
||||
{
|
||||
std::ostringstream ss;
|
||||
|
||||
@ -853,18 +861,17 @@ void DefinesStreamProxy::ExpandMacro(ParserLine& line,
|
||||
unsigned& linePos,
|
||||
std::ostringstream& out,
|
||||
std::vector<const Define*>& callstack,
|
||||
const DefinesStreamProxy::Define* macro,
|
||||
const Define* macro,
|
||||
const std::vector<std::string>& parameterValues)
|
||||
{
|
||||
std::ostringstream rawOutput;
|
||||
InsertMacroParameters(rawOutput, macro, parameterValues);
|
||||
|
||||
std::string str = rawOutput.str();
|
||||
unsigned nestedPos = 0;
|
||||
ProcessNestedMacros(line, linePos, callstack, str, nestedPos);
|
||||
ProcessNestedMacros(line, linePos, callstack, str);
|
||||
|
||||
if (macro->m_contains_token_pasting_operators)
|
||||
ProcessTokenPastingOperators(line, linePos, callstack, str, nestedPos);
|
||||
ProcessTokenPastingOperators(line, linePos, str);
|
||||
|
||||
out << str;
|
||||
}
|
||||
@ -966,7 +973,7 @@ void DefinesStreamProxy::ContinueMultiLineMacro(ParserLine& line)
|
||||
}
|
||||
}
|
||||
|
||||
void DefinesStreamProxy::ProcessNestedMacros(ParserLine& line, unsigned& linePos, std::vector<const Define*>& callstack, std::string& input, unsigned& inputPos)
|
||||
void DefinesStreamProxy::ProcessNestedMacros(ParserLine& line, unsigned& linePos, std::vector<const Define*>& callstack, std::string& input)
|
||||
{
|
||||
bool usesDefines = false;
|
||||
|
||||
@ -1021,7 +1028,7 @@ void DefinesStreamProxy::ProcessMacrosSingleLine(ParserLine& line)
|
||||
{
|
||||
unsigned pos = 0;
|
||||
std::vector<const Define*> callstack;
|
||||
ProcessNestedMacros(line, pos, callstack, line.m_line, pos);
|
||||
ProcessNestedMacros(line, pos, callstack, line.m_line);
|
||||
}
|
||||
|
||||
void DefinesStreamProxy::ProcessMacrosMultiLine(ParserLine& line)
|
||||
|
@ -13,42 +13,30 @@
|
||||
|
||||
class DefinesStreamProxy final : public AbstractDirectiveStreamProxy
|
||||
{
|
||||
static constexpr const char* DEFINE_DIRECTIVE = "define";
|
||||
static constexpr const char* UNDEF_DIRECTIVE = "undef";
|
||||
static constexpr const char* IF_DIRECTIVE = "if";
|
||||
static constexpr const char* ELIF_DIRECTIVE = "elif";
|
||||
static constexpr const char* IFDEF_DIRECTIVE = "ifdef";
|
||||
static constexpr const char* IFNDEF_DIRECTIVE = "ifndef";
|
||||
static constexpr const char* ELSE_DIRECTIVE = "else";
|
||||
static constexpr const char* ENDIF_DIRECTIVE = "endif";
|
||||
static constexpr const char* DEFINED_KEYWORD = "defined";
|
||||
|
||||
static constexpr auto MAX_DEFINE_ITERATIONS = 128u;
|
||||
|
||||
public:
|
||||
class DefineParameterPosition
|
||||
{
|
||||
public:
|
||||
unsigned m_parameter_index;
|
||||
size_t m_parameter_position;
|
||||
bool m_stringize;
|
||||
|
||||
DefineParameterPosition();
|
||||
DefineParameterPosition(unsigned index, size_t position, bool stringize);
|
||||
DefineParameterPosition(unsigned index, unsigned position, bool stringize);
|
||||
|
||||
unsigned m_parameter_index;
|
||||
unsigned m_parameter_position;
|
||||
bool m_stringize;
|
||||
};
|
||||
|
||||
class Define
|
||||
{
|
||||
public:
|
||||
Define();
|
||||
Define(std::string name, std::string value);
|
||||
void IdentifyParameters(const std::vector<std::string>& parameterNames);
|
||||
|
||||
std::string m_name;
|
||||
std::string m_value;
|
||||
std::vector<DefineParameterPosition> m_parameter_positions;
|
||||
bool m_contains_token_pasting_operators;
|
||||
|
||||
Define();
|
||||
Define(std::string name, std::string value);
|
||||
void IdentifyParameters(const std::vector<std::string>& parameterNames);
|
||||
|
||||
private:
|
||||
void IdentifyTokenPasteOperatorOnly();
|
||||
};
|
||||
@ -64,14 +52,27 @@ public:
|
||||
class MacroParameterState
|
||||
{
|
||||
public:
|
||||
MacroParameterState();
|
||||
|
||||
ParameterState m_parameter_state;
|
||||
std::ostringstream m_current_parameter;
|
||||
std::vector<std::string> m_parameters;
|
||||
std::stack<char> m_bracket_depth;
|
||||
|
||||
MacroParameterState();
|
||||
};
|
||||
|
||||
explicit DefinesStreamProxy(IParserLineStream* stream, bool skipDirectiveLines = false);
|
||||
|
||||
void AddDefine(Define define);
|
||||
void Undefine(const std::string& name);
|
||||
|
||||
[[nodiscard]] std::unique_ptr<ISimpleExpression> ParseExpression(std::shared_ptr<std::string> fileName, int lineNumber, std::string expressionString);
|
||||
|
||||
ParserLine NextLine() override;
|
||||
bool IncludeFile(const std::string& filename) override;
|
||||
void PopCurrentFile() override;
|
||||
[[nodiscard]] bool IsOpen() const override;
|
||||
[[nodiscard]] bool Eof() const override;
|
||||
|
||||
private:
|
||||
enum class BlockMode : uint8_t
|
||||
|
||||
@ -81,6 +82,45 @@ private:
|
||||
BLOCK_BLOCKED
|
||||
};
|
||||
|
||||
static int GetLineEndEscapePos(const ParserLine& line);
|
||||
void MatchDefineParameters(const ParserLine& line, size_t& currentPos);
|
||||
void ContinueDefine(const ParserLine& line, size_t currentPos);
|
||||
void ContinueParameters(const ParserLine& line, size_t& currentPos);
|
||||
[[nodiscard]] bool MatchDefineDirective(const ParserLine& line, size_t directiveStartPosition, size_t directiveEndPosition);
|
||||
[[nodiscard]] bool MatchUndefDirective(const ParserLine& line, size_t directiveStartPosition, size_t directiveEndPosition);
|
||||
[[nodiscard]] bool MatchIfDirective(const ParserLine& line, size_t directiveStartPosition, size_t directiveEndPosition);
|
||||
[[nodiscard]] bool MatchElIfDirective(const ParserLine& line, size_t directiveStartPosition, size_t directiveEndPosition);
|
||||
[[nodiscard]] bool MatchIfdefDirective(const ParserLine& line, size_t directiveStartPosition, size_t directiveEndPosition);
|
||||
[[nodiscard]] bool MatchElseDirective(const ParserLine& line, size_t directiveStartPosition, size_t directiveEndPosition);
|
||||
[[nodiscard]] bool MatchEndifDirective(const ParserLine& line, size_t directiveStartPosition, size_t directiveEndPosition);
|
||||
[[nodiscard]] bool MatchDirectives(const ParserLine& line);
|
||||
|
||||
static void ExtractParametersFromMacroUsage(
|
||||
const ParserLine& line, const unsigned& linePos, MacroParameterState& state, const std::string& input, unsigned& inputPos);
|
||||
bool FindMacroForIdentifier(const std::string& input, unsigned identifierStart, unsigned identifierEnd, const Define*& value) const;
|
||||
|
||||
static bool MatchDefinedExpression(const ParserLine& line, size_t& pos, std::string& definitionName);
|
||||
void ExpandDefinedExpressions(ParserLine& line) const;
|
||||
|
||||
bool FindNextMacro(const std::string& input, unsigned& inputPos, unsigned& defineStart, const DefinesStreamProxy::Define*& define) const;
|
||||
|
||||
static void ProcessTokenPastingOperators(const ParserLine& line, const unsigned& linePos, std::string& input);
|
||||
static void InsertMacroParameters(std::ostringstream& out, const DefinesStreamProxy::Define* macro, const std::vector<std::string>& parameterValues);
|
||||
void ExpandMacro(ParserLine& line,
|
||||
unsigned& linePos,
|
||||
std::ostringstream& out,
|
||||
std::vector<const Define*>& callstack,
|
||||
const DefinesStreamProxy::Define* macro,
|
||||
const std::vector<std::string>& parameterValues);
|
||||
|
||||
static void
|
||||
ContinueMacroParameters(const ParserLine& line, const unsigned& linePos, MacroParameterState& state, const std::string& input, unsigned& inputPos);
|
||||
void ContinueMultiLineMacro(ParserLine& line);
|
||||
|
||||
void ProcessNestedMacros(ParserLine& line, unsigned& linePos, std::vector<const Define*>& callstack, std::string& input);
|
||||
void ProcessMacrosSingleLine(ParserLine& line);
|
||||
void ProcessMacrosMultiLine(ParserLine& line);
|
||||
|
||||
IParserLineStream* const m_stream;
|
||||
const bool m_skip_directive_lines;
|
||||
std::map<std::string, Define> m_defines;
|
||||
@ -95,58 +135,4 @@ private:
|
||||
|
||||
const Define* m_current_macro;
|
||||
MacroParameterState m_multi_line_macro_parameters;
|
||||
|
||||
static int GetLineEndEscapePos(const ParserLine& line);
|
||||
void MatchDefineParameters(const ParserLine& line, size_t& currentPos);
|
||||
void ContinueDefine(const ParserLine& line, size_t currentPos);
|
||||
void ContinueParameters(const ParserLine& line, size_t& currentPos);
|
||||
_NODISCARD bool MatchDefineDirective(const ParserLine& line, size_t directiveStartPosition, size_t directiveEndPosition);
|
||||
_NODISCARD bool MatchUndefDirective(const ParserLine& line, size_t directiveStartPosition, size_t directiveEndPosition);
|
||||
_NODISCARD bool MatchIfDirective(const ParserLine& line, size_t directiveStartPosition, size_t directiveEndPosition);
|
||||
_NODISCARD bool MatchElIfDirective(const ParserLine& line, size_t directiveStartPosition, size_t directiveEndPosition);
|
||||
_NODISCARD bool MatchIfdefDirective(const ParserLine& line, size_t directiveStartPosition, size_t directiveEndPosition);
|
||||
_NODISCARD bool MatchElseDirective(const ParserLine& line, size_t directiveStartPosition, size_t directiveEndPosition);
|
||||
_NODISCARD bool MatchEndifDirective(const ParserLine& line, size_t directiveStartPosition, size_t directiveEndPosition);
|
||||
_NODISCARD bool MatchDirectives(const ParserLine& line);
|
||||
|
||||
static void ExtractParametersFromMacroUsage(
|
||||
const ParserLine& line, const unsigned& linePos, MacroParameterState& state, const std::string& input, unsigned& inputPos);
|
||||
bool FindMacroForIdentifier(const std::string& input, unsigned identifierStart, unsigned identifierEnd, const Define*& value) const;
|
||||
|
||||
static bool MatchDefinedExpression(const ParserLine& line, size_t& pos, std::string& definitionName);
|
||||
void ExpandDefinedExpressions(ParserLine& line) const;
|
||||
|
||||
bool FindNextMacro(const std::string& input, unsigned& inputPos, unsigned& defineStart, const DefinesStreamProxy::Define*& define) const;
|
||||
|
||||
static void ProcessTokenPastingOperators(
|
||||
const ParserLine& line, const unsigned& linePos, std::vector<const Define*>& callstack, std::string& input, unsigned& inputPos);
|
||||
static void InsertMacroParameters(std::ostringstream& out, const DefinesStreamProxy::Define* macro, const std::vector<std::string>& parameterValues);
|
||||
void ExpandMacro(ParserLine& line,
|
||||
unsigned& linePos,
|
||||
std::ostringstream& out,
|
||||
std::vector<const Define*>& callstack,
|
||||
const DefinesStreamProxy::Define* macro,
|
||||
const std::vector<std::string>& parameterValues);
|
||||
|
||||
static void
|
||||
ContinueMacroParameters(const ParserLine& line, const unsigned& linePos, MacroParameterState& state, const std::string& input, unsigned& inputPos);
|
||||
void ContinueMultiLineMacro(ParserLine& line);
|
||||
|
||||
void ProcessNestedMacros(ParserLine& line, unsigned& linePos, std::vector<const Define*>& callstack, std::string& input, unsigned& inputPos);
|
||||
void ProcessMacrosSingleLine(ParserLine& line);
|
||||
void ProcessMacrosMultiLine(ParserLine& line);
|
||||
|
||||
public:
|
||||
explicit DefinesStreamProxy(IParserLineStream* stream, bool skipDirectiveLines = false);
|
||||
|
||||
void AddDefine(Define define);
|
||||
void Undefine(const std::string& name);
|
||||
|
||||
_NODISCARD std::unique_ptr<ISimpleExpression> ParseExpression(std::shared_ptr<std::string> fileName, int lineNumber, std::string expressionString);
|
||||
|
||||
ParserLine NextLine() override;
|
||||
bool IncludeFile(const std::string& filename) override;
|
||||
void PopCurrentFile() override;
|
||||
_NODISCARD bool IsOpen() const override;
|
||||
_NODISCARD bool Eof() const override;
|
||||
};
|
||||
|
@ -80,7 +80,7 @@ public:
|
||||
result.m_fabricated_tokens.push_back(m_transform_func(tokens));
|
||||
|
||||
result.m_matched_tokens.clear();
|
||||
result.m_matched_tokens.emplace_back(result.m_fabricated_tokens.size() - 1, true);
|
||||
result.m_matched_tokens.emplace_back(static_cast<unsigned>(result.m_fabricated_tokens.size()) - 1u, true);
|
||||
}
|
||||
else if (result.m_matched_tokens.empty())
|
||||
{
|
||||
|
@ -16,7 +16,7 @@
|
||||
template<typename TokenType> class MatcherFactoryWrapper
|
||||
{
|
||||
// TokenType must inherit IParserValue
|
||||
static_assert(std::is_base_of<IParserValue, TokenType>::value);
|
||||
static_assert(std::is_base_of_v<IParserValue, TokenType>);
|
||||
|
||||
std::unique_ptr<AbstractMatcher<TokenType>> m_matcher;
|
||||
|
||||
@ -73,7 +73,7 @@ public:
|
||||
template<typename TokenType> class AbstractMatcherFactory
|
||||
{
|
||||
// TokenType must inherit IParserValue
|
||||
static_assert(std::is_base_of<IParserValue, TokenType>::value);
|
||||
static_assert(std::is_base_of_v<IParserValue, TokenType>);
|
||||
|
||||
const IMatcherForLabelSupplier<TokenType>* m_label_supplier;
|
||||
|
||||
@ -85,52 +85,52 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
_NODISCARD MatcherFactoryWrapper<TokenType> False() const
|
||||
[[nodiscard]] MatcherFactoryWrapper<TokenType> False() const
|
||||
{
|
||||
return MatcherFactoryWrapper<TokenType>(std::make_unique<MatcherFalse<TokenType>>());
|
||||
}
|
||||
|
||||
_NODISCARD MatcherFactoryWrapper<TokenType> True() const
|
||||
[[nodiscard]] MatcherFactoryWrapper<TokenType> True() const
|
||||
{
|
||||
return MatcherFactoryWrapper<TokenType>(std::make_unique<MatcherTrue<TokenType>>());
|
||||
}
|
||||
|
||||
_NODISCARD MatcherFactoryWrapper<TokenType> And(std::initializer_list<Movable<std::unique_ptr<AbstractMatcher<TokenType>>>> matchers) const
|
||||
[[nodiscard]] MatcherFactoryWrapper<TokenType> And(std::initializer_list<Movable<std::unique_ptr<AbstractMatcher<TokenType>>>> matchers) const
|
||||
{
|
||||
return MatcherFactoryWrapper<TokenType>(std::make_unique<MatcherAnd<TokenType>>(matchers));
|
||||
}
|
||||
|
||||
_NODISCARD MatcherFactoryWrapper<TokenType> And(std::vector<std::unique_ptr<AbstractMatcher<TokenType>>> matchers) const
|
||||
[[nodiscard]] MatcherFactoryWrapper<TokenType> And(std::vector<std::unique_ptr<AbstractMatcher<TokenType>>> matchers) const
|
||||
{
|
||||
return MatcherFactoryWrapper<TokenType>(std::make_unique<MatcherAnd<TokenType>>(std::move(matchers)));
|
||||
}
|
||||
|
||||
_NODISCARD MatcherFactoryWrapper<TokenType> Or(std::initializer_list<Movable<std::unique_ptr<AbstractMatcher<TokenType>>>> matchers) const
|
||||
[[nodiscard]] MatcherFactoryWrapper<TokenType> Or(std::initializer_list<Movable<std::unique_ptr<AbstractMatcher<TokenType>>>> matchers) const
|
||||
{
|
||||
return MatcherFactoryWrapper<TokenType>(std::make_unique<MatcherOr<TokenType>>(matchers));
|
||||
}
|
||||
|
||||
_NODISCARD MatcherFactoryWrapper<TokenType> Or(std::vector<std::unique_ptr<AbstractMatcher<TokenType>>> matchers) const
|
||||
[[nodiscard]] MatcherFactoryWrapper<TokenType> Or(std::vector<std::unique_ptr<AbstractMatcher<TokenType>>> matchers) const
|
||||
{
|
||||
return MatcherFactoryWrapper<TokenType>(std::make_unique<MatcherOr<TokenType>>(std::move(matchers)));
|
||||
}
|
||||
|
||||
_NODISCARD MatcherFactoryWrapper<TokenType> Loop(std::unique_ptr<AbstractMatcher<TokenType>> matcher) const
|
||||
[[nodiscard]] MatcherFactoryWrapper<TokenType> Loop(std::unique_ptr<AbstractMatcher<TokenType>> matcher) const
|
||||
{
|
||||
return MatcherFactoryWrapper<TokenType>(std::make_unique<MatcherLoop<TokenType>>(std::move(matcher)));
|
||||
}
|
||||
|
||||
_NODISCARD MatcherFactoryWrapper<TokenType> OptionalLoop(std::unique_ptr<AbstractMatcher<TokenType>> matcher) const
|
||||
[[nodiscard]] MatcherFactoryWrapper<TokenType> OptionalLoop(std::unique_ptr<AbstractMatcher<TokenType>> matcher) const
|
||||
{
|
||||
return MatcherFactoryWrapper<TokenType>(std::make_unique<MatcherOptional<TokenType>>(std::make_unique<MatcherLoop<TokenType>>(std::move(matcher))));
|
||||
}
|
||||
|
||||
_NODISCARD MatcherFactoryWrapper<TokenType> Optional(std::unique_ptr<AbstractMatcher<TokenType>> matcher) const
|
||||
[[nodiscard]] MatcherFactoryWrapper<TokenType> Optional(std::unique_ptr<AbstractMatcher<TokenType>> matcher) const
|
||||
{
|
||||
return MatcherFactoryWrapper<TokenType>(std::make_unique<MatcherOptional<TokenType>>(std::move(matcher)));
|
||||
}
|
||||
|
||||
_NODISCARD MatcherFactoryWrapper<TokenType> Label(const int label) const
|
||||
[[nodiscard]] MatcherFactoryWrapper<TokenType> Label(const int label) const
|
||||
{
|
||||
return MatcherFactoryWrapper<TokenType>(std::make_unique<MatcherLabel<TokenType>>(m_label_supplier, label));
|
||||
}
|
||||
|
@ -3,11 +3,11 @@
|
||||
namespace
|
||||
{
|
||||
// The highest bit is the fabricated flag
|
||||
constexpr size_t FABRICATED_FLAG_MASK = 1uz << (sizeof(size_t) * 8uz - 1uz);
|
||||
constexpr size_t TOKEN_INDEX_MASK = ~FABRICATED_FLAG_MASK;
|
||||
constexpr unsigned FABRICATED_FLAG_MASK = 1u << (sizeof(unsigned) * 8u - 1u);
|
||||
constexpr unsigned TOKEN_INDEX_MASK = ~FABRICATED_FLAG_MASK;
|
||||
} // namespace
|
||||
|
||||
MatcherResultTokenIndex::MatcherResultTokenIndex(const size_t index, const bool isFabricated)
|
||||
MatcherResultTokenIndex::MatcherResultTokenIndex(const unsigned index, const bool isFabricated)
|
||||
{
|
||||
m_token_index = index & TOKEN_INDEX_MASK;
|
||||
if (isFabricated)
|
||||
@ -19,7 +19,7 @@ bool MatcherResultTokenIndex::IsFabricated() const
|
||||
return m_token_index & FABRICATED_FLAG_MASK;
|
||||
}
|
||||
|
||||
size_t MatcherResultTokenIndex::GetTokenIndex() const
|
||||
unsigned MatcherResultTokenIndex::GetTokenIndex() const
|
||||
{
|
||||
return m_token_index & TOKEN_INDEX_MASK;
|
||||
}
|
||||
|
@ -10,12 +10,12 @@
|
||||
class MatcherResultTokenIndex
|
||||
{
|
||||
public:
|
||||
MatcherResultTokenIndex(size_t index, bool isFabricated);
|
||||
MatcherResultTokenIndex(unsigned index, bool isFabricated);
|
||||
[[nodiscard]] bool IsFabricated() const;
|
||||
[[nodiscard]] size_t GetTokenIndex() const;
|
||||
[[nodiscard]] unsigned GetTokenIndex() const;
|
||||
|
||||
private:
|
||||
size_t m_token_index;
|
||||
unsigned m_token_index;
|
||||
};
|
||||
|
||||
class MatcherResultCapture
|
||||
@ -54,8 +54,9 @@ public:
|
||||
for (const auto& capture : other.m_captures)
|
||||
{
|
||||
if (capture.m_token_index.IsFabricated())
|
||||
m_captures.emplace_back(capture.GetCaptureId(),
|
||||
MatcherResultTokenIndex(m_fabricated_tokens.size() + capture.m_token_index.GetTokenIndex(), true));
|
||||
m_captures.emplace_back(
|
||||
capture.GetCaptureId(),
|
||||
MatcherResultTokenIndex(static_cast<unsigned>(m_fabricated_tokens.size()) + capture.m_token_index.GetTokenIndex(), true));
|
||||
else
|
||||
m_captures.emplace_back(capture.GetCaptureId(), capture.m_token_index);
|
||||
}
|
||||
@ -63,7 +64,7 @@ public:
|
||||
for (const auto& token : other.m_matched_tokens)
|
||||
{
|
||||
if (token.IsFabricated())
|
||||
m_matched_tokens.emplace_back(m_fabricated_tokens.size() + token.GetTokenIndex(), true);
|
||||
m_matched_tokens.emplace_back(static_cast<unsigned>(m_fabricated_tokens.size()) + token.GetTokenIndex(), true);
|
||||
else
|
||||
m_matched_tokens.emplace_back(token.GetTokenIndex(), false);
|
||||
}
|
||||
|
@ -191,7 +191,7 @@ std::unique_ptr<ISimpleExpression> SimpleExpressionMatchers::ProcessExpression(S
|
||||
if (operationIndex < 0 || operationIndex >= static_cast<int>(SimpleBinaryOperationId::COUNT))
|
||||
throw ParsingException(TokenPos(), "Invalid binary operation id @ Expression");
|
||||
|
||||
operators.emplace_back(operators.size(), SimpleExpressionBinaryOperationType::ALL_OPERATION_TYPES[operationIndex]);
|
||||
operators.emplace_back(static_cast<unsigned>(operators.size()), SimpleExpressionBinaryOperationType::ALL_OPERATION_TYPES[operationIndex]);
|
||||
}
|
||||
else
|
||||
break;
|
||||
|
@ -10,17 +10,17 @@ class SimpleMatcherFactory : public AbstractMatcherFactory<SimpleParserValue>
|
||||
public:
|
||||
explicit SimpleMatcherFactory(const IMatcherForLabelSupplier<SimpleParserValue>* labelSupplier);
|
||||
|
||||
_NODISCARD MatcherFactoryWrapper<SimpleParserValue> Type(SimpleParserValueType type) const;
|
||||
_NODISCARD MatcherFactoryWrapper<SimpleParserValue> Keyword(std::string value) const;
|
||||
_NODISCARD MatcherFactoryWrapper<SimpleParserValue> KeywordIgnoreCase(std::string value) const;
|
||||
_NODISCARD MatcherFactoryWrapper<SimpleParserValue> KeywordPrefix(std::string value) const;
|
||||
_NODISCARD MatcherFactoryWrapper<SimpleParserValue> Identifier() const;
|
||||
_NODISCARD MatcherFactoryWrapper<SimpleParserValue> String() const;
|
||||
_NODISCARD MatcherFactoryWrapper<SimpleParserValue> Integer() const;
|
||||
_NODISCARD MatcherFactoryWrapper<SimpleParserValue> IntegerWithSign() const;
|
||||
_NODISCARD MatcherFactoryWrapper<SimpleParserValue> FloatingPoint() const;
|
||||
_NODISCARD MatcherFactoryWrapper<SimpleParserValue> FloatingPointWithSign() const;
|
||||
_NODISCARD MatcherFactoryWrapper<SimpleParserValue> Char(char c) const;
|
||||
_NODISCARD MatcherFactoryWrapper<SimpleParserValue> MultiChar(int multiCharacterSequenceId) const;
|
||||
_NODISCARD MatcherFactoryWrapper<SimpleParserValue> AnyCharBesides(std::vector<char> chars) const;
|
||||
[[nodiscard]] MatcherFactoryWrapper<SimpleParserValue> Type(SimpleParserValueType type) const;
|
||||
[[nodiscard]] MatcherFactoryWrapper<SimpleParserValue> Keyword(std::string value) const;
|
||||
[[nodiscard]] MatcherFactoryWrapper<SimpleParserValue> KeywordIgnoreCase(std::string value) const;
|
||||
[[nodiscard]] MatcherFactoryWrapper<SimpleParserValue> KeywordPrefix(std::string value) const;
|
||||
[[nodiscard]] MatcherFactoryWrapper<SimpleParserValue> Identifier() const;
|
||||
[[nodiscard]] MatcherFactoryWrapper<SimpleParserValue> String() const;
|
||||
[[nodiscard]] MatcherFactoryWrapper<SimpleParserValue> Integer() const;
|
||||
[[nodiscard]] MatcherFactoryWrapper<SimpleParserValue> IntegerWithSign() const;
|
||||
[[nodiscard]] MatcherFactoryWrapper<SimpleParserValue> FloatingPoint() const;
|
||||
[[nodiscard]] MatcherFactoryWrapper<SimpleParserValue> FloatingPointWithSign() const;
|
||||
[[nodiscard]] MatcherFactoryWrapper<SimpleParserValue> Char(char c) const;
|
||||
[[nodiscard]] MatcherFactoryWrapper<SimpleParserValue> MultiChar(int multiCharacterSequenceId) const;
|
||||
[[nodiscard]] MatcherFactoryWrapper<SimpleParserValue> AnyCharBesides(std::vector<char> chars) const;
|
||||
};
|
||||
|
@ -79,7 +79,7 @@ bool SimpleLexer::ReadMultiCharacterToken(const MultiCharacterTokenLookupEntry*
|
||||
linePos++;
|
||||
}
|
||||
|
||||
m_current_line_offset = m_current_line_offset - 1 + multiTokenLookup->m_value.size();
|
||||
m_current_line_offset = m_current_line_offset - 1 + static_cast<unsigned>(multiTokenLookup->m_value.size());
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -98,7 +98,7 @@ bool ArgumentParser::ParseArguments(std::vector<std::string>& args)
|
||||
m_matched_options[matchedOption] = std::vector<std::string>();
|
||||
}
|
||||
|
||||
const auto parameterCount = matchedOption->m_parameters.size();
|
||||
const auto parameterCount = static_cast<unsigned>(matchedOption->m_parameters.size());
|
||||
if (argIndex + parameterCount >= argCount)
|
||||
{
|
||||
std::cout << std::format("Not enough parameters for option '{}'.\n", arg);
|
||||
|
@ -3,31 +3,31 @@ game IW3;
|
||||
architecture x86;
|
||||
|
||||
// Game Assets
|
||||
asset PhysPreset ASSET_TYPE_PHYSPRESET;
|
||||
asset XAnimParts ASSET_TYPE_XANIMPARTS;
|
||||
asset XModel ASSET_TYPE_XMODEL;
|
||||
asset Material ASSET_TYPE_MATERIAL;
|
||||
asset MaterialTechniqueSet ASSET_TYPE_TECHNIQUE_SET;
|
||||
asset GfxImage ASSET_TYPE_IMAGE;
|
||||
asset snd_alias_list_t ASSET_TYPE_SOUND;
|
||||
asset SndCurve ASSET_TYPE_SOUND_CURVE;
|
||||
asset LoadedSound ASSET_TYPE_LOADED_SOUND;
|
||||
asset clipMap_t ASSET_TYPE_CLIPMAP_PVS;
|
||||
asset ComWorld ASSET_TYPE_COMWORLD;
|
||||
asset GameWorldSp ASSET_TYPE_GAMEWORLD_SP;
|
||||
asset GameWorldMp ASSET_TYPE_GAMEWORLD_MP;
|
||||
asset MapEnts ASSET_TYPE_MAP_ENTS;
|
||||
asset GfxWorld ASSET_TYPE_GFXWORLD;
|
||||
asset GfxLightDef ASSET_TYPE_LIGHT_DEF;
|
||||
asset Font_s ASSET_TYPE_FONT;
|
||||
asset MenuList ASSET_TYPE_MENULIST;
|
||||
asset menuDef_t ASSET_TYPE_MENU;
|
||||
asset LocalizeEntry ASSET_TYPE_LOCALIZE_ENTRY;
|
||||
asset WeaponDef ASSET_TYPE_WEAPON;
|
||||
asset FxEffectDef ASSET_TYPE_FX;
|
||||
asset FxImpactTable ASSET_TYPE_IMPACT_FX;
|
||||
asset RawFile ASSET_TYPE_RAWFILE;
|
||||
asset StringTable ASSET_TYPE_STRINGTABLE;
|
||||
asset PhysPreset AssetPhysPreset;
|
||||
asset XAnimParts AssetXAnim;
|
||||
asset XModel AssetXModel;
|
||||
asset Material AssetMaterial;
|
||||
asset MaterialTechniqueSet AssetTechniqueSet;
|
||||
asset GfxImage AssetImage;
|
||||
asset snd_alias_list_t AssetSound;
|
||||
asset SndCurve AssetSoundCurve;
|
||||
asset LoadedSound AssetLoadedSound;
|
||||
asset clipMap_t AssetClipMapPvs;
|
||||
asset ComWorld AssetComWorld;
|
||||
asset GameWorldSp AssetGameWorldSp;
|
||||
asset GameWorldMp AssetGameWorldMp;
|
||||
asset MapEnts AssetMapEnts;
|
||||
asset GfxWorld AssetGfxWorld;
|
||||
asset GfxLightDef AssetLightDef;
|
||||
asset Font_s AssetFont;
|
||||
asset MenuList AssetMenuList;
|
||||
asset menuDef_t AssetMenu;
|
||||
asset LocalizeEntry AssetLocalize;
|
||||
asset WeaponDef AssetWeapon;
|
||||
asset FxEffectDef AssetFx;
|
||||
asset FxImpactTable AssetImpactFx;
|
||||
asset RawFile AssetRawFile;
|
||||
asset StringTable AssetStringTable;
|
||||
|
||||
// Setup blocks
|
||||
block temp XFILE_BLOCK_TEMP default;
|
||||
@ -66,4 +66,3 @@ block normal XFILE_BLOCK_INDEX;
|
||||
#include "XAssets/RawFile.txt"
|
||||
#include "XAssets/StringTable.txt"
|
||||
|
||||
// EOF
|
@ -3,41 +3,41 @@ game IW4;
|
||||
architecture x86;
|
||||
|
||||
// Game Assets
|
||||
asset PhysPreset ASSET_TYPE_PHYSPRESET;
|
||||
asset PhysCollmap ASSET_TYPE_PHYSCOLLMAP;
|
||||
asset XAnimParts ASSET_TYPE_XANIMPARTS;
|
||||
asset XModel ASSET_TYPE_XMODEL;
|
||||
asset Material ASSET_TYPE_MATERIAL;
|
||||
asset MaterialPixelShader ASSET_TYPE_PIXELSHADER;
|
||||
asset MaterialVertexShader ASSET_TYPE_VERTEXSHADER;
|
||||
asset MaterialVertexDeclaration ASSET_TYPE_VERTEXDECL;
|
||||
asset MaterialTechniqueSet ASSET_TYPE_TECHNIQUE_SET;
|
||||
asset GfxImage ASSET_TYPE_IMAGE;
|
||||
asset snd_alias_list_t ASSET_TYPE_SOUND;
|
||||
asset SndCurve ASSET_TYPE_SOUND_CURVE;
|
||||
asset LoadedSound ASSET_TYPE_LOADED_SOUND;
|
||||
asset clipMap_t ASSET_TYPE_CLIPMAP_MP;
|
||||
asset ComWorld ASSET_TYPE_COMWORLD;
|
||||
asset GameWorldSp ASSET_TYPE_GAMEWORLD_SP;
|
||||
asset GameWorldMp ASSET_TYPE_GAMEWORLD_MP;
|
||||
asset MapEnts ASSET_TYPE_MAP_ENTS;
|
||||
asset FxWorld ASSET_TYPE_FXWORLD;
|
||||
asset GfxWorld ASSET_TYPE_GFXWORLD;
|
||||
asset GfxLightDef ASSET_TYPE_LIGHT_DEF;
|
||||
asset Font_s ASSET_TYPE_FONT;
|
||||
asset MenuList ASSET_TYPE_MENULIST;
|
||||
asset menuDef_t ASSET_TYPE_MENU;
|
||||
asset LocalizeEntry ASSET_TYPE_LOCALIZE_ENTRY;
|
||||
asset WeaponCompleteDef ASSET_TYPE_WEAPON;
|
||||
asset FxEffectDef ASSET_TYPE_FX;
|
||||
asset FxImpactTable ASSET_TYPE_IMPACT_FX;
|
||||
asset RawFile ASSET_TYPE_RAWFILE;
|
||||
asset StringTable ASSET_TYPE_STRINGTABLE;
|
||||
asset LeaderboardDef ASSET_TYPE_LEADERBOARD;
|
||||
asset StructuredDataDefSet ASSET_TYPE_STRUCTURED_DATA_DEF;
|
||||
asset TracerDef ASSET_TYPE_TRACER;
|
||||
asset VehicleDef ASSET_TYPE_VEHICLE;
|
||||
asset AddonMapEnts ASSET_TYPE_ADDON_MAP_ENTS;
|
||||
asset PhysPreset AssetPhysPreset;
|
||||
asset PhysCollmap AssetPhysCollMap;
|
||||
asset XAnimParts AssetXAnim;
|
||||
asset XModel AssetXModel;
|
||||
asset Material AssetMaterial;
|
||||
asset MaterialPixelShader AssetPixelShader;
|
||||
asset MaterialVertexShader AssetVertexShader;
|
||||
asset MaterialVertexDeclaration AssetVertexDecl;
|
||||
asset MaterialTechniqueSet AssetTechniqueSet;
|
||||
asset GfxImage AssetImage;
|
||||
asset snd_alias_list_t AssetSound;
|
||||
asset SndCurve AssetSoundCurve;
|
||||
asset LoadedSound AssetLoadedSound;
|
||||
asset clipMap_t AssetClipMapMp;
|
||||
asset ComWorld AssetComWorld;
|
||||
asset GameWorldSp AssetGameWorldSp;
|
||||
asset GameWorldMp AssetGameWorldMp;
|
||||
asset MapEnts AssetMapEnts;
|
||||
asset FxWorld AssetFxWorld;
|
||||
asset GfxWorld AssetGfxWorld;
|
||||
asset GfxLightDef AssetLightDef;
|
||||
asset Font_s AssetFont;
|
||||
asset MenuList AssetMenuList;
|
||||
asset menuDef_t AssetMenu;
|
||||
asset LocalizeEntry AssetLocalize;
|
||||
asset WeaponCompleteDef AssetWeapon;
|
||||
asset FxEffectDef AssetFx;
|
||||
asset FxImpactTable AssetImpactFx;
|
||||
asset RawFile AssetRawFile;
|
||||
asset StringTable AssetStringTable;
|
||||
asset LeaderboardDef AssetLeaderboard;
|
||||
asset StructuredDataDefSet AssetStructuredDataDef;
|
||||
asset TracerDef AssetTracer;
|
||||
asset VehicleDef AssetVehicle;
|
||||
asset AddonMapEnts AssetAddonMapEnts;
|
||||
|
||||
// Setup blocks
|
||||
block temp XFILE_BLOCK_TEMP default;
|
||||
@ -85,4 +85,3 @@ block normal XFILE_BLOCK_INDEX;
|
||||
#include "XAssets/VehicleDef.txt"
|
||||
#include "XAssets/AddonMapEnts.txt"
|
||||
|
||||
// EOF
|
@ -3,46 +3,46 @@ game IW5;
|
||||
architecture x86;
|
||||
|
||||
// Game Assets
|
||||
asset PhysPreset ASSET_TYPE_PHYSPRESET;
|
||||
asset PhysCollmap ASSET_TYPE_PHYSCOLLMAP;
|
||||
asset XAnimParts ASSET_TYPE_XANIMPARTS;
|
||||
asset XModelSurfs ASSET_TYPE_XMODEL_SURFS;
|
||||
asset XModel ASSET_TYPE_XMODEL;
|
||||
asset Material ASSET_TYPE_MATERIAL;
|
||||
asset MaterialPixelShader ASSET_TYPE_PIXELSHADER;
|
||||
asset MaterialVertexShader ASSET_TYPE_VERTEXSHADER;
|
||||
asset MaterialVertexDeclaration ASSET_TYPE_VERTEXDECL;
|
||||
asset MaterialTechniqueSet ASSET_TYPE_TECHNIQUE_SET;
|
||||
asset GfxImage ASSET_TYPE_IMAGE;
|
||||
asset snd_alias_list_t ASSET_TYPE_SOUND;
|
||||
asset SndCurve ASSET_TYPE_SOUND_CURVE;
|
||||
asset LoadedSound ASSET_TYPE_LOADED_SOUND;
|
||||
asset clipMap_t ASSET_TYPE_CLIPMAP;
|
||||
asset ComWorld ASSET_TYPE_COMWORLD;
|
||||
asset GlassWorld ASSET_TYPE_GLASSWORLD;
|
||||
asset PathData ASSET_TYPE_PATHDATA;
|
||||
asset VehicleTrack ASSET_TYPE_VEHICLE_TRACK;
|
||||
asset MapEnts ASSET_TYPE_MAP_ENTS;
|
||||
asset FxWorld ASSET_TYPE_FXWORLD;
|
||||
asset GfxWorld ASSET_TYPE_GFXWORLD;
|
||||
asset GfxLightDef ASSET_TYPE_LIGHT_DEF;
|
||||
asset Font_s ASSET_TYPE_FONT;
|
||||
asset MenuList ASSET_TYPE_MENULIST;
|
||||
asset menuDef_t ASSET_TYPE_MENU;
|
||||
asset LocalizeEntry ASSET_TYPE_LOCALIZE_ENTRY;
|
||||
asset WeaponAttachment ASSET_TYPE_ATTACHMENT;
|
||||
asset WeaponCompleteDef ASSET_TYPE_WEAPON;
|
||||
asset FxEffectDef ASSET_TYPE_FX;
|
||||
asset FxImpactTable ASSET_TYPE_IMPACT_FX;
|
||||
asset SurfaceFxTable ASSET_TYPE_SURFACE_FX;
|
||||
asset RawFile ASSET_TYPE_RAWFILE;
|
||||
asset ScriptFile ASSET_TYPE_SCRIPTFILE;
|
||||
asset StringTable ASSET_TYPE_STRINGTABLE;
|
||||
asset LeaderboardDef ASSET_TYPE_LEADERBOARD;
|
||||
asset StructuredDataDefSet ASSET_TYPE_STRUCTURED_DATA_DEF;
|
||||
asset TracerDef ASSET_TYPE_TRACER;
|
||||
asset VehicleDef ASSET_TYPE_VEHICLE;
|
||||
asset AddonMapEnts ASSET_TYPE_ADDON_MAP_ENTS;
|
||||
asset PhysPreset AssetPhysPreset;
|
||||
asset PhysCollmap AssetPhysCollMap;
|
||||
asset XAnimParts AssetXAnim;
|
||||
asset XModelSurfs AssetXModelSurfs;
|
||||
asset XModel AssetXModel;
|
||||
asset Material AssetMaterial;
|
||||
asset MaterialPixelShader AssetPixelShader;
|
||||
asset MaterialVertexShader AssetVertexShader;
|
||||
asset MaterialVertexDeclaration AssetVertexDecl;
|
||||
asset MaterialTechniqueSet AssetTechniqueSet;
|
||||
asset GfxImage AssetImage;
|
||||
asset snd_alias_list_t AssetSound;
|
||||
asset SndCurve AssetSoundCurve;
|
||||
asset LoadedSound AssetLoadedSound;
|
||||
asset clipMap_t AssetClipMap;
|
||||
asset ComWorld AssetComWorld;
|
||||
asset GlassWorld AssetGlassWorld;
|
||||
asset PathData AssetPathData;
|
||||
asset VehicleTrack AssetVehicleTrack;
|
||||
asset MapEnts AssetMapEnts;
|
||||
asset FxWorld AssetFxWorld;
|
||||
asset GfxWorld AssetGfxWorld;
|
||||
asset GfxLightDef AssetLightDef;
|
||||
asset Font_s AssetFont;
|
||||
asset MenuList AssetMenuList;
|
||||
asset menuDef_t AssetMenu;
|
||||
asset LocalizeEntry AssetLocalize;
|
||||
asset WeaponAttachment AssetAttachment;
|
||||
asset WeaponCompleteDef AssetWeapon;
|
||||
asset FxEffectDef AssetFx;
|
||||
asset FxImpactTable AssetImpactFx;
|
||||
asset SurfaceFxTable AssetSurfaceFx;
|
||||
asset RawFile AssetRawFile;
|
||||
asset ScriptFile AssetScript;
|
||||
asset StringTable AssetStringTable;
|
||||
asset LeaderboardDef AssetLeaderboard;
|
||||
asset StructuredDataDefSet AssetStructuredDataDef;
|
||||
asset TracerDef AssetTracer;
|
||||
asset VehicleDef AssetVehicle;
|
||||
asset AddonMapEnts AssetAddonMapEnts;
|
||||
|
||||
// Setup blocks
|
||||
block temp XFILE_BLOCK_TEMP default;
|
||||
@ -96,4 +96,3 @@ block normal XFILE_BLOCK_SCRIPT;
|
||||
#include "XAssets/VehicleDef.txt"
|
||||
#include "XAssets/AddonMapEnts.txt"
|
||||
|
||||
// EOF
|
@ -3,38 +3,38 @@ game T5;
|
||||
architecture x86;
|
||||
|
||||
// Game Assets
|
||||
asset PhysPreset ASSET_TYPE_PHYSPRESET;
|
||||
asset PhysConstraints ASSET_TYPE_PHYSCONSTRAINTS;
|
||||
asset DestructibleDef ASSET_TYPE_DESTRUCTIBLEDEF;
|
||||
asset XAnimParts ASSET_TYPE_XANIMPARTS;
|
||||
asset XModel ASSET_TYPE_XMODEL;
|
||||
asset Material ASSET_TYPE_MATERIAL;
|
||||
asset MaterialTechniqueSet ASSET_TYPE_TECHNIQUE_SET;
|
||||
asset GfxImage ASSET_TYPE_IMAGE;
|
||||
asset SndBank ASSET_TYPE_SOUND;
|
||||
asset SndPatch ASSET_TYPE_SOUND_PATCH;
|
||||
asset clipMap_t ASSET_TYPE_CLIPMAP_PVS;
|
||||
asset ComWorld ASSET_TYPE_COMWORLD;
|
||||
asset GameWorldSp ASSET_TYPE_GAMEWORLD_SP;
|
||||
asset GameWorldMp ASSET_TYPE_GAMEWORLD_MP;
|
||||
asset MapEnts ASSET_TYPE_MAP_ENTS;
|
||||
asset GfxWorld ASSET_TYPE_GFXWORLD;
|
||||
asset GfxLightDef ASSET_TYPE_LIGHT_DEF;
|
||||
asset Font_s ASSET_TYPE_FONT;
|
||||
asset MenuList ASSET_TYPE_MENULIST;
|
||||
asset menuDef_t ASSET_TYPE_MENU;
|
||||
asset LocalizeEntry ASSET_TYPE_LOCALIZE_ENTRY;
|
||||
asset WeaponVariantDef ASSET_TYPE_WEAPON;
|
||||
asset SndDriverGlobals ASSET_TYPE_SNDDRIVER_GLOBALS;
|
||||
asset FxEffectDef ASSET_TYPE_FX;
|
||||
asset FxImpactTable ASSET_TYPE_IMPACT_FX;
|
||||
asset RawFile ASSET_TYPE_RAWFILE;
|
||||
asset StringTable ASSET_TYPE_STRINGTABLE;
|
||||
asset PackIndex ASSET_TYPE_PACK_INDEX;
|
||||
asset XGlobals ASSET_TYPE_XGLOBALS;
|
||||
asset ddlRoot_t ASSET_TYPE_DDL;
|
||||
asset Glasses ASSET_TYPE_GLASSES;
|
||||
asset EmblemSet ASSET_TYPE_EMBLEMSET;
|
||||
asset PhysPreset AssetPhysPreset;
|
||||
asset PhysConstraints AssetPhysConstraints;
|
||||
asset DestructibleDef AssetDestructibleDef;
|
||||
asset XAnimParts AssetXAnim;
|
||||
asset XModel AssetXModel;
|
||||
asset Material AssetMaterial;
|
||||
asset MaterialTechniqueSet AssetTechniqueSet;
|
||||
asset GfxImage AssetImage;
|
||||
asset SndBank AssetSoundBank;
|
||||
asset SndPatch AssetSoundPatch;
|
||||
asset clipMap_t AssetClipMapPvs;
|
||||
asset ComWorld AssetComWorld;
|
||||
asset GameWorldSp AssetGameWorldSp;
|
||||
asset GameWorldMp AssetGameWorldMp;
|
||||
asset MapEnts AssetMapEnts;
|
||||
asset GfxWorld AssetGfxWorld;
|
||||
asset GfxLightDef AssetLightDef;
|
||||
asset Font_s AssetFont;
|
||||
asset MenuList AssetMenuList;
|
||||
asset menuDef_t AssetMenu;
|
||||
asset LocalizeEntry AssetLocalize;
|
||||
asset WeaponVariantDef AssetWeapon;
|
||||
asset SndDriverGlobals AssetSoundDriverGlobals;
|
||||
asset FxEffectDef AssetFx;
|
||||
asset FxImpactTable AssetImpactFx;
|
||||
asset RawFile AssetRawFile;
|
||||
asset StringTable AssetStringTable;
|
||||
asset PackIndex AssetPackIndex;
|
||||
asset XGlobals AssetXGlobals;
|
||||
asset ddlRoot_t AssetDDL;
|
||||
asset Glasses AssetGlasses;
|
||||
asset EmblemSet AssetEmblemSet;
|
||||
|
||||
// Setup blocks
|
||||
block temp XFILE_BLOCK_TEMP default;
|
||||
@ -79,4 +79,3 @@ block normal XFILE_BLOCK_PHYSICAL;
|
||||
#include "XAssets/Glasses.txt"
|
||||
#include "XAssets/EmblemSet.txt"
|
||||
|
||||
// EOF
|
@ -3,54 +3,54 @@ game T6;
|
||||
architecture x86;
|
||||
|
||||
// Game Assets
|
||||
asset PhysPreset ASSET_TYPE_PHYSPRESET;
|
||||
asset PhysConstraints ASSET_TYPE_PHYSCONSTRAINTS;
|
||||
asset DestructibleDef ASSET_TYPE_DESTRUCTIBLEDEF;
|
||||
asset XAnimParts ASSET_TYPE_XANIMPARTS;
|
||||
asset XModel ASSET_TYPE_XMODEL;
|
||||
asset Material ASSET_TYPE_MATERIAL;
|
||||
asset MaterialTechniqueSet ASSET_TYPE_TECHNIQUE_SET;
|
||||
asset GfxImage ASSET_TYPE_IMAGE;
|
||||
asset SndBank ASSET_TYPE_SOUND;
|
||||
asset SndPatch ASSET_TYPE_SOUND_PATCH;
|
||||
asset clipMap_t ASSET_TYPE_CLIPMAP_PVS;
|
||||
asset ComWorld ASSET_TYPE_COMWORLD;
|
||||
asset GameWorldSp ASSET_TYPE_GAMEWORLD_SP;
|
||||
asset GameWorldMp ASSET_TYPE_GAMEWORLD_MP;
|
||||
asset MapEnts ASSET_TYPE_MAP_ENTS;
|
||||
asset GfxWorld ASSET_TYPE_GFXWORLD;
|
||||
asset GfxLightDef ASSET_TYPE_LIGHT_DEF;
|
||||
asset Font_s ASSET_TYPE_FONT;
|
||||
asset FontIcon ASSET_TYPE_FONTICON;
|
||||
asset MenuList ASSET_TYPE_MENULIST;
|
||||
asset menuDef_t ASSET_TYPE_MENU;
|
||||
asset LocalizeEntry ASSET_TYPE_LOCALIZE_ENTRY;
|
||||
asset WeaponVariantDef ASSET_TYPE_WEAPON;
|
||||
asset WeaponAttachment ASSET_TYPE_ATTACHMENT;
|
||||
asset WeaponAttachmentUnique ASSET_TYPE_ATTACHMENT_UNIQUE;
|
||||
asset WeaponCamo ASSET_TYPE_WEAPON_CAMO;
|
||||
asset SndDriverGlobals ASSET_TYPE_SNDDRIVER_GLOBALS;
|
||||
asset FxEffectDef ASSET_TYPE_FX;
|
||||
asset FxImpactTable ASSET_TYPE_IMPACT_FX;
|
||||
asset RawFile ASSET_TYPE_RAWFILE;
|
||||
asset StringTable ASSET_TYPE_STRINGTABLE;
|
||||
asset LeaderboardDef ASSET_TYPE_LEADERBOARD;
|
||||
asset XGlobals ASSET_TYPE_XGLOBALS;
|
||||
asset ddlRoot_t ASSET_TYPE_DDL;
|
||||
asset Glasses ASSET_TYPE_GLASSES;
|
||||
asset EmblemSet ASSET_TYPE_EMBLEMSET;
|
||||
asset ScriptParseTree ASSET_TYPE_SCRIPTPARSETREE;
|
||||
asset KeyValuePairs ASSET_TYPE_KEYVALUEPAIRS;
|
||||
asset VehicleDef ASSET_TYPE_VEHICLEDEF;
|
||||
asset MemoryBlock ASSET_TYPE_MEMORYBLOCK;
|
||||
asset AddonMapEnts ASSET_TYPE_ADDON_MAP_ENTS;
|
||||
asset TracerDef ASSET_TYPE_TRACER;
|
||||
asset SkinnedVertsDef ASSET_TYPE_SKINNEDVERTS;
|
||||
asset Qdb ASSET_TYPE_QDB;
|
||||
asset Slug ASSET_TYPE_SLUG;
|
||||
asset FootstepTableDef ASSET_TYPE_FOOTSTEP_TABLE;
|
||||
asset FootstepFXTableDef ASSET_TYPE_FOOTSTEPFX_TABLE;
|
||||
asset ZBarrierDef ASSET_TYPE_ZBARRIER;
|
||||
asset PhysPreset AssetPhysPreset;
|
||||
asset PhysConstraints AssetPhysConstraints;
|
||||
asset DestructibleDef AssetDestructibleDef;
|
||||
asset XAnimParts AssetXAnim;
|
||||
asset XModel AssetXModel;
|
||||
asset Material AssetMaterial;
|
||||
asset MaterialTechniqueSet AssetTechniqueSet;
|
||||
asset GfxImage AssetImage;
|
||||
asset SndBank AssetSoundBank;
|
||||
asset SndPatch AssetSoundPatch;
|
||||
asset clipMap_t AssetClipMapPvs;
|
||||
asset ComWorld AssetComWorld;
|
||||
asset GameWorldSp AssetGameWorldSp;
|
||||
asset GameWorldMp AssetGameWorldMp;
|
||||
asset MapEnts AssetMapEnts;
|
||||
asset GfxWorld AssetGfxWorld;
|
||||
asset GfxLightDef AssetLightDef;
|
||||
asset Font_s AssetFont;
|
||||
asset FontIcon AssetFontIcon;
|
||||
asset MenuList AssetMenuList;
|
||||
asset menuDef_t AssetMenu;
|
||||
asset LocalizeEntry AssetLocalize;
|
||||
asset WeaponVariantDef AssetWeapon;
|
||||
asset WeaponAttachment AssetAttachment;
|
||||
asset WeaponAttachmentUnique AssetAttachmentUnique;
|
||||
asset WeaponCamo AssetWeaponCamo;
|
||||
asset SndDriverGlobals AssetSoundDriverGlobals;
|
||||
asset FxEffectDef AssetFx;
|
||||
asset FxImpactTable AssetImpactFx;
|
||||
asset RawFile AssetRawFile;
|
||||
asset StringTable AssetStringTable;
|
||||
asset LeaderboardDef AssetLeaderboard;
|
||||
asset XGlobals AssetXGlobals;
|
||||
asset ddlRoot_t AssetDDL;
|
||||
asset Glasses AssetGlasses;
|
||||
asset EmblemSet AssetEmblemSet;
|
||||
asset ScriptParseTree AssetScript;
|
||||
asset KeyValuePairs AssetKeyValuePairs;
|
||||
asset VehicleDef AssetVehicle;
|
||||
asset MemoryBlock AssetMemoryBlock;
|
||||
asset AddonMapEnts AssetAddonMapEnts;
|
||||
asset TracerDef AssetTracer;
|
||||
asset SkinnedVertsDef AssetSkinnedVerts;
|
||||
asset Qdb AssetQdb;
|
||||
asset Slug AssetSlug;
|
||||
asset FootstepTableDef AssetFootstepTable;
|
||||
asset FootstepFXTableDef AssetFootstepFxTable;
|
||||
asset ZBarrierDef AssetZBarrier;
|
||||
|
||||
// Setup blocks
|
||||
block temp XFILE_BLOCK_TEMP default;
|
||||
@ -112,4 +112,3 @@ block normal XFILE_BLOCK_STREAMER_RESERVE;
|
||||
#include "XAssets/FootstepFXTableDef.txt"
|
||||
#include "XAssets/ZBarrierDef.txt"
|
||||
|
||||
// EOF
|
@ -12,7 +12,7 @@ StructureComputations::StructureComputations(const StructureInformation* structu
|
||||
|
||||
bool StructureComputations::IsAsset() const
|
||||
{
|
||||
return m_info->m_asset_enum_entry != nullptr;
|
||||
return !m_info->m_asset_name.empty();
|
||||
}
|
||||
|
||||
MemberInformation* StructureComputations::GetDynamicMember() const
|
||||
|
@ -2,7 +2,6 @@
|
||||
|
||||
StructureInformation::StructureInformation(DefinitionWithMembers* definition)
|
||||
: m_definition(definition),
|
||||
m_asset_enum_entry(nullptr),
|
||||
m_is_leaf(false),
|
||||
m_requires_marking(false),
|
||||
m_has_matching_cross_platform_structure(false),
|
||||
|
@ -16,8 +16,8 @@ class StructureInformation
|
||||
public:
|
||||
explicit StructureInformation(DefinitionWithMembers* definition);
|
||||
|
||||
DefinitionWithMembers* const m_definition;
|
||||
EnumMember* m_asset_enum_entry;
|
||||
DefinitionWithMembers* m_definition;
|
||||
std::string m_asset_name;
|
||||
|
||||
std::vector<StructureInformation*> m_usages;
|
||||
std::vector<std::unique_ptr<MemberInformation>> m_ordered_members;
|
||||
|
@ -7,6 +7,7 @@
|
||||
#include "Templates/ZoneWriteTemplate.h"
|
||||
|
||||
#include <filesystem>
|
||||
#include <format>
|
||||
#include <fstream>
|
||||
#include <iostream>
|
||||
|
||||
@ -41,7 +42,7 @@ bool CodeGenerator::GenerateCodeForTemplate(RenderingContext* context, ICodeTemp
|
||||
|
||||
if (!stream.is_open())
|
||||
{
|
||||
std::cout << "Failed to open file '" << p.string() << "'\n";
|
||||
std::cerr << std::format("Failed to open file '{}'\n", p.string());
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -58,21 +59,21 @@ bool CodeGenerator::GetAssetWithName(IDataRepository* repository, const std::str
|
||||
auto* def = repository->GetDataDefinitionByName(name);
|
||||
if (def == nullptr)
|
||||
{
|
||||
std::cout << "Could not find type with name '" << name << "'\n";
|
||||
std::cerr << std::format("Could not find type with name '{}'\n", name);
|
||||
return false;
|
||||
}
|
||||
|
||||
auto* defWithMembers = dynamic_cast<DefinitionWithMembers*>(def);
|
||||
auto* info = defWithMembers != nullptr ? repository->GetInformationFor(defWithMembers) : nullptr;
|
||||
if (info == nullptr)
|
||||
asset = defWithMembers != nullptr ? repository->GetInformationFor(defWithMembers) : nullptr;
|
||||
if (asset == nullptr)
|
||||
{
|
||||
std::cout << "Could not find type with name '" << name << "'\n";
|
||||
std::cerr << std::format("Could not find type with name '{}'\n", name);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!StructureComputations(info).IsAsset())
|
||||
if (!StructureComputations(asset).IsAsset())
|
||||
{
|
||||
std::cout << "Type is not an asset '" << name << "'\n";
|
||||
std::cerr << std::format("Type is not an asset '{}'\n", name);
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -100,7 +101,7 @@ bool CodeGenerator::GenerateCode(IDataRepository* repository)
|
||||
const auto foundTemplate = m_template_mapping.find(templateName);
|
||||
if (foundTemplate == m_template_mapping.end())
|
||||
{
|
||||
std::cout << "Unknown template '" << generationTask.m_template_name << "'.\n";
|
||||
std::cerr << std::format("Unknown template '{}'.\n", generationTask.m_template_name);
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -111,13 +112,13 @@ bool CodeGenerator::GenerateCode(IDataRepository* repository)
|
||||
auto context = RenderingContext::BuildContext(repository, asset);
|
||||
if (!GenerateCodeForTemplate(context.get(), foundTemplate->second.get()))
|
||||
{
|
||||
std::cout << "Failed to generate code for asset '" << asset->m_definition->GetFullName() << "' with preset '" << foundTemplate->first
|
||||
<< "'\n";
|
||||
std::cerr << std::format(
|
||||
"Failed to generate code for asset '{}' with preset '{}'\n", asset->m_definition->GetFullName(), foundTemplate->first);
|
||||
return false;
|
||||
}
|
||||
|
||||
std::cout << "Successfully generated code for asset '" << asset->m_definition->GetFullName() << "' with preset '" << foundTemplate->first
|
||||
<< "'\n";
|
||||
std::cout << std::format(
|
||||
"Successfully generated code for asset '{}' with preset '{}'\n", asset->m_definition->GetFullName(), foundTemplate->first);
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -133,9 +134,7 @@ bool CodeGenerator::GenerateCode(IDataRepository* repository)
|
||||
}
|
||||
const auto end = std::chrono::steady_clock::now();
|
||||
if (m_args->m_verbose)
|
||||
{
|
||||
std::cout << "Generating code took " << std::chrono::duration_cast<std::chrono::milliseconds>(end - start).count() << "ms\n";
|
||||
}
|
||||
std::cout << std::format("Generating code took {}ms\n", std::chrono::duration_cast<std::chrono::milliseconds>(end - start).count());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -21,6 +21,5 @@ private:
|
||||
static bool GetAssetWithName(IDataRepository* repository, const std::string& name, StructureInformation*& asset);
|
||||
|
||||
const ZoneCodeGeneratorArguments* m_args;
|
||||
|
||||
std::unordered_map<std::string, std::unique_ptr<ICodeTemplate>> m_template_mapping;
|
||||
};
|
||||
|
@ -9,14 +9,14 @@
|
||||
class CodeTemplateFile
|
||||
{
|
||||
public:
|
||||
std::string m_file_name;
|
||||
int m_tag;
|
||||
|
||||
CodeTemplateFile(std::string fileName, const int tag)
|
||||
: m_file_name(std::move(fileName)),
|
||||
m_tag(tag)
|
||||
{
|
||||
}
|
||||
|
||||
std::string m_file_name;
|
||||
int m_tag;
|
||||
};
|
||||
|
||||
class ICodeTemplate
|
||||
|
@ -3,6 +3,7 @@
|
||||
#include "Domain/Computations/MemberComputations.h"
|
||||
#include "Domain/Computations/StructureComputations.h"
|
||||
#include "Internal/BaseTemplate.h"
|
||||
#include "Utils/StringUtils.h"
|
||||
|
||||
#include <cassert>
|
||||
#include <iostream>
|
||||
@ -261,7 +262,7 @@ namespace
|
||||
LINEF("{0}::{0}(Zone* zone, IZoneInputStream* stream)", LoaderClassName(m_env.m_asset))
|
||||
|
||||
m_intendation++;
|
||||
LINE_STARTF(": AssetLoader({0}, zone, stream)", m_env.m_asset->m_asset_enum_entry->m_name)
|
||||
LINE_STARTF(": AssetLoader({0}::EnumEntry, zone, stream)", m_env.m_asset->m_asset_name)
|
||||
if (m_env.m_has_actions)
|
||||
{
|
||||
LINE_MIDDLE(", m_actions(zone)")
|
||||
@ -1349,8 +1350,7 @@ std::vector<CodeTemplateFile> ZoneLoadTemplate::GetFilesToRender(RenderingContex
|
||||
std::vector<CodeTemplateFile> files;
|
||||
|
||||
auto assetName = context->m_asset->m_definition->m_name;
|
||||
for (auto& c : assetName)
|
||||
c = static_cast<char>(tolower(c));
|
||||
utils::MakeStringLowerCase(assetName);
|
||||
|
||||
files.emplace_back(std::format("{0}/{0}_load_db.h", assetName), TAG_HEADER);
|
||||
files.emplace_back(std::format("{0}/{0}_load_db.cpp", assetName), TAG_SOURCE);
|
||||
|
@ -245,7 +245,7 @@ namespace
|
||||
LINEF("{0}::{0}(Zone* zone)", MarkerClassName(m_env.m_asset))
|
||||
|
||||
m_intendation++;
|
||||
LINEF(": AssetMarker({0}, zone)", m_env.m_asset->m_asset_enum_entry->m_name)
|
||||
LINEF(": AssetMarker({0}::EnumEntry, zone)", m_env.m_asset->m_asset_name)
|
||||
m_intendation--;
|
||||
|
||||
LINE("{")
|
||||
|
@ -97,7 +97,6 @@ namespace
|
||||
m_intendation++;
|
||||
PrintHeaderConstructor();
|
||||
PrintHeaderMainWriteMethodDeclaration(m_env.m_asset);
|
||||
PrintHeaderGetNameMethodDeclaration(m_env.m_asset);
|
||||
|
||||
m_intendation--;
|
||||
LINE("};")
|
||||
@ -160,8 +159,6 @@ namespace
|
||||
PrintWritePtrMethod(m_env.m_asset);
|
||||
LINE("")
|
||||
PrintMainWriteMethod();
|
||||
LINE("")
|
||||
PrintGetNameMethod();
|
||||
}
|
||||
|
||||
private:
|
||||
@ -220,11 +217,6 @@ namespace
|
||||
LINEF("void WritePtr_{0}(bool atStreamStart);", MakeSafeTypeName(info->m_definition))
|
||||
}
|
||||
|
||||
void PrintHeaderGetNameMethodDeclaration(const StructureInformation* info) const
|
||||
{
|
||||
LINEF("static std::string GetAssetName({0}* pAsset);", info->m_definition->GetFullName())
|
||||
}
|
||||
|
||||
void PrintHeaderMainWriteMethodDeclaration(const StructureInformation* info) const
|
||||
{
|
||||
LINEF("void Write({0}** pAsset);", info->m_definition->GetFullName())
|
||||
@ -261,7 +253,8 @@ namespace
|
||||
"{0}::{0}({1}* asset, const Zone& zone, IZoneOutputStream& stream)", WriterClassName(m_env.m_asset), m_env.m_asset->m_definition->GetFullName())
|
||||
|
||||
m_intendation++;
|
||||
LINEF(": AssetWriter(zone.m_pools->GetAssetOrAssetReference({0}, GetAssetName(asset)), zone, stream)", m_env.m_asset->m_asset_enum_entry->m_name)
|
||||
LINEF(": AssetWriter(zone.m_pools->GetAssetOrAssetReference({0}::EnumEntry, AssetNameAccessor<{0}>()(*asset)), zone, stream)",
|
||||
m_env.m_asset->m_asset_name)
|
||||
m_intendation--;
|
||||
|
||||
LINE("{")
|
||||
@ -1102,40 +1095,6 @@ namespace
|
||||
LINE("}")
|
||||
}
|
||||
|
||||
void PrintGetNameMethod()
|
||||
{
|
||||
LINEF("std::string {0}::GetAssetName({1}* pAsset)", WriterClassName(m_env.m_asset), m_env.m_asset->m_definition->GetFullName())
|
||||
LINE("{")
|
||||
m_intendation++;
|
||||
|
||||
if (!m_env.m_asset->m_name_chain.empty())
|
||||
{
|
||||
LINE_START("return pAsset")
|
||||
|
||||
auto first = true;
|
||||
for (const auto* member : m_env.m_asset->m_name_chain)
|
||||
{
|
||||
if (first)
|
||||
{
|
||||
first = false;
|
||||
LINE_MIDDLEF("->{0}", member->m_member->m_name)
|
||||
}
|
||||
else
|
||||
{
|
||||
LINE_MIDDLEF(".{0}", member->m_member->m_name)
|
||||
}
|
||||
}
|
||||
LINE_END(";")
|
||||
}
|
||||
else
|
||||
{
|
||||
LINEF("return \"{0}\";", m_env.m_asset->m_definition->m_name)
|
||||
}
|
||||
|
||||
m_intendation--;
|
||||
LINE("}")
|
||||
}
|
||||
|
||||
void PrintWritePtrArrayMethod_Loading(const DataDefinition* def, const StructureInformation* info, const bool reusable) const
|
||||
{
|
||||
LINEF("m_stream->Align({0});", def->GetAlignment())
|
||||
|
@ -130,7 +130,7 @@ bool CommandsParserState::GetTypenameAndMembersFromTypename(const std::string& t
|
||||
|
||||
if (foundDefinition == nullptr)
|
||||
{
|
||||
currentSeparatorPos = typeNameValue.size();
|
||||
currentSeparatorPos = static_cast<unsigned>(typeNameValue.size());
|
||||
foundDefinition = m_repository->GetDataDefinitionByName(typeNameValue);
|
||||
}
|
||||
|
||||
|
@ -376,7 +376,7 @@ std::unique_ptr<IEvaluation>
|
||||
operands.emplace_back(std::move(firstStatementPart));
|
||||
|
||||
if (result.PeekAndRemoveIfTag(TAG_EVALUATION_OPERATION) == TAG_EVALUATION_OPERATION)
|
||||
operators.emplace_back(operators.size(), result.NextCapture(CAPTURE_BINARY_OPERATION_TYPE).OpTypeValue());
|
||||
operators.emplace_back(static_cast<unsigned>(operators.size()), result.NextCapture(CAPTURE_BINARY_OPERATION_TYPE).OpTypeValue());
|
||||
else
|
||||
break;
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
namespace
|
||||
{
|
||||
static constexpr auto CAPTURE_TYPE = 1;
|
||||
static constexpr auto CAPTURE_ENUM_ENTRY = 2;
|
||||
static constexpr auto CAPTURE_ASSET_NAME = 2;
|
||||
} // namespace
|
||||
|
||||
SequenceAsset::SequenceAsset()
|
||||
@ -17,7 +17,7 @@ SequenceAsset::SequenceAsset()
|
||||
AddMatchers({
|
||||
create.Keyword("asset"),
|
||||
create.Label(CommandsCommonMatchers::LABEL_TYPENAME).Capture(CAPTURE_TYPE),
|
||||
create.Identifier().Capture(CAPTURE_ENUM_ENTRY),
|
||||
create.Identifier().Capture(CAPTURE_ASSET_NAME),
|
||||
create.Char(';'),
|
||||
});
|
||||
}
|
||||
@ -25,7 +25,7 @@ SequenceAsset::SequenceAsset()
|
||||
void SequenceAsset::ProcessMatch(CommandsParserState* state, SequenceResult<CommandsParserValue>& result) const
|
||||
{
|
||||
const auto& typeNameToken = result.NextCapture(CAPTURE_TYPE);
|
||||
const auto& enumEntryToken = result.NextCapture(CAPTURE_ENUM_ENTRY);
|
||||
const auto& assetNameToken = result.NextCapture(CAPTURE_ASSET_NAME);
|
||||
|
||||
auto* definition = state->GetRepository()->GetDataDefinitionByName(typeNameToken.TypeNameValue());
|
||||
if (definition == nullptr)
|
||||
@ -39,9 +39,7 @@ void SequenceAsset::ProcessMatch(CommandsParserState* state, SequenceResult<Comm
|
||||
if (information == nullptr)
|
||||
throw ParsingException(typeNameToken.GetPos(), "No information for definition");
|
||||
|
||||
auto* enumMember = state->GetRepository()->GetEnumMemberByName(enumEntryToken.IdentifierValue());
|
||||
if (enumMember == nullptr)
|
||||
throw ParsingException(enumEntryToken.GetPos(), "Unknown enum entry");
|
||||
|
||||
information->m_asset_enum_entry = enumMember;
|
||||
information->m_asset_name = assetNameToken.IdentifierValue();
|
||||
if (information->m_asset_name.empty())
|
||||
throw ParsingException(assetNameToken.GetPos(), "Asset name is empty");
|
||||
}
|
||||
|
@ -10,12 +10,12 @@ namespace
|
||||
{
|
||||
bool CalculateRequiresMarking(std::unordered_set<const void*>& visitedStructures, StructureInformation* info)
|
||||
{
|
||||
if (visitedStructures.find(info) != visitedStructures.end())
|
||||
if (visitedStructures.contains(info))
|
||||
return info->m_requires_marking;
|
||||
|
||||
visitedStructures.emplace(info);
|
||||
|
||||
if (info->m_asset_enum_entry)
|
||||
if (StructureComputations(info).IsAsset())
|
||||
{
|
||||
info->m_requires_marking = true;
|
||||
return true;
|
||||
@ -47,7 +47,7 @@ namespace
|
||||
continue;
|
||||
|
||||
// Any script strings, asset refs and assets need to be processed.
|
||||
if (member->m_is_script_string || member->m_asset_ref || member->m_type && member->m_type->m_asset_enum_entry)
|
||||
if (member->m_is_script_string || member->m_asset_ref || member->m_type && StructureComputations(member->m_type).IsAsset())
|
||||
{
|
||||
info->m_requires_marking = true;
|
||||
return true;
|
||||
|
Loading…
x
Reference in New Issue
Block a user