diff --git a/Crawler/Crawler.cpp b/Crawler/Crawler.cpp index d2321dde..dac14a27 100644 --- a/Crawler/Crawler.cpp +++ b/Crawler/Crawler.cpp @@ -26,7 +26,7 @@ Crawler::Crawler() } bool Crawler::OnUserCreate(){ - TMXParser("assets/maps/Level1.tmx"); + TMXParser level1("assets/maps/Level1.tmx"); //Initialize Camera. camera=Camera2D{WINDOW_SIZE}; diff --git a/Crawler/TMXParser.h b/Crawler/TMXParser.h index 444d31ed..9f487f95 100644 --- a/Crawler/TMXParser.h +++ b/Crawler/TMXParser.h @@ -87,30 +87,42 @@ private: std::string data; while (s.good()) { int quotationMarkCount=0; + bool pastEquals=false; data=""; + bool valid=false; while(s.good()){ int character=s.get(); if(character=='"'){ quotationMarkCount++; } - data+=character; if(character==' '&"ationMarkCount%2==0){ + valid=true; break; } + data+=character; + if(pastEquals&"ationMarkCount%2==0){ + valid=true; + break; + } + if(character=='='&"ationMarkCount%2==0){ + pastEquals=true; + } } - if (newTag.tag.length()==0) { //Tag's empty, so first line is the tag. - newTag.tag=data; - std::cout<<"Tag: "<0){ + if (newTag.tag.length()==0) { //Tag's empty, so first line is the tag. + newTag.tag=data; + std::cout<<"Tag: "<