Garbage when drawing level map

andylatham82:
The result is something very close to how the level should look, but is mangling the graphics. I'm not 100% sure if I'm using the pointers right, I haven't used them much before. I've attached an image of the screen.

The pointer dereference is IMO incorrect... I'm a little confused as to why it would compile...
The original LevelMap.cpp was OK, no need to worry about pointers there; floorTile and nullTile will automatically collapse to a pointer when required.

Try this:

    const unsigned char *pTileTexture;

    Tile(const unsigned char *pTexture) :  pTileTexture(pTexture) {
    }
    
    void Draw(int posX, int posY) {
      sprite.Draw(posX, posY, pTileTexture);
    }