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
- 2/ Locate a viewport
Note that blending option is enabled only for 32bpp blitter!
- 3/ Industry tooltips
- 4/ Plans
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.
- 5/ Vehicle route
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)
- 6/ Settings
Also, don't forget to increase the maximum zoom out level!
- 7/ Patch
- adapted to the "more height levels" feature (+ full heightlevel colour dithering)
- replaced dark/light heightlevels by darken/lighten lookup tables
r52:
- adapted to codechange r26623 (SettingsPage)
- sanity check for binary data length (server recv)
- fix a crash with tooltip buffer
r51:
- 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 route
r50:
- fix crash when oilrig is not shown on map
- fix smallmap notification to viewports
- fix horizontal alignment of route step labels
r49:
- 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 things
r47:
- 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 mode
r45:
- the vegetation map style takes into account the transparency settings of trees
- route steps are aware of font height
- fix toggle private/public plan crash
r44:
- 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 private
r43:
- 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 path
r41:
- "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 gcc
r37:
- 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 & r25020
r34:
- fix scrolling viewport blending (GetBytesPerPixel != GetScreenDepth)
r33:
- adapted to codechange r24206
r32:
- 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 focused
r30:
- fix depot stopover (was not shown)
- show a vehicle's path
r29:
- 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 tunnels
r27:
- 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 viewport
r26:
- 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 width
r24:
- ensure that sprites are not encoded for map zoomlevels
r23:
- 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 r23670
r21:
- fix freeform graphic glitch
- added 2 Advanced Settings to show/hide bridges and tunnels
r20:
- 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 32X
r18:
- 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 dirty
r15:
- 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 checking
r12:
- 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 ground
r9:
- fix vehicle trail
- slightly better performance
r8:
- 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 mode
r7:
- 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:
1/ owner+contour
2/ industry
3/ vegetation
r4:
- secondary viewport draws what it should
- ground heightmap looks like what smallmap does
- vehicles are rendered