Commit Graph

23631 Commits

Author SHA1 Message Date
glx
9195f2337a Codechange: use std::vector for _resolutions 2019-04-18 21:49:34 +02:00
glx
25e534f3cf Codechange: use std::vector for _sorted_railtypes 2019-04-18 21:49:34 +02:00
glx
0797de06be Codechange: use std::vector for _sorted_cargo_specs 2019-04-18 21:49:34 +02:00
translators
f0b3267615 Update: Translations from eints
indonesian: 9 changes by fanioz
2019-04-17 19:45:47 +02:00
PeterN
671a310d21
Fix #7235: Ensure catchment area of neutral station covers entire industry. (#7518) 2019-04-16 20:30:07 +01:00
translators
8ae15d9797 Update: Translations from eints
indonesian: 6 changes by fanioz
2019-04-16 19:45:42 +02:00
Michael Lutz
38729297f9 Codechange: No need for AutoFreePtr if there's std::unique_ptr. 2019-04-15 22:52:50 +01:00
Michael Lutz
4e85ccf3c0 Codechange: Replace SmallStackSafeStackAlloc with std::array.
The only port that ever used it to make heap allocations instead of stack ones was the NDS port, which got thrown out some time ago.
2019-04-15 22:52:50 +01:00
stormcone
79343762a4 Fix: Typos. (#7517) 2019-04-15 22:06:41 +02:00
translators
3964604148 Update: Translations from eints
luxembourgish: 1 change by Phreeze
2019-04-15 19:45:42 +02:00
peter1138
4f052fc2a4 Cleanup: Fix alignment after NULL -> nullptr change. 2019-04-13 20:35:10 +01:00
glx
410b81537c Fix 801cbea9c: operator< is not always the best idea
Also removes unused and anyway broken SmallMap::SortByKey() function.
2019-04-13 21:05:25 +02:00
PeterN
3bbd7ea2c1
Fix: Industry coverage area is no longer rectangular. (#7464)
AIs test station catchment in reverse to how players see station catchment.
This did not take account of non-rectangular station catchment areas, so AIs
could end up placing stations in locations that did not accept/deliver cargo.
2019-04-13 14:27:57 +01:00
PeterN
abe8cf4985
Codechange: Replace duplicated code with TileArea::Expand() (#7467) 2019-04-13 14:12:34 +01:00
glx
801cbea9cc Codechange: use std::sort() for all std::vector types 2019-04-13 12:49:18 +01:00
glx
5b77102b63 Codechange: use std::sort() to sort file lists 2019-04-13 12:49:18 +01:00
glx
b52561fd38 Codechange: use std::sort() in EngList_Sort[Partial]() 2019-04-13 12:49:18 +01:00
glx
2db88953e7 Codechange: use std::sort() in GUIList 2019-04-13 12:49:18 +01:00
PeterN
b9b34f676b
Change: Always report error when ordering a road vehicle to wrong type of road stop. (#7316)
This was inconsistent before, depending on road/tram and articulated/single vehicle status.
2019-04-13 12:43:49 +01:00
peter1138
5bd2b15e86 Codechange: Replace NULL with nullptr in squirrel interface. 2019-04-11 22:42:11 +01:00
peter1138
c0836bccef Codechange: NULL -> nullptr in settings files. 2019-04-11 13:00:55 +01:00
peter1138
0130f3be45 Fix #7491: Send company update admin message when bankruptcy counter changes. 2019-04-11 13:00:25 +01:00
SamuXarick
4ad981a98e Fix 50e08f333a: Creating a cargo subsidy with town as source did not consider min population. (#7493) 2019-04-11 07:35:46 +01:00
Henry Wilson
7c8e7c6b6e Codechange: Use null pointer literal instead of the NULL macro 2019-04-10 23:22:20 +02:00
glx22
3b4f224c0b
Fix #7494: std::sort() and qsort() use different comparators (#7495) 2019-04-10 20:55:53 +02:00
translators
87d588f22f Update: Translations from eints
luxembourgish: 17 changes by Phreeze
spanish (mexican): 2 changes by njn
2019-04-10 19:45:43 +02:00
Jonathan G Rennison
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
Michael Lutz
8b1880187a Remove: AutoFreeSmallVector.
The last use was for storing a list of memory blocks. As the way these lists are accessed is very
specific, it is easier to just write an explicit destructor instead of trying to exactly match the behaviour.
2019-04-09 22:45:15 +02:00
Michael Lutz
e804173595 Codechange: If something is a vector of strings, use a vector of strings instead of an AutoFreeSmallVector. 2019-04-09 22:45:15 +02:00
Michael Lutz
c7b9987d08 Codechange: Switch DropDownList to directly use std::vector, thus making AutoDeleteSmallVector obsolete.
DropDownListItem are strongly managed using std::unique_ptr to ensure leak-free handling. Appropriate use
of move-semantics make intent a lot clearer than parameter comments and allows the compiler to generate
copy-free code for most situations.
2019-04-09 22:45:15 +02:00
Michael Lutz
d3e113eb5f Codechange: Use std::vector instead of AutoDeleteSmallVector in GS text handling. 2019-04-09 22:45:15 +02:00
Michael Lutz
baf9229931 Codechange: Replace AutoDeleteSmallVector with direct std::vector use in text layout code. 2019-04-09 22:45:15 +02:00
Michael Lutz
329bb52613 Codechange: Store text layout runs directly as values in a std::vector instead of heap allocated.
This reduces memory allocations and heap fragmentation.
2019-04-09 22:45:15 +02:00
Michael Lutz
9325d63d8e Fix: Forgotten override keywords for DropDownListIconItem. 2019-04-09 22:45:15 +02:00
Michael Lutz
fbc4cef180 Codechange: Use override specifier for text layout classes. 2019-04-09 22:45:15 +02:00
Michael Lutz
d95c7083ea Fix: Don't crash if reading a GS string file from disk produces an error.
The raw_strings vector may not include NULLs as no consumer can deal with it.
2019-04-09 22:45:15 +02:00
translators
0a883afe19 Update: Translations from eints
luxembourgish: 20 changes by Phreeze
2019-04-09 19:45:42 +02:00
PeterN
812886ca61
Fix #7478: Don't remove NewGRF objects on company take-over. (#7483) 2019-04-08 19:20:43 +01:00
kiwitreekor
bc9b47d2e5 Fix #6222: Advanced sprite layout sometimes showed incorrect railtype ground tile 2019-04-08 18:41:07 +01:00
glx22
3e608afa6c
Fix: [Windows] OpenTTD window may be inactive when an error happens (#7482) 2019-04-07 21:52:30 +02:00
Michael Lutz
967b27a2c1 Codechange: C++11 STL has a function for getting the number of CPU cores. 2019-04-06 11:27:39 +02:00
Michael Lutz
ae748166d0 Codechange: Use platform independent C++11 function for sleeping on a thread. 2019-04-06 11:27:39 +02:00
Michael Lutz
94c5269fa7 Codechange: Use atomic variables for thread synchronization where useful. 2019-04-06 11:27:39 +02:00
Michael Lutz
05bc2ed7cb Codechange: Replace custom thread code with C++11 thread objects.
We assume a conforming C++11 compiler environment that has a valid <thread>-header.
Failure to run a real thread is handled gracefully.
2019-04-06 11:27:39 +02:00
Michael Lutz
05f4e73608 Codechange: Replace custom mutex code with C++11 mutex'es.
A conforming compiler with a valid <mutex>-header is expected.
Most parts of the code assume that locking a mutex will never fail unexpectedly,
which is generally true on all common platforms that don't just pretend to
be C++11. The use of condition variables in driver code is checked.
2019-04-06 11:27:39 +02:00
Michael Lutz
3b86f54fc7 Fix: [OSX] .mm files are C++ files, not C files. 2019-04-06 11:27:39 +02:00
glx22
90a91f1d0d
Fix: [MSVC] don't force SDK version (#7474) 2019-04-05 21:07:06 +02:00
glx22
a1e492d0d8
Fix #7439: don't overwrite CompanyRemoveReason with ClientID (#7465) 2019-04-05 15:11:52 +02:00
Samu
fb6e31ca43 Cleanup 3f32711: Don't apply forbid 90 deg turn settings for ships. 2019-04-05 10:03:54 +01:00
peter1138
8114bad033 Fix #7469: Desync when using build and refit feature. 2019-04-04 23:29:43 +01:00