Skip to content

Commit

Permalink
as a test, use xBRZ when zooming images
Browse files Browse the repository at this point in the history
This also sets the max zoom to 288 so you can reach 3x and 4x if
desired.
  • Loading branch information
cbeck88 committed Oct 24, 2014
1 parent 760cb18 commit 3f18331
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/display.cpp
Expand Up @@ -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;
Expand Down Expand Up @@ -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) {
Expand Down
4 changes: 3 additions & 1 deletion src/image.cpp
Expand Up @@ -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);
}
Expand Down

0 comments on commit 3f18331

Please sign in to comment.