7
7
//
8
8
9
9
#include " ResourceSystem.h"
10
+
10
11
#include < vector>
11
12
12
13
namespace Siege
@@ -18,15 +19,15 @@ static std::map<String, Texture> textures = std::map<String, Texture>();
18
19
void ResourceSystem::RegisterModel (const String& path)
19
20
{
20
21
String fullPath = baseDir + path;
21
- // if (models.find(fullPath) != models.end()) return;
22
- // models[fullPath] = LoadModel(fullPath);
22
+ // if (models.find(fullPath) != models.end()) return;
23
+ // models[fullPath] = LoadModel(fullPath);
23
24
}
24
25
25
26
void ResourceSystem::RegisterTexture (const String& path)
26
27
{
27
28
String fullPath = baseDir + path;
28
- // if (textures.find(fullPath) != textures.end()) return;
29
- // textures[fullPath] = LoadTexture(fullPath);
29
+ // if (textures.find(fullPath) != textures.end()) return;
30
+ // textures[fullPath] = LoadTexture(fullPath);
30
31
}
31
32
32
33
void * ResourceSystem::GetModel (const String& path)
@@ -48,23 +49,23 @@ void ResourceSystem::FreeResources()
48
49
// Iterate over vectors backwards to avoid memory issues
49
50
for (auto i = freedModels.rbegin (); i != freedModels.rend (); i++)
50
51
{
51
- // UnloadModel(**i);
52
+ // UnloadModel(**i);
52
53
}
53
54
freedModels.clear ();
54
55
models.clear ();
55
56
56
57
for (auto i = freedTextures.rbegin (); i != freedTextures.rend (); i++)
57
58
{
58
- // UnloadTexture(**i);
59
+ // UnloadTexture(**i);
59
60
}
60
61
freedTextures.clear ();
61
62
textures.clear ();
62
63
}
63
64
64
65
void ResourceSystem::ClearResources ()
65
66
{
66
- // for (auto& model : models) freedModels.push_back(&model.second);
67
- // for (auto& texture : textures) freedTextures.push_back(&texture.second);
67
+ // for (auto& model : models) freedModels.push_back(&model.second);
68
+ // for (auto& texture : textures) freedTextures.push_back(&texture.second);
68
69
}
69
70
70
71
void ResourceSystem::SetBaseDirectory (const String& dir)
0 commit comments