-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAssetManager.cpp
More file actions
35 lines (26 loc) · 874 Bytes
/
Copy pathAssetManager.cpp
File metadata and controls
35 lines (26 loc) · 874 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#include "AssetManager.hpp"
void AssetManager::LoadTexture(std::string name, std::string fileName) {
sf::Texture tex;
if( tex.loadFromFile(fileName) ) {
tex.setSmooth(true);
this->_textures[name] = tex;
}
}
/*void AssetManager::LoadTexture(std::string name, std::string fileName, int xStart, int yStart, int width, int height) {
sf::Texture tex;
if( tex.loadFromFile(fileName, sf::IntRect(xStart, yStart, width, height)) ) {
this->_textures[name] = tex;
}
}*/
sf::Texture& AssetManager::GetTexture(std::string name) {
return this->_textures.at(name);
}
void AssetManager::LoadFont(std::string name, std::string fileName) {
sf::Font font;
if( font.loadFromFile(fileName) ) {
this->_fonts[name] = font;
}
}
sf::Font& AssetManager::GetFont(std::string name) {
return this->_fonts.at(name);
}