Original Post
hey everyone, it's my first post here on gamedev. Anyways, I am working on a 2D tile-based RPG in OpenGL and I've run into a small problem. I was planning on having my tile structs point to a Sprite class that draws most of my game's 2d sprites. I think this will work except when I save the map to a file the pointer will become invalid. I don't have my code at the moment but here's a small example. struct CTile { CSprite* tile bool walkable } CTile map[5][5] //map array //load map from file... map[0][0].tile->Draw(0, 0); //draw a tile How would I retrieve a valid pointer when I load the map tiles from file?