Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zoomable smallmap #1222

Closed
DorpsGek opened this issue Sep 12, 2007 · 7 comments
Closed

Zoomable smallmap #1222

DorpsGek opened this issue Sep 12, 2007 · 7 comments
Labels
component: interface This is an interface issue flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) patch from FlySpray This issue is in fact a Patch, but imported from FlySrpay

Comments

@DorpsGek
Copy link
Member

Romanski opened the ticket and wrote:

This patch adds zoom feature for the small map. Original thread here: http://www.tt-forums.net/viewtopic.php?f=33&t=33971

Features:
* zoom buttons
* zoom in/out at cursor
* don't display all city names at large zoom-outs
* industries mode: hide cities and roads when zoomed out
* industries mode: draw 2x2 industries at large zoom out to ensure visibility
* dither modes as compile-time option (see screenshot in forum)
* documented new algorithm

The algorithm used to draw the smallmap is very different from the original, so it's not a minor change. The original algorithm drew 4px wide zig-zagging columns of tiles; the new algorithm scans horizontally from left to right, 4px at a time at zoom=1, or 1px at a time at higher zooms.

Attachments

Reported version: 0.5.2
Operating system: All


This issue was imported from FlySpray: https://bugs.openttd.org/task/1222
@DorpsGek
Copy link
Member Author

Rubidium wrote:

The new algorithm is a little glitchy in (at least) the two "biggest" zoom out levels. When you have a 2048x2048 map with lots of towns and even more industries and you zoom out completely, select the industries "view" (the lots of colors view), and you scroll through the minimap a single line (depending on the direction of scroll) is glitchy.


This comment was imported from FlySpray: https://bugs.openttd.org/task/1222#comment2205

@DorpsGek
Copy link
Member Author

Romanski wrote:

I assume that by "glitchy" you mean that the towns jump a single pixel up or down. The attached diff fixes this issue.

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/1222#comment2532

@DorpsGek
Copy link
Member Author

Romanski wrote:

Task 1222 (http://bugs.openttd.org/task/1222) implements zoomable smallmap in a different way:

Better in 54:
+ smooth zooming (some people dislike it but I think it's nice)
+ zoom to arbitrary zoom levels
+ zoom in more than the original, un-zoomable map.
+ smaller change vs. the original code, so easier to verify

Better in 1222:
+ 4x higher resolution when zoomed out (the task 54 patch uses the original smallmap algorithm, which is restricted to drawing the map out of 4x1 pixel blocks)
+ draw towns and industries as dots when zoomed out, to avoid them disappearing altogether
+ zoom in/out at cursor, just like the main map
+ scrolling the wheel quickly will zoom several levels in/out quickly
+ pretty dithering
+ works when paused

Please consider both fairly! :) (disclaimer: obviously I'm the author of 1222; I'm trying to be as objective as I can here; if there is an advantage of task 54 patch which I didn't mention it was not on purpose!)

Smooth scrolling could be implemented on top of this patch if desired, too. I didn't do that in the first revision though because this is quite a big change already.


This comment was imported from FlySpray: https://bugs.openttd.org/task/1222#comment2551

@DorpsGek
Copy link
Member Author

DorpsGek commented Nov 3, 2007

TrueBrain wrote:

Without really reading the patch, I have a question for you: is it possible to split up the patch is smaller pieces, as it is really big, and undoable to read all.


This comment was imported from FlySpray: https://bugs.openttd.org/task/1222#comment2587

@DorpsGek
Copy link
Member Author

DorpsGek commented Nov 4, 2007

Romanski wrote:

@truelight: I could reduce it to about 90% of its current size by reverting some tidy-ups. The rest is one big change, unfortunately. The diff is unreadable because it is too fine-grained: really it should show a bunch of functions being deleted and replaced with a bunch of other functions.

I don't suppose reducing it to 90% will help you much?


This comment was imported from FlySpray: https://bugs.openttd.org/task/1222#comment2611

@DorpsGek
Copy link
Member Author

DorpsGek commented Feb 6, 2010

Alberth wrote:

Although your patch didn't make it to trunk, it was a source of inspiration. Thank you.


This comment was imported from FlySpray: https://bugs.openttd.org/task/1222#comment7537

@DorpsGek
Copy link
Member Author

DorpsGek commented Feb 6, 2010

Alberth closed the ticket.

Reason for closing: Implemented

in r19039-r19042


This comment was imported from FlySpray: https://bugs.openttd.org/task/1222

@DorpsGek DorpsGek closed this as completed Feb 6, 2010
@DorpsGek DorpsGek added component: interface This is an interface issue flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) patch from FlySpray This issue is in fact a Patch, but imported from FlySrpay labels Apr 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: interface This is an interface issue flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) patch from FlySpray This issue is in fact a Patch, but imported from FlySrpay
Projects
None yet
Development

No branches or pull requests

1 participant