- [NEW] Càrrega d'habitacions

- [NEW] Càrrega unificada d'imatges
This commit is contained in:
2025-10-31 13:59:45 +01:00
parent 953db90fda
commit a0fa9b70af
4 changed files with 274 additions and 13 deletions

17
source/images.cpp Normal file
View File

@@ -0,0 +1,17 @@
#include "images.h"
#include <map>
namespace images
{
std::map<std::string, draw::surface*> images;
draw::surface *getImage(std::string filename)
{
auto item = images.find(filename);
if (item != images.end()) return item->second;
draw::surface *image = draw::loadSurface(filename.c_str());
images[filename] = image;
return image;
}
}