fix: tidy namespace Scenes::/Info:: PascalCase i locals UPPER_CASE
This commit is contained in:
@@ -231,28 +231,28 @@ void Screen::present(Uint32* pixel_data) {
|
||||
// no trencar la selecció de l'usuari.
|
||||
Rendering::PostFXParams clean{};
|
||||
shader_backend_->setPostFXParams(clean);
|
||||
const auto prev_shader = shader_backend_->getActiveShader();
|
||||
if (prev_shader != Rendering::ShaderType::POSTFX) {
|
||||
const auto PREV_SHADER = shader_backend_->getActiveShader();
|
||||
if (PREV_SHADER != Rendering::ShaderType::POSTFX) {
|
||||
shader_backend_->setActiveShader(Rendering::ShaderType::POSTFX);
|
||||
}
|
||||
shader_backend_->uploadPixels(pixel_data, GAME_WIDTH, GAME_HEIGHT);
|
||||
shader_backend_->render();
|
||||
if (prev_shader != Rendering::ShaderType::POSTFX) {
|
||||
shader_backend_->setActiveShader(prev_shader);
|
||||
if (PREV_SHADER != Rendering::ShaderType::POSTFX) {
|
||||
shader_backend_->setActiveShader(PREV_SHADER);
|
||||
}
|
||||
} else {
|
||||
// Fallback SDL_Renderer. A mult=1, flux directe original: logical
|
||||
// Fallback SDL_Renderer. A MULT=1, flux directe original: logical
|
||||
// presentation (setada per applyFallbackPresentation) + scale mode de
|
||||
// texture_ segons l'opció. A mult>1, la còpia intermèdia crea la
|
||||
// texture_ segons l'opció. A MULT>1, la còpia intermèdia crea la
|
||||
// font ampliada (NN via GPU), i es presenta via logical presentation
|
||||
// a la mida de la font intermèdia.
|
||||
SDL_UpdateTexture(texture_, nullptr, pixel_data, GAME_WIDTH * sizeof(Uint32));
|
||||
|
||||
const int mult = Options::video.internal_resolution;
|
||||
if (mult > 1) {
|
||||
const int MULT = Options::video.internal_resolution;
|
||||
if (MULT > 1) {
|
||||
ensureFallbackInternalTexture();
|
||||
if (internal_texture_sdl_ != nullptr) {
|
||||
// Còpia NN a la textura intermèdia (mult·game). Sampler NN
|
||||
// Còpia NN a la textura intermèdia (MULT·game). Sampler NN
|
||||
// per construcció: volem píxels grans i nets.
|
||||
SDL_SetTextureScaleMode(texture_, SDL_SCALEMODE_NEAREST);
|
||||
SDL_SetRenderTarget(renderer_, internal_texture_sdl_);
|
||||
@@ -261,7 +261,7 @@ void Screen::present(Uint32* pixel_data) {
|
||||
SDL_SetRenderTarget(renderer_, nullptr);
|
||||
|
||||
// Filtre global al pas final → finestra (via logical presentation
|
||||
// que applyFallbackPresentation ja configura amb mida game·mult).
|
||||
// que applyFallbackPresentation ja configura amb mida game·MULT).
|
||||
SDL_ScaleMode final_scale = (Options::video.texture_filter == Options::TextureFilter::LINEAR)
|
||||
? SDL_SCALEMODE_LINEAR
|
||||
: SDL_SCALEMODE_NEAREST;
|
||||
@@ -273,9 +273,9 @@ void Screen::present(Uint32* pixel_data) {
|
||||
}
|
||||
// Si la creació de la textura intermèdia ha fallat, caiem al path normal.
|
||||
}
|
||||
// mult=1 (o fallback-del-fallback): texture_ directament. El scale mode
|
||||
// MULT=1 (o fallback-del-fallback): texture_ directament. El scale mode
|
||||
// el manté applyFallbackPresentation — però el re-apliquem per si la
|
||||
// ruta mult>1 el va sobreescriure anteriorment.
|
||||
// ruta MULT>1 el va sobreescriure anteriorment.
|
||||
SDL_ScaleMode direct_scale = (Options::video.texture_filter == Options::TextureFilter::LINEAR)
|
||||
? SDL_SCALEMODE_LINEAR
|
||||
: SDL_SCALEMODE_NEAREST;
|
||||
@@ -632,16 +632,16 @@ void Screen::applyFallbackPresentation() {
|
||||
}
|
||||
// Amb resolució interna N > 1, la mida lògica creix proporcionalment
|
||||
// perquè SDL scale des de 320·N × 200·N a la finestra — menys aggressive linear.
|
||||
const int mult = Options::video.internal_resolution < 1 ? 1 : Options::video.internal_resolution;
|
||||
SDL_SetRenderLogicalPresentation(renderer_, GAME_WIDTH * mult, GAME_HEIGHT * mult, mode);
|
||||
const int MULT = Options::video.internal_resolution < 1 ? 1 : Options::video.internal_resolution;
|
||||
SDL_SetRenderLogicalPresentation(renderer_, GAME_WIDTH * MULT, GAME_HEIGHT * MULT, mode);
|
||||
}
|
||||
|
||||
void Screen::ensureFallbackInternalTexture() {
|
||||
if (renderer_ == nullptr) {
|
||||
return;
|
||||
}
|
||||
const int mult = Options::video.internal_resolution;
|
||||
if (mult <= 1) {
|
||||
const int MULT = Options::video.internal_resolution;
|
||||
if (MULT <= 1) {
|
||||
// No cal textura intermèdia — recicla si la teníem.
|
||||
if (internal_texture_sdl_ != nullptr) {
|
||||
SDL_DestroyTexture(internal_texture_sdl_);
|
||||
@@ -650,7 +650,7 @@ void Screen::ensureFallbackInternalTexture() {
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (internal_texture_sdl_ != nullptr && internal_texture_mult_ == mult) {
|
||||
if (internal_texture_sdl_ != nullptr && internal_texture_mult_ == MULT) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -661,15 +661,15 @@ void Screen::ensureFallbackInternalTexture() {
|
||||
internal_texture_sdl_ = SDL_CreateTexture(renderer_,
|
||||
SDL_PIXELFORMAT_ABGR8888,
|
||||
SDL_TEXTUREACCESS_TARGET,
|
||||
GAME_WIDTH * mult,
|
||||
GAME_HEIGHT * mult);
|
||||
GAME_WIDTH * MULT,
|
||||
GAME_HEIGHT * MULT);
|
||||
if (internal_texture_sdl_ == nullptr) {
|
||||
std::cerr << "Screen: failed to create fallback internal texture (×" << mult << "): "
|
||||
std::cerr << "Screen: failed to create fallback internal texture (×" << MULT << "): "
|
||||
<< SDL_GetError() << '\n';
|
||||
internal_texture_mult_ = 0;
|
||||
return;
|
||||
}
|
||||
internal_texture_mult_ = mult;
|
||||
internal_texture_mult_ = MULT;
|
||||
}
|
||||
|
||||
void Screen::adjustWindowSize() {
|
||||
|
||||
Reference in New Issue
Block a user