diff --git a/.gitignore b/.gitignore index f4940f273..67299f752 100644 --- a/.gitignore +++ b/.gitignore @@ -47,3 +47,4 @@ test/gtest/src/gtest-stamp/gtest-build.cmake test/gtest/src/gtest-stamp/Debug/gtest-patch *.cache test/gtest/src/gtest-stamp/Debug/gtest-build +*.lib diff --git a/code/OpenGEXParser.cpp b/code/OpenGEXParser.cpp index 0acf209a6..03f222d1c 100644 --- a/code/OpenGEXParser.cpp +++ b/code/OpenGEXParser.cpp @@ -189,6 +189,17 @@ bool OpenGEXParser::skipComments() { return skipped; } +//------------------------------------------------------------------------------------------------ +void OpenGEXParser::readUntilEndOfLine() { + while( !IsLineEnd( m_buffer[ m_index ] ) ) { + ++m_index; + } + ++m_index; + if( IsLineEnd( m_buffer[ m_index ] ) ) { + ++m_index; + } +} + //------------------------------------------------------------------------------------------------ bool OpenGEXParser::parseNextNode() { std::string token( getNextToken() ); @@ -202,8 +213,11 @@ bool OpenGEXParser::parseNextNode() { if( !getNodeData( nodeType ) ) { return false; } + + readUntilEndOfLine(); m_nodeTypeStack.pop_back(); + } return true; @@ -329,21 +343,19 @@ bool OpenGEXParser::getMetricAttributeKey( std::string &attribName ) { //------------------------------------------------------------------------------------------------ bool OpenGEXParser::onMetricNode( const std::string &attribName ) { + float value( 0.0f ); bool success( true ); if( "distance" == attribName ) { - float distance( 0.0f ); - if( getFloatData( 1, &distance ) ) { - m_model.m_metrics.m_distance = distance; + if( getFloatData( 1, &value ) ) { + m_model.m_metrics.m_distance = value; } } else if( "angle" == attribName ) { - float angle( 0.0f ); - if( getFloatData( 1, &angle ) ) { - m_model.m_metrics.m_angle = angle; + if( getFloatData( 1, &value ) ) { + m_model.m_metrics.m_angle = value; } } else if( "time" == attribName ) { - float time( 0.0f ); - if( getFloatData( 1, &time ) ) { - m_model.m_metrics.m_time = time; + if( getFloatData( 1, &value ) ) { + m_model.m_metrics.m_time = value; } } else if( "up" == attribName ) { std::string up; diff --git a/code/OpenGEXParser.h b/code/OpenGEXParser.h index f6ef2df14..82b30e4ae 100644 --- a/code/OpenGEXParser.h +++ b/code/OpenGEXParser.h @@ -87,6 +87,7 @@ public: protected: std::string getNextToken(); bool skipComments(); + void readUntilEndOfLine(); bool parseNextNode(); bool getNodeHeader( std::string &name ); bool getBracketOpen();