screen: opcio d'establir el nivell de zoom directament

console: opcio d'establir el zoom directament
This commit is contained in:
2026-03-30 23:42:30 +02:00
parent 705a9fc7cd
commit 16924cf503
3 changed files with 32 additions and 4 deletions

View File

@@ -194,6 +194,21 @@ auto Screen::incWindowZoom() -> bool {
return false;
}
// Establece el zoom directamente; false si fuera del rango [1, max_zoom] o en pantalla completa
auto Screen::setWindowZoom(int zoom) -> bool {
if (Options::video.fullscreen) { return false; }
if (zoom < 1 || zoom > Options::window.max_zoom) { return false; }
if (zoom == Options::window.zoom) { return false; }
Options::window.zoom = zoom;
setVideoMode(Options::video.fullscreen);
return true;
}
// Devuelve el zoom máximo permitido según la pantalla actual
auto Screen::getMaxZoom() const -> int {
return Options::window.max_zoom;
}
// Cambia el color del borde
void Screen::setBorderColor(Uint8 color) {
border_color_ = color;