Commit Graph

397 Commits

Author SHA1 Message Date
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
rubidium c9d7e89138 (svn r26870) -Fix (r15190): since freeform edges the 'tile height' at southern edge * 8 pixels just 'south' of the edge tile would not be drawn and would as a result not be refreshed causing artefacts to remain there. This adds a virtual slope to level 0 so it can be redrawn appropriately. Loosely based on patch by ic111 2014-09-21 08:19:32 +00:00
rubidium 0463dbdc9e (svn r26482) -Codechange: add an include that allows us to undefine/redefine "unsafe" functions to prevent them from being used, and thus having to care about certain aspects of their return values 2014-04-23 20:13:33 +00:00
fonsinchen 4055397915 (svn r26338) -Fix [FS#5908]: Don't redraw the link graph overlay if it's empty (MJP) 2014-02-15 12:19:46 +00:00
rubidium 2618d960e3 (svn r26209) -Codechange: remove some template magic and simplify some code 2014-01-02 22:41:58 +00:00
rubidium 3c94485ba0 (svn r26205) -Feature: SSE 4.1 sprite sorter, improving the sorting performance significantly (MJP)
For example with GCC 4.8, x86_64 Linux, Intel i5-3337U this patch improves the performance of Pile, Treham and Hamac test save games by about 10% in over-all run time at fast forward at 1920x1080 when zoomed out and when trees are not disabled.
2014-01-02 16:48:16 +00:00
frosch 3d99546107 (svn r25823) -Codechange [FS#5780]: Simplify if-cases in ViewportDrawStrings. (Juanjo) 2013-10-06 20:18:53 +00:00
rubidium f4c9ba4981 (svn r25546) -Fix: two small memory leaks 2013-06-30 20:40:49 +00:00
rubidium ef7befdbd8 (svn r25264) -Feature: linkgraph overlay over main viewport (fonsinchen) 2013-05-19 14:49:25 +00:00
frosch 05203587b5 (svn r24975) -Fix [FS#5463]: Additional zoom in levels could glitch by a few pixels due to incorrect rounding. 2013-02-06 17:51:05 +00:00
planetmaker c24374f99c (svn r24900) -Fix [FS#5389]: Comments with typos (most fixes supplied by Eagle_rainbow) 2013-01-08 22:46:42 +00:00
rubidium 41e5c839e0 (svn r24179) -Codechange: move some variables of Town to TownCache 2012-04-25 20:50:13 +00:00
rubidium 113746b3a6 (svn r24068) -Change/fix [FS#5103]: significantly reduce the area that is redrawn for text effects (Rhamphoryncus) 2012-03-25 19:30:05 +00:00
rubidium 927734e6ce (svn r24065) -Feature-ish [FS#5101]: debug option for showing the redrawn dirty blocks/rectangles 2012-03-25 19:06:59 +00:00
frosch 5bf1710a28 (svn r23835) -Change [FS#4999]: Make signs placed in scenario editor belong to the GS. That way they are always shown in game and are not editable. 2012-01-22 13:54:02 +00:00
truebrain e7cd301d3c (svn r23621) -Add: allow manipulation of signs via GameScripts 2011-12-19 20:59:29 +00:00
peter1138 07633a064c (svn r23329) -Fix (r23316): Scale child sprite pixel offsets unless told not to. Fixes lifts and industry graphics. 2011-11-25 23:06:17 +00:00
peter1138 81598273e9 (svn r23316) -Feature: Add ability to zoom in to 2x and 4x level. 2011-11-24 12:38:48 +00:00
peter1138 4e97261315 (svn r23314) -Add: Add settings to restrict viewport zoom levels. 2011-11-24 12:20:14 +00:00
frosch f6ff2a3c15 (svn r23125) -Codechange: Replace some 8s with TILE_SIZE / 2. (adf88) 2011-11-06 15:54:55 +00:00
rubidium 9782b7bb0a (svn r23110) -Codechange: let the flying altitude return ints are well 2011-11-04 13:40:59 +00:00
rubidium 2a2c102b0b (svn r23108) -Codechange: more uint -> int / byte -> int conversions for Z related variables 2011-11-04 11:52:19 +00:00
rubidium 7757a2ed40 (svn r23091) -Codechange: rename some Get*Z functions to Get*PixelZ functions if they return the Z in pixels (like TilePixelHeight) 2011-11-04 10:18:13 +00:00
planetmaker 4b3aa9f26e (svn r22761) -Fix (r22708): Make invisible signs un-clickable (Zuu) 2011-08-19 20:54:15 +00:00
frosch f34c666bc5 (svn r22755) -Fix [FS#4727]: When marking tile selections dirty, use the height information of the corners instead of the surface slope. This is more accurate when the foundation is kind of undefined. 2011-08-16 21:25:33 +00:00
frosch 233065a5d8 (svn r22740) -Fix [FS#4708]: Display the size of the leveled platform in the measurement tooltip of terraforming operations. 2011-08-13 10:44:15 +00:00
frosch 92e701c6ed (svn r22739) -Fix: The measurement tooltip is supposed to be hidden when not dragging an area. 2011-08-13 10:43:11 +00:00
planetmaker 3fb66890ee (svn r22708) -Feature [FS#4701]: Display option to hide competitors' signs and station names (Zuu) 2011-08-01 18:41:21 +00:00
frosch abf286e990 (svn r22649) -Fix [FS#4670]: Switching from a red to a white highlight (by switching to another tool) without switching the highlight mode (HT_RECT etc.) did not mark the selection dirty. 2011-07-10 14:44:41 +00:00
yexo 1714e5d509 (svn r22181) -Fix (r20574): following a vehicle with a very high VehicleID was impossible 2011-03-04 12:12:48 +00:00
rubidium 7eba2bf4d3 (svn r21890) -Cleanup: remove some unneeded includes 2011-01-22 14:52:20 +00:00
rubidium 7efd7e19ed (svn r21845) -Codechange: move documentation towards the code to make it more likely to be updates [d-m]. 2011-01-18 22:31:06 +00:00
alberth 661e13a86a (svn r21667) -Codechange: Introduce _thd.Reset(). 2010-12-30 15:32:31 +00:00
alberth cedb07bba3 (svn r21666) -Codechange: Use GetCallbackWnd at more places. 2010-12-30 13:18:04 +00:00
alberth 22a13850cb (svn r21665) -Codechange: Make GetCallbackWnd a method of _thd. 2010-12-30 13:16:31 +00:00
rubidium b98c758e0b (svn r21648) -Codechange: unduplicate a bit of code 2010-12-27 18:21:19 +00:00
alberth d2564a3e56 (svn r21638) -Codechange (r1): Simplify testing that outersize.x is bigger than 0. 2010-12-25 19:58:50 +00:00
rubidium 2c41b8ee97 (svn r21637) -Codechange: make it more clear that IS_PALETTE_COLOUR belongs to TextColour 2010-12-25 19:47:15 +00:00
smatz b5268dccbd (svn r21632) -Codechange: call ResetObjectToPlace() even when current place_mode is HT_NONE 2010-12-25 12:47:05 +00:00
alberth 96906c1a45 (svn r21628) -Codechange: Remove local variables that just point to global _thd. 2010-12-24 17:51:46 +00:00
alberth 852e647bcc (svn r21627) -Codechange: Remove _place_proc global variable. 2010-12-24 15:08:19 +00:00
alberth 9cdd8c6d48 (svn r21621) -Codechange: Only consider tile highlighting mode bits in tile selection functions. 2010-12-24 14:55:31 +00:00
alberth e930b9985d (svn r21620) -Codechange: Don't consider direction bits when checking for an active highlight mode. 2010-12-24 14:52:42 +00:00
alberth cdae336feb (svn r21619) -Fix [FS#4327]: Don't copy direction bits when restarting a rail selection. 2010-12-24 14:48:38 +00:00
smatz e4e6735cea (svn r21612) -Fix (r21608): dragging with HT_POINT was half a tile off 2010-12-23 20:25:55 +00:00
alberth 90780fd25b (svn r21608) -Codechange: Move diagnonal rectangle dragging detection completely to tile highlighting. 2010-12-23 14:24:34 +00:00
alberth 1ba348914d (svn r21607) -Codechange: Be more robust against having extra bits in HighLightStyle vars. 2010-12-23 14:15:05 +00:00
alberth 08c6b99294 (svn r21600) -Codechange: Remove new_drawstyle and new_diagonal variables from the _thd structure. 2010-12-22 19:24:36 +00:00
alberth 50faf52cfc (svn r21542) -Codechange (r14789): Handling a click at a tile once is enough. 2010-12-20 09:34:30 +00:00
smatz 728220ec88 (svn r21531) -Fix: gcc 3.4 warning 2010-12-16 14:03:21 +00:00
rubidium 20364bcefa (svn r21501) -Fix (rnotlongago): guess what was complaining this time? 2010-12-13 15:34:30 +00:00
rubidium 652e262601 (svn r21498) -Codechange: make the measurement tooltip handle diagonal selection properly 2010-12-13 15:11:03 +00:00
rubidium 959308a243 (svn r21497) -Codechange: prepare the viewport selection mechanism for selecting diagonally 2010-12-13 15:09:59 +00:00
rubidium a029b2b83a (svn r21477) -Fix [FS#4300]: tooltips were removed when their related window got closed 2010-12-12 14:14:26 +00:00
alberth ab50f74d7f (svn r21273) -Codechange: Return values should start at the same line. 2010-11-20 15:44:24 +00:00
alberth 7e48d85104 (svn r21060) -Doc: Improved wording of comments (mostly by __ln__) 2010-10-30 17:51:07 +00:00