as a test, use xBRZ when zooming images

This also sets the max zoom to 288 so you can reach 3x and 4x if
desired.
This commit is contained in:
Chris Beck 2014-10-21 18:17:25 -04:00
parent 760cb18b3e
commit 3f18331a08
2 changed files with 5 additions and 2 deletions

View file

@ -72,7 +72,7 @@ namespace {
const int SmallZoom = DefaultZoom / 2;
const int MinZoom = 4;
const int MaxZoom = 200;
const int MaxZoom = 288;
size_t sunset_delay = 0;
bool benchmark = false;
@ -2282,6 +2282,7 @@ bool display::set_zoom(int amount, bool absolute)
if (new_zoom > MaxZoom) {
new_zoom = MaxZoom;
}
LOG_DP << "new_zoom = " << new_zoom << std::endl;
if (new_zoom != zoom_) {
gui::slider* zoom_slider = find_slider("map-zoom-slider");
if (zoom_slider) {

View file

@ -772,7 +772,9 @@ static surface get_scaled_to_zoom(const locator& i_locator)
surface res(get_image(i_locator, UNSCALED));
// For some reason haloes seems to have invalid images, protect against crashing
if(!res.null()) {
return scale_surface(res, ((res.get()->w * zoom) / tile_size), ((res.get()->h * zoom) / tile_size));
surface xbrz(scale_surface_xbrz(res, std::max(std::min(zoom/tile_size,5),1)));
return scale_surface(xbrz, ((res.get()->w * zoom) / tile_size), ((res.get()->h * zoom) / tile_size));
//return scale_surface(res, ((res.get()->w * zoom) / tile_size), ((res.get()->h * zoom) / tile_size));
} else {
return surface(NULL);
}