mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-06-09 22:38:06 -05:00
Load vertex decl asset
This commit is contained in:
@ -26,10 +26,7 @@ namespace techset
|
||||
assert(state->m_in_pass == false);
|
||||
state->m_in_pass = true;
|
||||
|
||||
if (state->m_before_first_pass)
|
||||
state->m_before_first_pass = false;
|
||||
else
|
||||
state->m_acceptor->AcceptNextPass();
|
||||
state->m_acceptor->AcceptNextPass();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
@ -11,13 +11,15 @@ namespace techset
|
||||
{
|
||||
class SequenceEndPass final : public TechniqueParser::sequence_t
|
||||
{
|
||||
static constexpr auto CAPTURE_FIRST_TOKEN = 1;
|
||||
|
||||
public:
|
||||
SequenceEndPass()
|
||||
{
|
||||
const SimpleMatcherFactory create(this);
|
||||
|
||||
AddMatchers({
|
||||
create.Char('}')
|
||||
create.Char('}').Capture(CAPTURE_FIRST_TOKEN)
|
||||
});
|
||||
}
|
||||
|
||||
@ -25,6 +27,11 @@ namespace techset
|
||||
void ProcessMatch(TechniqueParserState* state, SequenceResult<SimpleParserValue>& result) const override
|
||||
{
|
||||
assert(state->m_in_pass == true);
|
||||
|
||||
std::string errorMessage;
|
||||
if(!state->m_acceptor->AcceptEndPass(errorMessage))
|
||||
throw ParsingException(result.NextCapture(CAPTURE_FIRST_TOKEN).GetPos(), errorMessage);
|
||||
|
||||
state->m_in_pass = false;
|
||||
}
|
||||
};
|
||||
|
@ -6,7 +6,6 @@ using namespace techset;
|
||||
|
||||
TechniqueParserState::TechniqueParserState(ITechniqueDefinitionAcceptor* acceptor)
|
||||
: m_acceptor(acceptor),
|
||||
m_before_first_pass(true),
|
||||
m_in_pass(false),
|
||||
m_in_shader(false),
|
||||
m_current_shader(ShaderSelector::VERTEX_SHADER)
|
||||
|
@ -8,8 +8,7 @@ namespace techset
|
||||
{
|
||||
public:
|
||||
ITechniqueDefinitionAcceptor* const m_acceptor;
|
||||
|
||||
bool m_before_first_pass;
|
||||
|
||||
bool m_in_pass;
|
||||
bool m_in_shader;
|
||||
ShaderSelector m_current_shader;
|
||||
|
@ -74,6 +74,7 @@ namespace techset
|
||||
ITechniqueDefinitionAcceptor& operator=(ITechniqueDefinitionAcceptor&& other) noexcept = default;
|
||||
|
||||
virtual void AcceptNextPass() = 0;
|
||||
virtual bool AcceptEndPass(std::string& errorMessage) = 0;
|
||||
|
||||
virtual void AcceptStateMap(const std::string& stateMapName) = 0;
|
||||
|
||||
|
Reference in New Issue
Block a user