Commit Graph

356 Commits (847e5f33d4749568cda696b8940ec10b540bd6fb)

Author SHA1 Message Date
glx 869581eb23 Codechange: Replace FOR_ALL_SIGNS with range-based for loops 5 years ago
glx ddabfed1cd Codechange: Replace station related FOR_ALL with range-based for loops 5 years ago
Niels Martin Hansen 9900af38f5
Fix #7847: Use ViewportSign coordinates for sign Kdtree coordinates (#7849)
Ensure the same coordinates are used for station/town/player signs regardless of how the landscape changes below it after the coordinates were first determined.

By keeping track of whether each ViewportSign is valid for Kdtree use (and only ever registering the viewport sign when the object is valid) a lot of code can be simplified and become more robust at the same time.
5 years ago
S. D. Cloudt 13cc8a0cee Cleanup: Removed SVN headers 5 years ago
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
5 years ago
PeterN 2d0352d67f
Fix e8d397e4ee: Avoid using RemapCoords2 during savegame conversion. (#7588) 5 years ago
Niels Martin Hansen c9fe6e7b8f Fix #7371: Avoid dependency on foundations of town tile during saveload 5 years ago
Charles Pigott 96a4787710 Codechange: Set ZoomLevel's base type to byte instead of using ZoomLevelByte 5 years ago
peter1138 81d335b081 Feature: Add station coverage area display for towns. 5 years ago
peter1138 81f0f97406 Feature: Add existing station coverage area display when placing new station parts. 5 years ago
peter1138 b6733edd17 Feature: Add coverage area display for existing stations. 5 years ago
PeterN c17736b493
Fix e8d397e: Invisible station/waypoint signs could still be clicked on. (#7531) 5 years ago
Henry Wilson 7c8e7c6b6e Codechange: Use null pointer literal instead of the NULL macro 5 years ago
glx22 66dd7c3879
Fix: MSVC warnings (#7423) 5 years ago
Henry Wilson c01a2e2a81 Codechange: Removed SmallVector completely 5 years ago
Henry Wilson ab711e6942 Codechange: Replaced SmallVector::[Begin|End]() with std alternatives 5 years ago
Henry Wilson a0f36a50e6 Codechange: Replaced SmallVector::Append() with std::vector::[push|emplace]_back() 5 years ago
Henry Wilson 097328c3d7 Codechange: Replaced SmallVector::Get() const with std alternatives 5 years ago
Henry Wilson a690936ed7 Codechange: Replace SmallVector::Length() with std::vector::size() 5 years ago
Henry Wilson bfd79e59dc Codechange: Replace SmallVector::Clear() with std::vector::clear() 5 years ago
peter1138 1585c12bb9 Fix 4da83d2f66: Remove measurement tooltips when completed. 5 years ago
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.
5 years ago
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.
5 years ago
Niels Martin Hansen e8d397e4ee Codechange: Make a merged k-d tree index of all viewport signs 5 years ago
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.
5 years ago
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.
5 years ago
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) 6 years ago
Johannes E. Krause 05da5a177c Codechange: Simplify marking tiles dirty when terraforming (Patch by adf88, #6583) 6 years ago
Johannes E. Krause f744dea0ff Fix: jumping effect when scrolling viewport over bottom edge of the map (Patch by adf88, #6583) 6 years ago
Johannes E. Krause f0290d5de7 Codechange: Add InverseRemapCoords2 function for remapping viewport coordinates to underlying tile coordinates (Patch by adf88, #6583) 6 years ago
btzy 9d75600ac0 Fix: Round up deltas for smooth scrolling, so target will be reached 6 years ago
nikolas d8ccad91f9 Fix: Some code and comment typos
Found with codespell
6 years ago
frosch 1a1204472e Revert: Sprite sorting optimisation sorted incorrectly.
This reverts commit 25ab9c1997.
6 years ago
Charles Pigott 52ed3bcbaa Remove: A few bits of dead code 6 years ago
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.
6 years ago
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.
6 years ago
J0an Josep cfb8092397 Fix b4b98e5165: Use FALLTHROUGH attribute with correct indentation. 6 years ago
Pavel Stupnikov 8e4bce58ea Feature: GS methods to scroll viewport for players (#6745) 6 years ago
frosch b4b98e5165 (svn r27893) -Codechange: Use fallthrough attribute. (LordAro) 7 years ago
alberth 3cd390b2ce (svn r27344) -Doc: Documenting the (Re)setObjectToPlace functions. 9 years ago
frosch 4830497f0b (svn r27340) -Fix [FS#6338]: Silence warning by moving _string_colourmap to a file no its own. (Cif) 9 years ago
frosch 9fb56ca02e (svn r27248) -Fix [FS#6257]: Town labels on smallmap and zoomed-out viewports were not centered. (_dp_) 9 years ago
frosch f26e9bf59d (svn r27162) -Fix [FS#6208]: Tile selection was drawn outside of map in some cases. (adf88) 9 years ago
frosch 3adf082db2 (svn r27161) -Fix [FS#6156] [FS#6206]: Reimplement the viewport drawing algorithm. 9 years ago
frosch cfac8dbbc6 (svn r27160) -Fix: Division of signed values by TILE_SIZE requires cast to stay signed. 9 years ago
frosch 06d1d50884 (svn r27158) -Codechange: Simplify mapping from viewport to smallmap coordinates by duplicating less code. 9 years ago
frosch e8e49e5dda (svn r27157) -Fix: Mark bridge middle tiles dirty when building/removing/changing bridges. 9 years ago
frosch 2e1be6081d (svn r27148) -Fix: Rounding and unit-conversion inconsistencies in calls to MarkAllViewportsDirty. 10 years ago
rubidium d534c80e94 (svn r27020) -Cleanup: some coding style consistency improvements (mostly spaces) 10 years ago
rubidium fddeeb5e49 (svn r27002) -Fix-ish: replace some non-ASCII characters with ASCII characters, e.g. @þaram to @param 10 years ago