Commit Graph
100 Commits
Author SHA1 Message Date
Jonathan G RennisonandMichael Lutz b82bcac3cd Fix #10419: Water infrastructure accounting when building ship depots 2023-01-29 23:15:53 +01:00
Jonathan G Rennisonandrubidium42 10e76b2788 Fix #10032: Capacities of articulated vehicles in build window
See also: #9954
2023-01-14 18:52:01 +01:00
Jonathan G Rennisonandrubidium42 14c1266bbc Fix: Wrong type cast for selected AI/GS script info in AIListWindow
This resulted in technically undefined behaviour when listing GSs
2022-12-22 21:26:27 +01:00
Jonathan G Rennisonandrubidium42 d4c530904c Fix #10274: Use after free when rescanning scripts with GS selected 2022-12-22 21:23:48 +01:00
Jonathan G RennisonandMichael Lutz c7d7658004 Fix #10214: CMD_CREATE_LEAGUE_TABLE did not set CMD_STR_CTRL 2022-12-16 21:07:36 +01:00
Jonathan G RennisonandMichael Lutz 1a05e95945 Fix #10214: League and graph buttons in toolbar not having a default action 2022-12-16 21:07:36 +01:00
Jonathan G RennisonandMichael Lutz e0cb31ff07 Fix #10214: Header and footer missing from league table saveload 2022-12-16 21:07:36 +01:00
Jonathan G RennisonandGitHub 7c3c92f8b8 Fix #10155: SyncCompanySettings sending old instead of new setting values (#10158) 2022-11-12 17:24:31 +00:00
Jonathan G RennisonandMichael Lutz 64b437fa89 Fix: Data race with mixer thread performance measurements 2022-11-11 23:48:24 +01:00
Jonathan G RennisonandMichael Lutz 0fae0599b7 Fix: Data race on effect volume setting with mixer thread 2022-11-11 23:48:24 +01:00
Jonathan G RennisonandMichael Lutz a962d7476b Fix: Data races on MixerChannel active states 2022-11-11 23:48:24 +01:00
Jonathan G RennisonandGitHub e931f3061f Fix: Dereference of past-the-end iterator in linkgraph overlay tooltip (#10145) 2022-11-07 00:16:38 +01:00
Jonathan G RennisonandGitHub 4dc741a8a0 Fix #10011: Incorrect infrastructure totals when overbuilding bay road stop (#10143)
Fix https://github.com/OpenTTD/OpenTTD/issues/10011
2022-11-06 16:46:11 +01:00
Jonathan G RennisonandGitHub 3b3c9c1c3a Fix #10129: Use after free in GRFLoadConfig invalid GRF error path (#10130) 2022-11-05 15:17:18 +01:00
Jonathan G RennisonandLoïc Guilloux 47456ac672 Change: Reduce number of instructions in AlphaBlendTwoPixels 2022-10-16 18:55:09 +02:00
Jonathan G RennisonandLoïc Guilloux f9cdb5b610 Fix: Correctly set alpha of output in AlphaBlendTwoPixels
Match alpha behaviour of ComposeColourRGBA
2022-10-16 18:55:09 +02:00
Jonathan G RennisonandGitHub 73e5c57e6b Fix 5e413c9d: Last sprite offset in GRF file was not recorded (#10062)
A line was missed when preparing PR #9988, as this had been added
in a commit prior to the one which the PR was immediately based on
2022-09-29 11:56:42 +02:00
Jonathan G RennisonandGitHub 5e413c9dcd Fix #9804: Only apply sprite_zoom_min setting when sprites available (#9988)
Only discard sprite zoom levels when a suitable higher zoom level is
defined in the same colour mode

This is to avoid placeholder or empty sprites being used, causing
visual artefacts
2022-09-21 12:37:11 +02:00
Jonathan G RennisonandLoïc Guilloux 20f7ff8ac0 Codechange: Fix unnecessary string reallocation in IConsoleLine constructor 2022-09-21 12:32:07 +02:00
Jonathan G RennisonandLoïc Guilloux 0a7ffae0d9 Fix #10010: Memory leak in IConsolePrint in non-dedicated case 2022-09-21 12:32:07 +02:00
Jonathan G RennisonandGitHub 67331fe946 Fix #9951: Scenario editor random industries button and persistent storage (#9952)
BasePersistentStorageArray::SwitchMode was not called
2022-07-21 16:21:38 +01:00
Jonathan G RennisonandLoïc Guilloux 19af139631 Fix #9937: Station industries_near incorrect after removing part moved sign
RecomputeCatchment was being called before moving the sign tile
instead of afterwards
2022-06-29 12:49:55 +02:00
Jonathan G RennisonandNiels Martin Hansen 4acccc232a Fix #9925: Industry tile layout validation for layouts of only one tile 2022-06-18 22:02:08 +02:00
Jonathan G RennisonandMichael Lutz b3893878bb Fix #9867: Industry::stations_near not filled at industry creation 2022-04-25 19:32:22 +02:00
Jonathan G RennisonandMichael Lutz 6ccf020dc2 Fix #9802: Assertion failure in BuildRailWaypointWindow constructor 2022-01-30 11:20:00 +01:00
Jonathan G RennisonandMichael Lutz 4844268d1c Fix #9774: CmdBuildRoadStop updated station acceptance in estimate mode 2021-12-30 20:39:10 +01:00
Jonathan G RennisonandMichael Lutz e08a6e2014 Fix #9735: Fix OrderBackup::Reset in non-GUI case 2021-12-19 16:53:10 +01:00
Jonathan G RennisonandNiels Martin Hansen 762b656b53 Fix #9740: Fix loading of gamelog change items from savegame ver >= 294 2021-12-10 22:46:16 +01:00
Jonathan G RennisonandGitHub fc58ed9987 Codechange: Remove CargoSpec::multipliertowngrowth which is unused (#9701)
This is set by cargo property 19.
This property is only implemented in TTDPatch.
2021-11-16 22:48:21 +00:00
Jonathan G RennisonandGitHub 6e3d023e69 Fix #9535: Maintain a reverse dependency map of network content (#9538)
Fixes performance issues with dependency lookup when retrieving
content list from the content server.
2021-09-09 18:06:00 +02:00
Jonathan G RennisonandGitHub 8a33e98834 Fix #8169: nullptr dereference when autoreplacing vehicle with no orders (#9387) 2021-06-19 23:31:23 +02:00
Jonathan G Rennisonandrubidium42 a896753ecc Fix #9264: Do not attach temporary wagons to free wagon chains when autoreplacing 2021-05-23 21:05:55 +02:00
Jonathan G RennisonandGitHub ece9a356dc Fix #9113: Assertion failure when removing airport with order backup (#9182) 2021-05-03 15:03:25 +01:00
Jonathan G RennisonandMichael Lutz 39b7ef31f8 Fix: Data races on cursor state in OpenGL backends 2021-04-10 18:31:42 +02:00
Jonathan G RennisonandMichael Lutz fbd0a2e65a Fix: Thread unsafe use of sprite cache in OpenGLBackend::DrawMouseCursor
See also: #8870
See also: #8977
2021-04-10 18:31:42 +02:00
Jonathan G RennisonandMichael Lutz 3ede756d23 Fix: Viewport drag tooltips not being removed when dragging over other windows 2021-04-08 19:34:45 +02:00
Jonathan G RennisonandMichael Lutz ae94b2d296 Fix: Viewport drag tooltip flickering when dragging outside window 2021-04-08 19:34:45 +02:00
Jonathan G RennisonandGitHub 825867f2c5 Fix: [Network] State conditions for sending client info/quit packets (#8959)
Use status >= STATUS_AUTHORIZED as the state criteria for all cases
where updates about other clients are sent.
This avoids the case where a client is informed that another client
has joined but not informed when it later quits, resulting in
stale entries in the client list window.
2021-04-06 19:31:52 +01:00
Jonathan G RennisonandGitHub 83ac5aa27a Fix: Memory leak of airport tile layout in AirportChangeInfo (prop 0A) (#8928) 2021-04-02 10:13:53 +02:00
Jonathan G RennisonandMichael Lutz c0b722ec46 Codechange: Add fast path to catenary drawing in MaskWireBits
MaskWireBits always returns its input unchanged if the input
has only 0 or 1 track bits set.
Having only 0 or 1 track bits sets (i.e. non junction tiles)
is by far the most common case.
Examining the state of neighbouring tiles and the subsequent
masking logic is relatively expensive and can be omitted in this case.
2021-03-10 23:28:10 +01:00
Jonathan G RennisonandCharles Pigott 25909b06d2 Fix #8809: Crash when removing airport when hangar window open 2021-03-07 17:59:38 +00:00
Jonathan G RennisonandGitHub 15b99f2e7a Fix: Whole status bar instead of money widget refreshed on money change (#8692)
This could result in the rest of the status bar being
redrawn unnecessarily frequently
2021-02-18 12:29:30 +01:00
Jonathan G RennisonandGitHub 55ed7d16f7 Fix: Unnecessary status bar redraws when there is no news to show (#8691)
InvalidateWindowData with mode SBI_NEWS_DELETED was called on the
status bar when checking for a new item of news to be shown in the
ticker, even if there is no news queued and no change occurs.
2021-02-18 12:17:51 +01:00
Jonathan G RennisonandGitHub e059a88533 Fix: Autorenew failure advice due to bad refit being shown to all companies (#8681) 2021-02-18 10:50:33 +01:00
Jonathan G RennisonandGitHub 1411f878ab Add: Console command to dump debugging information (#8548) 2021-01-13 21:16:47 +01:00
Jonathan G RennisonandMichael Lutz 15fd63b1b8 Fix: Assert fail when using restart command after opening save/load GUI 2020-12-30 00:57:09 +01:00
Jonathan G RennisonandCharles Pigott 0e017f6233 Codechange: Enable FINAL, (un)likely, __attribute__ when building with clang 2020-12-27 10:30:55 +00:00
Jonathan G RennisonandCharles Pigott fc52d3df50 Codechange: Use likely/__builtin_expect for assertion macros 2020-12-27 10:30:55 +00:00
Jonathan G RennisonandCharles Pigott 5cf28be742 Codechange: Add support for verbose asserts 2020-12-27 10:30:55 +00:00
Jonathan G RennisonandCharles Pigott eb74179c6d Codechange: Unconditionally use static_assert
We're well past having to support non-C++11 compliant compilers now.
2020-12-27 10:30:55 +00:00
Jonathan G RennisonandGitHub 94d629d79b Change: [Linkgraph] Allow job threads to be aborted early when clearing schedule (#8416)
When link graph jobs are cleared due to abandoning the game or exiting,
flag the job as aborted.
The link graph job running in a separate thread checks the aborted flag
periodically and terminates processing early if set.
This reduces the delay at game abandon or exit if a long-running job
would otherwise still be running.
2020-12-25 00:36:36 +01:00
Jonathan G RennisonandPatric Stout 7f0fefddcf Change: [Linkgraph] Only acquire thread join performance measurements on network clients
Network servers and single player clients do not block on thread joins
due to instead pausing shortly before the join is due.
2020-12-22 15:17:57 +01:00
Jonathan G RennisonandPatric Stout 0c5dc5d41e Change: [Linkgraph] Pause the game when linkgraph jobs lag (#6470)
Check if the job is still running two date fract ticks before it is due
to join, and if so pause the game until its done.
When loading a game, check if the game would block immediately due to
a job which is scheduled to be joined within two date fract ticks,
and if so pause the game until its done.
This avoids the main thread being blocked on a thread join, which appears
to the user as if the game is unresponsive, as the UI does not repaint
and cannot be interacted with.
Show if pause is due to link graph job in status bar, update network
messages.
This does not apply for network clients.
2020-12-22 15:17:57 +01:00
Jonathan G RennisonandCharles Pigott 053d4f3bff Fix: Thread unsafe use of SendPacket for PACKET_SERVER_MAP_SIZE
NetworkTCPSocketHandler::SendPacket is not thread safe and may not
be used concurrently from multiple threads without suitable locking
2020-07-09 16:08:01 +01:00
Jonathan G RennisonandNiels Martin Hansen 7a09413a1a Fix: Incorrect save/load array size of Town::cargo_accepted
In 11ab3c4e the number of cargo types was changed from 32 to 64.
The save/load of Town::cargo_accepted was not updated, such that
only half of the data structure is saved/loaded in savegame versions
199 to 218.
Discard and regenerate data from all savegame versions prior to 219.
2020-06-28 15:32:53 +02:00
Jonathan G RennisonandNiels Martin Hansen 54237b0e98 Codechange: Move SlSkipBytes to saveload.h 2020-06-28 15:32:53 +02:00
Jonathan G RennisonandNiels Martin Hansen e6f3e15c32 Fix 63ccb36e: Incorrect string type for OrderBackup::name save/load
In 63ccb36e BaseConsist::name was changed from a malloced char*
to a std::string.
OrderBackup inherits from BaseConsist.
The saveload of OrderBackup::name was not updated.
2020-06-22 08:02:42 +02:00
Jonathan G RennisonandCharles Pigott 1ac0d4a5b2 Fix: Thread unsafe use of NetworkAddress::GetAddressAsString
Remove static buffer form of NetworkAddress::GetAddressAsString.
This is used in multiple threads concurrently, and is not thread-safe.

Replace it with a form returning std::string.
2020-06-21 11:47:56 +01:00
Jonathan G RennisonandNiels Martin Hansen b0f192abc4 Fix: Racy use of flags in TCPConnecter::CheckCallbacks
conected and aborted flags are used concurrently from multiple threads.
2020-06-18 19:57:34 +02:00
Jonathan G RennisonandNiels Martin Hansen c167648d75 Fix: Violation of strict weak ordering in group name sorters
This could be caused by a group being renamed, and the old
name being cached from a previous sort.

See: #7838
2020-06-18 12:38:43 +02:00
Jonathan G RennisonandNiels Martin Hansen d830a34394 Fix: Violation of strict weak ordering in engine name sorter
This could be caused by an engine being renamed, and the old
name being cached from a previous sort.

See: #7838
2020-06-18 12:38:43 +02:00
Jonathan G RennisonandNiels Martin Hansen 084b073e57 Codechange: Use template type for GUIList::Sort comparator 2020-06-18 12:38:43 +02:00
Jonathan G RennisonandNiels Martin Hansen f11cd8f2d0 Fix: Compilation warnings in story_gui and script_story_page
See: #7896
2020-05-27 22:22:56 +02:00
Jonathan G RennisonandNiels Martin Hansen 2b6df2544f Codechange: Don't fail configure if SDL2 is not detected 2020-02-10 08:12:50 +01:00
Jonathan G RennisonandNiels Martin Hansen 1a88fb5c91 Fix #7592: Do not cache road vehicle path within 8 tiles of destination with multiple entrances
Ported from jgrpp commit 79d5be7e265df3be8b73d484f0c7261b3c23229d
2020-02-07 23:02:10 +01:00
Jonathan G RennisonandNiels Martin Hansen 14af8701df Fix #6566: Fix signed integer overflow in viewport draw area chunking
This caused drawing areas larger than 2097151 pixels at 8x zoom to
not be subdivided into smaller chunks as required.
This resulted in pathological performance issues in the sprite sorter.
2020-02-02 15:37:14 +01:00
Jonathan G RennisonandMichael Lutz 2fee030a26 Change: Algorithm for transfer feeder payments
The original algorithm pays intermediate legs in feeder systems based
on the start and end stations of that particular leg.
This tends to result in large negative payments on the final leg for
journeys with many feeder legs, as the overall feeder payment increases
with the number of legs, and the final leg is penalised for discrepancies
between the previous leg payments and the actual payment for delivery
from the source to the destination.
The feeder share setting is a partial mitigation, however it is difficult
to tune as a suitable value depends on the number of legs and the network
topology, which are often not the same for all vehicles.

The new incremental algorithm pays the cargo payment from the source
station to the end station of the current leg, minus any previous
transfer feeder payments for each leg.
This prevents unbounded increase of feeder payments and therefore avoids
the issue of excessive negative payments on the final leg.
Feeder payments may be negative, e.g. in the case of poorly performing
or highly indirect legs. This is better than penalising the final leg.
This mode reduces the need to tune the feeder shares setting to the
current network.

The feeder share setting applies in the existing way.
2020-01-28 23:37:16 +01:00
Jonathan G RennisonandCharles Pigott 87700bfe0e Codechange: Use cached town name for town list window filtering 2020-01-12 19:37:43 +00:00
Jonathan G RennisonandCharles Pigott d35f35a968 Codechange: Use cached town, station, industry names for list window sorting
This is to avoid needing to expensively regenerate name strings on
every comparison when sorting by name in the town/station/industry
list windows.
2020-01-12 19:37:43 +00:00
Jonathan G RennisonandCharles Pigott c3223903ed Codechange: Cache resolved town, station and industry name strings 2020-01-12 19:37:43 +00:00
Jonathan G RennisonandCharles Pigott f1734e7815 Change: Only resort industry directory window on production change if necessary 2020-01-12 19:37:43 +00:00
Jonathan G RennisonandCharles Pigott 22ba048c89 Change: Only resort town directory window on population change if necessary 2020-01-12 19:37:43 +00:00
Jonathan G RennisonandNiels Martin Hansen 6e7117e04c Codechange: [Linkgraph] Skip MCF source node Dijkstra when all demand satisfied
MCF Dijkstra iterations are executed for all source nodes in a round-robin order.
Source nodes typically require different numbers of MCF Dijkstra iterations
to satisfy all of their demand.
This change is to avoid performing MCF Dijkstra iterations on source nodes which
have already been fully satisfied.
2020-01-08 22:49:53 +01:00
Jonathan G RennisonandCharles Pigott 150dfba95b Codechange: Remove std::function from Pool iteration wrapper
Add a separate template wrapper for filtered iteration
2020-01-07 09:00:45 +00:00
Jonathan G RennisonandNiels Martin Hansen 4cc1420beb Fix: Non-deterministic name sorting in industry directory window
In the case where multiple industries have the same name, sorting
in the industry directory window is non-deterministic.
This results in the order changing on each re-sort, and is noticeable
when the industries have different production or transported values.
2020-01-07 09:03:36 +01:00
Jonathan G RennisonandCharles Pigott 12380fc1bb Fix: Assertion failure when post road-works cleanup removes all road pieces 2020-01-05 20:44:07 +00:00
Jonathan G RennisonandMichael Lutz 35dc377a58 Fix: Infrastructure total update when removing tram road stop
The wrong road owner was used when updating the tram infrastructure total.
This could result in desyncs, negative infrastructure totals, etc.
2019-12-08 15:12:56 +01:00
Jonathan G RennisonandNiels Martin Hansen a1d6354caf Fix: Out of bounds tile access in ErrmsgWindow::OnInitialPosition
This fixes part A of #7619, but not part B.

Vehicle::x_pos and Vehicle::y_pos are not required to be within the map bounds.

See also: GetTileHeightBelowAircraft()
2019-11-14 08:13:44 +01:00
Jonathan G RennisonandCharles Pigott a15ace0f5b Fix #7783, Fix #7816: [SDL2] Fix input handling in edit context
In particular this fixes handling of the shift key
2019-11-10 17:58:42 +00:00
Jonathan G RennisonandCharles Pigott 1dba06656d Codechange: Add utility function for whether the focused window is a console 2019-11-10 17:58:42 +00:00
Jonathan G RennisonandCharles Pigott 81f159434d Codechange: Add EditBoxGainedFocus method to VideoDriver base class 2019-11-10 17:58:42 +00:00
Jonathan G RennisonandCharles Pigott 46f7c6a641 Change: [SDL2] Add an "unprintable" flag to struct VkMapping
SDL_Keysym::sym is not suitable for checking whether the character
is printable or not
2019-11-10 17:58:42 +00:00
Jonathan G RennisonandCharles Pigott d41378c00a Fix: [SDL2] Page down key not handled
SDLK_PAGEUP and SDLK_PAGEDOWN are not sequential
They must have separate entries in _vk_mapping
2019-11-10 17:58:42 +00:00
Jonathan G RennisonandCharles Pigott 3db399d7d9 Fix: [SDL2] Detection of backtick scancode
SDL_Keysym::scancode is a SDL_SCANCODE_* constant, not a raw scan code
2019-11-10 17:58:42 +00:00
Jonathan G RennisonandMichael Lutz 2be619ea88 Fix #7820: Heap use after free when removing oil rig 2019-11-03 00:39:38 +01:00
Jonathan G RennisonandCharles Pigott d71a7c21da Fix #7593: Crash in ScriptOrder::GetOrderDistance in VT_AIR mode
Null pointer dereference occurred when either origin_tile or dest_tile
were waypoint tiles.
2019-07-22 20:26:36 +01:00
Jonathan G Rennisonandglx22 b9eb9a4af9 Fix #7594: Max speed rendered incorrectly in road vehicle purchase window when using original acceleration model (#7597)
An incorrect DParam index was used.
2019-05-18 19:31:00 +02:00
Jonathan G RennisonandMichael Lutz 01f957c51f Fix: Crash due to use of invalid iterator in ClientNetworkContentSocketHandler
In particular this crash can be observed when using the
bootstrap GUI to download the base graphics.

In ClientNetworkContentSocketHandler::OnReceiveContentInfo
ClientNetworkContentSocketHandler::callbacks is iterated, using an iterator
cb->OnReceiveContentInfo() is called (cb is of type BootstrapAskForDownloadWindow)
This calls new BootstrapContentDownloadStatusWindow()
This inherits from BaseNetworkContentDownloadStatusWindow
The constructor of which calls _network_content_client.AddCallback(this)
This reallocates the std::vector which is being iterated in ClientNetworkContentSocketHandler::OnReceiveContentInfo
This results in iter being invalid, and an assertion failure occurs shortly
afterwards due to its use in the next iteration of cb->OnReceiveContentInfo()

Adjust all locations where ClientNetworkContentSocketHandler::callbacks
is iterated to avoid problematic behaviour
2019-04-09 22:56:23 +02:00
Jonathan G RennisonandCharles Pigott 1a115e1cc8 Change: Include _current_company in crashlog AI config line
_current_company is not currently logged anywhere in the crashlog.
_local_company is logged, despite being much less useful than
_current_company.
This change logs _current_company alongside _local_company.
2019-03-11 12:47:46 +00:00
Jonathan G RennisonandNiels Martin Hansen 64f1847bec Codechange: [Linkgraph GUI] Replace line visibility detection algorithm
Use an implementation of the Cohen-Sutherland line-clipping algorithm.
The previous algorithm had an excessive false-positive rate.
Line-rendering is sufficiently expensive that using a line-clipping
algorithm with a much lower false-positive rate is a net performance
benefit.
2019-01-28 19:15:21 +01:00
Jonathan G RennisonandPeterN 4b256fed36 Codechange: [Blitter] Adjust line-drawing algorithm to reduce wasted off-screen work
This clips the line segment to be within the screen area prior to pixel iteration.
2019-01-24 11:12:06 +00:00
Jonathan G RennisonandPeterN 0240e90169 Fix: [Blitter] Avoid signed overflow when drawing long lines 2019-01-24 11:12:06 +00:00
Jonathan G RennisonandPeterN db924a4681 Codechange: [Blitter] Change DrawLine to be templated
This is remove per-pixel overheads due to use of the SetPixel virtual
method.
These overheads included:
* expensive virtual method call which prevents inlining
* palette lookup for every pixel
* branch on whether palette animation is enabled on every pixel

Regenerate project files.
2019-01-24 11:12:06 +00:00
Jonathan G RennisonandMichael Lutz df92a056df Fix #6875: Depot building cost does not include foundation build cost (#6883) 2018-08-14 22:05:47 +02:00
Jonathan G RennisonandPatric Stout d839526365 Fix bf8d7df: Script/AI construction of rail track and waypoints (#6881) 2018-08-12 09:45:38 +02:00
Jonathan G RennisonandPatric Stout 6a3d411fa1 Fix: Use after free in CmdBuildTunnel (#6856)
Use after free could occur when when excavating far end
removed multiple NewGRF objects
2018-07-22 21:58:05 +02:00
Jonathan G RennisonandPeterN 8fc1517515 Codechange: detect native Apple clang correctly in config.lib #6773
Fixes: 00c1603256
2018-07-22 15:15:54 +01:00
Jonathan G RennisonandIngo von Borstel 491a884944 Fix: ALL_CARGOTYPES mask constant was 32 instead of 64 bits (#6845)
NUM_CARGO and CargoTypes were increased from 32 to 64 cargoes/bits
respectively in commit 11ab3c4ea2
2018-07-02 22:47:55 +02:00
Jonathan G RennisonandMichael Lutz dc8fff2c4d Add: Hover tool-tips to cargo dest flow legend window.
This is to improve the usability of the window.
The two-letter abbreviations are not always clear, in particular
when using a large number of cargoes.
The company colours can be ambiguous when there are a large
number of companies.
2018-06-24 20:18:10 +02:00
Jonathan G RennisonandMichael Lutz 458bc90678 Fix: Poor contrast in cargo dest flow legend window cargo labels.
Select foreground colour depending on the brightness of the background.

Previously all cargo labels were rendered using black text, even
the background cargo colour was dark/black.
As an example: FIRS coal was black text on a black background.
2018-06-24 19:32:04 +02:00