Hi Nexus,
I appreciate the feedback, but I don't agree with everything you said. I am certainly looking for things I could do better with SFML or other SDK API's, but I think you're nit-picking with some of the details you offered.
Good idea!
But your codes are full of memory leaks. If you use new, you must also use delete. However, the better option is to avoid manual memory management at all, i.e. use automatic objects or smart pointers instead of raw pointers (why not std::map<std::string, sf::Image> instead of std::map<std::string, sf::Image*>?)
I decided to see if you were right that it was "full of memory leaks". Leak meaning, memory will continually be allocated and not freed, thus the leak will eventually cause out of memory.
Here is a list of all the "new" in the code:
GameSound.cpp 62 38: SoundMap
[SoundStr] = new sf::SoundBuffer();
GameSound.cpp 130 18: pSoundInst = new sf::Sound();
SmashPC.cpp 36 13: gpMap = new SmashPcMap("", gu32ScreenX, gu32ScreenY, &App);
SmashPC.cpp 39 19: gpOurPlayer = new SmashPcPlayer(&App, gpMap->GetSpace(), cpv(200, 200));
SmashPcPlayer.cpp 40 16: mpSprite = new sf::Sprite();
Utiliies.cpp 116 31: gImageMap[FileName] = new sf::Image();[/list]
The sound buffer is being allocated once per loading of a sound file. So, that's not a leak.
The Sound Instance is loaded once per use, and deleted when it's finished playing (or stopped). not a leak.
The Map and Player are allocated once, and that's it. Not a Leak.
Sprites are allocated once per SmashPcPlayer instance, which there's one, and deleted when the instance is deconstructed. Not a leak.
And images are allocated once per image file. Not a leak.
Now, it's true I don't delete all the objects when the game is closed, and that's bad, I know. I'll be sure to add that (it's a peeve of mine too). But, it's not a leak, since the OS will clear all the memory allocated in the program.
And I personally would use fewer global variables, they bring a lot of problems even if seeming comfortable in the first term. And last, you should declare variables like sf::Event as local as possible, and use const instead of #define for constants
I may not need them to be global and might make them local.
You're welcome to use const's for numeric constants, I'll continue to use defines. To each their own.
And, again, I think you are kind of nit-picking with the Event declaration.
With all that said, I'll still encourage criticism of the code. No-one is ever good enough they shouldn't listen to what others have to offer.
Thanks!