I am having trouble accessing my TileLayer properly. I.e. I want to do something like this:
TileLayerNode* spawnLayerNode = (TileLayerNode*)mapNode->getLayerNode("Spawnpoint");
TileLayer* spawnLayer = (TileLayer*) tileLayerNode->getTileLayer();
However, the (TileLayer*) is an invalid cast. There is a function castTileLayerPtr which should handle the casting, but it returns a static pointer which leaves me nowhere closer.
I've also tried using the address & function, yet again I end up with some invalid conversion.
So: What is the best pattern to use for the shared pointer version of the tileLayers? What is the proper way to go from shared pointers to normal pointers, as required by most other TK functions.
I'll try to read up on shared pointers in c++ and see if this is some general c++ way of doing things that I am simply unaware of (I've mostly done C89 stuff).