Commit Graph

146 Commits

Author SHA1 Message Date
Peter Nelson
e6740046ee Codechange: Use range-for iteration. 2023-05-11 07:58:55 +01:00
Rubidium
68ff3fd062 Change: include fmt.h C++ headers in stdafx.h
This to prevent compilation issues between runs with and without precompiled
headers. Also remove the headers from the rest of the code base as they are
not needed there anymore, although they do relatively little harm.
2023-05-08 16:49:23 +02:00
Peter Nelson
0880616851 Codechange: Remove various STRING strings. 2023-05-05 07:07:54 +01:00
Tyler Trahan
6501f84b4a
Codechange: Move calendar date functions inside TimerGameCalendar (#10753) 2023-05-04 13:14:12 +00:00
Peter Nelson
6be6703498 Fix: Linkgraph legend assumes strings are small.
Ensure all linkgraph legend strings are drawn with FS_SMALL forced, so
that it does not rely on NewGRF authors.
2023-04-30 11:47:53 +01:00
PeterN
57f2d70fef
Change: Use cstdint instead of rolling our own types. (#10651) 2023-04-27 10:04:18 +02:00
Tyler Trahan
930f0a16d8 Codechange: Define Date/Year/Month/Day within TimerGameCalendar class 2023-04-26 07:14:03 -04:00
Patric Stout
7aa2b9ab0a
Codechange: move all date-related variables inside the timer (#10706) 2023-04-24 15:56:01 +00:00
PeterN
9910240f0e
Cleanup: Remove obsolete (Make)EnumPropsT. (#10697)
This was used by the command system to help extract p1/p2 parameters, which no longer happens.
2023-04-23 17:46:14 +01:00
Tyler Trahan
646a7e625b
Change: Use seconds for Linkgraph update settings (#10610) 2023-04-14 22:49:12 +02:00
Peter Nelson
5199881a8d Codechange: Use correct type for linkgraph company mask. 2023-04-07 22:09:55 +01:00
PeterN
c1077212d7
Codechange: Use a shared_ptr for viewport overlay. (#10586) 2023-03-31 16:06:36 +01:00
Jonathan G Rennison
87f4d37de3
Fix #10522: Link graph line tooltip test for vertical lines (#10524) 2023-03-03 17:37:17 -05:00
Michael Lutz
aab580e0ac Codechange: [Linkgraph] Drop node/edge wrappers from LinkGraph. 2023-02-26 21:41:24 +01:00
Michael Lutz
4d3da0cf14 Codechange: [Linkgraph] Drop node/edge wrappers from LinkGraphJob. 2023-02-26 21:41:24 +01:00
Michael Lutz
7352f812e6 Codechange: [Linkgraph] Only store present link graph edges and not all possible edges. 2023-02-26 21:41:24 +01:00
Michael Lutz
8f851ead70 Codechange: [Linkgraph] Split annotation for demand between nodes from the edge annotations. 2023-02-26 21:41:24 +01:00
Michael Lutz
fe27db3dfd Codechange: [Linkgraph] Store edges in each node and not in a global matrix. 2023-02-26 21:41:24 +01:00
Rubidium
00721787e1 Fix: wrong type for INVALID_LINK_GRAPH_JOB 2023-01-27 07:05:49 +01:00
Rubidium
fe2bcd2a58 Codechange: migrate size related functions to Map structure 2023-01-21 17:11:40 +01:00
Rubidium
bcfe0fb076 Codechange: introduce GetMainWindow() to properly account for nullptr checks
Some nullptr checks have been removed as they were not triggered with nullptr
with the null video driver and in dedicated server mode.
2023-01-14 21:15:23 +01:00
Patric Stout
1fb101eabb
Codechange: address CodeQL issue "Multiplication result converted to larger type" (#10306)
Most are very unlikely to ever be triggered in our codebase; two
stand out: linkgraph and money cheat. Those, potentially, could
wrap earlier than expected.
2023-01-02 20:30:02 +00:00
Peter Nelson
890b2666d3 Change: Use scaled WidgetDimensions. 2022-11-12 18:28:39 +00:00
Peter Nelson
b6ed595176 Codechange: Prefer suggested widget padding. 2022-11-12 18:28:39 +00:00
Peter Nelson
6f95e04005 Change: Use Rect helpers for widget drawing.
This replaces repetitive and sometimes unwieldy use of constants.
2022-11-12 18:28:39 +00:00
Peter Nelson
eb4ba1991b Change: Use CenterBounds function in more places.
CenterBounds may have a 1 pixel difference so the result is not exactly
the same.
2022-11-12 18:28:39 +00:00
Jonathan G Rennison
e931f3061f
Fix: Dereference of past-the-end iterator in linkgraph overlay tooltip (#10145) 2022-11-07 00:16:38 +01:00
Nicolas Chappe
8bf56f39f2 Fix #9708: [Linkgraph] Don't assume vehicles have a non-zero max speed 2022-10-29 18:39:03 +02:00
Nicolas Chappe
c5369caa45 Fix: [Linkgraph] possible rounding errors for travel times of low-capacity links 2022-10-29 18:39:03 +02:00
Nicolas Chappe
25b3ff6423 Cleanup: simplify LinkRefresher::RefreshStats 2022-10-29 18:39:03 +02:00
Nicolas Chappe
864771ca09 Feature: [Linkgraph] Show a tooltip with statistics when hovering a link 2022-10-18 22:03:39 +02:00
Bouke Haarsma
c7f55a058b
Fix: link overlay line width on HiDPI displays (#10064) 2022-10-04 11:58:58 +02:00
Tyler Trahan
e79724ea22
Feature: Alternative linkgraph colour schemes (#9866) 2022-04-25 19:32:55 +02:00
Niels Martin Hansen
e68bf58989 Codechange: Use anonymous union for vehicle orders/old orders list 2022-02-15 20:01:10 +01:00
Michael Lutz
13528bfcd0 Codechange: Un-bitstuff all remaining commands. 2021-12-16 22:28:32 +01:00
Michael Lutz
0f64ee5ce1 Codechange: Template DoCommandP to automagically reflect the parameters of the command proc.
When finished, this will allow each command handler to take individually
different parameters, obliviating the need for bit-packing.
2021-12-16 22:28:32 +01:00
Michael Lutz
549caca39c Codechange: Move command arguments to the back of the networked command function calls. 2021-12-16 22:28:32 +01:00
Nicolas Chappe
b83820e723 Change: [Linkgraph] Delete links only served by vehicles stopped in depot
A stale link is not deleted if the link refresher finds a vehicle that still serves it.
This commit excludes vehicles stopped in depot for a very long time from the link refresher,
so that their stale links can be deleted.
2021-08-20 22:37:03 +02:00
Nicolas Chappe
de28817d9f Fix 977604ef: [Linkgraph] Add a special case for unknown travel times on link update 2021-08-18 01:48:11 +02:00
Nicolas Chappe
977604ef08 Feature: [Linkgraph] Prioritize faster routes for passengers, mail and express cargo
Passengers usually prefer fast paths to short paths.
Average travel times of links are updated in real-time for use in Dijkstra's algorithm,
and newer travel times weigh more, just like capacities.
2021-08-17 14:57:59 +02:00
glx22
a543a4b7bb Codechange: Remove FOR_EACH_SET_CARGO_ID 2021-07-09 21:36:09 +02:00
Patric Stout
7b135a8269 Codechange: use SLE_STRUCT(LIST) for Linkgraph chunks 2021-06-14 21:58:05 +02:00
Patric Stout
9fff00ba20
Codechange: C++-ify lists for SaveLoad (#9323)
Basically, this changes "SaveLoad *" to either:
1) "SaveLoadTable" if a list of SaveLoads was meant
2) "SaveLoad &" if a single entry was meant

As added bonus, this removes SL_END / SLE_END / SLEG_END. This
also adds core/span.hpp, a "std::span"-lite.
2021-05-31 22:26:44 +02:00
rubidium42
6fe4d4ad7b Codechange: linkgraph always iterates with NodeIDs over the Size(), so make Size() the same type to prevent infinite loops 2021-05-27 18:30:56 +02:00
rubidium42
44ca7d9377 Change: Use gender-neutral pronouns 2021-05-15 10:16:48 +02:00
Rubidium
bb9121dbd4 Fix: comparison of narrow type to wide type in loop (potential for infinite loops) 2021-05-15 10:16:10 +02:00
Peter Nelson
56a6f66903 Codechange: Use text lines instead of pixel height of font for link graph widgets. 2021-04-30 17:08:15 +01:00
Milek7
4cd9e0f41b Fix: Add virtual destructor to link graph Path.
Classes derived from Path were freed through base class pointer, but no virtual destructor was present.
2021-04-13 20:48:49 +02:00
Tyler Trahan
de891238d6
Change: Recolour graph windows to brown (#8700) 2021-03-11 15:30:29 +01:00
Charles Pigott
9b800a96ed
Codechange: Remove min/max functions in favour of STL variants (#8502) 2021-01-08 11:16:18 +01:00