Incomplete tile merging implementation

Co-authored-by: sigonasr2 <sigonasr2@gmail.com>
pull/28/head
parent 36005ec0b3
commit 50cb945df4
  1. 14
      Crawler/Crawler.cpp

@ -1085,6 +1085,20 @@ void Crawler::LoadLevel(MapName map){
if(IsUpperForegroundTile(tileSheet,tileSheetIndex)){
GroupForegroundTilesTogether(upperForegroundTileGroups);
}
for(auto it=foregroundTileGroups.begin();it!=foregroundTileGroups.end();++it){
for(auto it2=foregroundTileGroups.begin();it2!=foregroundTileGroups.end();++it2){
if(it==it2)continue;
geom2d::rect<int>group_rect=(*it).GetRange();
geom2d::rect<int>group2_rect=(*it2).GetRange();
group_rect.pos.x-=1;group_rect.pos.y-=1;
group_rect.size.x-=1;group_rect.size.y-=1;
if(geom2d::overlaps(group_rect,group2_rect)){
//Merge them together.
(*it).
std::copy(,group2_rect.end(),std::back_inserter(group_rect));
}
}
}
#pragma endregion
}
}

Loading…
Cancel
Save