-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTextureManager.cpp
More file actions
34 lines (25 loc) · 851 Bytes
/
TextureManager.cpp
File metadata and controls
34 lines (25 loc) · 851 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
//
// Created by mahit on 4/12/2025.
//
#include "TextureManager.h"
void textureManager::loadTexture(const string& file) {
string pathWay = "../files/images/" + file+ ".png";
sf::Texture tex;
if (tex.loadFromFile(pathWay)) {
textures[file] = tex;
} else {
cout<<"HUH "<<pathWay<<endl;
}
}
void textureManager::loadAllTextures() {
vector<string> textureNames = {
"tile_hidden", "flag", "mine",
"debug", "number_1", "number_2", "number_3", "number_4",
"number_5", "number_6", "number_7", "number_8", "number_8", "digits", "face_happy",
"face_lose", "face_win", "leaderboard", "pause", "play", "tile_revealed"
};
// Loop through and load each texture.
for (const auto& name : textureNames) {
loadTexture(name);
}
}