Duplicat el fitxers de shaders per a resolucions verticals de 256 i 240

This commit is contained in:
2024-12-02 13:39:19 +01:00
parent 0cd96aced5
commit 020ee81479
5 changed files with 252 additions and 15 deletions

View File

@@ -200,7 +200,8 @@ void Screen::setVideoMode(ScreenVideoMode videoMode)
if (options.video.shaders)
{
#ifndef NO_SHADERS
std::ifstream f(Asset::get()->get("crtpi.glsl").c_str());
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());
std::string source((std::istreambuf_iterator<char>(f)), std::istreambuf_iterator<char>());
shader::init(window_, shader_canvas_, source.c_str());