A TMX Parser in C++.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
TMXParser/main.cpp

29 lines
683 B

#define OLC_PGE_APPLICATION
#include "pixelGameEngine.h"
#include <strstream>
#include "TMXParser.h"
2 years ago
using namespace olc;
2 years ago
int main(){
TMXParser parser("00_test_room.tmx");
Map mData = parser.GetData();
XMLTag mapTag = mData.MapData;
double version = mapTag.GetDouble("version");
int width = mapTag.GetInteger("width");
int height = mapTag.GetInteger("height");
bool isInfinite = mapTag.GetBool("infinite");
std::cout<<version<<": "<<width<<","<<height<<","<<isInfinite;
LayerTag layerTag = mData.LayerData[0];
XMLTag layer0Tag = layerTag.tag;
int layerID=layer0Tag.GetInteger("id");
std::cout<<"\n"<<layerID;
std::cout<<"\n"<<layerTag.tiles[8][6];
2 years ago
return -1;
}