1
Graphics / Re: Unknown problem with drawing.
« on: November 26, 2013, 12:38:56 am »Third, what global variables?
Line 7 in SFMLApp.cpp:TextureManager* SFMLApp::textureManager = new TextureManager();As for the "unnecessary" include files... what's unnecessary about them? I can't very well use an SFML class without including the appropriate header...
Just include what you need. If you need the RenderWindow, you include <SFML/Graphics/RenderWindow.hpp>. If you need a Sprite, you include <SFML/Graphics/Sprite.hpp> and so on.
It makes the include part look longer and it takes time getting used to, but it speeds up the building process.and yes, the Init() method, rather than a constructor was necessary... how else do you expect me to return a boolean value to tell the Execute() method whether or not the window was properly initialized?
Exceptions
But back to the topic:
Try to print out the scale, position and size of the tile your mouse is hovering over or even put the whole tilemap into a text file. Then investigate which variable is wrong. I could even imagine that there are tiles with no texture over the actual tiles.
P.S.: Nexus is right, your map generation algorithm is short, but complex and error-prone. Look here or here for some ideas.
That's not a global variable... that's a static member of the SFMLApp class.
As for the includes, I'll do that. I didn't realize you could include sub-classes from those packages.