Compare commits

..

No commits in common. 'e6315b1be860b0d0fc51d5ef82b597d374d9ff16' and '54f824e7764d27f630296c96cce864d26ea132b3' have entirely different histories.

  1. 15
      TMXParser.h

@ -1,8 +1,9 @@
#include "pixelGameEngine.h"
#include <strstream>
using namespace olc;
#include <sstream>
#include <fstream>
#include <map>
#include <vector>
#include <iostream>
struct XMLTag{
std::string tag;
@ -39,6 +40,7 @@ struct XMLTag{
struct LayerTag{
XMLTag tag;
public:
std::vector<std::vector<int>> tiles;
std::string str() {
std::string displayStr=tag.tag+"\n"+tag.FormatTagData(tag.data);
@ -127,9 +129,9 @@ class TMXParser{
while (f.good()) {
std::string data;
f>>data;
if (data.empty()) continue;
if (accumulator.length()>0) {
//We're accumulating strings until we find '>'
accumulator+=" "+data;
//Check if it ends with '>'
if (data[data.length()-1]=='>') {
@ -148,9 +150,6 @@ class TMXParser{
data = data.substr(data.find(",")+1,std::string::npos);
rowData.push_back(stoi(datapiece));
}
if (data.length()) {
rowData.push_back(stoi(data));
}
parsedMapInfo.LayerData[parsedMapInfo.LayerData.size()-1].tiles.push_back(rowData);
}
}

Loading…
Cancel
Save