Arreglos tontos de codi

This commit is contained in:
2025-02-23 09:12:15 +01:00
parent a42141ebd7
commit f43d18e6f0
8 changed files with 10 additions and 37 deletions

View File

@@ -15,10 +15,7 @@
#include "on_screen_help.h" // Para OnScreenHelp
#include "options.h" // Para Options, OptionsVideo, options, Options...
#include "mouse.h"
#ifndef NO_SHADERS
#include "jail_shader.h" // para init, render
#endif
// [SINGLETON]
Screen *Screen::screen_ = nullptr;
@@ -105,11 +102,6 @@ void Screen::renderScreen()
SDL_SetRenderTarget(renderer_, nullptr);
clean();
#ifdef NO_SHADERS
// Actualiza la pantalla con el contenido del buffer de renderizado
SDL_RenderCopy(renderer_, game_canvas_, nullptr, nullptr);
SDL_RenderPresent(renderer_);
#else
if (options.video.shaders)
{
// Aplica shaders y renderiza el contenido
@@ -121,7 +113,6 @@ void Screen::renderScreen()
SDL_RenderCopy(renderer_, game_canvas_, nullptr, nullptr);
SDL_RenderPresent(renderer_);
}
#endif
}
// Establece el modo de video
@@ -174,13 +165,11 @@ void Screen::setVideoMode(ScreenVideoMode videoMode)
// Reinicia los shaders
if (options.video.shaders)
{
#ifndef NO_SHADERS
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_, game_canvas_, source.c_str());
#endif
}
}