additional sound type for local brake, support for combined sounds

This commit is contained in:
tmj-fstate
2017-12-14 14:31:34 +01:00
parent 428710b8e7
commit 4e6e428cea
12 changed files with 725 additions and 162 deletions

View File

@@ -109,9 +109,21 @@ cParser::getToken<bool>( bool const ToLower, const char *Break ) {
}
// methods
cParser &
cParser::autoclear( bool const Autoclear ) {
m_autoclear = Autoclear;
if( mIncludeParser ) { mIncludeParser->autoclear( Autoclear ); }
return *this;
}
bool cParser::getTokens(unsigned int Count, bool ToLower, const char *Break)
{
tokens.clear(); // emulates old parser behaviour. TODO, TBD: allow manual reset?
if( true == m_autoclear ) {
// legacy parser behaviour
tokens.clear();
}
/*
if (LoadTraction==true)
trtest="niemaproblema"; //wczytywać
@@ -123,7 +135,7 @@ bool cParser::getTokens(unsigned int Count, bool ToLower, const char *Break)
this->str("");
this->clear();
*/
for (unsigned int i = 0; i < Count; ++i)
for (unsigned int i = tokens.size(); i < Count; ++i)
{
std::string token = readToken(ToLower, Break);
if( true == token.empty() ) {
@@ -215,6 +227,7 @@ std::string cParser::readToken( bool ToLower, const char *Break ) {
parameter = readToken( false );
}
mIncludeParser = std::make_shared<cParser>( includefile, buffer_FILE, mPath, LoadTraction, includeparameters );
mIncludeParser->autoclear( m_autoclear );
if( mIncludeParser->mSize <= 0 ) {
ErrorLog( "Bad include: can't open file \"" + includefile + "\"" );
}