Commit Graph

352 Commits

Author SHA1 Message Date
Gabda b870596f15 Add #6887: Option to show zone inside local authority boundary of towns
Can be found at town information > local authority window
Layout for button is same as Graph Keys
Turn on/off for every town individually
2019-08-17 21:45:20 +01:00
PeterN 2d0352d67f
Fix e8d397e4ee: Avoid using RemapCoords2 during savegame conversion. (#7588) 2019-05-13 12:27:35 +01:00
Niels Martin Hansen c9fe6e7b8f Fix #7371: Avoid dependency on foundations of town tile during saveload 2019-05-11 14:58:00 +02:00
Charles Pigott 96a4787710 Codechange: Set ZoomLevel's base type to byte instead of using ZoomLevelByte 2019-04-29 17:40:22 +01:00
peter1138 81d335b081 Feature: Add station coverage area display for towns. 2019-04-25 09:14:01 +02:00
peter1138 81f0f97406 Feature: Add existing station coverage area display when placing new station parts. 2019-04-25 09:14:01 +02:00
peter1138 b6733edd17 Feature: Add coverage area display for existing stations. 2019-04-25 09:14:01 +02:00
PeterN c17736b493
Fix e8d397e: Invisible station/waypoint signs could still be clicked on. (#7531) 2019-04-20 17:49:54 +01:00
Henry Wilson 7c8e7c6b6e Codechange: Use null pointer literal instead of the NULL macro 2019-04-10 23:22:20 +02:00
glx22 66dd7c3879
Fix: MSVC warnings (#7423) 2019-03-28 00:09:33 +01:00
Henry Wilson c01a2e2a81 Codechange: Removed SmallVector completely 2019-03-26 20:15:57 +00:00
Henry Wilson ab711e6942 Codechange: Replaced SmallVector::[Begin|End]() with std alternatives 2019-03-26 20:15:57 +00:00
Henry Wilson a0f36a50e6 Codechange: Replaced SmallVector::Append() with std::vector::[push|emplace]_back() 2019-03-26 20:15:57 +00:00
Henry Wilson 097328c3d7 Codechange: Replaced SmallVector::Get() const with std alternatives 2019-03-26 20:15:57 +00:00
Henry Wilson a690936ed7 Codechange: Replace SmallVector::Length() with std::vector::size() 2019-03-26 20:15:57 +00:00
Henry Wilson bfd79e59dc Codechange: Replace SmallVector::Clear() with std::vector::clear() 2019-03-26 20:15:57 +00:00
peter1138 1585c12bb9 Fix 4da83d2f66: Remove measurement tooltips when completed. 2019-03-21 19:14:41 +00:00
peter1138 4da83d2f66 Fix #7386: Measurement tooltip for tunnels, aqueducts & docks did not display or flickered.
Measurement tooltip was auto-closed as the hover/right-click test for tooltips was not
satisfied in this case. This is fixed by keeping the tooltip visible and instead explicitly
closing the tooltip when the PlaceObject is cancelled/completed.
2019-03-20 23:00:32 +00:00
Patric Stout e3c639a09f Remove: ENABLE_NETWORK switch
This switch has been a pain for years. Often disabling broke
compilation, as no developer compiles OpenTTD without, neither do
any of our official binaries.

Additionaly, it has grown so hugely in our codebase, that it
clearly shows that the current solution was a poor one. 350+
instances of "#ifdef ENABLE_NETWORK" were in the code, of which
only ~30 in the networking code itself. The rest were all around
the code to do the right thing, from GUI to NewGRF.

A more proper solution would be to stub all the functions, and
make sure the rest of the code can simply assume network is
available. This was also partially done, and most variables were
correct if networking was disabled. Despite that, often the #ifdefs
were still used.

With the recent removal of DOS, there is also no platform anymore
which we support where networking isn't working out-of-the-box.

All in all, it is time to remove the ENABLE_NETWORK switch. No
replacement is planned, but if you feel we really need this option,
we welcome any Pull Request which implements this in a way that
doesn't crawl through the code like this diff shows we used to.
2019-03-20 19:24:55 +01:00
Niels Martin Hansen e8d397e4ee Codechange: Make a merged k-d tree index of all viewport signs 2019-03-09 20:27:11 +01:00
PeterN 87ebfe1227
Fix #7004: Mark linkgraph dirty to be rebuilt on next draw call. (#7265)
Previously the linkgraph was rebuilt before the viewport extents were finalized.
2019-02-23 19:19:41 +00:00
Peter Nelson 0749a291c4 Revert 479f13fc41, Fix #7133, Fix #7136: "Codechange: Tweak ViewportAddLandscape so it no more relies on "go down as fast as possible" tile height model (Patch by adf88, #6583)"
This reverts commit 479f13fc41.
2019-02-03 19:39:20 +00:00
Johannes E. Krause 479f13fc41 Codechange: Tweak ViewportAddLandscape so it no more relies on "go down as fast as possible" tile height model (Patch by adf88, #6583) 2019-01-24 21:17:17 +01:00
Johannes E. Krause 05da5a177c Codechange: Simplify marking tiles dirty when terraforming (Patch by adf88, #6583) 2019-01-24 21:17:17 +01:00
Johannes E. Krause f744dea0ff Fix: jumping effect when scrolling viewport over bottom edge of the map (Patch by adf88, #6583) 2019-01-24 21:17:17 +01:00
Johannes E. Krause f0290d5de7 Codechange: Add InverseRemapCoords2 function for remapping viewport coordinates to underlying tile coordinates (Patch by adf88, #6583) 2019-01-24 21:17:17 +01:00
btzy 9d75600ac0 Fix: Round up deltas for smooth scrolling, so target will be reached 2019-01-20 19:43:56 +00:00
nikolas d8ccad91f9 Fix: Some code and comment typos
Found with codespell
2019-01-17 22:01:07 +00:00
frosch 1a1204472e Revert: Sprite sorting optimisation sorted incorrectly.
This reverts commit 25ab9c1997.
2018-11-18 17:30:28 +01:00
Charles Pigott 52ed3bcbaa Remove: A few bits of dead code 2018-10-31 12:41:49 +01:00
Jindrich Makovicka 25ab9c1997 Codechange: Improve (un)zoom performance
When zooming out with a high res display, there can be about 150k sprites
to be sorted before displaying. With the O(n^2) complexity of the sprite
sorter, this can take several seconds.

This patch works around this by sorting the sprites by the xmin coordinate
first using QSort, which later allows an early bailout out of the inner
loop. This is enough to cut down the full unzoom time on a 4k display to a
fraction of second.
2018-10-26 20:22:38 +02:00
Niels Martin Hansen 2a868b9f3b Feature: Framerate display window (#6822)
Frame rate and various game loop/graphics timing measurements and graphs. Accessible via the Help menu, and can print some stats in the console via the fps command.
2018-07-19 21:17:07 +02:00
J0an Josep cfb8092397 Fix b4b98e5165: Use FALLTHROUGH attribute with correct indentation. 2018-04-30 21:52:40 +02:00
Pavel Stupnikov 8e4bce58ea Feature: GS methods to scroll viewport for players (#6745) 2018-04-24 19:19:00 +02:00
frosch b4b98e5165 (svn r27893) -Codechange: Use fallthrough attribute. (LordAro) 2017-08-13 18:38:42 +00:00
alberth 3cd390b2ce (svn r27344) -Doc: Documenting the (Re)setObjectToPlace functions. 2015-07-28 08:16:52 +00:00
frosch 4830497f0b (svn r27340) -Fix [FS#6338]: Silence warning by moving _string_colourmap to a file no its own. (Cif) 2015-07-26 09:47:17 +00:00
frosch 9fb56ca02e (svn r27248) -Fix [FS#6257]: Town labels on smallmap and zoomed-out viewports were not centered. (_dp_) 2015-04-25 11:58:19 +00:00
frosch f26e9bf59d (svn r27162) -Fix [FS#6208]: Tile selection was drawn outside of map in some cases. (adf88) 2015-02-22 15:05:48 +00:00
frosch 3adf082db2 (svn r27161) -Fix [FS#6156] [FS#6206]: Reimplement the viewport drawing algorithm. 2015-02-22 14:42:34 +00:00
frosch cfac8dbbc6 (svn r27160) -Fix: Division of signed values by TILE_SIZE requires cast to stay signed. 2015-02-22 14:14:30 +00:00
frosch 06d1d50884 (svn r27158) -Codechange: Simplify mapping from viewport to smallmap coordinates by duplicating less code. 2015-02-22 14:10:44 +00:00
frosch e8e49e5dda (svn r27157) -Fix: Mark bridge middle tiles dirty when building/removing/changing bridges. 2015-02-22 14:01:24 +00:00
frosch 2e1be6081d (svn r27148) -Fix: Rounding and unit-conversion inconsistencies in calls to MarkAllViewportsDirty. 2015-02-14 12:53:07 +00:00
rubidium d534c80e94 (svn r27020) -Cleanup: some coding style consistency improvements (mostly spaces) 2014-10-15 18:31:37 +00:00
rubidium fddeeb5e49 (svn r27002) -Fix-ish: replace some non-ASCII characters with ASCII characters, e.g. @þaram to @param 2014-10-12 18:26:54 +00:00
rubidium a229fb79b5 (svn r26910) -Fix: account for the height of the landscape at the edge of the map to determine the scroll boundaries (based on patch by ic111) 2014-09-22 18:14:44 +00:00
rubidium adf237d550 (svn r26908) -Codechange: replace a magic number by a more logical calculation 2014-09-22 15:04:18 +00:00
rubidium 073aa05da5 (svn r26900) -Fix-ish: dirty the appropriate area around map edges when terraforming there to prevent any artefacts from occuring (ic111) 2014-09-21 17:29:48 +00:00
rubidium 4d619ad10e (svn r26899) -Codechange: reduce the amount of tiles that needs to be drawn by taking the height of tiles into account instead of drawing way too many (ic111) 2014-09-21 17:27:37 +00:00