I was playing on a 2048*2048 map and felt the need of the feature presented in this *very first* patch: an extension of zooming out capability of the main viewport (relying only on the smallmap was not convenient enough for me).
This patch has been initially done on top of the 1.1 branch of OpenTTD. I tried to reuse a maximum of already existing code. As I like very much how the smallmap presents things, I borrowed its "owners" (with heightmap activated) rendering method. It is obviously far from perfect but it runs quite smoothly on my computer and should help big map players.
I hope this kind of feature will find its way into trunk one day
1/ Zoom out any viewport up to 128X
To get an overview, no need to switch to the smallmap constantly: just use your mousewheel (works with main viewport and extraviewports too).
maps.png [ 92.06 KiB | Viewed 6596 times ]
NB: Bridges and tunnels support is glitchy.
When you move a viewport (not in map mode), the other viewports (in map mode) will show its location.
Note that blending option is enabled only for 32bpp blitter!
If you are tired of the "click on industry, read info then close window" routine, this is for you!
To ease cooperative games, this is a tool to draw lines on viewports.
By default, a plan is visible only by its owning company but you can advertise the plan and make it public (public appears in blue).
Double click on a plan in the list expand its lines.
The selected line or plan is drawn in red.
The Delete button affects the selected item in the list.
Understanding where a vehicle goes is very important.
On a big map, there are too many towns to get quickly the relation between name and location.
So to make things easier, the route steps are pointed out.
And if you want more, it can show the path and conditional branching.
(there is an expert setting to chose dashed or plain lines)
All options are found in "Display options" and its "Viewport Map" subpage.
Also, don't forget to increase the maximum zoom out level!
advanced-settings.png [ 8.54 KiB | Viewed 3732 times ]
- adapted to the "more height levels" feature (+ full heightlevel colour dithering)
- replaced dark/light heightlevels by darken/lighten lookup tablesr52:
- adapted to codechange r26623 (SettingsPage)
- sanity check for binary data length (server recv)
- fix a crash with tooltip bufferr51:
- add ability to draw straight plan lines (in 2 clicks)
- fix plans GUI with custom fonts
- scrolling a viewport does not give it focus
- add advanced setting to specify the dash level of a vehicle's router50:
- fix crash when oilrig is not shown on map
- fix smallmap notification to viewports
- fix horizontal alignment of route step labelsr49:
- extend focus system to prevent useless redraw and on/off/on effect (when using dropdowns) with route steps and path (and fix marking dirty when passing from a vehicle A window to a vehicle B window)r48:
- dynamically adjust the disabled state of the buttons of the plans window
- set plan initial visibility to true if the player works for the plan's owner
- cancel current drawing if the associated plan is remotely deleted
- fix public plans handling and some focus related thingsr47:
- fix the selected item handling in plan window (possible crash after a plan gets remotely deleted)r46:
- fix SetLine32() anim value (blinking owners are definitely not good)
- templatize map rendering with show_slope
- reworked slope colours in vegetation map moder45:
- the vegetation map style takes into account the transparency settings of trees
- route steps are aware of font height
- fix toggle private/public plan crashr44:
- updated filter mark dirty (no farmfield changes in map mode)
- configurable maintoolbar hotkey "plan_list" to open the plans window
- fix plans error strings
- add tooltip to plans window buttons
- change the advertise (plan) button into Make public/Make privater43:
- new route step graphics
- fix plans destructor (possible crash when returning to menu)r42:
- plans feature: draw things with the mouse to ease explanations in coop games (there are 2 levels of plan visibility : local company only or public)
- changed line style of vehicle route pathr41:
- "vegetation" mode adapts itself to baseset/NewGRF
- force realtime rendering of the map
- deduplicate code in industry tooltips
- route steps use grf resource instead of uint8 _ugly_array
- route steps support multiple stops at the same place (ex: "A -> B -> C -> B -> A" means 2 lines for B)r40:
- added a gcc friendly PREFETCH_NTA macro (only 01_iterator-prefetch-tile.patch is affected)r39:
- "Scan surroundings" now relies on an inlined iterator whom prefetches tiles (ViewportMapGetMostSignificantTileType() is 2 times faster than it was)r38:
- fix compilation with gccr37:
- fix wrong stopover in case of an explicit order "go to nearest depot"r36:
- adapted to codechanges r25262, r25263 & r25264 (linkgraph)r35:
- adapted to codechanges r25018 & r25020r34:
- fix scrolling viewport blending (GetBytesPerPixel != GetScreenDepth)r33:
- adapted to codechange r24206r32:
- add "scan surroundings" (replica of the idea behind SmallMapWindow::GetTileColours())
- better bridges & tunnels support at high zoom out levels (thanks to "scan surroundings")
- fix invalid order crash (related to stopovers and path)r31:
- vehicle refit window is now handled for stopovers and path
- transfer focus to vehicle view when closing a window like orders or timetable
- prevent news from getting focusedr30:
- fix depot stopover (was not shown)
- show a vehicle's pathr29:
- show on map the steps of a vehicle's route (only when the focused window is related to a specific vehicle)
- cleanup 2 magic constants for extraviewport tooltips (nvp->pos_x/y)r28:
- fix coordinates of scrolling viewport box on map
- fix keynames for hotkeys.cfg
- do not show hidden players' bridges and tunnels
- show where train stations are in map owner mode
- finally enable the use of owner's colour for bridges and tunnelsr27:
- add 2 global hotkeys equivalent of ctrl+mousewheel ("previous_map_mode"/PAGEUP and "next_map_mode"/PAGEDOWN) ; it affects the first window matching criteria (a viewport at map zoomlevel): first it checks the focused window then it falls back on the main viewportr26:
- show where the scrolling viewport is on maps (the right-clicked and dragged one)r25:
- all advanced settings are now in Interface->Display options->Viewport Map
- doubleclick on map: depending on adv. settings, it goes directly to zoom1X or it opens an extra viewport
- line buffer is dynamically adjusted to widthr24:
- ensure that sprites are not encoded for map zoomlevelsr23:
- fix the flickering in realtime rendering mode (related to colour_index_base)r22:
- code cleanup
- fix minor graphic bug with slopes
- fix viewport refresh when showing/hiding stuff from smallmap controls
- adapted to feature r23670r21:
- fix freeform graphic glitch
- added 2 Advanced Settings to show/hide bridges and tunnelsr20:
- slopes influence players' colour in owner mode
- bridges and tunnels are rendered (known bug: at least one end of the bridge/tunnel must be in the redrawn block)r19:
- town names are shown up to 32Xr18:
- split patch in 3 parts
- in map mode, town names are shown in a tooltip
- fix extraviewport tooltips (feature r23316 related)r17:
- adapted to feature r23316 ("Add ability to zoom in to 2x and 4x level")r16:
- adapted to codechange r23091
- reworked and simplified filter for marking tile dirtyr15:
- interactions with smallmap's legend immediately affect viewports
- the "Industry chain -> Link to smallmap" button refresh all viewports in industry mode too
- industry tooltip is now enabled for all zoom levels (I just can't play without it anymore
- fix text of Advanced Option "default_viewport_map_mode"r14:
- fix tooltip (yes, again: r12 fix broke partially the "Length: x" tooltip)r13:
- crashfix: I forgot some basic range checkingr12:
- crashfix: a tooltip keeps StringID but not the associated params (meaning with r11: one overlap, one redraw... one crash :S)r11:
- added a tooltip to industry mode (production info)r10:
- patch now following trunk (r22277)
- better sync between vehicles and groundr9:
- fix vehicle trail
- slightly better performancer8:
- enhanced rendering (with slopes)
- better handling of owned roads color
- partially fix vehicle trail (problem occuring in realtime mode only)
- realtime option moved from "Interaction" to "Display options"
- Advanced Option to enable/disable slopes
- Advanced Option to select default map moder7:
- replace the full refresh every n ticks by realtime
- filtering applied on the dirty tile setting system (reduce cpu usage)
- bugfix with 32bpp-anim (forgotten ::SetLine() in v6)
- option added in Advanced Settings -> Interaction -> Render viewport map in realtime (if not: 1:n ticks)r6:
- code clean-up
- really fix the graphic glitch (colidx init related)r5:
- minor graphic glitch corrected (vertical lines with wrong color)
- introduce "ctrl + mousewheel" to cycle through 3 map types:
- secondary viewport draws what it should
- ground heightmap looks like what smallmap does
- vehicles are rendered