Moved working systems into InGame
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user