Moved working systems into InGame

This commit is contained in:
Kayne Ruse
2013-04-29 17:25:56 +10:00
parent c9447fcf3b
commit ecdf658463
15 changed files with 186 additions and 151 deletions
+8 -4
View File
@@ -7,10 +7,7 @@ SurfaceManager::SurfaceManager() {
}
SurfaceManager::~SurfaceManager() {
for (auto it : surfaceMap) {
SDL_FreeSurface(it.second);
}
surfaceMap.clear();
FreeAll();
}
SDL_Surface* SurfaceManager::Load(std::string key, std::string fname) {
@@ -53,6 +50,13 @@ void SurfaceManager::Free(std::string key) {
}
}
void SurfaceManager::FreeAll() {
for (auto it : surfaceMap) {
SDL_FreeSurface(it.second);
}
surfaceMap.clear();
}
SDL_Surface* SurfaceManager::LoadSurface(std::string key, std::string fname) {
SDL_Surface* ptr = SDL_LoadBMP(fname.c_str());
if (ptr == nullptr) {