Commit Graph

16638 Commits

Author SHA1 Message Date
Charles Pigott bb7353c02a Codechange: Some more null checks 2018-10-31 12:41:49 +01:00
Charles Pigott 1778b2d66e Codechange: Merge some duplicated functions 2018-10-31 12:41:49 +01:00
Charles Pigott ca5f73b196 Codechange: Turn a define into a constant 2018-10-31 12:41:49 +01:00
Charles Pigott b5028efc1f Fix: Protect against a few out of bounds or uninitialised usage errors 2018-10-31 12:41:49 +01:00
Charles Pigott 52ed3bcbaa Remove: A few bits of dead code 2018-10-31 12:41:49 +01:00
Charles Pigott e0c0394e37 Fix: Remove various dead or unnecessary assignments 2018-10-31 12:41:49 +01:00
Charles Pigott f5b1115039 Doc: Lots and lots of doxymentation fixes 2018-10-31 12:35:54 +01:00
Niels Martin Hansen f3dbb3f676 Fix #6951: Ensure RailTypes bitfield is always treated as 64 bit
Some compilers (like VC++ 2015) will otherwise narrow it in some contexts where it should not be.
2018-10-30 21:46:28 +01:00
Niels Martin Hansen 350395a6c2 Fix: Missing m8 data in console when using Query tool
When map array 8 was added, the Query tool wasn't updated to also
print the value there to the console, in debug builds.
2018-10-30 16:33:07 +01:00
Niels Martin Hansen 50efaa2372 Fix e00908f: Visual C++ 2015 compile error
Microsoft Visual C++ 2015 Update 3 (and possibly other versions) consider a struct member undefined in a
static_assert in the struct body. Moving the static_assert to a member function solves the issue.
2018-10-27 10:30:24 +02: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
translators 47ff673664 Update: Translations from eints
finnish: 25 changes by ln
2018-10-26 19:45:42 +02:00
Samu eff09c43cd Fix #4109: Add more water checks to the Oil Rig layout
Prevents Oil Rig docking tile from becoming unreachable by ships when spawning next to each other.
2018-10-25 20:09:42 +02:00
translators bddf25c36a Update: Translations from eints
portuguese (brazilian): 66 changes by Tucalipe
2018-10-23 19:45:44 +02:00
Miguel Horta 42b00c3b39 Fix #6938: Don't change company value to perform cost estimations (#6939)
These meddling kids dared to play with magic, but the ancients texts
weren't ready for that.
Refactors logic to estimate costs that dated to even before OpenTTD 0.1;
2018-10-13 13:34:57 +02:00
Miguel Horta e00908f5e9 Fix #6898: Replace atoi() with strtoul()
Normalize type and parsing of generation_seed across all files
Add assert_compile() to ensure correct type
2018-10-11 20:22:31 +01:00
translators fbfa4eb592 Update: Translations from eints
polish: 3 changes by xaxa
2018-10-08 19:45:44 +02:00
translators 9cf999bca7 Update: Translations from eints
korean: 2 changes by telk5093
2018-10-03 19:45:41 +02:00
translators 8a70101e7f Update: Translations from eints
vietnamese: 63 changes by myquartz
2018-10-02 19:45:40 +02:00
translators 25a060b4ae Update: Translations from eints
vietnamese: 2 changes by myquartz
2018-10-01 19:45:43 +02:00
Johannes E. Krause 662dcc3c31 Fix #6920: Make 9.8m/s^2 a common constant for TE-calculation 2018-09-30 20:45:41 +02:00
translators 060248a422 Update: Translations from eints
spanish (mexican): 2 changes by Absay
2018-09-24 19:45:43 +02:00
Stefan Strogin fec44b0d09 Fix #6854: Compilation with ICU 62 (#6912) 2018-09-20 22:36:45 +02:00
SamuXarick 41fb7cb15e Fix #6892: [Script] CONFIG_RANDOM did not use the full parameter range (#6902) 2018-09-20 22:31:38 +02:00
translators 59a1614ba0 Update: Translations from eints
czech: 27 changes by djst
croatian: 1 change by VoyagerOne
italian: 1 change by lorenzodv
2018-09-19 19:45:44 +02:00
Max Maton eed0da60a2 Fix #6622: Fixes empty company name in news when gamescript constructs a town 2018-09-18 18:35:26 +02:00
Samuel Cochran 1a73c39838 Add: BACKSPACE can be mapped as a hotkey 2018-09-16 11:36:25 +02:00
Charles Pigott ca5b68145a Fix #6839: OLD_GM_DIR midi search path got lost (#6900) 2018-09-12 09:19:06 +02:00
translators 94961732a3 Update: Translations from eints
basque: 4 changes by Thadah
2018-09-07 19:45:44 +02:00
translators 8137d14d33 Update: Translations from eints
russian: 1 change by Lone_Wolf
2018-09-06 19:45:43 +02:00
Niels Martin Hansen bb086f9240 Fix: Better "temp" path for decoded MPSMIDI files when source filename has no path separators 2018-09-03 21:57:04 +02:00
Niels Martin Hansen 560b01f307 Fix: Check the search paths for standard MIDI files 2018-09-03 21:57:04 +02:00
Michael Lutz 4b0b4e0643 Feature: [NewGRF] Increase size of persistent storage to 256. 2018-09-02 21:31:15 +02:00
frosch 6391d49277 Fix: Variable 0x85 had no bounds checks. 2018-09-02 21:15:54 +02:00
translators 703e7f8fc7 Update: Translations from eints
spanish (mexican): 1 change by Absay
2018-08-17 19:45:42 +02:00
Jonathan G Rennison df92a056df Fix #6875: Depot building cost does not include foundation build cost (#6883) 2018-08-14 22:05:47 +02:00
Jonathan G Rennison d839526365 Fix bf8d7df: Script/AI construction of rail track and waypoints (#6881) 2018-08-12 09:45:38 +02:00
translators 50d930298d Update: Translations from eints
croatian: 1 change by VoyagerOne
2018-08-11 19:45:42 +02:00
translators a53e4d8fe5 Update: Translations from eints
dutch: 137 changes by mrLeopold
2018-08-09 19:45:42 +02:00
translators 27c4f5517f Update: Translations from eints
dutch: 115 changes by mrLeopold
2018-08-08 19:45:45 +02:00
translators 004f54f4c8 Update: Translations from eints
hebrew: 23 changes by dnd_man
french: 45 changes by glx
2018-08-07 19:45:41 +02:00
translators b34a1f372f Update: Translations from eints
italian: 1 change by lorenzodv
2018-08-04 19:45:41 +02:00
J0an Josep 67f6bcdc9b Fix #6805: Update CmdBuilRailWaypoint bits. 2018-08-04 08:59:22 +02:00
J0an Josep a53f13cff6 Fix #6805: Clear some m8 bits when making some tiles. 2018-08-04 08:59:22 +02:00
ScumbagDog 16cf577b61 Feature: Added New Russian Ruble as currency (#6678) 2018-08-04 08:58:50 +02:00
translators 76f788124b Update: Translations from eints
latvian: 8 changes by krixis02
2018-08-03 19:45:40 +02:00
translators 4bd281cef3 Update: Translations from eints
korean: 44 changes by telk5093
2018-07-30 19:45:41 +02:00
Niels Martin Hansen 9627577596 Fix: HouseSpec::watched_cargoes not 64 bit
Looks like HouseSpec::watched_cargoes was missed in the conversion to 64 cargo types.
2018-07-29 17:12:56 +02:00
translators 64dac65e20 Update: Translations from eints
spanish (mexican): 1 change by Absay
2018-07-28 19:45:41 +02:00
translators b885f62676 Update: Translations from eints
croatian: 44 changes by VoyagerOne
polish: 6 changes by xaxa
2018-07-26 19:45:41 +02:00
Peter Nelson bf8d7df736 Change: Extend rail types to 64 (6 bit storage) 2018-07-26 13:27:40 +01:00
Peter Nelson 5db883fbe9 Change: Move rail type bits from m3 to m8. 2018-07-26 13:27:40 +01:00
Peter Nelson 65548c37a8 Change: Extend map array by 2 bytes with a uint16. 2018-07-26 13:27:40 +01:00
translators 8090580f77 Update: Translations from eints
spanish (mexican): 25 changes by Absay
2018-07-25 19:45:41 +02:00
glx a4eccd8076 Fix: dmusic compilation with MSYS2/MINGW 2018-07-24 21:39:21 +02:00
J0an Josep 8975318286 Fix 2a868b9f3b8e3b5f8b9e5f728f628ec88fd5e3ad: Expose widgets and windows to scripts and fix documentation. 2018-07-23 20:32:18 +02:00
translators 0bca1c53c9 Update: Translations from eints
spanish (mexican): 19 changes by Absay
2018-07-23 19:45:41 +02:00
Jonathan G Rennison 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
translators 38443bab0b Update: Translations from eints
catalan: 2 changes by juanjo
russian: 9 changes by Lone_Wolf
2018-07-22 19:45:41 +02:00
translators 2f5cb9e4fc Update: Translations from eints
catalan: 63 changes by juanjo
2018-07-21 19:45:40 +02:00
translators 6a6ffddc5f Update: Translations from eints
greek: 46 changes by kyrm
italian: 44 changes by lorenzodv
2018-07-20 19:45:40 +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
Charles Pigott 63898f61b0 Codechange: Rearrange struct packing defines and make MinGW use _Pragma pack style 2018-07-19 20:24:17 +02:00
translators 93469a92f2 Update: Translations from eints
korean: 3 changes by kevinhigh
2018-07-18 19:45:40 +02:00
translators 3014213186 Update: Translations from eints
malay: 11 changes by eidan_shafie
2018-07-17 19:45:39 +02:00
translators f70544074c Update: Translations from eints
latin: 19 changes by Supercheese
english (us): 19 changes by Supercheese
2018-07-11 19:45:41 +02:00
translators 85ef5acf29 Update: Translations from eints
malay: 10 changes by eidan_shafie
spanish (mexican): 9 changes by Absay
2018-07-10 19:45:40 +02:00
translators ae13f88c12 Update: Translations from eints
malay: 9 changes by eidan_shafie
2018-07-09 19:45:37 +02:00
translators 8bbf06e0d4 Update: Translations from eints
belarusian: 7 changes by KorneySan
russian: 7 changes by Lone_Wolf
2018-07-08 19:45:37 +02:00
translators 5a11c6a036 Update: Translations from eints
russian: 6 changes by Lone_Wolf
2018-07-07 19:45:37 +02:00
Ingo von Borstel 88b77a7883
Fix #6844: Compile warning when compiling dedicated server (#6849) 2018-07-07 18:48:17 +02:00
translators 2ed0e30a8f Update: Translations from eints
malay: 37 changes by eidan_shafie
2018-07-05 19:45:41 +02:00
translators f86dc6867e Update: Translations from eints
serbian: 37 changes by Srbija
2018-07-04 19:45:39 +02:00
translators 210afa3701 Update: Translations from eints
serbian: 23 changes by Srbija
greek: 6 changes by Jubilee
russian: 1 change by Lone_Wolf
danish: 7 changes by filli1303
finnish: 21 changes by ln
2018-07-03 19:45:42 +02:00
Jonathan G Rennison 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
translators 4a35409e0f Update: Translations from eints
italian: 1 change by lorenzodv
2018-07-02 19:45:39 +02:00
translators 8f278b3405 Update: Translations from eints
croatian: 4 changes by VoyagerOne
2018-07-01 19:45:40 +02:00
Niels Martin Hansen 6cf4d7d3ef Fix: Put last SVN revision back in NewGRF version number (#6843)
This is necessary to be compatible with some Game Scripts that might trigger compatibility modes if the SVN revision part is wrong. Potentially some NewGRFs might also be affected.

See for example [SuperLib's Helper class](https://dev.openttdcoop.org/projects/superlib/repository/entry/helper.nut#L280), containing this function:

    function _SuperLib_Helper::HasWorldGenBug()
    {
    	local version = _SuperLib_Helper.GetOpenTTDVersion();
    
    	if (version.Major == 0 || (version.Major == 1 && version.Minor <= 3)) {
    		return version.Revision < 25339;
    	} else {
    		return version.Revision < 25305;
    	}
    }

If this function sees a Revision value of zero, it might trigger a workaround not required, causing a regression in scripts dependent on this. The MinimalGS example, for one, will trigger this.
2018-07-01 12:15:00 +02:00
J0anJosep 4189cb85ba Codechange: Use HasTracks with TrackStatus. 2018-06-27 23:14:30 +02:00
J0anJosep d01c09fb73 Codechange: Use HasTrack(dir) to improve code readability. 2018-06-27 23:14:30 +02:00
J0anJosep 31ac11bddb Codechange: Increase readability of track functions and pathfinders. 2018-06-27 23:14:30 +02:00
Juanjo 85ebe20a76 Cleanup: Unnecessary assignation on FollowTileExit(): done previously on the function. 2018-06-27 23:14:30 +02:00
Juanjo 6a9df285d0 Codechange: Separate an assertion. More information if assert is triggered. 2018-06-27 23:14:30 +02:00
Charles Pigott 2aacddd412 Codechange: lengthof is not defined for runtime-length strings, use sizeof instead 2018-06-27 22:54:46 +02:00
Charles Pigott 5f86e1a390 Codechange: Silence -Wclass-memaccess warnings with GCC8 2018-06-27 22:54:46 +02:00
Charles Pigott e1b9187e9b Codechange: Add initialisation values for all CompanyProperty attributes 2018-06-27 22:54:46 +02:00
Michael Lutz dbfc417e65 Fix: [Win32] Garbage in OS window title if branch name was too long.
This was caused by a missing \0-character on reaching the buffer limit.
2018-06-27 22:16:43 +02:00
translators 6c02c19931 Update: Translations from eints
italian: 3 changes by lorenzodv
2018-06-27 19:45:41 +02:00
PeterN 11ab3c4ea2
Change: Increase cargo type limit to 64. 2018-06-26 13:32:58 +01:00
translators 7eca4a9b47 Update: Translations from eints
french: 5 changes by glx
2018-06-25 19:45:40 +02:00
Niels Martin Hansen 336d6cab68 Fix 6298b96: Playlist window not drawing playlist
Copy-paste error in change to remove C++11 usage...
2018-06-25 00:00:56 +02:00
Pavel Stupnikov 9fc3212679 Feature #6397: Keep town growth rate in sync with house count
Takes some code and ideas from #6378 patch, but doesn't change anything GS-related.
2018-06-24 20:55:48 +02:00
Jonathan G Rennison 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
Niels Martin Hansen 6298b96571 Change: Modernise music control logic implementation (#6839)
Rewrite of almost the entire music control logic to a more modern style, hopefully also easier to understand. The old playlist handling made it look like arcane magic, which it doesn't have to be.

- Playlists are now stored in std::vector of objects instead of arrays of bytes with magic sentinel values, that need to be rotated around all the time. Position in playlist is stored as a simple index.
- The theme song is now reserved for the title screen, it doesn't play on any of the standard playlists, but is still available for use on custom playlists.
- When the player enters/leaves the game from the main menu, the music always restarts.
- Playback state (playing or not) is kept even if music becomes unavailable due to an empty playlist (or an empty music set), so it can restart immediately if music becomes available again.
- The shuffle algorithm was changed to a standard Fisher-Yates.
- Possibly better behavior when editing a custom playlist while it's playing.
- Custom playlists should be compatible.
- Framework for supporting custom playlists with songs from multiple music sets.
2018-06-24 20:06:05 +02:00
translators 889175f7ad Update: Translations from eints
croatian: 1 change by VoyagerOne
italian: 1 change by lorenzodv
french: 1 change by glx
2018-06-24 19:45:46 +02:00
Jonathan G Rennison 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
Alberth 7fed8fe004 Fix #6553: Make viewport button text unambiguous. 2018-06-24 15:03:06 +02:00
Niels Martin Hansen 4fb76db42f Feature #986: Automatic save when losing connection to a network game 2018-06-23 15:22:31 +02:00
Alberth289346 11ba094582 Feature #4186: Append '(City)' behind cities in the town directory (sbr) 2018-06-23 14:02:50 +02:00
Alberth 1a5a95aa49 Fix: Make switch on MD5File::ChecksumResult complete to avoid compiler warning 2018-06-23 14:00:41 +02:00