Make use of the new resource manager's purgeable flag

This commit is contained in:
2020-01-26 16:14:39 -05:00
parent a2e73a0223
commit d530abe00b
6 changed files with 17 additions and 14 deletions

View File

@@ -634,6 +634,7 @@ void cPict::recalcRect() {
std::shared_ptr<const sf::Texture> cPict::getSheet(eSheetType type, size_t n) {
std::ostringstream sout;
bool purgeable = false;
switch(type) {
case NUM_SHEET_TYPES:
break;
@@ -692,6 +693,7 @@ std::shared_ptr<const sf::Texture> cPict::getSheet(eSheetType type, size_t n) {
// TODO: Implement this
break;
case SHEET_FULL:
purgeable = true;
switch(n) {
case 1100:
sout << "invenhelp";
@@ -713,10 +715,11 @@ std::shared_ptr<const sf::Texture> cPict::getSheet(eSheetType type, size_t n) {
break;
default:
// TODO: The scenario should be allowed to define a sheet1100.png without it being ignored in favour of invenhelp.png
purgeable = false;
sout << "sheet" << n;
}
}
return &ResMgr::graphics.get(sout.str());
return &ResMgr::graphics.get(sout.str(), purgeable);
}
void cPict::draw(){