integrat Asset amb ResourceHelper

This commit is contained in:
2025-08-19 10:06:52 +02:00
parent ed077c1da5
commit 4b6b89ceb2
3 changed files with 28 additions and 5 deletions

View File

@@ -224,8 +224,10 @@ void Screen::renderInfo() {
void Screen::loadShaders() {
if (shader_source_.empty()) {
const std::string GLSL_FILE = param.game.game_area.rect.h == 256 ? "crtpi_256.glsl" : "crtpi_240.glsl";
std::ifstream f(Asset::get()->get(GLSL_FILE).c_str());
shader_source_ = std::string((std::istreambuf_iterator<char>(f)), std::istreambuf_iterator<char>());
auto data = Asset::get()->loadData(GLSL_FILE);
if (!data.empty()) {
shader_source_ = std::string(data.begin(), data.end());
}
}
}