1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-12 17:19:09 +00:00

Compare commits

..

1863 Commits

Author SHA1 Message Date
Patric Stout
80ebcc72fb Change: rebrand Cheats as Sandbox Options (#11874) 2024-01-26 19:56:01 +01:00
Tyler Trahan
28716548d2 Feature: Setting to automatically restart server based on hours played (#11142) 2024-01-26 10:25:25 -05:00
Patric Stout
37fd69b604 Remove: [CI] Linux Legacy support (#11882)
Although created not long ago, you battled to be relevant.
Sadly, GitHub Runners didn't agree with you.
You can't run node20.
And that makes you a broken legacy.
So many potential.
But here we are. Bye Linux Legacy. Thank you for being.
2024-01-25 23:24:43 +01:00
Loïc Guilloux
09b66751cf Fix b38d3c2208: missing water regions invalidation when building locks (#11879) 2024-01-25 22:18:26 +00:00
dependabot[bot]
62d7d92a0e Upgrade: [CI] bump the actions group with 9 updates (#11881)
Bumps the actions group with 9 updates:

| Package | From | To |
| --- | --- | --- |
| [actions/checkout](https://github.com/actions/checkout) | `3` | `4` |
| [actions/cache](https://github.com/actions/cache) | `3` | `4` |
| [actions/github-script](https://github.com/actions/github-script) | `6` | `7` |
| [OpenTTD/actions](https://github.com/openttd/actions) | `2` | `5` |
| [github/codeql-action](https://github.com/github/codeql-action) | `2` | `3` |
| [actions/download-artifact](https://github.com/actions/download-artifact) | `3` | `4` |
| [actions/upload-artifact](https://github.com/actions/upload-artifact) | `3` | `4` |
| [tibdex/github-app-token](https://github.com/tibdex/github-app-token) | `1` | `2` |
| [peter-evans/repository-dispatch](https://github.com/peter-evans/repository-dispatch) | `2` | `3` |

Updates `actions/checkout` from 3 to 4
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3...v4)

Updates `actions/cache` from 3 to 4
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](https://github.com/actions/cache/compare/v3...v4)

Updates `actions/github-script` from 6 to 7
- [Release notes](https://github.com/actions/github-script/releases)
- [Commits](https://github.com/actions/github-script/compare/v6...v7)

Updates `OpenTTD/actions` from 2 to 5
- [Release notes](https://github.com/openttd/actions/releases)
- [Commits](https://github.com/openttd/actions/compare/v2...v5)

Updates `github/codeql-action` from 2 to 3
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/v2...v3)

Updates `actions/download-artifact` from 3 to 4
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](https://github.com/actions/download-artifact/compare/v3...v4)

Updates `actions/upload-artifact` from 3 to 4
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v3...v4)

Updates `tibdex/github-app-token` from 1 to 2
- [Release notes](https://github.com/tibdex/github-app-token/releases)
- [Commits](https://github.com/tibdex/github-app-token/compare/v1...v2)

Updates `peter-evans/repository-dispatch` from 2 to 3
- [Release notes](https://github.com/peter-evans/repository-dispatch/releases)
- [Commits](https://github.com/peter-evans/repository-dispatch/compare/v2...v3)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions
- dependency-name: actions/cache
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions
- dependency-name: actions/github-script
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions
- dependency-name: OpenTTD/actions
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions
- dependency-name: actions/download-artifact
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions
- dependency-name: tibdex/github-app-token
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions
- dependency-name: peter-evans/repository-dispatch
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-25 21:22:33 +00:00
Patric Stout
cd75adfb71 Add: [Dependabot] introduce Dependabot to keep our workflows up-to-date (#11880) 2024-01-25 21:10:38 +01:00
Patric Stout
36579dd18b Change: set smooth-scrolling on by default (#11860) 2024-01-25 11:07:36 +01:00
Patric Stout
ea8c1d8597 Change: make for smooth-scrolling based on actual time
This means if rendering takes a bit longer, scrolling goes a bit
quicker, making travel time always about the same time for the
same distance.
2024-01-25 10:29:48 +01:00
Jonathan G Rennison
cbb24b5d71 Codechange: Split bit numbers from values in RailTypeFlags, RoadTypeFlags enums (#11877) 2024-01-24 22:24:34 +01:00
Tyler Trahan
21581b6ab3 Feature: Setting for minutes per calendar year (#11428) 2024-01-23 18:33:54 -05:00
translators
be8ed26db6 Update: Translations from eints
norwegian (nynorsk): 5 changes by translators
slovenian: 5 changes by translators
faroese: 5 changes by translators
hebrew: 5 changes by translators
afrikaans: 5 changes by translators
urdu: 5 changes by translators
persian: 5 changes by translators
bulgarian: 5 changes by translators
belarusian: 5 changes by translators
basque: 5 changes by translators
russian: 23 changes by Ln-Wolf
finnish: 1 change by hpiirai
malay: 5 changes by translators
scottish gaelic: 5 changes by translators
croatian: 5 changes by translators
latin: 5 changes by translators
french: 49 changes by glx22, 8 changes by ottdfevr
portuguese (brazilian): 80 changes by pasantoro
icelandic: 5 changes by translators
2024-01-23 18:40:53 +00:00
Tyler Trahan
fd9e72a7e7 Feature: Use real-time "wallclock" timekeeping units (#11341) 2024-01-23 11:36:09 -05:00
Tyler Trahan
bbdbf9a589 Add: AI/GS Time Mode to choose between economy (default) and calendar time (#11603) 2024-01-23 10:42:10 -05:00
Patric Stout
a1487ce620 Add: list_[scenario|heightmap] and load_[scenario|height] console commands (#11867) 2024-01-23 14:01:25 +01:00
Tyler Trahan
76499b96fb Fix fa479c4: Typo in vehicle list tooltip (#11871) 2024-01-22 23:17:26 +00:00
Patric Stout
090616b4c9 Add: allow loading heightmaps from command-line (#11870)
If you want to load a file from tar, you have to give the file
inside the tar in order for it to work:

<tar-file>/<dir-in-tar>/<file>.png
2024-01-22 22:35:25 +00:00
Kuhnovic
bf3fd6526b Fix: use correct size parameter type in TileArea constructors (#11869) 2024-01-22 22:06:42 +00:00
Patric Stout
11d4f1b2bd Fix d3b2a576: LOAD_HEIGHTMAP / LOAD_SCENARIO are Scenario Editor modes (#11868) 2024-01-22 21:28:00 +00:00
Patric Stout
d3b2a576de Feature: Plugin framework for Social Integration with Steam, Discord, GOG, etc (#11628) 2024-01-22 19:22:45 +00:00
Patric Stout
75f21065c9 Codechange: refactor DecodeHexText to a generic purpose ConvertHexToBytes (#11866)
DecodeHexText() does more than just decoding hex. ConvertHexToBytes()
now only does pure hex decoding. This required a bit of refactoring
for the code using DecodeHexText().
2024-01-22 19:42:47 +01:00
translators
786cc85e86 Update: Translations from eints
english (au): 155 changes by krysclarke
norwegian (bokmal): 9 changes by v0nNemizez
english (us): 155 changes by 2TallTyler
chinese (simplified): 9 changes by WenSimEHRP
russian: 41 changes by Ln-Wolf
finnish: 1 change by hpiirai
2024-01-22 18:40:42 +00:00
Tyler Trahan
735abfe111 Codechange: Split dates and timers into Economy and Calendar time (#10700) 2024-01-22 09:04:34 -05:00
EmperorJake
419f48dfb3 Change: set amount of smoke/sparks to "realistic" by default (#11624) 2024-01-21 21:23:35 +00:00
Kuhnovic
b38d3c2208 Change: simplified water region evaluation, removed savegame data (#11750) 2024-01-21 20:56:50 +00:00
Patric Stout
1985e7415b Fix: smooth-scrolling large distances didn't got smoothly in one direction (#11861) 2024-01-21 20:52:44 +00:00
c7d5cedc7b Codechange: Replace C-style TICC/TOCC macros with C++ RAII implementation. (#11857)
Usage is more robust, and will always include timing when the TicToc object goes out of scope.
2024-01-21 18:38:40 +00:00
691c628b07 Codechange: Use named initialization for unscaled WidgetDimensions. (#11859)
Remove now-unused WD_* enums.
2024-01-21 18:10:49 +00:00
Patric Stout
0c81579363 Fix #6377: two tarballs with the same folder in them were considered as one (#11855) 2024-01-21 19:06:58 +01:00
SamuXarick
6588680ccc Revert #6923: start_date parameter is no longer in use
There was an issue with the start_date parameter for AIs. It did not let Random AIs to have their configure button clickable once the game has started, and this was due to the start_date not being pushed into the config.

But now that start_date is no longer in use since #10653, this workaround can be safely removed.
2024-01-21 18:49:08 +01:00
Patric Stout
f35e257adc Fix #9722: create vital windows as soon as local_company is set (#11858)
Many places use local_company to detect whether world generation is
done, and blindly assume all vital windows exists when local_company
is set.
2024-01-21 17:36:33 +00:00
a9a0bfffc1 Change: Disable building rail infrastructure if train build limit is zero. (#11847)
This matches the behaviour of road, ship and aircraft infrastructure.
2024-01-21 16:51:23 +00:00
89474701bc Codechange: Use templates to deduplicate goal widgets. (#11852) 2024-01-21 16:23:17 +00:00
Patric Stout
fa8294ebe7 Remove: rdtsc and TIC/TOC based on CPU ticks (#11856)
Use TIC/TOC based on std::chrono instead. This information is also
easier to compare with others, as although it depends on CPU, it
means a bit more if "yours takes 4ms and mine takes 10ms".
2024-01-21 15:38:15 +00:00
Patric Stout
fe035c306e Codechange: prevent out-of-bound read (even if the result is never used) (#11853) 2024-01-21 14:25:00 +00:00
8797cc7ef2 Codechange: Replace GroupStatistics' num_engines with std::map. (#11849)
This removes manual memory management with calloc/free calls, and prevents potentially large arrays being allocated for each group.
2024-01-21 14:09:44 +00:00
c0ab436077 Codechange: Store Colours in Colours type. (#11625)
This reduces casts, some magic numbers, and introduces a bit of type-safety.
2024-01-21 13:23:04 +00:00
0841978304 Codechange: Use vector and iterators to store old/new vehicles during autoreplace. (#11851)
This avoids malloc/free of 3 arrays along index counting, and the data for each part is kept together.
2024-01-21 09:21:22 +00:00
Patric Stout
66a16d5ddf Fix: [CI] wait for all targets to succeeded before uploading to any (#11845)
Otherwise it is possible Steam upload happens while CDN upload
does not, which is a bit awkward.
2024-01-20 23:51:50 +00:00
Patric Stout
526a0db956 Fix: [CI] don't share Rust cache between legacy and generic linux (#11848)
The resulting binaries of generic can't run on legacy.
2024-01-20 22:05:56 +00:00
Rubidium
2d77f09a81 Codechange: use std::shared_ptr for vector of TCPConnecters 2024-01-20 23:03:44 +01:00
Patric Stout
71b8801b61 Fix bd85f61a: [Linux] don't include sys/random.h on older glibc systems (#11844) 2024-01-20 20:43:06 +00:00
Tyler Trahan
fa479c4a7c Cleanup: Describe modifier keys more consistently in tooltips (#11716) 2024-01-20 19:26:39 +00:00
Tyler Trahan
500870627d Change: Rewrite a few main toolbar tooltips (#11717) 2024-01-20 13:49:34 -05:00
translators
4d79d86812 Update: Translations from eints
catalan: 18 changes by J0anJosep
2024-01-20 18:38:38 +00:00
d6ccfdbbd9 Fix #11827: Make Layouter::GetCharPosition() aware of ligatures. (#11831)
When ligatures happen the precise individual character position is not known, so instead return the previous position (which is that of the ligature.)
2024-01-20 17:16:42 +00:00
Rubidium
086cbd0d72 Codechange: add constexpr to math functions where applicable 2024-01-20 17:30:36 +01:00
Rubidium
dfe70181f1 Codechange: add constexpr to bitmath functions where applicable 2024-01-20 17:30:36 +01:00
Rubidium
4c51534b6a Remove: LeastCommonMultiple / GreatestCommonDivisor
Use std::lcm / std::gcd instead.
2024-01-20 16:45:21 +01:00
Rubidium
1403f24fa9 Codechange: replace LeastCommonMultiple with std::lcm 2024-01-20 16:45:21 +01:00
Patric Stout
bd85f61a40 Change: use a stronger hash and actual random information to generate Uids 2024-01-20 14:23:03 +01:00
Patric Stout
37244bc8c5 Codechange: MacOS already has MIN/MAX macros defined
This is caused because we use PreCompile Headers, and one of them
includes a system headers which defines MIN/MAX.
2024-01-20 14:23:03 +01:00
Patric Stout
63a3d56b8a Add: monocypher 4.0.2
Monocypher will take care of all our encryption needs; as most
OSes and vcpkg doesn't have it available, we vendor it.
2024-01-20 14:23:03 +01:00
Rubidium
6b21368bc2 Codechange: replace FIND_FIRST_BIT/FindFirstBit2x64 with FindFirstBit 2024-01-19 21:10:39 +01:00
Rubidium
8faaedeff9 Codechange: replace hand written function to find first/last bit with C++ variant 2024-01-19 21:10:39 +01:00
903119115b Fix 9602de4: FinaliseCargoArray did nothing. (#11839)
`CargoSpec::Iterate()` deliberately skips invalid cargo types, but `FinaliseCargoCarry()` is only interested in them.
2024-01-19 20:07:47 +00:00
translators
db7697bcdf Update: Translations from eints
chinese (simplified): 22 changes by WenSimEHRP
romanian: 37 changes by bnegrut
2024-01-19 18:40:43 +00:00
9cf47af490 Change: Invalidate music volume when restarting music playback on Windows. (#11836) 2024-01-19 17:01:36 +00:00
6a2c37b4ed Fix 09f585b: Crash if font name ends with comma or comma and whitespace on Linux. (#11838) 2024-01-19 08:03:32 +00:00
Rubidium
1c694e433d Codechange: use std::popcount instead of hand written loop 2024-01-19 06:48:55 +01:00
ae575a7a5b Codechange: Store text run positions in vector of points.
This simplifies the interlaced vector of x/y positions.
2024-01-19 00:08:31 +00:00
f7cc88f370 Codechange: Return vector references instead of pointer to first item. 2024-01-19 00:08:31 +00:00
Rubidium
2f8de227dc Remove: unused OTTD_ALIGNMENT define and ReadLE16(Un)aligned 2024-01-18 23:29:15 +01:00
Rubidium
ee00c7b159 Codechange: use TO_LE16 directly when reading language file offsets 2024-01-18 23:29:15 +01:00
translators
32b99bf77c Update: Translations from eints
portuguese: 4 changes by azulcosta
2024-01-18 18:40:14 +00:00
Loïc Guilloux
bf4b669628 Fix: [Script] Improve ScriptText validation (#11721)
The validation is now done in two steps:
 - First we get the list of parameters in the same order they used to be in encoded string
 - Then we validate the parameter types like FormatString would use them while encoding the string
2024-01-18 18:06:30 +01:00
28ef5146ba Fix #11646: Non-thread safe shared buffer returned from GetLogPrefix().
Return string from GetLogPrefix instead of shared string's buffer.
2024-01-18 17:40:25 +01:00
Patric Stout
2b599c9d00 Fix: [HarfBuzz] make HarfBuzz use the same glyphs as we render 2024-01-18 10:41:01 +01:00
Patric Stout
a24c2bf10a Codechange: [HarfBuzz] hb-ft will set the scaling on its own 2024-01-18 10:41:01 +01:00
7faa3848de Change: Mark whole screen dirty when toggling font AA. (#11825) 2024-01-17 23:04:07 +00:00
Rubidium
4cc97e04e6 Fix #11801, 51f1e93: CalcClosestTownFromTile needs the kd-tree to be valid 2024-01-17 23:40:19 +01:00
0be26f5856 Change: Remove extra padding from query text. (#11823)
This window uses 'modalpopup' padding so does not need extra padding on its text.
2024-01-17 22:17:14 +00:00
Rubidium
47c0184a0b Codechange: replace ROR/ROL with std::rotr/rotl 2024-01-17 23:05:40 +01:00
frosch
f457be5a27 Fix #11819, aa5ba5b: Out-of-bounds access in linkgraph GUI. (#11821) 2024-01-17 22:26:33 +01:00
Rubidium
2d77cf9c80 Codechange: replace StrStartsWith/StrEndsWith with starts_with and ends_with 2024-01-17 19:48:22 +01:00
translators
384b804f9c Update: Translations from eints
english (au): 1 change by krysclarke
chinese (simplified): 21 changes by WenSimEHRP
danish: 4 changes by bscargo
french: 2 changes by ottdfevr
portuguese (brazilian): 5 changes by pasantoro
polish: 5 changes by pAter-exe
2024-01-17 18:39:56 +00:00
341bdabc70 Fix #11815, bb491127: Missing brackets prevented vehicles turning properly. (#11816) 2024-01-17 13:23:55 +00:00
Jonathan G Rennison
fd0528a9b4 Fix: Excessive switching of horizontal scale for FPS graph 60 Hz categories 2024-01-17 06:34:17 +01:00
Jonathan G Rennison
17d47ba06f Fix 661bdae2: cargo_payment not cleared when aircraft loading cancelled 2024-01-17 06:33:54 +01:00
Patric Stout
fd073a2810 Remove: replace custom span with std::span 2024-01-17 00:25:08 +01:00
Patric Stout
bb49112784 Codechange: switch our codebase to C++20 2024-01-17 00:25:08 +01:00
Michael Lutz
fd59393899 Fix #11791, e1f5be62: Run missing-glyph detection after toggling sprite font. (#11812) 2024-01-17 00:00:26 +01:00
Patric Stout
e7ba42ad4b Fix bde05ce7: also update the version in the OpenTTD docs to v0.4 (#11810) 2024-01-16 22:37:05 +00:00
Rubidium
aa5ba5bd7f Codechange: allow certain enumeration to be added
Otherwise C++20 doesn't like it.
2024-01-16 23:30:23 +01:00
7737aa6640 Codechange: Make all NWidgetPart arrays constexpr.
This ensures that the arrays are not created at runtime and prevents using non-constexpr values.
2024-01-16 21:57:05 +00:00
71b7ba0daa Codechange: Allow constexpr NWidgetPart construction. 2024-01-16 21:57:05 +00:00
a5b6e17556 Codechange: Make geometry methods constexpr. 2024-01-16 21:57:05 +00:00
68843e3a96 Codechange: Move WidgetDimensions::unscaled to header to allow const use. 2024-01-16 21:57:05 +00:00
7eecd7512f Codechange: Remove redundant struct keyword. 2024-01-16 21:57:05 +00:00
Patric Stout
6860a86d45 Codechange: remove all u8 prefix in favour of compile-time option (#11807) 2024-01-16 21:33:53 +00:00
Patric Stout
6550682b49 Codechange: minor bits and pieces related to fmt::format() (#11806)
- Don't make run-time formatting what can be done compile-time.
- Be explicit about run-time formatting.
- Fix datetime printing.
2024-01-16 21:10:34 +00:00
Patric Stout
0b7410d979 Codechange: compile-time validate the string format of IConsolePrint (#11804)
This means we can no longer use runtime picking what string to use.
2024-01-16 21:04:35 +00:00
Patric Stout
8b4c5a6269 Codechange: compile-time validate the string format of SlErrorCorruptFmt (#11805) 2024-01-16 20:58:55 +00:00
d005e8f8bd Fix 884b9e66: No need to include extra pixel for pressed state. (#11803) 2024-01-16 20:50:46 +00:00
Patric Stout
bde05ce79c Update: OpenTTD TTF font to v0.4 (#11799) 2024-01-16 20:10:48 +00:00
translators
2efd897691 Update: Translations from eints
english (au): 4 changes by krysclarke
english (us): 4 changes by 2TallTyler
chinese (simplified): 8 changes by WenSimEHRP
korean: 4 changes by telk5093
russian: 4 changes by Ln-Wolf
finnish: 4 changes by hpiirai
french: 8 changes by ottdfevr
2024-01-16 18:39:39 +00:00
Rubidium
661bdae2e5 Fix #11785, cf16f45: when bumping aircraft into the air, remove them from the loading vehicle list again 2024-01-16 00:08:19 +01:00
Rubidium
f99793547e Fix fbd71a9: for TTO savegames, getting the savegame type left the file pointing to the wrong location 2024-01-16 00:08:19 +01:00
Rubidium
d5518f6263 Fix 36a0818: TTO did not save company shares 2024-01-16 00:08:19 +01:00
Rubidium
51f1e939e8 Change: be more resilient against missing towns in old loader 2024-01-16 00:08:19 +01:00
Rubidium
67b405d2f6 Fix #11783, 953445a: TTO savegames are not 65536 by 65536 2024-01-16 00:08:19 +01:00
Rubidium
f5b320e502 Codechange: use range based for loop, instead of tile numbers 2024-01-16 00:08:19 +01:00
Rubidium
b09a4384d9 Codechange: remove need to use separate array for old_map3 2024-01-16 00:08:19 +01:00
8510f7bd00 Fix: NWidgetParts must use unscaled dimensions. (#11794) 2024-01-15 23:02:25 +00:00
Patric Stout
42e07809d0 Change: [CI] upgrade linux-generic to libc 2.28 and introduce linux-legacy (#11792)
linux-legacy is the old variant, which uses libc 2.17, released in 2012.
linux-generic is now upgraded to libc 2.28, released in 2018.
2024-01-15 21:30:52 +00:00
EmperorJake
64bc07ff4e Change: Make "middle" the default stopping location for trains in platforms (#11605) 2024-01-15 22:10:27 +01:00
Patric Stout
7fd2c2d44f Fix: [Linux] install all X11 dependencies in linux-generic (#11787)
Without this, xrandr support is not compiled into SDL, which means
that SDL will only see a single display spanning all your displays
(a virtual desktop).
2024-01-15 21:59:19 +01:00
Patric Stout
375074577f Fix: [SDL] remove hint to avoid hardware acceleration (#11790)
This hint was once needed because of the way we handled surfaces.
But as OpenGL already uses a hardware surface, we already had to
fix all the issues that comes with it. As that is generic code,
this hint is no longer actually needed. Further more, recent SDL
versions break because of it on Wayland.
2024-01-15 21:57:55 +01:00
Loïc Guilloux
b18e78e21d Change: Redesign script debug window (#11782) 2024-01-15 21:41:44 +01:00
Tyler Trahan
68814bd912 Codechange: Rename SIGTYPE_NORMAL to SIGTYPE_BLOCK (#11788) 2024-01-15 15:27:48 -05:00
Tyler Trahan
4a194482ea Fix e1f5be6: Typo when selecting traditional sprite font (#11789) 2024-01-15 20:24:26 +00:00
translators
a1690d5b7b Update: Translations from eints
portuguese (brazilian): 1 change by pasantoro
2024-01-15 18:39:20 +00:00
Jonathan G Rennison
94e74a45c2 Fix: Viewport virt coords not updated when sprite font toggled (#11784) 2024-01-15 19:16:04 +01:00
53fa54f8e9 Fix e1f5be62: Clear font cache when toggling sprite font. (#11780)
This is necessary for the sprite font height and ascender to be updated correctly.
2024-01-15 00:21:11 +00:00
Patric Stout
32fc740582 Fix: [SDL2] fullscreen always used the resolution of the first display (#11779) 2024-01-14 22:41:51 +00:00
Patric Stout
302ba93471 Fix: [SDL2] only resolutions of the first display were shown (#11778) 2024-01-14 22:25:54 +00:00
Michael Lutz
994bdff81e Codechange: [CMake] Use timestamps to copy non-generated baseset files. 2024-01-14 22:50:56 +01:00
Michael Lutz
e1f5be6244 Add: GUI options to select sprite font and AA mode for all fonts. 2024-01-14 22:50:56 +01:00
Michael Lutz
20f1a0dc57 Fix: [OSX] Spurious log message when a sprite glyph was layouted. 2024-01-14 22:50:56 +01:00
Michael Lutz
36cf6b1d13 Feature: Scalable OpenTTD TrueType font made by Zephyris.
This uses the normal variant for the small font, not the all-caps version.
2024-01-14 22:50:56 +01:00
Michael Lutz
6e766a2e81 Change: Allow TrueType fonts to provide our private-use glyphs. 2024-01-14 22:50:56 +01:00
Loïc Guilloux
37610af0e4 Fix: Don't replace stripped characters with '?' in console (#11777) 2024-01-14 21:49:42 +00:00
Rubidium
564441e822 Remove: Debug redirect over network
It does not work for dedicated servers because upon starting the process to
resolve the address to redirect to gets killed. Also with all the async going
on in the network code, the debug redirection will start very late in the
process.
2024-01-14 22:14:31 +01:00
a6873ef7dd Codechange: Avoid repeatedly calling virtual methods in text drawing loop. (#11774) 2024-01-14 19:06:50 +00:00
translators
e8d6b496c2 Update: Translations from eints
english (au): 1 change by krysclarke
english (us): 1 change by 2TallTyler
chinese (simplified): 9 changes by WenSimEHRP
korean: 1 change by telk5093
russian: 1 change by Ln-Wolf
finnish: 1 change by hpiirai
danish: 2 changes by bscargo
french: 2 changes by ottdfevr
portuguese: 1 change by azulcosta
2024-01-14 18:39:10 +00:00
f219557cf2 Codechange: List functions in gui.h under correct source file. (#11775) 2024-01-14 18:12:40 +00:00
71aaed860b Codechange: Missing some conversions to WidgetID. (#11773) 2024-01-14 16:47:10 +00:00
Loïc Guilloux
93ba6d6776 Fix: compilation without precompiled headers (#11770) 2024-01-14 13:27:03 +01:00
e3bb6497f7 Codechange: Don't assume game options widget is a dropdown list. 2024-01-14 11:41:11 +00:00
8ca867ef63 Codechange: Replace game options' style-breaking if-condition with switch. 2024-01-14 11:41:11 +00:00
translators
341d022024 Update: Translations from eints
chinese (simplified): 141 changes by WenSimEHRP
russian: 3 changes by Ln-Wolf
danish: 6 changes by bscargo
latvian: 10 changes by lexuslatvia
dutch: 16 changes by Afoklala
french: 2 changes by ottdfevr
2024-01-13 18:38:17 +00:00
Jonathan G Rennison
b3f31a6523 Fix #11696: Graphics set parameters missing from survey data (#11764) 2024-01-12 21:53:31 +00:00
Jonathan G Rennison
479490d7e8 Codechange: Remove unnecessary vector for writing GRF parameter JSON (#11763) 2024-01-12 21:38:31 +00:00
Loïc Guilloux
54b57fbfeb Codechange: [Script] Use ScriptList::FillList() in more locations (#11762) 2024-01-12 21:19:08 +01:00
Tyler Trahan
60da6b992e Fix #4415: Land info build date is also renovation date (#11759)
Co-authored-by: Gadg8eer <64449092+Gadg8eer@users.noreply.github.com>
2024-01-12 14:27:33 -05:00
Loïc Guilloux
03df70ce8a Fix #11752: [Win32] Wrong multi-line text layout due to incorrect partial run handling (#11761) 2024-01-12 19:40:08 +01:00
Loïc Guilloux
28efa65e0c Revert a2edf52: SQOpsLimiter does a more precise job (#11754) 2024-01-12 17:04:43 +01:00
Jonathan G Rennison
1101b04371 Fix: Build button text when train purchase window using "Engines" filter 2024-01-12 16:34:39 +01:00
Rubidium
32ab765792 Fix #11485: new run on same line must not use last_space of previous run as cut-off point
Use the start of the next run instead as the location of the last space.
2024-01-12 16:31:29 +01:00
Patric Stout
b1812751e0 Fix: [CI] unbreak Linux releases by using a slightly older rust-cache action (#11758)
The maintainer bumped node16 -> node20 in a patch version, which
is a bit awkward for us, as we can't run node20 in this workflow
(yet). Most other actions used a major version for that, and for
similar reasons we cannot upgrade "download-artifact" to v4.

This is a temporary solution, while we start looking into how to
support node20 in this workflow.
2024-01-12 10:25:50 +00:00
translators
94d31864b3 Update: Translations from eints
chinese (simplified): 16 changes by WenSimEHRP
arabic (egypt): 23 changes by AviationGamerX
korean: 1 change by telk5093
portuguese (brazilian): 10 changes by pasantoro
polish: 4 changes by pAter-exe
2024-01-11 18:39:13 +00:00
Patric Stout
d3ee045c2d Codechange: refactor the Windows-only DllLoader in a cross-platform LibraryLoader (#11751) 2024-01-10 21:38:58 +00:00
Loïc Guilloux
f7bd70baec Fix #11748: Incorrect clamping of negative service interval values (#11749) 2024-01-10 16:23:36 +01:00
Jonathan G Rennison
86b046cd26 Fix: Incorrect assertion in GetTileIndexFromLocalCoordinate (#11747) 2024-01-10 00:20:34 +00:00
8f2266f0ed Codechange: Use range-for when validating and finalising industries. (#11744) 2024-01-09 22:36:09 +00:00
Jonathan G Rennison
09eefd6e95 Cleanup: Remove unused constant YAPF_SHIP_PATH_CACHE_LENGTH 2024-01-09 20:58:51 +01:00
Jonathan G Rennison
c1b421c0c3 Fix: Clear one way state when removing road from road+tram tile 2024-01-09 20:57:53 +01:00
97e2bc612c Codechange: Rename and move SpriteGroup-specific cargo types into a namespace.
These 'cargo types' have special defined uses and must not be used elsewhere. This makes it clearer that they are special.
2024-01-09 18:56:05 +00:00
400ae65ff2 Codechange: Redefine some cargo-related values in terms of CargoID instead of CargoType.
Values used as special filter types are now defined as offsets from NUM_CARGO instead of confusingly reusing CARGO_NO_REFIT/CARGO_AUTO_REFIT types.
2024-01-09 18:56:05 +00:00
952d111b94 Codechange: Split CT_INVALID into CT_INVALID and INVALID_CARGO.
INVALID_CARGO is a CargoID and should be used for most purposes in game.
CT_INVALID is a CargoType used for defining default properties.
2024-01-09 18:56:05 +00:00
translators
4fd986bd07 Update: Translations from eints
english (au): 7 changes by krysclarke
english (us): 7 changes by 2TallTyler
chinese (simplified): 6 changes by WenSimEHRP
serbian: 39 changes by DoLoop216
russian: 3 changes by Ln-Wolf
finnish: 4 changes by hpiirai
portuguese: 10 changes by azulcosta
polish: 34 changes by pAter-exe
2024-01-09 18:38:30 +00:00
Loïc Guilloux
c86d918921 Add: [Script] Optional filter parameter to more ScriptXXXList constructors (#11698) 2024-01-09 09:39:13 +01:00
Kuhnovic
f1e999ec59 Feature: Region-based pathfinder for ships (#10543) 2024-01-08 20:29:05 +01:00
translators
9a7c4dda52 Update: Translations from eints
english (au): 3 changes by krysclarke
english (us): 3 changes by 2TallTyler
chinese (simplified): 5 changes by WenSimEHRP
korean: 3 changes by telk5093
russian: 3 changes by Ln-Wolf
finnish: 3 changes by hpiirai
french: 5 changes by Lishouuu
2024-01-08 18:40:07 +00:00
Tyler Trahan
56dd8497e0 Fix: Use consistent wording on waypoint button tooltip (#11700) 2024-01-07 21:11:25 +00:00
Kaspars Putniņš
cfc14a57e1 Add: Latvian Lats currency (#11691) 2024-01-07 16:03:38 -05:00
Jonathan G Rennison
4b48d3b5fe Fix: String gender scan with SCC_INDUSTRY_NAME (#11697) 2024-01-07 15:48:47 -05:00
Tyler Trahan
948651d086 Fix: Use consistent wording for lorry stations (#11699) 2024-01-07 15:45:35 -05:00
translators
6bf7a86a04 Update: Translations from eints
english (us): 2 changes by 2TallTyler
korean: 2 changes by telk5093
danish: 2 changes by bscargo
2024-01-07 18:38:14 +00:00
Tyler Trahan
1e56bd1e5a Change: Reorganize Settings menu items (#11683) 2024-01-07 08:44:50 -05:00
translators
0a8c0d62ee Update: Translations from eints
chinese (simplified): 103 changes by WenSimEHRP
latvian: 2 changes by lexuslatvia
2024-01-06 18:39:19 +00:00
Rubidium
3a676a5af0 Codechange: replace static inline with static for non-class functions 2024-01-06 13:37:33 +01:00
06a5fa6239 Codechange: Use CompanyMask to pass Companies to PopupMainCompanyToolbMenu().
It's like the type was designed for it.
2024-01-05 22:26:07 +00:00
6828b6014a Codechange: Use company group statistics to test for vehicles for drop down list state.
This avoids iterating full the vehicle pool to find out if a company has any vehicles of a particular type.
2024-01-05 22:26:07 +00:00
SamuXarick
847f3f660d Fix #10511: Delay 'go to nearest depot' orders (#11548)
Delay the nearest depot order search for a day if the vehicle can't find its destination, which happens when it has already attempted to do so and failed to find a valid destination.
2024-01-05 21:23:01 +00:00
7a5106042f Codechange: Use CompanyMask and company group statistics for auto clean tests. (#11693)
This function does not need to know how many vehicles there are, only that there is at least one.
2024-01-05 20:58:24 +00:00
34e8c8e1c1 Codechange: Build station and depot vehicle lists from shared order lists. (#11676)
The brings some performance advantages:

* No need to iterate all vehicles and check for primary vehicle as only vehicles that can have orders are listed.
* Shared orders only need to be tested once instead of for each vehicle sharing them.
* Vehicle tests only need to be performed on the first shared vehicle instead of all.
2024-01-05 18:59:38 +00:00
Patric Stout
7788b68bbe Fix: don't unneededly block on transmitting survey on exit (#11687) 2024-01-05 18:54:00 +00:00
Patric Stout
28e2576589 Fix: race-condition when quitting the game with libcurl (#11688)
There could be a callback in _new_http_callbacks that is not
processed yet. All callbacks in _http_callbacks were cancelled,
but not the ones in _new_http_callbacks
2024-01-05 18:48:21 +00:00
translators
8bc473766b Update: Translations from eints
english (au): 2 changes by krysclarke
chinese (simplified): 6 changes by WenSimEHRP
russian: 2 changes by Ln-Wolf
finnish: 2 changes by hpiirai
dutch: 6 changes by Afoklala
portuguese: 5 changes by azulcosta
portuguese (brazilian): 2 changes by ericandradex
polish: 4 changes by pAter-exe
2024-01-05 18:38:36 +00:00
glx22
7bfc766f94 Fix: [Script] document return type of member GSIndustry::GetProductionLevel 2024-01-05 19:17:08 +01:00
glx22
707e8001be Fix #11689: properly close DOXYGEN_API block 2024-01-05 19:17:08 +01:00
glx22
4c1ddb1479 Change: [Script] detection of not properly closed DOXYGEN_API blocks 2024-01-05 19:17:08 +01:00
623df6b94f Codechange: Get count of road vehicles by summing company group statistics data in small UFO handler. (#11690)
This avoids needing to iterate the complete vehicle pool. Company group statistics are maintained elsewhere already.

The vehicle pool is still iterated later to find the nth random road vehicle.
2024-01-05 13:13:55 +00:00
91ea8e3fa6 Codechange: Use locals for company/deity mode during script loops. (#11686) 2024-01-05 08:32:43 +00:00
06050f7bb3 Fix: Pass townnameparts as parameter when testing townname based companyname. (#11685)
Length of returned string could vary and pass/fail the length check with a different
string than the final selection.
2024-01-04 23:10:54 +00:00
7482f71692 Change: Don't handle 'missing' string parameters as 0. (#11673)
If not enough parameters are supplied for a string, then a value of 0 was used, which could result in incorrect information being displayed.

Instead, throw an exception and include an error in the string.
2024-01-04 20:50:58 +00:00
translators
c44faf4eea Update: Translations from eints
english (us): 2 changes by 2TallTyler
chinese (simplified): 39 changes by WenSimEHRP
polish: 29 changes by pAter-exe
2024-01-04 18:39:48 +00:00
Jonathan G Rennison
5db9266f4b Change: Allow STRING/STRINGN to use all remaining parameters in game script mode 2024-01-04 17:45:33 +00:00
Jonathan G Rennison
e2a79f0f32 Codechange: No longer advance parent offset in StringParameters parent mode
Add method to manually advance offset
2024-01-04 17:45:33 +00:00
Tyler Trahan
a3576e48c1 Cleanup: Remove DS_Store added in #11682 (#11684) 2024-01-04 17:02:16 +00:00
EmperorJake
6522351a1f Feature: Setting to disable the loading speed penalty for trains longer than the station 2024-01-04 16:59:11 +01:00
Rubidium
e3f49ee7a0 Codechange: coding style fixes 2024-01-04 16:23:54 +01:00
Jonathan G Rennison
0075364c89 Fix: curl_global_cleanup called before libcurl HTTP thread exited 2024-01-04 13:41:24 +01:00
Jonathan G Rennison
51ef416b49 Fix: libcurl HTTP thread race at uninit preventing thread exit 2024-01-04 13:41:24 +01:00
Patric Stout
c6dafb0865 Doc: indicate a bit better that mass-change PRs for translations are possible (#11677) 2024-01-04 13:40:59 +01:00
George Abraham
4fcd94a1cb Update: replace the cedilla characters with comma ones for Romanian (#11665)
This is specifically for s-cedilla and t-cedilla to their comma variants.
These variants, especially in smaller font sizes, look almost identical but
they are different. Currently the translation uses a mix of the cedilla and
comma variants, where the cedilla ones are often in the older strings.

Replace reinnoi with innoi, as it is the correct form.
2024-01-03 20:56:07 +01:00
translators
799455abf7 Update: Translations from eints
latvian: 2 changes by lexuslatvia
portuguese (brazilian): 1 change by pasantoro
2024-01-03 18:39:18 +00:00
3864902683 Codechange: Use vehicle viewport hash to find clicked vehicle. (#11675)
This avoids having to iterate all vehicles, which can be an performance improvement when there are many vehicles.
2024-01-03 18:36:34 +00:00
Patric Stout
aef49e9933 Fix: race-conditions in GUI updates when downloading HTTP files (#11639) 2024-01-02 22:05:25 +01:00
translators
344bdafb53 Update: Translations from eints
latvian: 8 changes by lexuslatvia
polish: 1 change by pAter-exe
2024-01-02 18:40:54 +00:00
Krys Clarke
1cdafcd7ac Fix: Missing word in conditional order comparator (#11632) 2024-01-02 18:29:25 +00:00
ae3352582a Fix: Autorenew failed message consumes arguments. (#11669) 2024-01-02 18:08:04 +00:00
Jonathan G Rennison
48b6b1844a Change: Limit total script ops that can be consumed by a list valuate (#11670) 2024-01-02 19:02:12 +01:00
Jonathan G Rennison
502a52edd5 Fix: Spurious cancellations of HTTP content downloads (#11668) 2024-01-01 19:13:29 +00:00
translators
3e4dee6d0c Update: Translations from eints
english (us): 11 changes by 2TallTyler
korean: 29 changes by telk5093
2024-01-01 18:38:47 +00:00
Jonathan G Rennison
88324a253e Fix #11644: Off by one error/buffer over-read in StrMakeValid (#11645)
* Fix #11644: Off by one error in StrMakeValid UTF-8 decode overrun detection

* Fix #11644: Off by one error in StrMakeValid buffer last character

* Fix: Unnecessary string duplication at StrMakeValid call sites
2024-01-01 13:26:31 -05:00
Loïc Guilloux
a672813bb0 Add: [Script] Optional filter parameter to ScriptVehicleList constructor (#11663) 2024-01-01 01:07:47 +01:00
Loïc Guilloux
f56a2d0f82 Fix: Missing invalidations on gui.ai_developer_tools change (#11664) 2024-01-01 00:43:10 +01:00
Jonathan G Rennison
3e2060f155 Fix #11337: Station blocked/pylon/wire bits with CBID_STATION_TILE_LAYOUT (#11656) 2023-12-31 18:31:01 -05:00
translators
13348b7790 Update: Translations from eints
galician: 13 changes by Xocko12
catalan: 47 changes by J0anJosep
latvian: 14 changes by lexuslatvia
french: 11 changes by ottdfevr
portuguese: 52 changes by azulcosta
2023-12-31 18:38:20 +00:00
934545a674 Fix: Calculation of initial engine age was inaccurate. (#11660)
Engine age in months was calculated as the difference in days / 32, instead of the actually difference in months. This would result in engines being artificially younger if a game was started at a later date.
2023-12-31 15:47:32 +00:00
7124b4eef1 Codechange: Use std::unique_ptr for all NWidgets. 2023-12-31 15:33:56 +00:00
9a3934ae23 Codechange: Use vector/unique_ptr inside widget containers.
This replaces a C-style double-linked-list which required all widgets
to have next/prev pointers, and removes the need for manual pointer management.
2023-12-31 15:33:56 +00:00
628092f133 Codechange: Use GetParentWidget to find widget's NWidgetMatrix container. 2023-12-30 22:02:37 +00:00
c2c65d66ba Codechange: Add GetParentWidget() to widgets.
This allows to get parent widgets in the nested tree from bottom-up.
2023-12-30 22:02:37 +00:00
8ff0bef862 Codechange: Make widget index const to prevent changes. (#11658)
This guards against future widget index manipulation.
2023-12-30 18:55:16 +00:00
translators
fd782ada05 Update: Translations from eints
russian: 11 changes by lexuslatvia
finnish: 12 changes by hpiirai
latvian: 217 changes by lexuslatvia
2023-12-30 18:38:27 +00:00
6215e9bf77 Fix #11655: Crash due to NWidgetMatrix modifying widget->index. (#11657)
NWidgetMatrix modifies its child widget's index to indicate which element
is to be drawn, which now causes issues with code that does not know about
stuffing extra data into the index.

Instead, let NWidgetMatrix store the currently processing element, and
retrieve this information from the matrix widget while child widgets are
being drawn.

This means only widgets that are children of NWidgetMatrix need to know
anything about their extra data.
2023-12-30 18:24:26 +00:00
Charles Pigott
1e60734660 Fix: Compilation with DEBUG_DUMP_COMMANDS enabled (#11607) 2023-12-30 17:46:32 +00:00
Patric Stout
49db7bbe08 Change: add vcpkg.json to instruct vcpkg what dependencies we require
This works on all OSes, making it far simpler for any developer
to jump in. Just install vcpkg, run "vcpkg install" in our root,
and you have all the dependencies.
2023-12-30 18:40:04 +01:00
Patric Stout
0c064b5119 Change: [CI] use vcpkg built-in caching mechanism 2023-12-30 18:40:04 +01:00
Patric Stout
5d86588a45 Change: [CI] pkg-config is installed by default on latest runner 2023-12-30 18:40:04 +01:00
Patric Stout
086bd00f5d Fix: [CI] upgrade curl to a modern version to avoid patching other tools 2023-12-30 18:40:04 +01:00
Patric Stout
3fec8ece5a Change: [CI] always use "latest" image for our runners 2023-12-30 18:40:04 +01:00
Patric Stout
d6e8e83052 Fix: [CI] patch in SHF_COMPRESSED symbol for our Linux Generic binaries (#11651) 2023-12-30 14:40:09 +01:00
f3b4d2a384 Fix #11649: Ignore disabling a widget that does not exist. (#11652)
Orders window has different widget layouts depending on vehicle type
which don't all have the same widgets, and therefore it tries to disable
widgets that might not exist.

Restore the old behaviour of ignoring such requests, instead of crashing.
2023-12-30 13:29:31 +00:00
268e512fb8 Codechange: Set storage type of widget enums to WidgetID. 2023-12-30 00:23:57 +00:00
a0dfb76e34 Codechange: Replace mishmash of types for widget index with WidgetID.
Indices were stored as int, but often passed around as uint/uint8_t and casts.

Now they should all use WidgetID.
2023-12-30 00:23:57 +00:00
fd84f73323 Fix #11643: Empty area at top of survey preview. (#11647)
Empty area at the top of some textfile windows due to calling
SetDisplayedPlane() after calling FinishInitNested(), and/or changing
the displayed plane and not calling ReInit() after.

This was previously hidden by CheckForMissingGlyphs() reinitialising
all windows anyway.
2023-12-30 00:19:27 +00:00
b86182ab84 Codechange: Use std::map to provide indexed widget access.
This removes the need to determine the biggest widget index and replaces C-style memory handling.
2023-12-29 18:45:43 +00:00
a12f426d69 Codechange: Rename nested array to widget lookup.
This changes from naming storage-type to naming functionality.

* `FillNestedArray` is renamed to `FillWidgetLookup`.
* `Window::nested_array` is renamed to `Window::widget_lookup`.
* `array` parameter renamed as well.
2023-12-29 18:45:43 +00:00
translators
a8e587632a Update: Translations from eints
danish: 3 changes by bscargo
dutch: 10 changes by Afoklala
2023-12-29 18:38:59 +00:00
feb94d233d Codechange: Remove deferred nested_array initialization path. (#11640)
Having two ways (`FillNestedArray` and `SetupSmallestSize`) to initialize
`Window::nested_array` introduces confusion.

Instead, make `FillNestedArray` the canonical way, always call it, and remove
init_array from `SetupSmallestSize`.
2023-12-29 14:27:04 +00:00
Patric Stout
11ba951250 Fix: race-condition when creating new HTTP requests from different threads (#11638) 2023-12-29 12:45:23 +01:00
5d2ed80c95 Fix: Changing group parent did not properly update partially-default liveries. 2023-12-28 23:16:19 +00:00
bfb4254226 Fix: Changing default livery did not propagate to group liveries.
#11614 attempted to address this but did not handle 2CC properly, and changes to the default livery were not handled.
2023-12-28 23:16:19 +00:00
Jonathan G Rennison
3b18877b87 Fix #11629: AirportGetNearestTown for rotated airports (#11631)
Add rotation parameter to AirportGetNearestTown
Add wrapper for existing stations
Remove unnecessary iterator cloning
2023-12-28 21:43:05 +00:00
33ff64ef74 Codechange: Simplify ConvertDateToYMD by returning YearMonthDay instead of outputting to a pointer. (#11637) 2023-12-28 21:34:08 +00:00
bd3b28551e Codechange: Replace reliability magic numbers with constants.
These are derived as a percentage of UINT16_MAX.
2023-12-28 21:26:24 +00:00
7b2c143df0 Fix: Prevent underflow if engine base life is less than 8 years. 2023-12-28 21:26:24 +00:00
translators
ead5ad119c Update: Translations from eints
english (au): 11 changes by krysclarke
danish: 9 changes by bscargo
portuguese (brazilian): 10 changes by pasantoro
2023-12-28 18:38:31 +00:00
Richard Wheeler
5cf9c46b29 Feature: Toyland-specific river graphics (#11523)
Replaces the old solution of reusing temperate sprites for toyland.
2023-12-27 17:44:21 -05:00
translators
ce6a65d7b5 Update: Translations from eints
english (au): 2 changes by krysclarke
chinese (simplified): 37 changes by WenSimEHRP
romanian: 28 changes by bnegrut
russian: 13 changes by Ln-Wolf
finnish: 36 changes by hpiirai
danish: 16 changes by bscargo
dutch: 17 changes by Afoklala
2023-12-27 18:38:01 +00:00
Jonathan G Rennison
2b914c7a2f Fix: Memory leak in WindowDescTestsFixture 2023-12-26 23:48:59 +01:00
Rubidium
e0c670cbe8 Codechange: replace NULL with nullptr 2023-12-26 07:18:52 +01:00
Rubidium
2072e532f7 Codechange: replace NULL with nullptr 2023-12-26 07:18:52 +01:00
a2a7ecf88e Fix 9ce1626b: Some blitters have bp->remap aliased to remap for performance. (#11626)
While this probably doesn't make a huge difference for the custom transparent remap code path, the alias is there so use it.
2023-12-25 20:59:37 +00:00
fdf6cbf848 Change: Scale sprites to requested highest resolution level. (#11600)
Sprites from graphics sets which only provide high resolution sprites are now scaled up from scaled down versions.
2023-12-25 20:08:13 +00:00
SamuXarick
947e77267a Doc 0ca4b4e: Script debug window numbers are now ascending (#11623) 2023-12-25 18:42:29 +01:00
Loïc Guilloux
6c5a4aa2cb Fix 2d3af14: Don't draw script log over panel borders (#11621) 2023-12-25 18:42:13 +01:00
9ce1626bb4 Change: Support custom transparency remaps with 32bpp blitters.
This closes a 15 year old TODO...
2023-12-25 11:22:52 +00:00
0bc22dd310 Add: 32bpp-to-8bpp palette index lookup.
Lookups are calculated on demand and caches in a 256KB in-memory table.
2023-12-25 11:22:52 +00:00
daec0e2ca4 Codechange: Split palette handling to separate file. 2023-12-25 11:22:52 +00:00
4ecc107d30 Codechange: Perform simpler comparison first when checking for palette updates.
This avoids unnecessarily comparing contents of an array.
2023-12-25 11:22:52 +00:00
Loïc Guilloux
af8b8c2cfc Fix 4a2038e301: fully restore script break filter on reopen (#11622) 2023-12-24 00:08:18 +00:00
c0cdf3460e Change: Rename Standard Livery to Default Livery. 2023-12-23 13:45:35 +00:00
3436b5f090 Change: Show a message in livery window if vehicle type has no groups. 2023-12-23 13:45:35 +00:00
513c7e7b53 Change: Add distinct tooltips for vehicle group colour schemes. 2023-12-23 13:45:35 +00:00
eda0dd24fe Change: Remove hardcoded minimum sizes and allow resize.
This stops the window being needlessly large.
2023-12-23 13:45:35 +00:00
0949eddd55 Change: Move colour selection dropdowns to bottom of window.
This stops them looking similar to how filter controls are used elsewhere,
and matches action dropdowns on other windows.
2023-12-23 13:45:35 +00:00
5cb7a16edc Fix #11618: Don't try to display unavailable zoom levels in sprite aligner. (#11619) 2023-12-23 13:17:33 +00:00
Darragh
acfe367507 Fix #11442: "default" colour in group colour window is not updated when changing master colour (#11614)
Updated SelectCompanyLiveryWindow.DrawWidget method to check if a group's livery.in_use 0 bit is set, rendering the company's default colour if it has not been.
2023-12-22 17:56:09 +01:00
fd0aa3dd19 Fix #11515: Zoom level could wrap around when changing interface scale. (#11615)
This happened due to converting the new value to unsigned before clamping instead of after.
2023-12-22 15:23:42 +00:00
c1afbc9415 Fix: Update widget dimensions before updating viewport signs. (#11611)
Viewport signs used fullbevel WidgetDimensions before it was updated for the new interface scale.
2023-12-20 22:10:05 +00:00
Loïc Guilloux
2d3af14181 Add: Horizontal scroll for script debug log (#11597) 2023-12-20 22:50:03 +01:00
0ca4b4e146 Change: Allow opening multiple script debug windows by holding Ctrl. 2023-12-20 20:39:07 +00:00
4a2038e301 Codechange: Make script debug window filter state per-window. 2023-12-20 20:39:07 +00:00
b85ecf9ac2 Codechange: Replace pointer to Sprite array with reference to SpriteCollection. (#11580)
Add `SpriteLoader::SpriteCollection` type which is an array of `SpriteLoad::Sprite`.

This removes the ambiguity of what `SpriteLoader::Sprite *` is pointing to,
and cleans up mismatches using both dereference -> and array access [] for the
same object.
2023-12-20 20:38:21 +00:00
7466c3c39e Fix: Draw unavailable mask over picker sprite instead of behind it.
This makes these disabled picker buttons consistent with other disabled buttons.
2023-12-20 09:29:28 +00:00
712a4bb40b Fix: Prevent picker preview sprites from overflowing button bevel. 2023-12-20 09:29:28 +00:00
313ee13e5f Codechange: Add Rect version of FillDrawPixelInfo().
This simplifies most callers as they longer have to split out a rect.
2023-12-20 09:29:28 +00:00
Tyler Trahan
111b4e6060 Doc: Fix broken links in COMPILING and CONTRIBUTING guides (#11608) 2023-12-20 03:15:15 +01:00
Finn Willard
3a42340db3 Add: Hotkey to focus industry directory filter box
Co-authored-by: Tyler Trahan <tyler@tylertrahan.com>
2023-12-19 11:23:37 -05:00
Finn Willard
7d3ae4a058 Add: Hotkey to focus town directory filter box
Co-authored-by: Tyler Trahan <tyler@tylertrahan.com>
2023-12-19 11:23:37 -05:00
Tyler Trahan
e8d2ebb016 Fix: Add missing includes to timers from script implementation files (#11604) 2023-12-19 14:09:46 +00:00
SamuXarick
fddcaef74a Codechange: Use town zone constants instead of magic numbers 2023-12-18 22:12:43 +01:00
translators
9b7a5bc876 Update: Translations from eints
vietnamese: 1 change by KhoiCanDev
danish: 4 changes by bscargo
2023-12-18 18:39:11 +00:00
b19a6c3b81 Fix: Window width/height was doubly-scaled with automatic DPI switch. (#11598) 2023-12-18 13:05:06 +00:00
SamuXarick
c05ffb22bd Fix #10452: Don't let AyStar max_search_nodes unattended when initializing (#11544)
Add a constant with the default value of 10000 and have the pathfinding settings refer to it.

Add a preventative method to AyStar when it's initializing, to limit the number of max_search_nodes if left unattended.
2023-12-17 22:50:53 +01:00
translators
8ab3838387 Update: Translations from eints
vietnamese: 20 changes by KhoiCanDev
italian: 5 changes by Rivarossi
2023-12-17 18:37:38 +00:00
661e0cd82d Fix: Make compact picker windows expand to fill if necessary. (#11591) 2023-12-16 23:08:42 +00:00
translators
651343d69e Update: Translations from eints
english (au): 17 changes by krysclarke
english (us): 17 changes by 2TallTyler
italian: 30 changes by Rivarossi
russian: 17 changes by Ln-Wolf
french: 36 changes by ottdfevr
portuguese (brazilian): 30 changes by pasantoro
2023-12-16 18:36:51 +00:00
translators
0e6038f0e5 Update: Translations from eints
english (us): 19 changes by 2TallTyler
vietnamese: 14 changes by KhoiCanDev
turkish: 26 changes by BeratSJ
dutch: 19 changes by Afoklala
2023-12-15 18:38:09 +00:00
Tyler Trahan
8816c9dd26 Change: Improve and standardize wording of World Generation helptexts 2023-12-15 09:57:44 -05:00
Tyler Trahan
1343d7e25a Change: Don't mention TerraGenesis in setting helptexts
We no longer show the land generator in the World Generation GUI, so this is less important to explain in tooltips.
2023-12-15 09:57:44 -05:00
Tyler Trahan
1e8aa9ce22 Add: Use more tooltips in World Generation GUI 2023-12-15 09:57:44 -05:00
302e8852c1 Fix: Crash if squirrel compatibility scripts cannot be parsed. (#11589) 2023-12-15 01:25:36 +00:00
Loïc Guilloux
7726f8f245 Fix: [Script] Properly store the previous AsyncMode state (#11587) 2023-12-14 21:29:44 +00:00
bbf3028f89 Fix #11585: Crash when cleaning AI/GS with nested AsyncMode.
Do not throw sanity check when in_shutdown is true. This is also applied to
ExecMode and TestMode as they follow the same pattern.
2023-12-14 20:54:31 +00:00
47dd04d16c Fix: Don't crash when saving a crashlog save with no main window open. 2023-12-14 20:54:31 +00:00
da2d21f5b0 Fix: Left-over printf-style format passed to fmt. (#11584) 2023-12-14 19:35:35 +00:00
translators
63c006a174 Update: Translations from eints
korean: 20 changes by telk5093
danish: 13 changes by bscargo
portuguese (brazilian): 18 changes by pasantoro
2023-12-14 18:38:27 +00:00
Jonathan G Rennison
97b86b7147 Codechange: Use MakeParameters with GetNextParameter in FormatString (#11583)
Instead of StringParameters subspan, to avoid GSs being able to
cause subspan boundary assertion failures
2023-12-14 10:41:31 -05:00
12bb750128 Codechange: Cargo filters no longer take an index. (#11582)
Update naming of functions to reflect that parameter is now a cargoid.
2023-12-14 01:48:45 +00:00
d6515d6c98 Fix 0a8bcdd: Scaling non-sprite fonts does not depend on _font_zoom changing. (#11579) 2023-12-13 19:51:44 +00:00
translators
8e05001001 Update: Translations from eints
english (au): 18 changes by krysclarke
russian: 18 changes by Ln-Wolf
2023-12-13 18:38:37 +00:00
6c5aeae01b Fix #11577: Extra viewport opened in wrong location. (#11578)
ExtraViewportWindow calls IninitializeViewport() with focus as 0, which is ambiguous as focus should be either a TileIndex or a VehicleID.

Instead, pass the tile and let InitializeViewport() handle setting all the coordinates.
2023-12-13 02:19:16 +00:00
0a8bcdd344 Change: Be selective about clearing sprite/font caches on interface scale change. (#11576)
Sprite cache contains all zoom levels anyway, so does not need to be reloaded.

Font cache does not need to be clear if the font zoom hasn't changed, i.e. when changing the max sprite zoom level setting.
2023-12-11 21:03:54 +00:00
translators
b62fafc5d4 Update: Translations from eints
english (au): 1 change by krysclarke
italian: 1 change by Rivarossi
german: 7 changes by SecretIdetity
russian: 1 change by Ln-Wolf
danish: 1 change by bscargo
french: 1 change by glx22
2023-12-11 18:39:36 +00:00
dc27f1649a Fix e2425b7: Sprites no longer refreshed if max zoom level changed.
Handle this via AdjustGUIZoom() instead.
2023-12-11 14:16:49 +00:00
162ffc288d Fix e2425b7: WidgetDimensions and depot sizes not set up if blitter forced.
Set up WidgetDimensions and depot sizes during InitWindowSystem().
2023-12-11 14:16:49 +00:00
Tyler Trahan
2bada59193 Feature: Mode to display timetable in seconds 2023-12-11 07:12:45 -05:00
Tyler Trahan
2a62caa30b Codechange: Use Ticks for BaseConsist timetable fields 2023-12-11 07:12:45 -05:00
Tyler Trahan
051abb2fad Change: Don't show scoring year in high score table (#11546) 2023-12-10 18:05:51 -05:00
6e8c27b8e5 Change: Hide bevel for resizeable sparse layout windows. (#11572)
When clicked, the button is still highlighted to show that it is active.

The bevel is controlled with widget_data by RWV_SHOW_BEVEL or RWV_HIDE_BEVEL values.
2023-12-10 17:25:36 +00:00
SamuXarick
a3d56e2c6e Fix: Prevent overflow when calculating max town noise (#11564)
Max town noise could overflow if the population was high enough. The value is now clamped.
2023-12-10 15:42:55 +00:00
09251d993c Change: Use sparse padding for network server list. (#11571) 2023-12-10 14:48:58 +00:00
102fc6a9d1 Cleanup: iif should be iff (if-and-only-if) (#11570) 2023-12-10 12:05:28 +00:00
8186182e4c Codechange: Set displayed plane earlier to avoid ReInit. 2023-12-10 12:01:55 +00:00
fb60f8f2f5 Codechange: Simplify BuildRailStationWindow initialization. 2023-12-10 12:01:55 +00:00
66b064cbad Codechange: Use return value of SetDisplayedPlane to simplify CompanyWindow. 2023-12-10 12:01:55 +00:00
ebf299e1b4 Codechange: Make SetDisplayedPlane return whether the plane changed or not. 2023-12-10 12:01:55 +00:00
d6060a4d47 Change: Use sparse padding for start network server window. (#11569) 2023-12-09 23:35:46 +00:00
a759d35f26 Fix #11352: Draw all network server info as multiline strings. (#11567)
This also allows the 'header' (which is not actually a widget) to grow
as necessary to fit the server name.
2023-12-09 20:43:36 +00:00
c0ea0589b4 Fix: AirportGetNearestTown incorrectly assumed first TileIterator result was origin. (#11565)
Not all TileIterators are equal, and some do not start at the top-corner, so the perimeter check was wrong. As the caller already has thie origin tile, use that instead.
2023-12-09 09:47:41 +00:00
10f94fb0dd Codechange: Remove runtime variable size assertion. 2023-12-09 08:13:03 +00:00
9f853c10b0 Codechange: Add compile-time check that variable size matches saveload entry. 2023-12-09 08:13:03 +00:00
cb53fed229 Codechange: Move VarType helpers to allow earlier use. 2023-12-09 08:13:03 +00:00
a05d6ee404 Fix: Ensure saveload type match variable type.
This either changes the saveload definition or changes the variable depending on which makes more sense.
2023-12-09 08:13:03 +00:00
54d45a6047 Codechange: Don't keep autosave_interval in std::chrono::minutes.
This variable is saved as a setting which requires the variable type to be known, but std::chrono::minutes may vary depending on system type.

Instead, keep as uint32_t and convert to std::chrono::minutes only when setting the timer.
2023-12-09 08:13:03 +00:00
a29766d6cc Codechange: Move dropdown list size and position calculation to window.
This simplifies initialization of DropdownWindow, as instead of both the caller code and the class needing to know about list sizes and available space, only the DropdownWindow needs to know.
2023-12-09 08:12:34 +00:00
f1cceb43a1 Codechange: Move initialization of DropdownWindow members. 2023-12-09 08:12:34 +00:00
52b121942b Codechange: DropdownWindow's selected_index is not actually an index. 2023-12-09 08:12:34 +00:00
translators
2dcb00a79a Update: Translations from eints
galician: 88 changes by pvillaverde
chinese (simplified): 4 changes by WenSimEHRP
italian: 6 changes by Rivarossi
turkish: 2 changes by densxd
dutch: 5 changes by Afoklala
2023-12-08 18:38:34 +00:00
3317e29847 Fix #11516: Adjust window size by interface scale during ReInit.
To simplify this and ensure that scaling only occurs once, regardless of
resize nesting, each window now remembers interface scale.
2023-12-07 23:58:32 +00:00
e2425b72c1 Fix: Don't implicitly ReInit all windows after updating the character width cache.
This caused duplicate ReInit when changing interface scale.
2023-12-07 23:58:32 +00:00
54ba757910 Fix #11556: Missing saveload change for OrderBackup. (#11557)
Apply the saveload change from #11468 to OrderBackup and bump again.
2023-12-07 19:31:30 +00:00
Jonathan G Rennison
2cbe91c312 Fix #11551, aab580e0a: Link graph job results were incorrectly applied (#11558)
Edge flows were incorrectly restricted because the restricted
instead of unrestricted last update date was checked

See also: #10314
2023-12-07 18:38:43 +00:00
60565da8f9 Codechange: Add specific WidgetDimension for dropdown list window. (#11554)
This avoids contorting fullbevel dimensions.
2023-12-07 16:10:09 +00:00
89461b5561 Codechange: Don't highlight unselectable dropdown item. (#11553) 2023-12-07 16:09:45 +00:00
90e386acaa Codechange: Vertical spacing for caption is captiontext, not framerect. (#11550)
This does not really matter as the caption height is sized correctly later anyway, so this just avoids confusion.
2023-12-06 21:36:51 +00:00
bdef9b451c Codechange: Remove unnecessary SetMinimalTextLines for text buttons alongside captions. (#11549) 2023-12-06 21:14:09 +00:00
translators
d8f989a1f5 Update: Translations from eints
danish: 3 changes by bscargo
portuguese (brazilian): 5 changes by pasantoro
2023-12-06 18:39:07 +00:00
Loïc Guilloux
2a22063d77 Change: Remember the active game option window tab (#11547) 2023-12-06 14:44:38 +00:00
Loïc Guilloux
e901ce582d Add: [CI] Test grf generation (#11543) 2023-12-06 13:30:47 +01:00
58c252b81a Cleanup: Remove unnecessary pressed button offset code. 2023-12-05 21:12:35 +00:00
884b9e6690 Change: Revert pressed-button content shifting introduced in r2161.
This restores original behaviour, and prevents all image buttons being slightly too large.
2023-12-05 21:12:35 +00:00
translators
a92d0da8b4 Update: Translations from eints
finnish: 5 changes by hpiirai
polish: 5 changes by pAter-exe
2023-12-05 18:38:33 +00:00
Loïc Guilloux
e86eb25447 Change: [CMake] Use explicit list for regression (#11541) 2023-12-05 15:37:53 +01:00
translators
7d0ce826db Update: Translations from eints
english (au): 5 changes by krysclarke
english (us): 5 changes by 2TallTyler
korean: 5 changes by telk5093
russian: 5 changes by Ln-Wolf
catalan: 5 changes by J0anJosep
french: 5 changes by glx22
2023-12-04 18:38:44 +00:00
e749bbefe5 Change: Show rating in station list even with no cargo waiting. (#11540)
e745bd9 (r21144) changed the filter from cargo waiting to rating, which makes the station list display appear inconsistent with the cargo filter selection.
2023-12-04 18:16:09 +00:00
Loïc Guilloux
db65d763f7 Change: [CMake] Use explicit list for grf source files (#11539) 2023-12-04 16:41:02 +00:00
Loïc Guilloux
06b1bd3da4 Fix: [CI] Don't let SDL2 dependencies install too much stuff (#11537) 2023-12-04 13:55:52 +01:00
07a8bd21e4 Fix: Make station list filters use per-window state instead of global state.
Changing filters with multiple windows open would have unexpected effects leading to inconsistent state.

Now state is loaded and saved when the window is opened and closed, so state is still persistent.
2023-12-04 08:24:39 +00:00
dcf730f1f6 Codechange: Optionally allow passing state to GUIList sorter function.
GUIList sorter functions can currently only use global state, which makes per-window-instance sorting difficult.
2023-12-04 08:24:39 +00:00
4d9f335f36 Change: Add outline of sprite to sprite aligner. 2023-12-04 08:14:02 +00:00
f7380a4d2d Change: Make NewGRF Sprite Aligner window resizeable. 2023-12-04 08:14:02 +00:00
0434c1b474 Feature: (-tte) Add zoom level buttons to sprite aligner.
This allows for offsets to be adjusted a different zoom level than currently in use, and offset adjustment and display is also more convenient.
2023-12-04 08:14:02 +00:00
4e5700939d Change: Use sparse padding for sprite aligner. 2023-12-04 08:14:02 +00:00
9122b4eb47 Codechange: SetMinimalTextLines(1, 0) is implied for widgets with text. (#11536) 2023-12-03 22:42:50 +00:00
17c3ce8632 Codechange: Use maxdim instead of setting width/height separately. (#11535) 2023-12-03 22:23:54 +00:00
aae6e0481e Codechange: Rearrange AI/GS debug window following invalidate/set state/draw pattern. (#11483)
The AI/GS window updated its state as it was drawn, and would redraw again if some state had changed.

Instead, update state either during OnInvalidateData or before any drawing commences.
2023-12-03 18:53:31 +00:00
1084ab4b66 Add: Website button to Game Options window for basesets.
This links to the optional "url" item in the baseset's [metadata] section.
2023-12-03 18:52:33 +00:00
cc528bd8fc Change: Adjust layout of Content and NewGRF Website buttons for consistency. 2023-12-03 18:52:33 +00:00
2272e8fe0e Add: Website button for Game Script settings window. 2023-12-03 18:52:33 +00:00
f60c14a682 Add: Website button for AI settings window. 2023-12-03 18:52:33 +00:00
7ba89b946e Change: Hide unused cargos from vehicle cargo filter. (#11533)
The list of used cargo types is updated when the list is invalidated.
2023-12-03 18:11:08 +00:00
9a92e02fa7 Change: Add tooltips for text file buttons, and shorten Website / Readme buttons. (#11534) 2023-12-03 16:54:57 +00:00
Patric Stout
b866e52b17 Remove: officially mark Vista as no longer supported (#11531)
It is very likely Vista hasn't been working for years, but the
amount of users that use an OS that has been EoL for over 11 years
is very small, so reports happen rarely.
2023-12-02 22:12:50 +00:00
a258833aee Fix 67d071d: WC_STATION_LIST should be invalidated by owner, not station index. (#11530) 2023-12-02 21:46:43 +00:00
1aedea8eda Feature: Place cargo icon on cargo filter dropdowns.
Reveal the pixel art.
2023-12-02 15:23:05 +00:00
76701c4622 Add: Function to get largest cargo icon size. 2023-12-02 15:23:05 +00:00
8db7c79e79 Codechange: Add DropDownIcon constructor to override dimension.
This avoids the need to construct a DropDownIcon and set the dimension after.
2023-12-02 15:23:05 +00:00
49532914dd Change: Use CRTP-mixins to compose dropdown list items.
This allows list items to built from component parts as required, and additional
functionality is added:

* Icons and text can be positioned at the start or end of the space (templated.)
* Font size of text can be changed (templated.)
* Palette of sprites can be set (runtime.)
2023-12-02 15:23:05 +00:00
62e4d1e507 Codechange: Dimension must have both width and height.
Default parameters allowed Dimension to be constructed with only a width.

Instead use separate empty and width/height constructors to ensure that either none or both are provided.
2023-12-02 15:23:05 +00:00
0b1429ce14 Fix: AI window did not update button disabled state when changing values. (#11527) 2023-12-01 12:52:33 +00:00
cc488ec6c9 Fix ddd609c: Reverse build probability callback was not called for articulated parts. (#11526) 2023-11-30 23:12:39 +00:00
4a5ab331e2 Change: Add extra padding to climate buttons to match pre-#11464. (#11525)
Padding used to be included in the SetMinimalSize() part which was removed, but also made it require specific sprite sizes.

This now adds padding on the already determined size, removing the need for hardcoding pixel dimensions and allowing the sprites to be any size.
2023-11-30 19:18:28 +00:00
6f7153bf71 Codechange: Make a generic DrawRectOutline function from DrawOutline. (#11524)
This allows drawing an outline from Rect, not just constrained to a Widget's Rect. And reduces duplication a little.
2023-11-30 18:10:07 +00:00
rubidium42
33ba609290 Fix #11521, e404ba0: size for remaining span determined incorrectly 2023-11-30 08:20:58 -04:00
rubidium42
cb8612ba79 Remove: ZOOM_LVL_COUNT
This is the only enumeration with a COUNT and END. The logic of the COUNT
implied that BEGIN could be non-zero, but all but two uses of zoom level
assume that BEGIN is zero, making the separate count only confusing.
2023-11-29 21:12:28 -04:00
ddd609ce9b Feature: Randomize direction of rail vehicle on build based on probability callback. (#11489)
This allows NewGRF authors to indicate that the game should randomly flip rail vehicles on build, without needing to use random bits nor duplicate sprites to handle it themselves.

To use this functionality, test for callback 162 (CBID_VEHICLE_BUILD_PROBABILITY)  and var10 = 0 (values other than 0 are reserved for future use), and return a value between 0 and 100 inclusive.

The return value is a percentage chance of reversing the vehicle. A value of 0 will always build a forward facing vehicle, and 100 will always build a reverse facing vehicle.
2023-11-29 22:40:09 +00:00
glx22
e2c5eb3b65 Codechange: [CI] Use runner vcpkg in release-linux workflow 2023-11-29 21:00:01 +01:00
glx22
b1f98a79f8 Update: [CI] Use macos-12 image for release-macos workflow 2023-11-29 21:00:01 +01:00
6f35f3274f Fix ab1a4c6c: Crash if the "No Music" set is loaded because there is no current set_index. (#11511)
Add a helper function to get the current set_index which which checks it is in range.
2023-11-29 02:30:10 +00:00
rubidium42
27082f9efa Codechange: pass std::string references to OpenBrowser 2023-11-29 02:02:30 +01:00
Jonathan G Rennison
8437b20fed Fix: Deleting towns did not check for waypoints referencing the town 2023-11-29 00:27:16 +01:00
7b0afec11f Codechange: Use max_element to find highest cargo amount. 2023-11-28 22:30:48 +00:00
3f853d8003 Codechange: Use range-for to simplify getting first non-zero value.
This reduces indexed array access.
2023-11-28 22:30:48 +00:00
Tyler Trahan
4181d3c1ff Codechange: Don't use a magic number for the number of DiagDirections 2023-11-28 14:24:33 -05:00
Tyler Trahan
2dad9263d7 Doc: Add, fix, and clean up documentation inside town_cmd.cpp 2023-11-28 14:24:33 -05:00
Tyler Trahan
745945c4d3 Codechange: Be consistent with how we name common parameters
TileIndex is always tile and Town is always *t. Don't use t and *town.
2023-11-28 14:24:33 -05:00
Tyler Trahan
1b14eca9d9 Codechange: Rename TryClearTile() for clarity
The function does not execute the clearing action.
2023-11-28 14:24:33 -05:00
Tyler Trahan
a98fe9f317 Codechange: Rename MakeTownHouseBigger() for clarity 2023-11-28 14:24:33 -05:00
Tyler Trahan
060672428d Codechange: Merge confusingly-named helper functions into their timer 2023-11-28 14:24:33 -05:00
Tyler Trahan
1f41e773d6 Codechange: Use consistent name for bay road stops
As of #10494, this is how we describe original dead-end road stops.
2023-11-28 14:24:33 -05:00
translators
5f442c9127 Update: Translations from eints
english (us): 1 change by 2TallTyler
2023-11-28 18:38:40 +00:00
519fe33175 Fix ab1a4c6c: Changing baseset/playlist while shuffle is on does not change song. (#11510)
The change-playlist function relied on toggling shuffle to restart playing which is no longer the case, so always handle it when changing playlist instead.
2023-11-28 17:44:31 +00:00
e3924f3231 Fix #10811: Allow dragging vehicle in depot to any free row. (#11508) 2023-11-28 13:52:36 +00:00
e6d132d24b Fix #10926: New free wagons no longer split by type. (#11507)
NormalizeTrainVehInDepot() should only be called if an engine was built, not for wagons.
2023-11-28 13:48:09 +00:00
3df7d1aff9 Codechange: Template input buffer type in audio mixer. (#11505)
This reduces code duplication.
2023-11-28 00:05:30 +00:00
e5aed24395 Codechange: Use std::array for industry tile cargo acceptance. (#11498)
This avoids use of memcpy/memset to copy or fill.
2023-11-27 23:17:55 +00:00
f268c90bd3 Change: Use sparse padding for content download window. (#11501) 2023-11-27 23:17:16 +00:00
ab1a4c6c80 Change: Don't restart playback when toggling playlist shuffle.
Instead update the selected playlist entry for the current song.
2023-11-27 23:16:41 +00:00
6c91c4b99d Fix: Invalidate playlist window when (un)shuffling playlist. 2023-11-27 23:16:41 +00:00
4c6ccb5248 Change: Try stopping extmidi player with SIGINT first. (#11404)
This may give the player a chance to issue MIDI note-off commands.

The kill/waitpid cycle is also less aggressive, waiting 50ms each time.
2023-11-27 20:39:22 +00:00
Richard Wheeler
a856fbeca9 Fix: Incorrect mask files for NE river slopes (#11503) 2023-11-27 13:00:20 +00:00
e3622da408 Fix #11500: Rename Textfile GUI's LinkType to HyperlinkType. (#11502)
This disambiguates it with LinkType in league tables.
2023-11-27 10:06:46 +00:00
Richard Wheeler
2b92577f5c Fix: Add shading to river slopes
Adds a 32bpp shading to the river rapids/slopes to make them more visible. Requires a bump of original graphics grfs to use container version 2. Fixes #9031
2023-11-26 23:54:10 +01:00
46098449b6 Fix 7cfcf65: cargo_filter_criteria is now a CargoID instead of a index. (#11497) 2023-11-26 19:30:22 +00:00
7bee955a4b Change: Set height of larger heightmap/scenario worldgen buttons by text height. (#11496)
This allows the button height to scale properly by font size.
2023-11-26 17:56:51 +00:00
872fdcbbab Change: When building NewGRFs, use grfid (from grfcodec) to calculate NewGRF MD5 hash. (#11492)
This allows for v2 container NewGRFs to be created. Hashes are needed for building the baseset metadata, so the .hash files are stored the source tree so they can be built if grfcodec and grfid are not present.

The hash of openttd.grf is not actually needed, but it is simpler to leave it in than handle only orig_extra.grf.
2023-11-26 15:59:41 +00:00
Jonathan G Rennison
c5a292c0df Fix #11493: Incorrect flow values in LinkGraphJob::EdgeAnnotation (#11494) 2023-11-25 20:57:20 +00:00
translators
c6b9227dbb Update: Translations from eints 2023-11-25 18:37:21 +00:00
Tyler Trahan
d28caa3ced Codechange: Use ticks for timetable start date 2023-11-25 11:50:46 -05:00
Tyler Trahan
3902acb13d Codechange: Define a TickCounter variable type for TimerGameTick::counter 2023-11-25 11:50:46 -05:00
bc1d49ebf4 Codechange: Add missing ar from Toolb. 2023-11-25 16:45:01 +00:00
5489b9fc0c Codechange: Undo #11447, drop down list divider lines are now explicit. 2023-11-25 16:45:01 +00:00
667be98ce8 Codechange: List toolbar menu items and dividers explicitly.
This makes it clearer what items will be shown in the list, allows for non-consecutive
string IDs, and means unused enum values are not necessary.
2023-11-25 16:45:01 +00:00
47eabe0cd9 Fix 7cfcf65: Check if last-remembered build vehicle cargo filter is valid. (#11486)
This can be invalid when switching between games with different cargoes loaded.
2023-11-23 22:46:22 +00:00
096da3e59f Fix #11407: Don't steal focus from dropdown menus. (#11484) 2023-11-22 19:09:20 +00:00
09d01bd015 Fix: Restore original cargo legend 'blob' dimensions. (#11480)
An off-by-one in a previous life made the 'blob' too narrow.
2023-11-21 19:51:24 +00:00
c2f19fed24 Fix: Widget without tooltip should use STR_NULL not STR_EMPTY. (#11482) 2023-11-21 19:35:47 +00:00
c18a1494b7 Codechange: Remove FONT_HEIGHT_... macros. (#11481)
These make it look like we're dealing with a constant, but actually each is a call to `GetCharacterHeight(...)`.
2023-11-21 19:04:24 +00:00
translators
96ec9c1b47 Update: Translations from eints
indonesian: 67 changes by ekaknl22
2023-11-21 18:40:02 +00:00
0d60dc0353 Fix 96d98d08: Crash in text layouter due to trying to find height of string with zero-width.
96d98d08 removed the hardcoded minimum width in favour of all-calculated widths, however this does not work when determining multiline text sizes.
2023-11-20 23:09:20 +00:00
62d4fd0572 Codechange: Add method to guess the width/height required for a multiline string.
This is necessary for widget layouts where a minimum width is not yet known during UpdateWidgetSize().
2023-11-20 23:09:20 +00:00
f281525492 Codechange: Add method to resize both width and height of a widget. 2023-11-20 23:09:20 +00:00
d04fd4602d Codechange: Assert that max width passed to GetStringHeight is non-zero.
Max width of zero will cause text layouters to crash, potentially after exhausting memory first.
2023-11-20 23:09:20 +00:00
0578b8eaa9 Change: Use picker-spacing for scenario found town window. (#11478) 2023-11-20 23:06:15 +00:00
a58a043402 Fix 6065122: Missing SetFill on worldgen spacer. (#11477) 2023-11-20 19:31:26 +00:00
Jonathan G Rennison
9822fa6584 Fix: Trivial autoreplace of mixed cargo articulated engines (#11253)
Do not fail autoreplace/autorenew of mixed cargo articulated engines
due to an inability to refit to mixed cargoes, when no refit is
required because the target engine already has a suitable set of cargoes.
Notably, this allows autorenew (autoreplace to same engine type)
to succeed.
2023-11-20 14:16:28 +01:00
96d98d08c8 Change: Use sparse padding for main intro menu. (#11475) 2023-11-20 01:12:25 +00:00
c80fa7d752 Codechange: Simplify setting minimum width for game options dropdown lists. (#11474)
Height isn't necessary as drop down controls already have sufficient height, so we can use GetDropDownListDimension() to get the width.
2023-11-20 00:44:06 +00:00
f58a7ef673 Codechange: Remove now-unnecessary containers in picker layouts. (#11473)
These are no longer necessary as the issue they work around was resolved by #11471
2023-11-20 00:14:06 +00:00
293a26f248 Change: Use sparse padding and SETTING_BUTTON sizes for custom currency window. (#11472) 2023-11-19 21:12:55 +00:00
05b55c4d43 Fix: Extra space allocated to container-within-container may not get allocated to children. (#11471)
Always derive additional length from contained widgets instead of from the container, as the container's minimal length may have been adjusted by an NC_EQUALSIZE parent container.
2023-11-19 00:36:53 +00:00
translators
29102ce42c Update: Translations from eints
dutch: 1 change by Afoklala
2023-11-17 18:38:21 +00:00
08778094f4 Fix: extmidi did not move on to next song after playing ends. (#11469)
`song` is no longer a C-style string so cannot be cleared by writing a NUL char.
Use `.clear()` to properly clear a std::string.
2023-11-17 17:42:19 +00:00
b2d4d90502 Change: Apply interface scaling to NewGRF settings min/max sizes. 2023-11-16 20:54:51 +00:00
42ae61a4fe Change: Use sparse padding for NewGRF settings window. 2023-11-16 20:54:51 +00:00
cdb4e98a15 Change: Use sparse padding for AI/GS settings windows. (#11466) 2023-11-16 20:02:07 +00:00
f93711838f Fix 6317967: Missing exception for SetPipRatio(). (#11465) 2023-11-16 19:22:02 +00:00
60651227a0 Change: Simplify world gen widgets and use sparse padding. (#11464) 2023-11-16 18:58:59 +00:00
translators
bca321443a Update: Translations from eints
french: 1 change by Lishouuu
2023-11-16 18:39:24 +00:00
7d48a3f073 Codechange: Move RectPadding::zero definition to header. (#11461)
This potentially allows better inlining/optimization.
2023-11-16 17:07:29 +00:00
e2e0753916 Codechange: Use GetCurrentRect() where feasible. (#11460) 2023-11-16 17:06:57 +00:00
17ceed0241 Change: Use sparse padding for Game Options window. (#11463) 2023-11-16 17:06:38 +00:00
306e75223a Change: Adjust layouts and standardize spacing for company-related windows. 2023-11-15 12:43:44 +00:00
58c037fba0 Change: Increase finance window lines (and underlines) with interface scale. 2023-11-15 12:43:44 +00:00
translators
1dff1e34f6 Update: Translations from eints
tamil: 3 changes by Jeyanthinath
2023-11-14 18:36:57 +00:00
7cfcf65f95 Codechange: Simplify cargo filter lists, building only when required.
Some cargo filter lists were built in advance, and used as lookups to test which cargo type to filter.

Instead, use the Cargo ID directly as the filter parameter, and build the lists only when the drop down list is used.
2023-11-13 21:30:46 +00:00
08dfe35442 Codechange: Move DropDownList height and width calculation to helper. 2023-11-13 21:30:46 +00:00
translators
1242b355e5 Update: Translations from eints
danish: 1 change by bscargo
polish: 1 change by pAter-exe
2023-11-13 18:38:10 +00:00
c877494f7a Codechange: Simplify autoreplace rail/road types by using separate widget. (#11457)
This avoids needing to determine which type of list to deal with by additionally checking the window number for VEH_TRAIN/VEH_ROAD.
2023-11-13 12:32:34 +00:00
Tyler Trahan
7a6d102c4b Codechange: Clean up timetable start checks (#11456) 2023-11-13 07:19:39 -05:00
translators
5446ece100 Update: Translations from eints
vietnamese: 7 changes by KhoiCanDev
korean: 1 change by telk5093
catalan: 7 changes by J0anJosep
2023-11-12 18:38:05 +00:00
translators
1432511fe5 Update: Translations from eints
english (au): 1 change by krysclarke
italian: 7 changes by Rivarossi
russian: 1 change by Ln-Wolf
finnish: 1 change by hpiirai
portuguese: 1 change by azulcosta
portuguese (brazilian): 1 change by pasantoro
2023-11-11 18:36:44 +00:00
Tyler Trahan
235ac0bceb Codechange: Reword rail/road type label constants (#11451) 2023-11-10 17:37:22 -05:00
translators
ef1abbcd1f Update: Translations from eints 2023-11-10 18:38:29 +00:00
bd2ddb07ca Change: Move baseset missing/corrupted files label to list item. (#11455)
This allows any baseset error to be displayed in the drop down list so it is more easily visible, and avoids wasted space in the layout.
2023-11-10 12:25:56 +00:00
1071acb483 Codechange: Redundant use of char * and c_str(). (#11454) 2023-11-10 00:17:36 +00:00
938c8339d2 Codechange: Ensure space between for/if and (. 2023-11-09 20:15:38 +00:00
d4008850e3 Codechange: Ensure function opening { is on new line. 2023-11-09 20:15:38 +00:00
Jonathan G Rennison
1de1af08b9 Codechange: Replace AllocatedStringParameters with ArrayStringParameters (#11452)
All uses of AllocatedStringParameters are with a compile-time fixed
constant.
Use of a dynamically allocated buffer on the heap is unnecessary and
increases overhead, particularly due to frequent use as a temporary.
2023-11-09 19:43:47 +00:00
translators
92816ac96b Update: Translations from eints
german: 3 changes by SecretIdetity
romanian: 6 changes by bnegrut
2023-11-09 18:37:36 +00:00
9f90ab7b04 Codechange: Use rail/road type label constants instead of literals. (#11450) 2023-11-08 23:45:08 +00:00
translators
382d7a9076 Update: Translations from eints
hungarian: 54 changes by titanicbobo
2023-11-08 18:39:05 +00:00
Christopher Lee
763f0eb1f0 Add: LSB_RELEASE_ID Linuxmint to .deb package (#11390) 2023-11-08 01:27:50 +01:00
90bd8e64d8 Change: Simplify help window widgets and use sparse padding. 2023-11-07 23:09:05 +00:00
55adbe10b7 Add: WidgetDimensions for 'sparse' widget windows.
These are for windows that have space between widgets instead of being clumped together.
2023-11-07 23:09:05 +00:00
translators
56657eeaae Update: Translations from eints
chinese (simplified): 1 change by WenSimEHRP
danish: 1 change by bscargo
hindi: 111 changes by NisheshTyagi
2023-11-07 18:37:45 +00:00
842cf87765 Change: Bring airport picker inline with other pickers. 2023-11-07 18:27:51 +00:00
b216dc493f Change: Bring dock picker inline with other pickers. 2023-11-07 18:27:51 +00:00
27b5979056 Change: Improve layout of object picker. 2023-11-07 18:27:51 +00:00
db18f60beb Change: Improve layout of road/tram stop pickers. 2023-11-07 18:27:51 +00:00
61deab08fc Change: Improve layout of station picker. 2023-11-07 18:27:51 +00:00
136551408c Change: Show empty string drop down entries as divider. (#11447) 2023-11-06 22:35:01 +00:00
ab535c0a86 Codechange: Add base() method to StrongType to allow access to the base type without casting. (#11445)
This removes the ability to explicitly cast to the base type, but the requirement
to use .base() means the conversion is still explicit.
2023-11-06 20:29:35 +00:00
translators
737775f834 Update: Translations from eints
korean: 14 changes by telk5093
polish: 1 change by pAter-exe
2023-11-06 18:38:37 +00:00
badce415ea Change: Add horizontal scrollbar to Industry Directory window.
This list could be very wide depending on industries and language.
2023-11-05 22:22:32 +00:00
8ff6562b2f Codechange: Reduce variable scope. 2023-11-05 22:22:32 +00:00
6b9dc8cfcf Codechange: Don't filter industry list by cargo type every 3-sec refresh.
The 3-sec refresh is to update the list sorting. The filter only needs to
be applied once rebuilding the list.
2023-11-05 22:22:32 +00:00
4033750968 Codechange: Remove redundant NWID_VERTICAL in Industry Directory layout. 2023-11-05 22:22:32 +00:00
d380f2f3a2 Codechange: Simplify layout of depot pickers. 2023-11-05 20:09:45 +00:00
665902f5ba Codechange: Add widget dimensions to standardise picker winodws. 2023-11-05 20:09:45 +00:00
3cab980b30 Codechange: Skip invisible (zero-size) widgets in PIP Containers.
This gets rid of doubled-up spacing where an invisible child widget would be.
2023-11-05 20:09:45 +00:00
6317967dba Codechange: Add ability to allocate PIP-space dynamically by ratio.
This can be used to space out, centre, start-align, or end-align widgets without additional spacers.
2023-11-05 20:09:45 +00:00
ac54bd7e58 Codechange: Apply PIP during AssignSizePosition() instead of SetupSmallestSize(). 2023-11-05 20:09:45 +00:00
43aa91a7f5 Fix #11437: Flipped shorter rail vehicles disappear in windows. (#11446)
Mixed signed/unsigned strikes again, causing an incorrect sprite offset for shortened vehicles.
2023-11-05 20:09:11 +00:00
a9aaa2a183 Codechange: Don't be lenient with invalid NWidgetPart lists.
Some NWidgetPart combinations were ignored but it was not clear that they do nothing. Instead, assert if NWidgetPart is incorrectly applied.
2023-11-05 19:24:59 +00:00
b1eb5533eb Add: WindowDesc unit test to validate NWidgetPart lists. 2023-11-05 19:24:59 +00:00
1c94fb0389 Add: Mock sprite cache intialization.
This fills up the sprite cache with SPR_OPENTTD_BASE + OPENTTD_SPRITE_COUNT zero-size sprites, to
allow GetSpriteSize() calls to continue from unit-tests.
2023-11-05 19:24:59 +00:00
05436d9c2f Add: Expose minimal parts of SpriteCache internals.
These parts are needed to be able to mock the SpriteCache for unit-tests.
2023-11-05 19:24:59 +00:00
46f63074da Add: MockFontCache for testing GUI code that only needs to know font sizes. 2023-11-05 19:24:59 +00:00
translators
af4c7799fe Update: Translations from eints
korean: 1 change by telk5093
finnish: 1 change by hpiirai
portuguese (brazilian): 1 change by pasantoro
2023-11-05 18:37:09 +00:00
b5861fd8f3 Fix: Using MIN_YEAR for a date is probably wrong, Use MIN_DATE instead. (#11444)
Even with strong types ...
2023-11-05 15:43:56 +00:00
ef385499c7 Codechange: Remove ineffective NWidgetParts. (#11443) 2023-11-05 14:09:47 +00:00
translators
01728177e7 Update: Translations from eints
english (us): 3 changes by 2TallTyler
french: 2 changes by Lishouuu
2023-11-04 18:37:37 +00:00
Michael Lutz
071fdab236 Codechange: Replicate cursor screen backup to chat message display, removing explicit memory management.
Incidentally, this makes Blitter::GetBytesPerPixel unneeed.
2023-11-04 16:08:34 +01:00
bbd64bbe2b Fix #9545: Crash when all cargo types are disabled. (#11432)
This is not a very useful state, but it's nice to not crash.

Some parts of the game don't (yet) check for cargo types being redefined, that is out-of-scope here.
2023-11-04 14:42:47 +00:00
Patric Stout
c059ce0c97 Fix cda6f24f: don't ignore binary-dir if it happens to be working-dir (#11431)
Some of our code ignores the SP_WORKING_DIR for some actions, which
means that if, for example, your SP_BINARY_DIR is the same as your
SP_WORKING_DIR, neither is scanned.

Instead, only add SP_WORKING_DIR if it is unique.
2023-11-04 10:39:18 +00:00
db6b32e421 Codechange: Avoid pointers and lengthof in ExpensesList. (#11427)
Use std::initializer_list which allows iteration.
2023-11-03 23:15:37 +00:00
Michael Lutz
86e28e79fb Fix #11402: Make string filter locale-aware. 2023-11-03 22:34:01 +01:00
Michael Lutz
c294eaacc1 Fix: char_traits::find needs to return nullptr if nothing was found. 2023-11-03 22:34:01 +01:00
7d4a91ef9e Cleanup: Remove some unused functions. (#11429)
These were picked up with cppcheck.
2023-11-03 21:21:00 +00:00
translators
4c58df75fd Update: Translations from eints
english (au): 1 change by krysclarke
russian: 1 change by Ln-Wolf
dutch: 3 changes by Afoklala
portuguese: 1 change by azulcosta
2023-11-03 18:38:51 +00:00
ce6e739491 Codechange: Add unit-test to check if nested widget parts of properly closed.
Properly closed means exactly one EndContainer for every Container widget.
2023-11-03 09:38:41 +00:00
e8db137135 Codechange: Move test for Container WidgetType to helper function. 2023-11-03 09:38:41 +00:00
d4a77411a5 Fix: Some NWidget lists were not properly closed. (#11425) 2023-11-03 08:17:26 +00:00
cda896bca5 Remove: windowdesc-ini-key workflow, as this is now performed more reliably by a unit-test. 2023-11-02 22:25:01 +00:00
e563057478 Add: WindowDesc unit test to validate ini-key value.
ini-key must be present if WWT_DEFSIZEBOX or WWT_STICKYBOX is present.
This was previously enforced by a workflow, however that parsed the source
code with regex which turned out to be error-prone.
2023-11-02 22:25:01 +00:00
18fb8e153f Codechange: Add __FILE__/__LINE__ of WindowDesc to WindowDesc.
This is to allow unit-tests to produce more useful output.
2023-11-02 22:25:01 +00:00
873f93cab1 Fix: AI config window should not have an ini_key. (#11423)
This was missed by the workflow script that enforces this constraint.
2023-11-02 21:28:24 +00:00
translators
82ebc9860b Update: Translations from eints
finnish: 2 changes by hpiirai
danish: 1 change by bscargo
2023-11-02 18:38:58 +00:00
Rubidium
a849b4e175 Fix: allow same length server password in the UI 2023-11-02 17:19:38 +01:00
Rubidium
c6411168d8 Cleanup: missing spaces before continuation * in some comments 2023-11-01 22:56:11 +01:00
c687b59efc Codechange: Use unique_ptr for SmallMapWindow's overlay. 2023-11-01 21:49:06 +00:00
53845bc024 Codechange: Move includes to correct place.
Some other source file inadvertently included things via smallmap_gui.h
2023-11-01 21:49:06 +00:00
ed8df72c49 Revert 6b68956: Move declaration of SmallMapWindow out of header file.
This split needlessly complicates `SmallMapWindow` for the sake of one method (no longer) used by `LinkGraphOverlay`.
2023-11-01 21:49:06 +00:00
f91462f54b Codechange: Don't access SmallMapWindow method directly from LinkGraphOverlay. 2023-11-01 21:49:06 +00:00
ff5e8bb9a3 Fix #11413: Incorrect sorting by industry production.
Error caused by single character mistake. However this algorithm was inefficent if a filter was specified, and clearly the flow was error-prone.

Now using separately-scoped loops to avoid similar.
2023-11-01 21:37:53 +00:00
278b42d078 Codechange: Document Industry::GetCargoProduced/Accepted and add const-variant. 2023-11-01 21:37:53 +00:00
4f3adc038a Cleanup: Use standard comment codestyle. 2023-11-01 21:37:53 +00:00
Tyler Trahan
49d53c41ab Doc: Don't use other names for road vehicle bay stops (#11418) 2023-11-01 21:19:31 +00:00
d3cb6e1e67 Codechange: Call Widget::SetDirty/SetLowered directly. (#11417)
In these instances we already have the widget to hand, so don't need to look it up by index again.
2023-11-01 20:12:08 +00:00
Tyler Trahan
89480f3531 Change: Don't set vehicle on time if timetable not started (#11359) 2023-11-01 15:26:39 -04:00
bb50cbb772 Codechange: Assign/StoreSizePosition x/y can be negative. (#11416)
AssignSizePosition is used with negative values when an NWidgetMatrix is
scrolled, but they were passed as unsigned and then stored as signed.

Widget pos_x/pos_y were already made signed.
2023-11-01 18:44:23 +00:00
translators
c97120f003 Update: Translations from eints
english (au): 1 change by krysclarke
chinese (simplified): 5 changes by WenSimEHRP
korean: 2 changes by telk5093
russian: 1 change by Ln-Wolf
portuguese: 1 change by azulcosta
portuguese (brazilian): 1 change by pasantoro
polish: 1 change by pAter-exe
2023-11-01 18:38:53 +00:00
35a7770fde Fix 233aac5: Set newline default comment for new groups. (#11411)
The newline space between ini groups is actually recorded as a comment of the group. This got inadvertantly dropped in #11364.
2023-10-31 01:19:04 +00:00
frosch
e81313e93e Feature: Base graphics can offer parameters for additional settings. 2023-10-31 01:41:50 +01:00
frosch
de3f29d7b2 Add: store base graphics parameters in openttd.cfg. 2023-10-31 01:41:50 +01:00
frosch
f09fda1ff0 Codechange: store the GRFConfig of the base graphics, once loaded. 2023-10-31 01:41:50 +01:00
frosch
0b7ecf6102 Codechange: use the shortname as unique id to identify the base graphics in openttd.cfg. 2023-10-31 01:41:50 +01:00
frosch
97df27e41f Codechange: Store base graphics settings in a separate section in openttd.cfg. 2023-10-31 01:41:50 +01:00
2d3fef3113 Fix: Incorrect padding for smallmap legend 'icon'.
The size of this icon is based off FONT_HEIGHT_SMALL - 1, so it makes sense to use a scaled 1 here.
2023-10-30 22:11:31 +00:00
a8aba06a07 Fix: Insufficient space for labels on smallmap legend. 2023-10-30 22:11:31 +00:00
translators
186829b99f Update: Translations from eints
english (au): 1 change by krysclarke
dutch: 1 change by TrueBrain
portuguese: 1 change by azulcosta
polish: 4 changes by pAter-exe
2023-10-30 18:38:55 +00:00
translators
40f52afac2 Update: Translations from eints
indonesian: 1 change by liimee
russian: 2 changes by Ln-Wolf
finnish: 1 change by hpiirai
danish: 1 change by bscargo
french: 1 change by ottdfevr
portuguese (brazilian): 1 change by pasantoro
2023-10-29 18:37:50 +00:00
translators
9e6ea16ca7 Update: Translations from eints 2023-10-28 18:37:45 +00:00
c0aa9a5f87 Add: Debug tool to draw widget outlines. (#11401)
This is considered a developer tool and is controlled from the help menu (or default hotkey Ctrl-O).

This draws a white dashed outline around widgets. NWidgetSpacer and (unused) WWT_EMPTY widgets are also filled with check pattern to highlight them, as they usually indicate a design issue.
2023-10-28 19:07:50 +01:00
129e98fbab Fix d42a78f: Some raw drop down list strings may need token processing. (#11400)
Storing the raw string without processing though GetString() caused token
processing to be skipped.
2023-10-28 16:08:44 +01:00
062c19830b Fix: OpenTTD can fail to exit on an error due to mutex locks in threads. (#11398) 2023-10-28 16:08:08 +01:00
translators
7b376493a2 Update: Translations from eints
dutch: 3 changes by Afoklala
french: 1 change by ottdfevr
2023-10-27 18:38:08 +00:00
translators
7b4ecb5241 Update: Translations from eints
korean: 3 changes by telk5093
slovak: 1 change by legitalk
polish: 4 changes by pAter-exe
2023-10-26 18:38:26 +00:00
5ae5c35f38 Codechange: Remove redundant WWT_PANEL from bootstrap error windows. 2023-10-26 12:43:20 +01:00
a601a1f406 Change: Use modalpopup spacing for goal question windows. 2023-10-26 12:43:20 +01:00
616fb48e25 Change: Use modalpopup spacing for engine preview window. 2023-10-26 12:43:20 +01:00
19c314ea1f Change: Use modalpopup spacing for buy company window. 2023-10-26 12:43:20 +01:00
8a49c0eb2c Change: Use modalpopup spacing for network relay and survey windows. 2023-10-26 12:43:20 +01:00
Loïc Guilloux
375f24956c Fix: [CI] Installed (and cached) vcpkg packages are never upgraded in release-linux workflow (#11396)
Other workflows use a per image cache because images provide a fixed vcpkg clone.
2023-10-25 21:20:45 +02:00
f78c2c9810 Fix: Incorrect title on framerate windows for AIs. 2023-10-25 19:35:42 +01:00
d19832569e Cleanup: No need to cast const Font * to itself. (#11395) 2023-10-25 13:08:07 +00:00
translators
3d7f54472d Update: Translations from eints
english (us): 3 changes by 2TallTyler
danish: 3 changes by bscargo
polish: 1 change by pAter-exe
2023-10-24 18:38:34 +00:00
translators
9cdf66d3a1 Update: Translations from eints
czech: 18 changes by vladoschreiner
german: 27 changes by Wuzzy2
2023-10-23 18:38:04 +00:00
translators
d1351fa0d2 Update: Translations from eints
english (au): 3 changes by krysclarke
russian: 3 changes by Ln-Wolf
finnish: 3 changes by hpiirai
turkish: 4 changes by BeratSJ
french: 3 changes by ottdfevr
portuguese: 3 changes by azulcosta
portuguese (brazilian): 3 changes by pasantoro
2023-10-22 18:37:20 +00:00
Tyler Trahan
92ab114e13 Fix f49ffaa: Use DateAtStartOfYear() to calculate max timetable start date (#11388) 2023-10-22 10:51:06 -04:00
translators
f32058e4e5 Update: Translations from eints 2023-10-21 18:37:29 +00:00
Bernhard Reutner-Fischer
ac42dea7b2 Codechange: Remove unused parameter for Height()
DropDownListItem::Height does not need to take an argument so remove it

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2023-10-21 18:53:35 +02:00
59a2abd298 Codechange: Use unified NWidgetContainer methods instead of duplicating.
Most NWidgetContainer derivatives implemented Draw() and GetWidgetFromPos()
the same way. Move this these to NWidgetContainer itself to avoid repeating.
2023-10-21 14:26:36 +01:00
af41c5cb4e Codechange: Hide toolbar buttons by setting width to zero.
Zero-width is how widgets are hidden elsewhere.
This removes the need for an extra array to lookup if a button is hidden.
2023-10-21 14:26:36 +01:00
81ecbaaa33 Codechange: Hide multiplayer headers by setting width to zero.
Zero-width is how widgets are hidden elsewhere.
This removes the need for an extra array to lookup if a header is hidden.
2023-10-21 14:26:36 +01:00
Tyler Trahan
2dd2910ab3 Feature: Cheat to fix station ratings at 100% (#11346) 2023-10-21 08:35:52 -04:00
Rubidium
37f84b7372 Codechange: replace x.size() != 0 with !x.empty() 2023-10-20 23:05:43 +02:00
Rubidium
f16399f4c9 Codechange: replace x.size() > 0 with !x.empty() 2023-10-20 23:05:43 +02:00
Rubidium
c9276c2959 Codechange: replace x.size() == 0 with x.empty() 2023-10-20 23:05:43 +02:00
f06b3e9846 Change: Use CARGO_LIST to show station cargo acceptance changes. (#11379)
This simplifies construction of the news message and allows for more than
two changes to be show in one line.
2023-10-20 20:14:46 +01:00
translators
4c24334fda Update: Translations from eints 2023-10-20 18:38:26 +00:00
fd6f1e844a Codechange: Avoid emplace_back(new()) into a unique_ptr. (#11384)
This could theoretically leave an unmanaged pointer in certain circumstances, and directly using
make_unique shows intent.
2023-10-20 18:40:48 +01:00
429a6f58e7 Codechange: Use max_element to find best cargo (sub-)type in NewGRF var 42. (#11370)
This replaces two manual loops to find the best cargo (sub-)type.
2023-10-20 18:40:26 +01:00
90351578a6 Codechange: Use std::map instead of fixed array to store refit options.
This simplifies handling of available refit options.
2023-10-20 18:39:32 +01:00
e4f94747f3 Codechange: Use comparator struct to sort cargo ID by predefined sort order.
This allows reuse of the comparator where a typename is used instead.
2023-10-20 18:39:32 +01:00
bc8e26f4e7 Codechange: Simplify usage of GRFFile cargo_map. (#11349) 2023-10-20 18:38:54 +01:00
69e20e79ab Codechange: Add const versions of GetItem/GetGroup, and sprinkle liberally.
Non-const version of GetItem is not needed.
2023-10-20 18:37:27 +01:00
17ba9d8c96 Codechange: Use range-for instead of nullptr-terminated list in settingsgen.
This simplifies iteration and avoids use of pointers.
2023-10-20 18:37:27 +01:00
233aac567b Codechange: Use std::list instead of C-linked list for ini files.
This removes self-management of memory with new/delete and allows simpler iteration.
2023-10-20 18:37:27 +01:00
ec1cf96b62 Codechange: Move initialization of group-type to CreateGroup function. 2023-10-20 18:37:27 +01:00
8bd06807e4 Codechange: Pass initializer list instead of null-terminated list of group types. 2023-10-20 18:37:27 +01:00
1fecbeff76 Codechange: Remove create parameter from IniLoadFile::GetGroup.
GetGroup now only returns nullptr if the group does not exist.
Use GetOrCreateGroup to create a group.

This avoids creating groups while reading ini files.
2023-10-20 18:37:27 +01:00
c47a0e1578 Codechange: Correct scope of IniItem for for-loop. 2023-10-20 18:37:27 +01:00
6ce7195ef1 Codechange: Split GetGroup into GetGroup/GetOrCreateGroup.
This follows the pattern used for GetItem/GetOrCreateItem, and allows use
of references where we know the group must exist.
2023-10-20 18:37:27 +01:00
54b1a067eb Codechange: Test for nullptr instead of treating pointer as boolean. 2023-10-20 18:37:27 +01:00
d3c5ae2648 Codechange: Add CreateGroup/CreateItem methods for ini files.
This abstracts the internals a bit.
2023-10-20 18:37:27 +01:00
0c85ce29ea Codechange: Pass ini file by reference and prefer automatic storage.
This avoids new/delete operations, and (not) checking for nullptr.
2023-10-20 18:37:27 +01:00
3961318974 Codechange: Accept std::string in RemoveGroup(). 2023-10-20 18:37:27 +01:00
bb6fa9bf3b Change: Display cargo lists in sorted cargo order. (#11383) 2023-10-20 17:32:17 +01:00
Tyler Trahan
088db62dba Change: Always allow expanding towns in Scenario Editor to build new roads (#11377) 2023-10-19 17:01:45 -04:00
Jonathan G Rennison
4df2640f87 Fix: Tile slope missing from road stops varact2 variable 0x42 2023-10-19 20:05:36 +02:00
e1c83869ed Fix: Scale minimum width for server name by interface scale. (#11381) 2023-10-19 17:06:47 +00:00
9602de474d Codechange: Use iterators and/or range-for on cargo related loops. 2023-10-19 17:03:25 +01:00
2a88e0fab3 Codechange: Use bitmask instead of array for cargo consistency check.
We only need to know if a cargo type is accepted, not how much.
2023-10-19 17:03:25 +01:00
Jonathan G Rennison
a1c6923c63 Fix: Assertion in sprite aligner window (#11371)
When clicking sprite number after re-opening window having previously used sprite picker tool
2023-10-17 16:25:48 -04:00
Loïc Guilloux
ab805c4e9e Fix #11375, 7c37dcb: Use STRING2 when the passed string can have 2 parameters (#11376) 2023-10-16 17:49:44 +00:00
Tyler Trahan
f49ffaaaea Fix e4fd99a, Fix #11270: Vehicle max age is not subject to leap years (#11372) 2023-10-15 22:34:03 +00:00
356a5d5773 Codechange: Use std::vector in fallback layouter, and shorten accessors. (#11355)
This avoids use of malloc/free (and custom move constructors), and follows how the exist layouters are written.
2023-10-15 21:59:10 +01:00
translators
2be1b72a5b Update: Translations from eints
hungarian: 50 changes by Norodix
2023-10-15 18:36:51 +00:00
translators
a73ef95a2b Update: Translations from eints
chinese (simplified): 5 changes by WenSimEHRP
2023-10-14 18:37:25 +00:00
Rubidium
adad078b55 Fix #11367, 7c37dcb: use STRING1 when the passed string can have a parameter 2023-10-14 12:15:25 +02:00
bdcf6b6acd Fix: Treat closing network relay window as a choice of "No".
Issue ConnectFailure when closing the window if the relay request is
considered unhandled.
2023-10-13 20:47:28 +01:00
f379b31e28 Add: data parameter in Window::Close method.
This allows passing data when closing a window, e.g. to indicate how it was closed.
2023-10-13 20:47:28 +01:00
cda6f24fe8 Change: Filter duplicate paths from valid search path list. (#11363) 2023-10-09 21:38:13 +00:00
Loïc Guilloux
0458c15060 Cleanup: [MacOS] Remove unneeded WITH_SDL checks (#11360) 2023-10-09 19:35:15 +02:00
ac9db3f5aa Codechange: Don't use bit-field in Yapf rail node. (#11362)
Compacting 3 booleans into 3 bits could save memory allocation, however this data is inside a union which also contains a 4-byte integer. As such this gives the cost penalty of a bit-field without any benefit.
2023-10-09 12:11:55 +00:00
translators
84201a8520 Update: Translations from eints
chinese (traditional): 80 changes by wpi3
chinese (simplified): 1 change by WenSimEHRP
2023-10-07 18:37:44 +00:00
2fd3d943aa Fix 94167dfd: Don't shade the currently selected engine in autoreplace window. (#11354)
This breaks #7729 which specifically allows autoreplace of same engine types, and also did not work properly if the engine had been built during the current game session.
2023-10-06 21:09:24 +01:00
translators
89acfc7ff9 Update: Translations from eints
chinese (simplified): 1 change by WenSimEHRP
indonesian: 12 changes by liimee
2023-10-04 18:39:06 +00:00
d1a94d75e1 Fix: Incorrect include path for timers. (#11351) 2023-10-04 17:02:16 +01:00
translators
7145b7060a Update: Translations from eints
romanian: 3 changes by bnegrut
2023-10-03 18:39:41 +00:00
merni-ns
c794676928 Fix #10763, Fix #11168: Display variant groups that consist only of unavailable sub-groups (#11342) 2023-10-03 12:43:15 +00:00
5869f790d8 Fix: Check for engine variant loops during NewGRF initialization. (#11343)
Invalid NewGRFs could set up an engine variant loop that never ends. This
was checked for in some places that evaluated variants, but not all. In
most cases this would result in the engines not appearing, but could
potentially cause an infinite loop and crash.

Instead, during NewGRF initialization detect loops and remove invalid
variants before setting display flags.
2023-10-03 12:14:32 +01:00
merni-ns
077b08bbfa Fix #11261: Set number of items correctly when choosing available airport set (#11344) 2023-10-03 12:58:44 +02:00
frosch
82c8720814 Fix #8846: When upgrading NewGRF presets, copy NewGRF parameters only if the NewGRF are compatible. Otherwise reset to defaults. 2023-10-02 22:32:30 +02:00
frosch
d75a5e1a9a Fix: Upgrading NewGRF presets could result in incomplete display of NewGRF parameters until restart. 2023-10-02 22:32:30 +02:00
translators
c84219a42e Update: Translations from eints
english (us): 1 change by 2TallTyler
vietnamese: 21 changes by KhoiCanDev
2023-09-30 18:37:10 +00:00
b5dc9328f2 Change: Store station blocked/wires/pylons flags in map. (#11337)
This stores three flags in unused map bits, and avoids having to look up
station graphics and custom station specs to determine blocked/wires/pylons
status.

This potentially affects rail pathfinding performance.

Savegame version is not bumped, as the flags can just be updated every
time.
2023-09-30 12:30:25 +01:00
translators
fd79d34ba9 Update: Translations from eints
korean: 1 change by telk5093
2023-09-27 18:39:05 +00:00
translators
beafdadde4 Update: Translations from eints
italian: 25 changes by Rivarossi
2023-09-26 18:39:04 +00:00
890146fecb Codechange: Add -Wsuggest-override compilation flag. 2023-09-25 21:27:45 +01:00
015fbafe34 Codechange: Add missing override specifiers to squirrel. 2023-09-25 21:27:45 +01:00
49dae08a3b Codechange: Add missing override specifiers. 2023-09-25 21:27:45 +01:00
frosch
a454773a73 Doc: Link 3rdparty licenses from README. (#11333) 2023-09-25 22:11:20 +02:00
translators
a650194227 Update: Translations from eints
finnish: 1 change by hpiirai
2023-09-25 18:38:49 +00:00
translators
976f8c474f Update: Translations from eints
chinese (simplified): 139 changes by BYXxiaonanhui
catalan: 23 changes by J0anJosep
portuguese (brazilian): 1 change by pasantoro
2023-09-24 18:36:59 +00:00
translators
f8303b0397 Update: Translations from eints
english (au): 1 change by krysclarke
russian: 1 change by Ln-Wolf
danish: 1 change by bscargo
dutch: 1 change by Afoklala
french: 1 change by ottdfevr
portuguese: 1 change by azulcosta
polish: 68 changes by pAter-exe
2023-09-22 18:37:34 +00:00
Rubidium
bec36c1f98 Cleanup ba67f39: CodeQL's dependency was forgotten to be removed 2023-09-21 21:48:35 +02:00
398c7e5f9d Codechange: Use new function to get a bitmask of empty cargo types. 2023-09-21 18:29:02 +01:00
69ee38bd43 Codechange: Use GetAcceptanceMask() instead of duplicating it. 2023-09-21 18:29:02 +01:00
6d675c8acf Fix: #11329: Don't assert vehicle list length is non-zero when only asked to set string parameter. (#11330)
Since #11321, the vehicle list is not yet initialized when SetStringParameters is called, so a test that the vehicle list size is zero is triggered. However, doing this check in the SetStringParameters function is a bit out of its remit, so just remove it.
2023-09-21 13:24:53 +01:00
cef6a5f79c Fix #11326: Update autoreplace scrollbar count after clearing engine list. (#11327) 2023-09-21 07:42:49 +01:00
Joan Josep
6b7537646d Fix: Allow NewGRF inspection of road tiles. (#11323) 2023-09-20 22:54:34 +01:00
122bfa2afd Codechange: Use less locals for station free names bitmask. 2023-09-20 21:57:51 +01:00
aeaa552385 Codechange: Use std::bitset instead of bool array.
This avoids use of C-style pointers and memset.
2023-09-20 21:57:51 +01:00
2eacf36d0a Codechange: List fallback station names by ID instead of magic number.
This improves readability and intention of the station name generator.
2023-09-20 21:57:51 +01:00
frosch
f40816503f Codechange: Add enum items for dynmically created setting dropdowns. 2023-09-20 22:35:32 +02:00
frosch
39e67b6f4c Codechange: Use existing widget ids instead of raw numbers. 2023-09-20 22:35:32 +02:00
frosch
e0df937247 Fix b5885295: NewGRF preset dropdown was broken. 2023-09-20 22:35:32 +02:00
translators
72323ae9e6 Update: Translations from eints
danish: 20 changes by bscargo
2023-09-20 18:38:51 +00:00
Joan Josep
b9a1cb5d7c Fix: Spelling of NIHAirport. (#11322) 2023-09-20 20:22:37 +02:00
a0c6259e33 Codechange: Don't access cargo filter before it is initialized. (#11321)
The cargo filter list is initialized during window OnInit, but the first
build of the filtered list occurred before this.
2023-09-20 08:58:08 +01:00
48dc4219ea Codechange: Don't pass GUI cargo filter constants to command system. (#11320)
CMD_BUILD_VEHICLE expects CT_INVALID to indicate a new vehicle should not
be refitted on build, but the code passed CF_NONE instead. CF_NONE has the
same numeric value at CT_INVALID, so the test passed, but...
2023-09-20 08:56:53 +01:00
frosch
6b586dddad Cleanup: TransmitNotesOff is only called with buffer==_buffer. 2023-09-19 22:49:59 +02:00
frosch
c84fd30317 Codechange: Add missing 'override'. 2023-09-19 22:49:59 +02:00
frosch
2ff4248032 Codechange: Enable more warnings. 2023-09-19 22:49:59 +02:00
frosch
a7707302e6 Codechange: silence false warning. 2023-09-19 22:49:59 +02:00
frosch
55da426d44 Codechange: All ParagraphLayoutFactory::AppendToBuffer assume that the buffer has at least some space.
Assert on that.
2023-09-19 22:49:59 +02:00
frosch
baf7cc858b Codechange: Rename ship docking tile related functions. 2023-09-19 22:49:59 +02:00
frosch
5733145c59 Cleanup: Remove unneeded parameters. 2023-09-19 22:49:59 +02:00
frosch
b5885295f0 Codechange: Use parameters, which should be used. 2023-09-19 22:49:59 +02:00
frosch
b6c8f301be Codechange: Silence warnings about intentionally unused parameters. 2023-09-19 22:49:59 +02:00
Patric Stout
df400ef84a Fix: only count distance traveled in vehicles for cargo payment (#11283)
No longer you can utilize the free (and instant) labour of station
workers, transporting your cargo from one part of the station to
the other. No more!

Based on patch by dP.
2023-09-19 22:16:31 +02:00
translators
710722e3c1 Update: Translations from eints
korean: 1 change by telk5093
2023-09-19 18:38:46 +00:00
6fb89b189f Fix #11315: Sort industries and cargoes by name* in industry chain window.
*Cargo types are sorted by the normal method so it's not strictly alphabetical.
2023-09-19 12:25:20 +01:00
106f29f761 Codechange: Use iteration to copy cargo list into CFT_CARGO. 2023-09-19 12:25:20 +01:00
4f8d06ff73 Codechange: Use uint8_t instead of byte for numeric values. 2023-09-19 12:25:20 +01:00
9457bda614 Codechange: Use std::fill instead of memset when initializing GUI cargo fields. 2023-09-19 12:25:20 +01:00
18e75dbc88 Fix: Don't produce invalid cargo. (#11314)
Production for secondary industries did not always check that the produced cargo type isn't valid.
2023-09-18 22:43:03 +01:00
fd2dd4397f Codechange: Use range-for and iterator to populate default cargo table. 2023-09-17 21:26:01 +01:00
280dce9543 Codechange: Reorder CargoSpec to reduce alignment padding. 2023-09-17 21:26:01 +01:00
e8cbc3c2c7 Codechange: Simplify initialization of default cargoes. 2023-09-17 21:26:01 +01:00
Patric Stout
c6864637fb Add: [GitHub] also test if release builds without asserts are warning-free (#11309) 2023-09-17 19:47:55 +02:00
Rubidium
3a2509198f Codechange: use better location for the "invalid" action sentinel value
It used to be a random sentinel for end-of-(widget-)list that was used to tell
that no action has taken place yet. Since the last action is practically the
widget that was pressed, add the sentinel to that enumeration.
2023-09-17 19:44:20 +02:00
Rubidium
09a7902d36 Fix 8ab0936: missed WIDGET_LIST_END removals 2023-09-17 19:44:20 +02:00
Jonathan G Rennison
3afb732c37 Fix #11307: Incorrect GroupStatistics after selling leading wagon
When this results in a countable consist
2023-09-17 18:42:37 +01:00
14bcfff6f5 Codechange: Rename INVALID_CARGO to INVALID_CARGO_BITNUM
... to avoid future ambiguity.
2023-09-17 16:56:07 +01:00
9d1b131c44 Codechange: Use correct constant for invalid cargo type. 2023-09-17 16:56:07 +01:00
Rubidium
7ef22af2bb Codechange: introduce and use function to raise and dirty a set of widgets when they are lowered 2023-09-17 16:03:01 +02:00
6580ff1adb Fix #11230: Widget layout also failed for group-less vehicle list window. (#11310) 2023-09-17 10:03:24 +00:00
Rubidium
4cf88e068a Remove: unused include of cstdarg/stdarg.h 2023-09-16 23:09:53 +02:00
Rubidium
8ab0936491 Codechange: use parameter pack/folding instead of va_arg macros for widget states 2023-09-16 23:09:53 +02:00
translators
30eba33f1e Update: Translations from eints
english (us): 20 changes by 2TallTyler
2023-09-16 18:37:38 +00:00
frosch
c6f5b57f13 Fix #11297, 4e9a871: SCC_GENDER_LIST tried to determine the gender from the wrong sub-string. (#11299) 2023-09-15 15:25:25 -04:00
Patric Stout
39ef4b503f Fix: also apply cargo filters on shared groups in vehicle listing (#11294) 2023-09-15 21:22:58 +02:00
translators
8d90448153 Update: Translations from eints
romanian: 18 changes by bnegrut
turkish: 22 changes by densxd
dutch: 20 changes by Afoklala
portuguese: 21 changes by azulcosta
2023-09-15 18:37:57 +00:00
Jonathan G Rennison
42170e6c2b Codechange: Rename RoadType parameter of MakeRoadDepot
See: #9642
2023-09-15 18:21:12 +02:00
frosch
a3f661cb66 Fix: compilation failed on gcc 10.2 due to missing include. (#11300)
'_exit' is defined in 'unistd.h'.
2023-09-15 09:26:03 +01:00
translators
ba51a34b4c Update: Translations from eints
english (au): 20 changes by krysclarke
korean: 25 changes by telk5093
russian: 20 changes by Ln-Wolf
finnish: 20 changes by hpiirai
french: 20 changes by glx22
portuguese (brazilian): 20 changes by pasantoro
2023-09-14 18:37:08 +00:00
Patric Stout
37e2f99c09 Change: store crash logs in JSON format (#11232) 2023-09-14 20:13:27 +02:00
a0353af223 Codechange: Shuffle Depot members to reduce padding. 2023-09-14 09:50:58 +01:00
2fdc22e7ea Codechange: Shuffle CargoPayment members to reduce padding. 2023-09-14 09:50:58 +01:00
a3c70ee6fb Codechange: Pass by reference and use emplace-at-end for CargoSummary. (#11296) 2023-09-14 08:41:33 +00:00
289d6ebc43 Doc: Replace plain URLs to OpenGFX/SFX/MSX with Markdown links. (#11295) 2023-09-14 00:17:08 +01:00
Loïc Guilloux
b4ff06b6ef Fix: marked text was not updated during text deletion (#11293) 2023-09-13 20:59:34 +00:00
translators
fca62c245f Update: Translations from eints 2023-09-13 18:38:58 +00:00
Loïc Guilloux
220f93f552 Fix: IConsoleWindow:GetTextBoundingRect() is incorrect (#11292) 2023-09-13 16:07:55 +00:00
Daniel Robinson
71c2878799 Fix #10600: 'Replace Vehicles' didn't show numbers >999 (#10680) 2023-09-13 15:19:44 +00:00
Patric Stout
9c49a61249 Fix: base cargo payment on load/unload tile, instead of station sign location (#11281) 2023-09-13 14:41:09 +00:00
Patric Stout
ba67f39db6 Codechange: vendor the nlohmann-json library (#11290) 2023-09-13 16:11:34 +02:00
Niels Martin Hansen
41de0d46f3 Feature: Help and manuals access window 2023-09-13 16:11:08 +02:00
Niels Martin Hansen
2cff43251e Add: Install additional documentation files with the game
Also include it in Emscripten packages
2023-09-13 16:11:08 +02:00
Niels Martin Hansen
4765d0f8c2 Change: Text Layouter support querying all lines for character at pixel 2023-09-13 16:11:08 +02:00
Patric Stout
d1a0ca67be Codechange: simplify splitting of CargoPacket (#11286) 2023-09-13 09:40:01 -04:00
translators
a16aa3ef7d Update: Translations from eints
swedish: 1 change by joeax910
2023-09-12 18:38:00 +00:00
Patric Stout
b389d45d55 Doc: Add more hyperlinks within the included documentation (#11288)
Co-authored-by: Niels Martin Hansen <nielsm@indvikleren.dk>
2023-09-11 18:55:23 +00:00
translators
3fd50c2949 Update: Translations from eints
swedish: 2 changes by optiedev
vietnamese: 11 changes by KhoiCanDev
romanian: 5 changes by bnegrut
danish: 2 changes by bscargo
dutch: 2 changes by Afoklala
portuguese: 2 changes by azulcosta
polish: 15 changes by pAter-exe
2023-09-11 18:38:29 +00:00
acd7d3c913 Codechange: Rename *Railtype* to *RailType* for consistency. (#11287) 2023-09-11 08:55:12 +00:00
a0b2f28f9c Codechange: Use std::copy/fill pattern to initialize rail and road specs. (#11285)
This avoids use of lengthof and array indices.
2023-09-10 23:01:08 +00:00
Patric Stout
7e3cdbaf62 Fix: mark next_station as INVALID_STATION when loading from older savegames 2023-09-11 00:25:47 +02:00
Patric Stout
9e3763cfb3 Fix b0e73277: save/load next_station for CargoPacket again 2023-09-11 00:25:47 +02:00
Patric Stout
1243c331b6 Fix: don't compare next_station when trying to merge CargoPackets
For vehicle packets they shouldn't be compared, and for station
packets they are already in a bucket per next_station.
2023-09-11 00:25:47 +02:00
Patric Stout
9f8c1ea552 Codechange: rename next_station to next_hop to avoid confusing with another next_station 2023-09-11 00:25:47 +02:00
Patric Stout
a0f6983be4 Codechange: remove parameter from VehicleCargoList::Reassign that is always INVALID_STATION 2023-09-11 00:25:47 +02:00
6643c010bd Fix: NewGRF house class mappings were not reset between games. (#11279) 2023-09-10 18:55:37 +01:00
Michael Lutz
1c620b349f Feature: [NewGRF] Related Act2 objects for airports and airport tiles.
Airports are similar two stations and industries, both of which have the town as related object.
Airport tiles are similar to industry tiles, which have the industry as related object.
This seems a sensible structure, so let's make it Airport Tile -> Airport -> Town.
2023-09-10 19:38:18 +02:00
Michael Lutz
a6f2f3c042 Add: [NewGRF] Inspection window for airports.
As as the station window combines all station types, accessing the
debug view is via the parent of the airport tile only.
2023-09-10 19:38:18 +02:00
Patric Stout
e6c02ebee6 Fix b0e73277: cargodist information got lost when splitting of cargo (#11280)
During b0e73277 we removed loaded_at_xy, but I kinda forgot that
it was a union with next_station. Now next_station wasn't copied
anymore, or checked in AreMergable.
2023-09-10 15:20:58 +02:00
Tyler Trahan
701a61c9af Codechange: Delete date_type.h 2023-09-10 08:40:25 -04:00
Tyler Trahan
77173a6a10 Codechange: Move date consts and functions to CalendarTime and TimerGameCalendar classes 2023-09-10 08:40:25 -04:00
Tyler Trahan
fca2b37726 Codechange: Move Ticks into their own class 2023-09-10 08:40:25 -04:00
Patric Stout
30172fc037 Codechange: cleanup CargoPacket in terms of variable/function names (#11278)
Over the years, things got reused and changed, making the current
names somewhat unclear in what they actually mean and do.
2023-09-09 23:21:21 +02:00
Patric Stout
b0e73277d6 Codechange: remove loaded_at_xy from CargoPacket as it was unused (#11276) 2023-09-09 20:24:46 +01:00
f3b4f9d640 Codechange: Reduce size of TextEffectMode and TextEffectID.
TextEffectID was promoted to size_t in #9235, when it was used in loops.
However since then the relevant code uses range-for or iterators instead.
2023-09-09 19:26:47 +01:00
f6939d6c4d Codechange: Make INVALID_TE_ID a TextEffectID instead of a TextEffectMode.
Type-correctness?
2023-09-09 19:26:47 +01:00
3c61c642a9 Codechange: Don't allocate a text effect with INVALID_TE_ID.
Previously, despite INVALID_TE_ID existing, it was not checked during allocation and there was no limit to the number of text effects.
2023-09-09 19:26:47 +01:00
78b841d14e Codechange: Take reference to text effect instead of pointer when updating. 2023-09-09 19:26:47 +01:00
7519f7ad79 Codechange: Use std::find_if to find or assign a text effect slot.
This replaces an index-based loop.
2023-09-09 19:26:47 +01:00
7bd019df90 Codechange: Use std::array for TemporaryStorageArray.
This removes the need for initialisation with memset().
2023-09-09 15:26:03 +01:00
9040d7813d Codechange: Use std::array and std::unique_ptr for PersistentStorageArrays.
This (mostly) avoids the need for manual memory management and copying.
2023-09-09 15:26:03 +01:00
Patric Stout
c3918838f6 Fix: crash when opening a damaged base-graphics (#11275) 2023-09-09 14:06:00 +00:00
afc1ea8135 Codechange: Using alias and std::array for company expense storage. (#11273)
This simplifies passing yearly expenses to functions and use of std algorithms.
2023-09-09 13:15:53 +00:00
Patric Stout
00f13282a9 Codechange: keep how we convert string <-> JSON private (#11269) 2023-09-08 19:03:10 +02:00
Patric Stout
d725fa14a2 Fix: asserts unintentially being partially disabled in release-builds (#11268)
The nlohmann-json header file includes assert.h, which rudely resets
the assert macro to what that header thinks is right. As we set the
assert macro to be active with release builds when WITH_ASSERT is
active, this means that every file including nlohmann-json has their
asserts disabled (for release-builds) but files that don't do no.

Let's avoid this issue, by telling nlohmann to not include assert.h.
2023-09-08 10:11:37 +00:00
Rubidium
8c742b456f Codechange: use Textbuf directly, instead via several virtual functions in Window 2023-09-06 23:07:04 +02:00
Jonathan G Rennison
0316940fe8 Fix: Inaccurate waiting cargo total in station window when using cargodist (#11213)
For stations with many flows and/or small cargo packets,
due to accumulated inaccuracies in DivideApprox.

The displayed total should match GoodsEntry::TotalCount().
2023-09-06 21:36:26 +02:00
Loïc Guilloux
21bd5fb991 Fix: [CI] preview flow can't install latest version of npm (#11265) 2023-09-06 16:29:34 +00:00
Patric Stout
5f9b8aaa95 Codechange: [Script] use nlohmann for Squirrel <-> JSON conversion (#11251) 2023-09-06 13:14:12 +02:00
translators
6e8d7964ed Update: Translations from eints
english (us): 4 changes by 2TallTyler
2023-09-05 18:38:17 +00:00
translators
9d2920e9c5 Update: Translations from eints
french: 2 changes by ottdfevr
2023-09-04 18:38:09 +00:00
Patric Stout
337b7b0c63 Fix 8c9ecde9: actually remove autosave_interval from setting window (#11260) 2023-09-04 11:18:47 +00:00
152b0cac34 Codechange: Return update nwid_begin instead of count.
This avoids needing to keep track of how many widget parts have been consumed, instead we only to ensure nwid_begin < nwid_end.
2023-09-04 10:20:45 +01:00
e8015e497d Codechange: Use begin/end of nwidget parts of begin/length.
This simplifies processing nwidget parts as, unlike the remaining length, the pointer to the end of the list never changes. This is the same principle as we use(d) for tracking end instead of length for C-style strings.

And this removes 160~ instances of the lengthof() macro.
2023-09-04 10:20:45 +01:00
e4613fc04c Codechange: Allow using more than 65536 NewGRF string IDs.
NewGRF string allocation allowed up to 524288 strings, however stringid was passed as uint16_t which limits to 2^16.
2023-09-04 09:49:09 +01:00
3e762af2d1 Change: Replace fixed length _grf_text array with vector.
Additionally reshuffle GRFTextEntry for better alignment.

This removes a mostly-unused static 20MB allocation.
2023-09-04 09:49:09 +01:00
translators
dadf5182d8 Update: Translations from eints
english (au): 2 changes by krysclarke
russian: 3 changes by Ln-Wolf
finnish: 2 changes by hpiirai
portuguese (brazilian): 2 changes by pasantoro
2023-09-03 18:38:15 +00:00
bd150df914 Codechange: Reorder some high-use structs to reduce their size. (#11201)
This reduces GoodsEntry from 144 to 136 bytes (thereby reducing Station from 9704 bytes to 9192 bytes), and CargoPacket from 40 bytes to 32 bytes.
2023-09-02 20:56:36 +00:00
translators
5c2e4ee6fe Update: Translations from eints 2023-09-02 18:38:13 +00:00
glx22
b0f8890ba5 Codechange: [CMake] detect source files with duplicate names 2023-09-02 20:32:44 +02:00
glx22
c77184aa35 Codechange: [CMake] reduce code duplication 2023-09-02 20:32:44 +02:00
Bouke Haarsma
7e54418022 Codechange: workaround CMake/Xcode duplicate file name issue (#11186)
Having a library with files with the same name isn't supported in CMake's Xcode project file generation: https://gitlab.kitware.com/cmake/cmake/-/issues/20501. One of the files is renamed to work around this bug.
2023-09-02 19:46:52 +02:00
Michael Lutz
0089323542 Add: [Script] Custom news message text for industry SetProductionLevel. 2023-09-02 16:20:59 +02:00
Michael Lutz
1c56991213 Add: [Script] Game script control of industry production level. 2023-09-02 16:20:59 +02:00
mrmbernardi
a5c8365aa4 Feature: Setting to disallow level crossings with competitors (#10755) 2023-09-02 12:46:24 +02:00
frosch
236ec41fa2 Fix #11230: Group list widget layout failed, if dropdown widgets were higher than the font height. (#11231) 2023-09-02 12:45:19 +02:00
translators
6ab169fbe0 Update: Translations from eints
dutch: 1 change by Afoklala
2023-09-01 18:38:57 +00:00
Patric Stout
7afd686541 Codechange: add tests for GS <-> AdminPort JSON conversion (#11252)
While at it, fix a bug where booleans were made integers.
2023-08-31 19:38:15 +00:00
Patric Stout
993e7be707 Fix: [Script] GSAdmin.Send() could generate invalid JSON (#11250) 2023-08-31 16:52:52 +00:00
glx22
4eddec9e79 Add: [Emscripten] Support for bootstrapping 2023-08-31 12:59:12 +02:00
glx22
3d1c4a8589 Codechange: [Emscripten] Improve syncfs synchronisation on exit/abort 2023-08-31 12:59:12 +02:00
Patric Stout
75d3dc0a19 Codechange: [Emscripten] remove "relative_mode" parameter from -vsdl as it doesn't exist (#11249) 2023-08-31 12:04:22 +02:00
Patric Stout
502414b567 Fix: [Emscripten] config not saved on exit game (#11248)
When changing a Game Option and pressing Exit Game, the changes
were not actually stored. This because the post-mainloop code
was never executed for Emscripten.
2023-08-31 10:10:11 +01:00
Patric Stout
2f96ccc18a Add: [CI] Create and store breakpad symbols for releases (#11247)
Additionally, also store PDB and exe files on the Symbol Server
for easier debugging with MSVC.
2023-08-30 18:27:15 +00:00
Patric Stout
ecb4bb5161 Change: for surveys capture more information about the OpenTTD version (#11244) 2023-08-30 12:14:32 +02:00
translators
5e75afb628 Update: Translations from eints
catalan: 2 changes by J0anJosep
2023-08-28 18:38:07 +00:00
Patric Stout
a3d631ffed Change: make nlohmann a mandatory library to build OpenTTD (#11235) 2023-08-28 19:04:36 +02:00
Patric Stout
13b76b0243 Fix: [CI] don't install breakpad on arm64-windows-static, as it is not supported (yet) (#11242) 2023-08-28 16:49:14 +02:00
Patric Stout
110dd0e6c1 Fix: [CI] Allow release-flow to run in forks (while skipping survey-key) (#11241) 2023-08-28 16:24:07 +02:00
Patric Stout
abc060525d Add: calendar date for Survey results
This means no heuristics is possible on around which date people
play the game.
2023-08-28 13:02:52 +02:00
Patric Stout
b0d7cfaa3d Change: [Win32] don't allocate 192KiB of memory on the stack on crash (#11240)
Heap is out of the question, as it might be corrupted.
Allocating this much on stack is silly.

So instead, allocate virtual pages to write the information in.
2023-08-28 12:14:11 +02:00
Patric Stout
de5e338a76 Change: mention in MacOS / Windows crashlog popup when files couldn't be generated (#11239)
For example, if the crash.sav couldn't be created, and the TryExcept
detected an issue, write out that the file is not available in
the popup.
2023-08-27 22:49:12 +00:00
Joan Josep
be9a690f41 Fix #9642: Keep infrastructure totals when overbuilding road depots. (#11229) 2023-08-28 00:20:37 +02:00
Patric Stout
d4312c59a4 Codechange: [MacOS] use backtrace() instead of our custom variant (#11233)
As mentioned in the comment, we only did it ourselves as we once
were compatible with versions before 10.5. But that time has long
gone. So let's update the code to a bit more modern approach.
2023-08-27 22:32:11 +02:00
Joan Josep
5e6b5d981f Codechange: Use existing functions in GetMonthlyInfrastructureCosts. (#11237) 2023-08-27 22:12:44 +02:00
Patric Stout
b00e483b0f Change: recover when possible from crashes during a crash (#11238) 2023-08-27 21:54:05 +02:00
translators
99e4a14cdf Update: Translations from eints
english (au): 1 change by krysclarke
finnish: 3 changes by hpiirai
danish: 1 change by bscargo
french: 1 change by glx22
portuguese (brazilian): 1 change by pasantoro
2023-08-27 18:39:02 +00:00
Patric Stout
29a37c2e0b Change: [Win32] unify the crashlog handler with the other OSes (#11236)
While at it, make the crash text a bit more readable, and sync
this with MacOS.
2023-08-27 17:58:31 +00:00
translators
f2841e62d9 Update: Translations from eints
russian: 1 change by Ln-Wolf
turkish: 1 change by densxd
portuguese: 1 change by azulcosta
polish: 3 changes by pAter-exe
2023-08-26 18:38:15 +00:00
translators
6726918ab0 Update: Translations from eints
catalan: 30 changes by J0anJosep
2023-08-25 18:38:04 +00:00
Richard Wheeler
96fdfb941a Feature: Transparency option for cost and income indicators (#11001) 2023-08-25 16:04:40 +02:00
Joan Josep
a938067d6b Codechange: Invalid depot value is unrelated to invalid station value. (#11227) 2023-08-25 14:29:51 +02:00
Joan Josep
ead5284476 Doc: Improve the example given for fall throughs. (#11228) 2023-08-25 10:56:11 +00:00
translators
9aef380c99 Update: Translations from eints
italian: 43 changes by Rivarossi
french: 1 change by ottdfevr
2023-08-24 18:38:24 +00:00
translators
4d4a046d23 Update: Translations from eints
polish: 2 changes by pAter-exe
2023-08-22 18:39:08 +00:00
Jonathan G Rennison
2cbd76593a Fix #11215: Assert in NewGRF parameters window (manual parameter mode) (#11217) 2023-08-21 12:42:33 +02:00
Rubidium
6635f809dd Fix #11181: attempting to read string as int triggers assertion 2023-08-20 23:57:42 +02:00
Jonathan G Rennison
8df4aa7979 Fix: Road stops should not draw a ground sprite of 0 (#11214) 2023-08-20 15:46:19 -04:00
Patric Stout
45cc3acaf5 Codechange: [Win32] unify AppendDecodedStacktrace and LogStacktrace (#11220)
AppendDecodedStacktrace was already doing the same as LogStacktrace,
just with a different name.
2023-08-20 18:57:01 +00:00
translators
bc2dfc4691 Update: Translations from eints
turkish: 2 changes by BeratSJ
2023-08-20 18:39:09 +00:00
Patric Stout
352ac264a5 Remove: [Win32] module-list from crash.log (#11219)
Only Windows implemented this, and it opens the files to read them
to get a CRC. Doing this in a crash-handler is strange at best.

Lastly, nobody has actually ever used this information to come to
some sort of conclusion. The module-list is used in combination
with the crash.dmp, but this information is already embedded in
there.
2023-08-20 17:09:21 +00:00
Patric Stout
f120d2beb8 Add: use breakpad to create crash.dmp on MacOS / Linux too (#11202)
Normally only the Windows platform could create a crash.dmp, making
analysing crash-reports from MacOS / Linux rather tricky.
2023-08-20 17:16:08 +02:00
Patric Stout
8f6df242c4 Remove: [Win32] (pointer-only) stack trace in crash.log (#11211)
It only contains pointers, which nobody can decipher anyway.
So instead, just report "Not supported", like other targets do
when they can't print a sane stack trace.
2023-08-20 17:08:16 +02:00
Patric Stout
a5aebeb1b5 Remove: [Win32] register values in crash.log (#11212) 2023-08-20 16:59:22 +02:00
Loïc Guilloux
8c9ecde964 Change: Remove autosave from settings window (#11218)
It is broken since 4f4810d and it's also in game options.
2023-08-20 14:33:02 +00:00
translators
93f4f1e83a Update: Translations from eints
german: 40 changes by Wuzzy2
2023-08-19 18:38:46 +00:00
Patric Stout
cd10ddf9ae Remove: last remnants of SunOS (#11210)
We have no evidence SunOS has been tried in the last few years,
and the code is awkward enough to just remove.
2023-08-19 00:52:58 +02:00
Patric Stout
53af20910b Fix: [MSVC] generate static libraries / executables correctly with vcpkg -static target (#11208) 2023-08-19 00:43:32 +02:00
translators
7f5c0aab60 Update: Translations from eints
dutch: 2 changes by Afoklala
2023-08-18 18:38:21 +00:00
Patric Stout
5ac333c2cc Fix: [MacOS] screen looks blue-ish when using newer SDKs (#11207)
The define kCGBitmapByteOrder32Host changed (around SDK 12?)
into an enum, which means an old #ifndef was triggering,
overwriting the value to 0. Sadly, 0 means Order16Big, causing
RGBA to become GRAB, which results in strange colours.

As we no longer support PPC, drop that piece of code completely.
2023-08-18 13:22:00 +02:00
Loïc Guilloux
2bf3c02fbf Fix: no fast forward in network was ensured only from GUI side (#11206) 2023-08-17 21:14:39 +02:00
translators
e8c49d3543 Update: Translations from eints
swedish: 1 change by joeax910
2023-08-17 18:38:20 +00:00
Jonathan G Rennison
9061fef59c Fix #11203: [ICU] Glyph to char mapping with multiple runs (#11204) 2023-08-16 19:17:02 +00:00
translators
db1a9f00c0 Update: Translations from eints
dutch: 1 change by Bouke
2023-08-16 18:38:51 +00:00
romw314
662f76bfc4 Docs: mention Windows 11 in directory_structure.md (#11200) 2023-08-15 22:21:13 +02:00
Patric Stout
07730584d7 Codechange: make explicit when a TileIndex is cast to its basetype (#11190)
This prevents people accidentially assigning a TileIndex to a Date
or any other type they shouldn't.
2023-08-15 18:12:05 +02:00
arikover
5d3f7939e2 Fix d42a78f: Show correct road speed in construction dropdowns (#11196) 2023-08-15 10:34:36 +02:00
Loïc Guilloux
7ef55bdfb0 Cleanup: [CMake] don't add strgen.h twice (#11199) 2023-08-14 21:29:03 +00:00
translators
e652cd6434 Update: Translations from eints
swedish: 1 change by Brickblock1
english (us): 2 changes by 2TallTyler
2023-08-14 18:38:20 +00:00
Tyler Trahan
61dfd74e44 Codechange: Use correct type for max timetable start years constant (#11197) 2023-08-13 21:03:45 +02:00
translators
0726835735 Update: Translations from eints
english (au): 2 changes by krysclarke
french: 1 change by Lishouuu
portuguese (brazilian): 2 changes by pasantoro
2023-08-13 18:38:43 +00:00
Patric Stout
9dc2fbe4fa Fix 0238a2b5: crash when news message is displayed (#11195) 2023-08-13 10:16:36 +00:00
Rubidium
40195e689d Change: improve wording of help (host instead of IP) and update man page 2023-08-12 22:01:22 +02:00
Rubidium
a8e4d35bde Fix: crash when not passing parameter for -n 2023-08-12 22:01:22 +02:00
translators
56e0d0c7ef Update: Translations from eints
korean: 3 changes by telk5093
russian: 2 changes by Ln-Wolf
portuguese: 3 changes by azulcosta
2023-08-12 18:38:26 +00:00
Patric Stout
9624017fc2 Codechange: be more type-specific about types in NPFs queue (#11192) 2023-08-12 18:18:22 +00:00
Patric Stout
299570b2c1 Codechange: make TimerGameCalendar Date and Year types strongly typed (#10761) 2023-08-12 18:14:21 +00:00
Patric Stout
0238a2b567 Codechange: use std::variant instead of using bitflags in the value (#11191) 2023-08-12 16:05:00 +00:00
Patric Stout
a9ed590ca7 Codechange: use TimerGameCalendar::Date for variables in linkgraph that are dates (#11187) 2023-08-12 16:02:38 +02:00
Patric Stout
b7acf9e50e Codechange: use TimerGameCalendar::Year and friends when working with years (#11188) 2023-08-12 16:02:31 +02:00
Patric Stout
01f55eb734 Codechange: introduce week/quarter triggers for TimerGameCalendar (#11189)
This simplifies code that triggers on these periods.
2023-08-12 16:02:11 +02:00
Loïc Guilloux
02be6ab6ba Fix #11179, a979d9c: Don't start more competitors than allowed (#11185) 2023-08-11 22:30:01 +02:00
Tyler Trahan
8ea01c0bfb Fix #11180: Use TileVirtXY for aircraft crash tile (#11184) 2023-08-11 14:05:16 +00:00
Tyler Trahan
c7b51a8c3a Codechange: Use proper date types in various places (#11177) 2023-08-11 13:32:42 +00:00
Patric Stout
c9c9cfa4fd Codechange: simplify the type of loaded_at_xy / next_station (#11182)
It was TileOrStationID, most likely to make sure both types in
the union are identical. But as TileIndex is a StrongTypeDef
that becomes a bit weird. So instead, still make sure they are
of equal size, but define their individual types better.
2023-08-11 12:55:55 +00:00
Patric Stout
5fba47b0f7 Codechange: make no assumptions on how the internals of TileIndex work (#11183)
Basically, avoid ".value", and just cast it to its original type
if you want to retrieve this.
2023-08-11 14:53:51 +02:00
Tyler Trahan
6190f48df0 Codechange: Add a DateToYear function instead of dividing each time (#11173) 2023-08-11 08:19:54 -04:00
Tyler Trahan
4928ccf916 Fix #10478: Clarify airport noise control setting texts (#11169) 2023-08-11 08:19:26 -04:00
Tyler Trahan
e4fd99a33a Codechange: Use DateAtStartOfYear() instead of multiplying by DAYS_IN_LEAP_YEAR (#11174) 2023-08-11 08:18:59 -04:00
Tyler Trahan
93069066f9 Codechange: Use auto type when sorting dates (#11175) 2023-08-11 08:18:32 -04:00
Tyler Trahan
6f057cbe6a Codechange: Use proper date type in ClickChangeDateCheat (#11176) 2023-08-11 07:52:59 -04:00
Loïc Guilloux
ba95764f1c Fix 57717a2: VS2022 optimisation bug is fixed with MSVC 19.37 (#11172) 2023-08-09 21:43:34 +02:00
translators
c2fc2d2ed5 Update: Translations from eints
romanian: 48 changes by bnegrut
2023-08-09 18:40:24 +00:00
translators
4daa00c22a Update: Translations from eints
slovak: 53 changes by legitalk
2023-08-07 18:38:52 +00:00
translators
2bc97fae66 Update: Translations from eints
swedish: 45 changes by joeax910
portuguese: 106 changes by azulcosta
2023-08-06 18:38:21 +00:00
Tyler Trahan
9a602ff304 Fix #10334: Store separate newgrf-safe version of date_of_last_service. (#11124)
This value is not changed when the date cheat is used, which caused issues with changing properties based on service date.

Co-authored-by: Peter Nelson <peter1138@openttd.org>
2023-08-06 12:57:10 -04:00
translators
77c00dfe98 Update: Translations from eints
slovak: 9 changes by legitalk
dutch: 3 changes by Afoklala
2023-08-04 18:38:28 +00:00
translators
9d376dc8e0 Update: Translations from eints
finnish: 1 change by hpiirai
portuguese (brazilian): 1 change by pasantoro
2023-08-03 18:38:02 +00:00
translators
11ba39b435 Update: Translations from eints
korean: 21 changes by telk5093
polish: 1 change by pAter-exe
2023-08-02 18:38:24 +00:00
Jonathan G Rennison
6a048bc168 Fix #11164: Duplicate town names when using the many random towns function 2023-08-02 20:07:59 +02:00
translators
4213a2c909 Update: Translations from eints
russian: 1 change by Ln-Wolf
turkish: 33 changes by densxd
danish: 1 change by bscargo
french: 1 change by Lishouuu
polish: 21 changes by pAter-exe
2023-08-01 18:38:22 +00:00
4acb68e539 Fix #11162: Get colour map of correct train part. (#11163) 2023-08-01 15:05:42 +01:00
translators
43559524eb Update: Translations from eints
english (au): 1 change by krysclarke
english (us): 1 change by 2TallTyler
portuguese: 1 change by azulcosta
2023-07-31 18:39:05 +00:00
Tyler Trahan
9876c861e4 Remove: Unused ship pathfinder invalidation setting callback 2023-07-30 18:21:13 -04:00
Tyler Trahan
4decd2aa48 Change: Enable "Forbid 90 degree turns" setting by default 2023-07-30 18:21:13 -04:00
translators
5a2e9be9d3 Update: Translations from eints
vietnamese: 10 changes by KhoiCanDev
french: 15 changes by Lishouuu, 9 changes by ottdfevr
2023-07-30 18:38:12 +00:00
Tyler Trahan
f57296a033 Change: Only show platform stopping location in orders when other than default (#11102) 2023-07-29 17:59:02 -04:00
translators
536d2cb75b Update: Translations from eints
english (au): 4 changes by krysclarke
english (us): 4 changes by 2TallTyler
vietnamese: 2 changes by KhoiCanDev
russian: 21 changes by Ln-Wolf
finnish: 37 changes by hpiirai
portuguese: 24 changes by azulcosta
portuguese (brazilian): 6 changes by pasantoro
2023-07-29 18:38:24 +00:00
Loïc Guilloux
a979d9cdda Fix #11067, ed83c4b: Don't start competitors during map generation (#11069) 2023-07-29 12:31:33 +02:00
translators
760a194d31 Update: Translations from eints
english (us): 19 changes by 2TallTyler
dutch: 20 changes by Afoklala
2023-07-28 18:38:29 +00:00
Tyler Trahan
6e99326ad2 Fix: Missing hyphenation in various ownership strings (#11155) 2023-07-27 16:40:47 -04:00
translators
41faae8c59 Update: Translations from eints
english (au): 19 changes by krysclarke
vietnamese: 12 changes by KhoiCanDev
danish: 19 changes by bscargo
portuguese: 20 changes by azulcosta
portuguese (brazilian): 19 changes by pasantoro
2023-07-27 18:45:51 +00:00
translators
abc3a96e9d Update: Translations from eints
czech: 6 changes by JakMel
danish: 6 changes by bscargo
2023-07-26 18:38:42 +00:00
Henry Wilson
a9c65a69d0 Feature: Add config option to set default company secondary colour for new games
This does duplicate translation strings for the colours
2023-07-26 16:22:30 +02:00
translators
5653a94490 Update: Translations from eints
czech: 16 changes by JakMel
2023-07-25 18:38:34 +00:00
translators
974e6e220c Update: Translations from eints
korean: 3 changes by telk5093
french: 3 changes by ottdfevr
2023-07-24 18:40:15 +00:00
translators
74fac454d0 Update: Translations from eints
vietnamese: 1 change by KhoiCanDev
2023-07-23 18:38:30 +00:00
translators
d9d0a2c842 Update: Translations from eints
english (au): 3 changes by krysclarke
portuguese (brazilian): 22 changes by pasantoro
2023-07-22 18:38:34 +00:00
fd155dfb40 Change: Scale bridge GUI by interface scale. (#11152) 2023-07-22 17:10:18 +01:00
translators
96e937c6cd Update: Translations from eints
norwegian (bokmal): 1 change by buzzCraft
chinese (traditional): 1 change by wpi3
spanish (mexican): 1 change by absay
english (us): 3 changes by 2TallTyler
vietnamese: 13 changes by KhoiCanDev
russian: 3 changes by Ln-Wolf
dutch: 23 changes by Afoklala
lithuanian: 1 change by devbotas
portuguese: 6 changes by azulcosta
polish: 3 changes by pAter-exe
2023-07-21 18:38:52 +00:00
44a86e796f Fix #11061: Missed currency-code suffix removal for some translations. (#11149) 2023-07-21 06:31:04 +01:00
translators
5d27d00821 Update: Translations from eints 2023-07-20 18:39:13 +00:00
Andy
ce9305a5ee Add: [Script] GSIndustry.GetConstructionDate() method (#11145) 2023-07-20 20:35:37 +02:00
MasonGulu
0be27778af Add: alternative setting for right-click close window option to exclude pinned windows (#10204) 2023-07-19 23:24:22 +02:00
translators
092a3db745 Update: Translations from eints
finnish: 3 changes by hpiirai
polish: 15 changes by pAter-exe
2023-07-19 18:38:55 +00:00
Jonathan G Rennison
f31a25cd59 Change: Do not allow mixing road/tram types in powered road type list (#11148)
Road/tram property 0F
2023-07-19 19:51:21 +02:00
Rubidium
461b4b8861 Cleanup: remove typedefs for non _t (u)int types and WChar 2023-07-19 19:30:14 +02:00
Rubidium
eaae0bb5e7 Codechange: automatic adding of _t to (u)int types, and WChar to char32_t
for i in `find src -type f|grep -v 3rdparty/fmt|grep -v 3rdparty/catch2|grep -v 3rdparty/opengl|grep -v stdafx.h`; do sed 's/uint16& /uint16 \&/g;s/int8\([ >*),;[]\)/int8_t\1/g;s/int16\([ >*),;[]\)/int16_t\1/g;s/int32\([ >*),;[]\)/int32_t\1/g;s/int64\([ >*),;[]\)/int64_t\1/g;s/ uint32(/ uint32_t(/g;s/_uint8_t/_uint8/;s/Uint8_t/Uint8/;s/ft_int64_t/ft_int64/g;s/uint64$/uint64_t/;s/WChar/char32_t/g;s/char32_t char32_t/char32_t WChar/' -i $i; done
2023-07-19 19:30:14 +02:00
Patric Stout
4f4810dc28 Fix: store autosave settings under the new names 2023-07-19 13:17:50 +02:00
Patric Stout
790c1b1b02 Codechange: refactor setting conversions and make sure it only happens once
By forcing it only happens once, the first time you upgrade to
a newer client, means you are free to jump between older and newer
versions after that. As they will not resync, the newer setting
can take on any of the (newer) values, without breaking the old
client. And when going to an old client and back, it doesn't
change it back to the converted value anymore.
2023-07-19 13:17:50 +02:00
Patric Stout
ece50d5a1d Codechange: use BoolSettingDesc to parse settings in conversion code 2023-07-19 13:17:50 +02:00
Andy
06b2d9b1cc Doc: 'game_changelog.hpp' not 'gs_changelog.hpp' in GitHub PR template (#11147) 2023-07-19 11:43:24 +02:00
translators
335c7ddac7 Update: Translations from eints
swedish: 22 changes by Brickblock1
2023-07-18 18:40:57 +00:00
translators
61b0143c87 Update: Translations from eints
english (us): 21 changes by 2TallTyler
korean: 3 changes by telk5093
catalan: 27 changes by J0anJosep
turkish: 12 changes by densxd
french: 13 changes by Lishouuu
2023-07-17 18:40:04 +00:00
translators
9c262b0d92 Update: Translations from eints
english (au): 3 changes by krysclarke
russian: 3 changes by Ln-Wolf
portuguese: 3 changes by azulcosta
2023-07-16 18:39:47 +00:00
Jonathan G Rennison
864d2352c2 Fix: Integer overflow in LinkGraphOverlay::ShowTooltip for long links
In particular when fully zoomed in
This could result in tooltips not being shown at all, or being shown
when not appropriate
2023-07-16 10:10:04 +02:00
translators
756c469b8f Update: Translations from eints
english (au): 20 changes by krysclarke
swedish: 2 changes by SkogisREAL
japanese: 2 changes by fmang
welsh: 1 change by Ansbaradigeidfran
english (us): 2 changes by 2TallTyler
galician: 2 changes by pvillaverde
vietnamese: 2 changes by KhoiCanDev
korean: 8 changes by telk5093
hungarian: 1 change by PstasDev
indonesian: 1 change by ecolortest
italian: 2 changes by Rivarossi
german: 2 changes by Wuzzy2
russian: 9 changes by Ln-Wolf
finnish: 2 changes by hpiirai
catalan: 2 changes by J0anJosep
turkish: 2 changes by densxd
danish: 2 changes by bscargo
dutch: 2 changes by Afoklala
french: 2 changes by ZarTek-Creole
portuguese: 28 changes by azulcosta
esperanto: 2 changes by legoscia
portuguese (brazilian): 2 changes by ericandradex
polish: 2 changes by pAter-exe
2023-07-15 18:39:54 +00:00
Rubidium
bfbdaf8723 Update: force remove outdated strings as they can still trigger #11137 for other languages 2023-07-15 06:33:12 +02:00
Rubidium
a184e7f793 Fix #11137: assertion failure due to interpreting string as number 2023-07-15 06:33:12 +02:00
Tyler Trahan
e4be7f4a45 Change: Clean up window title and button capitalization and wording (#11134)
* Change: Use consistent window title format for industry/cargo chains

* Change: Don't capitalize dropdown entry for cargo flow legend

* Change: Use consistent window titles for AI and GS settings

* Change: Use consistent window title for company value graph

* Change: Use consistent window title for industry funding

* Change: Use consistent button title to display industry chain

* Change: Use consistent button capitalization for local authority button on town window

* Fix: Don't capitalize random words in vehicle list management dropdown

* Fix: Use title case for Frame Rate window caption

* Fix: Use title case for Detailed Performance Rating window caption
2023-07-14 10:25:01 -04:00
glx22
46b504a700 Fix: ini_key issues reported by the script 2023-07-14 14:32:46 +02:00
glx22
9cdf86a411 Add: workflow and script for checking ini_key issues in WindowDesc entries 2023-07-14 14:32:46 +02:00
Björn Wärmedal
7de37e07b6 Change: make Exclusive Transport Rights more exclusive (#11076)
Now, exclusive transport rights can only be bought if no company
currently owns them. A successful bribe will void any exclusive
transport rights that any *other* company currently has in the town.
2023-07-14 14:00:28 +02:00
merni-ns
fc9afb2d32 Fix #11115: Focus the abandon game/exit game windows (#11125) 2023-07-14 13:57:45 +02:00
c3d1264a4b Change: Don't save industry history if cargo slot isn't used. (#11133)
This avoids saving history of 16 slots per industry when in many cases (NewGRF dependent) only a couple are used.
2023-07-14 11:12:22 +01:00
Jonathan G Rennison
3ac663e619 Fix: Build road/tram stop windows did not set WindowDesc::ini_key (#11126)
Saved default window sizes were not persisted in the configuration file
2023-07-12 22:07:31 +02:00
translators
7996752fb1 Update: Translations from eints
indonesian: 71 changes by ecolortest
2023-07-12 18:43:54 +00:00
rubidium42
9f6fec01cd Codechange: rename cargo aging days to periods, as they are not really days (#11112) 2023-07-12 13:20:02 -04:00
Patric Stout
ab19882e94 Codechange: hint in all branches of ClampTo to resolve compile-time (#11130) 2023-07-12 13:54:44 +00:00
Patric Stout
97138acc8a Codechange: make date-related variables constexpr (#11129)
This hints the compiler even more to result math-related questions
compile-time.
2023-07-12 13:15:24 +00:00
Patric Stout
7ef6e99083 Fix: [CI] actually use the GitHub Apps token to trigger "Publish Docs" (#11128) 2023-07-11 13:14:50 +00:00
translators
d3181375a4 Update: Translations from eints
danish: 2 changes by bscargo
french: 2 changes by Lishouuu
2023-07-09 18:39:28 +00:00
translators
a54c28f2c3 Update: Translations from eints
polish: 3 changes by pAter-exe
2023-07-08 18:39:43 +00:00
Loïc Guilloux
119ac66c5c Fix: [Bootstrap] don't crash when failing to connect to content server (#11122) 2023-07-08 14:54:39 +00:00
Patric Stout
dadcade81c Fix: [CI] preview for one PR could cancel the preview of another (#11121) 2023-07-08 12:10:15 +00:00
Patric Stout
323dd619bb Change: [CI] rework preview flow and use Cloudflare Pages to publish (#11116) 2023-07-08 12:30:27 +02:00
Patric Stout
153323a4c0 Fix: [Emscripten] actually link against nlohmann_json (#11120)
We fake a plain (non-scoped) library, but we don't actually set
the library to anything valid. In result, it is never actually
linked.
2023-07-07 21:21:43 +00:00
Loïc Guilloux
c236ff356d Codechange: [Emscripten] enable WASM_BIGINT (#11118) 2023-07-07 20:32:33 +00:00
translators
bd91d249ea Update: Translations from eints
dutch: 3 changes by Afoklala
2023-07-07 18:41:15 +00:00
translators
b2ccc19f2d Update: Translations from eints
vietnamese: 2 changes by KhoiCanDev
2023-07-06 18:40:33 +00:00
Rubidium
18a31cca7c Codechange: do not make a string valid in place, to then copy it 2023-07-06 19:59:50 +02:00
Rubidium
b958a343fe Codechange: the templated StrMakeValidInPlace is not in place 2023-07-06 19:59:41 +02:00
Rubidium
968de827d6 Fix #11108, e2f583a: missing argument for SCC_CARGO_SHORT formatting 2023-07-06 19:46:54 +02:00
Loïc Guilloux
5f2246eabf Fix 021c45c: [CMake] detection and use of nlohmann-json for emscripten (#11113) 2023-07-06 11:49:06 +02:00
translators
9f28da4e33 Update: Translations from eints
tamil: 3 changes by merni-ns
2023-07-05 18:42:59 +00:00
Patric Stout
83b6512032 Fix d5a72193: [CI] downloading single artifact doesn't add folder to it (#11107) 2023-07-04 20:53:46 +00:00
translators
48f25427bc Update: Translations from eints
english (us): 15 changes by 2TallTyler
korean: 2 changes by telk5093
german: 41 changes by Wuzzy2
portuguese (brazilian): 2 changes by pasantoro
2023-07-04 18:43:15 +00:00
Patric Stout
bc83974b38 Fix: [Emscripten] switch to URL for content-service that supports WebSocket (#11106)
In the old days, content.openttd.org and bananas-server.openttd.org
ended up on the same route. But with a recent migration, they do not.
content.openttd.org only serves the custom TCP protocol, and
bananas-server.openttd.org only serves the HTTP(S).

Websockets use HTTPS, and as such, should be routed via the latter.
2023-07-04 12:39:55 +00:00
Koen Bussemaker
381fa36450 Change: Autorail / autoroad tools can start dragging from invalid tiles 2023-07-04 14:08:32 +02:00
merni-ns
a8a4737c5b Fix #11096: Increase priority of error and confirmation windows (#11104) 2023-07-03 23:24:44 +02:00
merni-ns
96da5581ce Doc: Link to coding style in the repository itself and add Discord link in addition to IRC 2023-07-03 23:17:04 +02:00
merni-ns
f1a6f91235 Doc: Remove redundant <pre> 2023-07-03 23:17:04 +02:00
translators
bcaa60612e Update: Translations from eints
portuguese: 3 changes by azulcosta
2023-07-03 18:40:35 +00:00
Rubidium
af9b9327af Codechange: do not keep local variable for temporary string parameters 2023-07-03 18:08:03 +02:00
Rubidium
e04d43f396 Remove: now unused stredup 2023-07-03 18:08:03 +02:00
Rubidium
2ec4ea2b99 Codechange: use the string temporaries for game script strings 2023-07-03 18:08:03 +02:00
Rubidium
3e488465f8 Codechange: allow string temporaries in a StringParameter 2023-07-03 18:08:03 +02:00
Rubidium
78f5d58dc6 Codechange: use std::string without const as return
Otherwise some compilers, e.g. MSVC, do not pick up that these are temporaries
and as such it will pass the temporaries to `const std::string &` instead of
the wanted `std::string &&`
2023-07-03 18:08:03 +02:00
Rubidium
b2edf82b69 Cleanup: remove unneeded CopyOutDParam version with StringID 2023-07-03 06:56:08 +02:00
Rubidium
4654b2b0aa Codechange: separate integer and string usage in StringParameters 2023-07-03 06:56:08 +02:00
Rubidium
8b7c34d7d4 Codechange: use string parameter backps for the text effects 2023-07-03 00:00:12 +02:00
Rubidium
7ed90a859f Codechange: function to check whether string parameters have changed since the backup 2023-07-03 00:00:12 +02:00
Rubidium
05ef3f0998 Cleanup: remove old backup/restore of string parameters 2023-07-02 22:31:01 +02:00
Rubidium
6313b8a4cb Codechange: move errors over to the new StringParameterBackup type 2023-07-02 22:31:01 +02:00
Rubidium
0943402bab Codechange: move news over to the new StringParameterBackup type 2023-07-02 22:31:01 +02:00
Rubidium
f4a3032985 Codechange: move tooltip and query window over to the new StringParameterBackup type 2023-07-02 22:31:01 +02:00
Rubidium
2687704afc Codechange: introduce new type and functions for StringParameter backups 2023-07-02 22:31:01 +02:00
translators
26f3efb419 Update: Translations from eints
english (au): 2 changes by krysclarke
italian: 14 changes by Rivarossi
russian: 2 changes by Ln-Wolf
finnish: 2 changes by hpiirai
tamil: 8 changes by merni-ns
2023-07-02 18:39:30 +00:00
Patric Stout
4c9c164ddc Fix d5a72193: [CI] GOG and Steam also depend on the source itself (#11095) 2023-07-01 21:32:47 +00:00
115f6cf8ea Fix #4575: Use Latin 'l' in English translation of zloty. (#11090)
This avoids many truetype fonts being unusable due to this single character not being available.
2023-07-01 20:12:28 +01:00
translators
10dd3119b1 Update: Translations from eints
welsh: 163 changes by Ansbaradigeidfran
2023-07-01 18:39:07 +00:00
merni-ns
161cc04b8a Fix #11087: Disable base graphics/sound dropdown outside main menu 2023-07-01 19:03:45 +02:00
merni-ns
4ae9ebf582 Change: Tooltip for base graphic/sound dropdown 2023-07-01 19:03:45 +02:00
Patric Stout
d5a72193e7 Change: [CI] upload releases to new CDN (#11093) 2023-07-01 14:30:57 +02:00
Kuhnovic
6169e7f4bc Feature: Orientation of rail and road depots can be changed (#9642) 2023-07-01 08:11:31 -04:00
c3fbe7bea8 Cleanup: Use FS enum instead of magic numbers. (#11088) 2023-06-30 20:11:09 +00:00
translators
082c47a4f9 Update: Translations from eints
dutch: 1 change by Afoklala
2023-06-30 18:40:38 +00:00
Rubidium
d5c75bd655 Codechange: use std::string instead of a temporary buffer for iconv calls 2023-06-30 19:15:21 +02:00
Rubidium
0ea3e338ab Codechange: replace buffer+strecpy with std::string 2023-06-29 17:32:27 +02:00
Rubidium
3f18a8863a Codechange: use std::getline to read strings from stdin 2023-06-29 16:49:10 +02:00
Rubidium
f333372dd1 Codechange: let IConsoleCmdExec accept std::string 2023-06-29 06:06:15 +02:00
Rubidium
fd380127f0 Codechange: use SignalObjectAndWait since we do not support older than Windows XP anymore 2023-06-28 23:22:14 +02:00
Rubidium
69d5b9d326 Cleanup: unused NO_THREADS #ifdefs 2023-06-28 19:07:10 +02:00
translators
55979b612e Update: Translations from eints
welsh: 28 changes by Ansbaradigeidfran
portuguese: 1 change by azulcosta
polish: 1 change by pAter-exe
2023-06-27 18:43:13 +00:00
Richard Wheeler
3b2934c479 Change: Make terraforming point selection sprite visible at >2x zoom out (#11017) 2023-06-27 10:47:42 -04:00
Johannes E. Krause
5b0cfc7ea5 Add: show fallback sprites with debuglevel sprite=4 2023-06-27 15:12:27 +02:00
Jonathan G Rennison
55c07eed59 Change: Add separate setting for server sent commands per frame limit (#11023)
Set a higher default value for this setting.
Use the higher of this and existing commands per frame limit
setting for server-originating commands, e.g. GS.

This is to support the GSAsyncMode class.
This also avoids undue throttling when more than one
script is in operation (e.g. AIs).
2023-06-27 12:32:45 +01:00
8465559488 Codechange: Pass face index as font os_handle for FreeType fonts. (#11073)
This allows fallback font detection to test the specific face within the
font rather instead of only the first.
2023-06-27 12:30:46 +01:00
Rubidium
794b642b9a Codechange: use std::string/std::vector over stredup/strecpy/CallocT/free 2023-06-27 12:35:31 +02:00
Rubidium
700241410b Remove: support for not having getifaddrs 2023-06-27 12:35:07 +02:00
Rubidium
7ad487eeee Cleanup: remove now unused GetInt32/64 functions 2023-06-27 12:34:40 +02:00
Rubidium
75a22a1c83 Codechange: move from GetIntXY to GetNextParameter<XYY> 2023-06-27 12:34:40 +02:00
Rubidium
e7937efb01 Codechange: add clearer named function to get the next (string) parameter 2023-06-27 12:34:40 +02:00
translators
ee34fae09a Update: Translations from eints
korean: 3 changes by telk5093
danish: 3 changes by bscargo
2023-06-26 18:42:58 +00:00
Niels Martin Hansen
103d88ee33 Fix: Layouter not taking stripped formatting codes into account when mapping visual coordinates to/from original string 2023-06-26 17:31:17 +02:00
Niels Martin Hansen
b52e526017 Fix: FallbackParagraphLayouter wasn't reverse-mapping glyphs to character indexes right 2023-06-26 17:31:17 +02:00
translators
5db4473ae8 Update: Translations from eints
vietnamese: 1 change by KhoiCanDev
finnish: 3 changes by hpiirai
french: 5 changes by Naeso
2023-06-25 18:41:23 +00:00
d140acf34e Fix: Setting tree lines drawn incorrectly for RTL languages. (#11070) 2023-06-25 19:32:53 +01:00
fac317b139 Cleanup: Remove {ORANGE} from settings page strings. 2023-06-25 17:22:02 +01:00
40a9b080aa Fix: Ensure settings page label is orange. 2023-06-25 17:22:02 +01:00
Loïc Guilloux
55e3dd9409 Cleanup 6298b96: Left-over function declaration (#11072) 2023-06-25 15:51:15 +00:00
Jonathan G Rennison
4f6d75f97d Fix #11016: Defer deletion of client and server game socket handlers
This fixes various use after free scenarios in error handling paths
2023-06-25 12:02:32 +01:00
Jonathan G Rennison
19ae88fb63 Fix: Error logging in game and admin server HandlePacket
Don't invent a packet type in the log message if we can't/don't
read a packet type at all.
Fix packet type not being logged when appropriate.
2023-06-25 12:02:32 +01:00
43ddf19df3 Change: Allow text shadow on WWT_EMPTY/WWT_TEXT to extend horizontally. (#11065)
This alleviates text shadows of truetype fonts being cropped in some
window layouts.
2023-06-25 11:58:39 +01:00
509471f7f8 Codechange: Use std::optional for GRFConfig::GRFError (#11066)
This changes the semantics from "object pointer ownership" to "optional object", and simplifies copies.
2023-06-25 11:57:58 +01:00
translators
71f241ffe1 Update: Translations from eints
english (au): 1 change by krysclarke
russian: 1 change by Ln-Wolf
turkish: 1 change by BeratSJ
french: 1 change by glx22
portuguese (brazilian): 4 changes by pasantoro
2023-06-24 18:40:40 +00:00
translators
78c9446aef Update: Translations from eints
norwegian (bokmal): 1 change by buzzCraft
chinese (traditional): 1 change by wpi3
spanish (mexican): 1 change by absay
lithuanian: 1 change by devbotas
portuguese (brazilian): 3 changes by Greavez
2023-06-23 18:41:29 +00:00
6f36f1d912 Change: Remove currency code/symbol suffix from language files. 2023-06-23 16:47:32 +01:00
9dd9b8ec74 Fix #11054: Prevent translation of currency codes.
Most languages stick with the 3-letter latin currency codes in the name
string, however some translations are... clever... and use the currency
symbol instead. Whilst this may look nice, it can cause issues with fonts
as some scripts have a specific limited set of fonts which do not include
these symbols.

Instead, hard code the currency code list and add it when drawing the
currency name.
2023-06-23 16:47:32 +01:00
d42a78f3e8 Codechange: Make DropDownListStringItem preformat and remove other implementations. (#11063)
Having to choose between DropDownListStringItem, DropDownListCharStringItem, and DropDownListParamStringItem depending on whether to draw a StringID, a raw string, or a StringID with extra parameters was needlessly complex.

Instead, allow passing a StringID or raw string to DropDownListStringItem. This will preformat the StringID into a raw string, and can therefore accept parameters via the normal SetDParam mechanism.

This also means that strings no longer need to be formatted on every draw.
2023-06-23 08:30:13 +00:00
Rubidium
321f01602a Codechange: reduce passing around parameters, but formatting strings earlier 2023-06-23 06:48:13 +02:00
Rubidium
f48baa7d00 Codechange: move sign invisibility check out of loop 2023-06-23 06:48:13 +02:00
translators
9016d4a5b5 Update: Translations from eints
arabic (egypt): 8 changes by AviationGamerX
turkish: 5 changes by densxd
danish: 3 changes by bscargo
2023-06-22 18:38:02 +00:00
translators
c316d9ecb7 Update: Translations from eints
english (au): 2 changes by krysclarke
vietnamese: 3 changes by KhoiCanDev
russian: 2 changes by Ln-Wolf
dutch: 5 changes by Afoklala
french: 2 changes by Lishouuu
portuguese: 2 changes by azulcosta
esperanto: 51 changes by legoscia
polish: 3 changes by pAter-exe
2023-06-21 18:37:58 +00:00
Patric Stout
ff050ea1d9 Fix: [CI] enable audio (alsa / jack / pulse) for generic Linux builds (#11051)
SDL needs to see the header files when compiling to enable those
drivers runtime. It doesn't actually link against them: it just
needs to see the headers.
2023-06-21 13:37:13 +02:00
Rubidium
4e9a871718 Codechange: merge multiple string parameter arrays to single array of structs 2023-06-21 05:46:11 +02:00
Rubidium
fa8c50758b Codechange: replace memcpy when copying DParams 2023-06-21 05:46:11 +02:00
Rubidium
2aa48bfcb3 Add: subspan function to span 2023-06-21 05:46:11 +02:00
Rubidium
7a785a4224 Codechange: simplify StringParameters now type cannot be nullptr 2023-06-20 22:25:25 +02:00
Rubidium
428333aeba Codechange: let AllocatedStringParameters allocated types too 2023-06-20 22:25:25 +02:00
Finn Willard
f23249f8f1 Fix #10917: Pay loan interest before generating statistics (#11040) 2023-06-20 22:02:09 +02:00
b68d56d94d Fix #11043: Don't choose toolbar dropdown option if focus is lost. (#11044)
Since dropdown menus now get closed if they lose focus, 'instant close' dropdowns (i.e. the toolbar dropdowns) should no longer execute their action to avoid unintended actions.
2023-06-20 20:34:05 +01:00
Rubidium
9f3254b72a Fix b1fb209: build failure due to removed parameter 2023-06-20 21:32:04 +02:00
translators
4d0369ea9c Update: Translations from eints
finnish: 1 change by hpiirai
portuguese (brazilian): 1 change by pasantoro
2023-06-20 18:38:55 +00:00
glx22
6c7f977197 Codechange: Use {COLOUR} to simplify drawing of timetables 2023-06-20 19:05:10 +02:00
glx22
b1fb209bed Add: {COLOUR} control code to allow colour changes at runtime 2023-06-20 19:05:10 +02:00
Rubidium
88138c55f8 Codechange: make offset protected and guard against invalid offsets 2023-06-20 17:37:49 +02:00
Rubidium
9c3c90effa Codechange: rename ClearTypeInformation so it can be used for preparing for the next run 2023-06-20 17:37:49 +02:00
Rubidium
01abcdfcac Codechange: make StringParameters#next_type only writable from outside the class 2023-06-20 17:37:49 +02:00
Rubidium
3e8f8c55c2 Codechange: make creating temporary StringParameters easier 2023-06-20 17:37:24 +02:00
Patric Stout
5bac27287e Fix 456abda5: [DorpsGek] escape "[" and "]" correctly (#11046) 2023-06-20 15:25:32 +00:00
Patric Stout
456abda508 Fix: [DorpsGek] report eints commits on Discord / IRC (#11045) 2023-06-20 14:23:57 +00:00
translators
aaf6811a2c Update: Translations from eints
english (au): 1 change by krysclarke
korean: 1 change by telk5093
russian: 1 change by Ln-Wolf
french: 1 change by Lishouuu
portuguese: 1 change by azulcosta
2023-06-20 13:37:22 +00:00
Rubidium
8caacb5a49 Codechange: use std::deque for console history 2023-06-20 15:25:29 +02:00
Rubidium
4fbc81003f Codechange: make SQString::Create that supports std::string and use that 2023-06-20 15:25:17 +02:00
translators
ea54408e1d Update: Translations from eints
french: 1 change by Lishouuu
2023-06-19 18:40:36 +00:00
merni-ns
b3669a8795 Fix #11026: Use real engine name instead of default name for filtering (#11033) 2023-06-19 01:03:32 +02:00
Rubidium
714ff35e9d Codechange: move to std::string over stredup + free 2023-06-18 22:55:15 +02:00
2a2443dd01 Feature: Create group of vehicles from manage vehicle list button. (#10890) 2023-06-18 20:48:04 +01:00
Rubidium
70de70bdcd Codechange: refactor code to remove need for stredup 2023-06-18 21:22:28 +02:00
Rubidium
74924c8186 Codechange: includes must be before 'safeguards.h' 2023-06-18 21:22:14 +02:00
Niels Martin Hansen
ed3f14686d Fix: Layouter::GetCharAtPosition counting wrong
Bug introduced in commit 60399e
2023-06-18 21:07:40 +02:00
translators
31cc349a09 Update: Translations from eints
swedish: 51 changes by SkogisREAL
2023-06-18 18:43:02 +00:00
Rubidium
09f585b772 Codechange: use std::string over stredup+free for splitting font name 2023-06-18 18:32:20 +02:00
Loïc Guilloux
1d9bc23525 Fix #10868: [Script] Handle errors when loading savegame data on stack (#11029) 2023-06-18 12:03:59 +02:00
Rubidium
381e8b69d2 Codechange: make size and offset size_t 2023-06-18 09:50:11 +02:00
Rubidium
4e6733cc6e Codechange: use args.GetParam(offset) over *args.GetPointerToOffset(offset) 2023-06-18 07:10:10 +02:00
Rubidium
e404ba0631 Codechange: generify GetRemainingParameters to allow custom offsets 2023-06-18 07:09:59 +02:00
translators
9215e36300 Update: Translations from eints
vietnamese: 2 changes by KhoiCanDev
finnish: 2 changes by hpiirai
danish: 2 changes by bscargo
2023-06-17 18:40:32 +00:00
Jonathan G Rennison
a6b625eea3 Fix #10993: Crash log when font caches not initialised (#11024)
See also: #10836
2023-06-17 17:56:27 +01:00
Rubidium
1d902a97ce Codechange: move StringParameters to strings_internal.h 2023-06-17 12:14:11 +02:00
Rubidium
ad048b143a Codechange: move implementation of Set/GetDParam to strings.cpp 2023-06-17 12:14:11 +02:00
Rubidium
dd53a738bb Codechange: automatically set/check the correct type for string parameters/genders 2023-06-17 11:02:31 +02:00
Rubidium
836541b41c Codechange: use SetDParam and CopyOutDParam for tooltips 2023-06-17 10:01:19 +02:00
Rubidium
ac0c932ce7 Codechange: use SetDParam to set measurement tooltip parameters 2023-06-17 10:01:19 +02:00
Jonathan G Rennison
ee8b03e8da Fix: Crash when failing to load a game into a dedicated server at startup (#11021)
Using the -g switch
2023-06-16 19:41:26 +01:00
ed06c6bdcf Codechange: Use vector when migrating old savegame orders. (#11020) 2023-06-16 19:40:24 +01:00
fc2510e2ba Codechange: Use std::vector for midifile's ByteBuffer. (#11019) 2023-06-16 17:04:46 +01:00
Owen Rudge
1a3d1bca59 Remove: OS/2 port 2023-06-16 14:29:14 +01:00
Rubidium
d4c2043294 Codechange: remove a number of unneeded c_str() calls 2023-06-15 22:14:45 +02:00
translators
aae8f40b9f Update: Translations from eints
english (au): 2 changes by krysclarke
korean: 2 changes by telk5093
russian: 2 changes by Ln-Wolf
french: 2 changes by ottdfevr
portuguese: 2 changes by azulcosta
portuguese (brazilian): 2 changes by ericandradex
polish: 2 changes by pAter-exe
2023-06-15 18:41:48 +00:00
Owen Rudge
5a7098cb41 Change: [Actions] Use notarytool for notarization instead of gon 2023-06-15 14:52:00 +01:00
Loïc Guilloux
1cd49bf5e5 Fix ca1e34c: [Script] Wrong value printed for {RAW_STRING} (#11011) 2023-06-14 22:07:11 +00:00
Jonathan G Rennison
864d3c9c16 Fix: CMD_CHANGE_SETTING did not reject SF_NO_NETWORK_SYNC settings (#11009) 2023-06-14 19:44:10 +02:00
f51f117b00 Change: Add window description flag to disallow interactive window closing. (#11008)
This replaces/simplifies testing for a closebox to allow closing a window with right-click, and testing for specific window classes when closing all windows by hotkey.

This allows right-click closing of dropdowns and the high-score window.
2023-06-14 17:24:14 +01:00
Rubidium
7c37dcb8e3 Fix: do not use {STRING} when {STRING1} or {STRING2} is needed 2023-06-14 09:44:06 +02:00
Rubidium
0a5e58451b Codechange: pass string parameters by reference 2023-06-14 06:14:08 +02:00
Rubidium
43f91bc50c Cleanup: unused GetDataPointer function 2023-06-13 23:53:13 +02:00
Rubidium
e332810231 Codechange: pass zero length arguments for {STRING}, instead of the remaining arguments 2023-06-13 23:53:13 +02:00
Rubidium
82851a9bef Codechange: do not mess with global string params to get pointer to first element 2023-06-13 23:53:13 +02:00
Rubidium
aba0d27a28 Codechange: use StringParameters for remapping the NewGRF string control codes 2023-06-13 22:11:21 +02:00
Rubidium
1146904d45 Fix: when a string consumes more parameters than allowed, nullptr is attempted to be formatted 2023-06-13 20:58:45 +02:00
translators
f1ec2f274c Update: Translations from eints
vietnamese: 6 changes by KhoiCanDev
korean: 4 changes by telk5093
german: 33 changes by SecretIdetity
romanian: 69 changes by kneekoo
russian: 2 changes by Ln-Wolf
finnish: 4 changes by hpiirai
turkish: 4 changes by BeratSJ
danish: 1 change by bscargo
dutch: 6 changes by Afoklala
french: 4 changes by ottdfevr
portuguese (brazilian): 6 changes by pasantoro
polish: 6 changes by pAter-exe
2023-06-13 18:40:34 +00:00
Andrii
f26de0d2f9 Fix #10982: No help text for gamelog command (#10984) 2023-06-13 08:33:33 +00:00
ebc451b071 Fix #10987: Double-close of dropdown stopped land-info tool working as default. (#11000)
Clicking and releasing on the query toolbar icon is meant to select the land-info tool.

This did not work as during closing a window, OnFocusLost() is called, which then closes the window again. These two calls toggled the land-info tool one and off in the same action.

Resolve by not calling Window::Close in OnFocusLost() if the window is already closing.
2023-06-12 08:42:02 +01:00
Rubidium
613ad80581 Codechange: remove need for GetDParamX 2023-06-12 09:12:11 +02:00
Rubidium
82b434b589 Codechange: rename function to better describe what it is doing 2023-06-12 09:12:11 +02:00
Rubidium
f86500df92 Codechange: remove need for SetDParamX 2023-06-12 09:12:11 +02:00
Rubidium
6c6f365d2f Codechange: remove offset parameter for copying DParams in and out 2023-06-11 17:03:31 +02:00
Rubidium
d42ef3a0ef Codechange: inject the query window caption into the widget 2023-06-11 17:03:31 +02:00
Patric Stout
6869f387ba Fix 07add7a9: [Win32] use full monitor resolution for fullscreen (#10985)
On Windows in fullscreen you cannot reach the top with
the cursor for the halve of the height of your toolbar.

Additionally, on Win10 in fullscreen you can see the actual toolbar.
2023-06-11 12:00:02 +02:00
2097719f26 Fix: Don't restore backed up vehicle name if it's no longer unique. (#10979) 2023-06-09 21:18:55 +00:00
Rubidium
6d597879d0 Codechange: let ReadLine return a string instead of passing a buffer 2023-06-09 19:58:29 +02:00
Rubidium
81f957b9f8 Codechange: use std::string to find the executable's working directory 2023-06-09 19:58:18 +02:00
merni-ns
1be668c2e4 Fix #10975: Clear a non-head engine's name (#10976) 2023-06-09 16:09:36 +01:00
Rubidium
66a984afd7 Codechange: rename function to better describe its functionality 2023-06-09 06:41:52 +02:00
Rubidium
48dcb79145 Cleanup: remove seprintf and vsnprintf 2023-06-09 06:41:33 +02:00
Rubidium
13cdf5fffa Codechange: use std::filesystem::path for the language file's path 2023-06-08 23:20:28 +02:00
Rubidium
97dd84d1e0 Codechange: move saveload string fixing code to saveload 2023-06-08 20:36:27 +02:00
Rubidium
3f35787458 Codechange: replace stredup + StrMakeValidInPlace with std::string + StrMakeValid 2023-06-08 19:32:15 +02:00
Rubidium
e762855201 Cleanup: remove str_strip_colours; StrMakeValid also removes the colours
Essentially str_strip_colours followed by StrMakeValid makes the calling of
str_strip_colours useless, as StrMakeValid would have removed them too.
2023-06-08 19:32:15 +02:00
mrmbernardi
35ef6c1723 Feature: [GS] Goal destination can be updated (#10817) 2023-06-08 18:00:31 +01:00
Rubidium
9408ab4799 Codechange: only one '\0' is required 2023-06-08 18:51:02 +02:00
Rubidium
2ae7367024 Codechange: replace StrMakeValidInPlace with StrValid 2023-06-08 18:29:44 +02:00
Rubidium
4ca23a19b6 Cleanup: char-pointer variant of strtolower 2023-06-08 18:09:11 +02:00
b49bd86a46 Fix dec7ff6b0c: Dropdowns couldn't be closed by pressing the parent button. (#10954)
Since dropdowns self-close, the detection of re-clicking a dropdown
button no longer worked, as the dropdown is already closed.

Instead set (and then test) a flag on the parent widget to indicate that
the dropdown closed. This method avoids looping windows on every click.
2023-06-07 19:01:30 +01:00
Rubidium
b2a8d8aea4 Codechange: use std::string for Windows' ISO code mangling 2023-06-07 08:27:18 +02:00
Rubidium
a541b8217d Codechange: use fmt::format to build Squirrel error message 2023-06-07 08:02:58 +02:00
Rubidium
5e9a1eb790 Codechange: use fmt::format to construct error message 2023-06-07 08:02:58 +02:00
Rubidium
4de9b8a988 Codechange: use fmt::format to create desync dump savegames 2023-06-07 08:02:58 +02:00
Rubidium
d5c0d3beb7 Codechange: unify the formatting of the game's caption 2023-06-07 08:02:46 +02:00
9fa1984ef0 Codechange: IniGroup::GetItem() can now be const. (#10966) 2023-06-06 22:39:37 +00:00
f249715db3 Fix #10964: Missing FontConfig format for language. (#10965) 2023-06-06 22:38:11 +00:00
eda3defcb5 Codechange: Pass language for font detection as std::string. (#10964) 2023-06-06 20:55:56 +00:00
7a0b6b7ddf Codechange: Remove Freetype bits on Win32/OSX. (#10960)
These platforms have their own specific font rendering.
2023-06-06 19:43:27 +01:00
translators
316a434933 Update: Translations from eints
english (au): 6 changes by krysclarke
russian: 4 changes by Ln-Wolf
danish: 5 changes by bscargo
portuguese: 7 changes by azulcosta
2023-06-06 18:40:40 +00:00
Rubidium
617cacd542 Fix #10961, 52a7c69: incorrect order of parameters to gamelog revision constructor 2023-06-06 20:26:26 +02:00
Rubidium
a47de4b2ab Cleanup: remove DRAW_STRING_BUFFER constant 2023-06-06 18:08:11 +02:00
Rubidium
96fef9f643 Codechange: allocate enough memory to layout the strings 2023-06-06 18:08:11 +02:00
Rubidium
1fa432ca92 Codechange: replace C-style string building with C++-style building 2023-06-06 18:08:11 +02:00
Rubidium
ca1e34c121 Codechange: use std::string to build ScriptText's encoded text 2023-06-06 18:07:54 +02:00
Rubidium
e32f0aa20b Cleanup: minimum string length for town name generator is not needed anymore 2023-06-05 23:26:12 +02:00
Rubidium
edb21620ea Cleanup: remove unneeded checks on remaining buffer size 2023-06-05 23:26:12 +02:00
Rubidium
affceea0ae Codechange: switch StringBuilder to use std::string as backend 2023-06-05 23:26:12 +02:00
Rubidium
ce8933d63e Add: std::back_insert_iterator<std::string> Utf8Encode function 2023-06-05 23:26:12 +02:00
Rubidium
55dfca1936 Codechange: replace seprintf with C++ style formatting 2023-06-05 23:25:59 +02:00
Rubidium
fbd71a9d72 Codechange: replace C-style string processing with C++-style for the listing callbacks 2023-06-05 23:25:49 +02:00
translators
433ec6b5bd Update: Translations from eints
korean: 2 changes by telk5093
russian: 2 changes by Ln-Wolf
finnish: 2 changes by hpiirai
turkish: 2 changes by EndChapter
french: 2 changes by glx22
portuguese: 2 changes by azulcosta
2023-06-05 18:42:37 +00:00
64d6ad50f9 Codechange: Split GetItem with GetOrCreateItem. (#10952)
`IniGroup::GetItem()` returns nullptr if the item does not exist, but does not if the create parameter is set to true. Resolve CodeQL warnings with `GetOrCreateItem()` which returns a reference to the item instead.
2023-06-05 18:29:52 +00:00
Patric Stout
3b1407d240 Feature: allow to do a hostile takeover of an AI company (in singleplayer) (#10914)
With the removal of the share-system, you could no longer make an
AI disappear in a single player game. At least, not without going
into the console.
2023-06-05 19:32:22 +02:00
f814c86389 Codechange: Reorganise hotkey initialisation. (#10951)
Hotkeys are now initialized inline, and use std::vector instead of
separate static C-arrays and std::string instead of char *. The list end
marker is no longer required.
2023-06-05 18:12:30 +01:00
rubidium42
921f5afc4d Codechange: Apply suggestions from code review 2023-06-05 17:07:39 +02:00
Rubidium
2dd2b698d2 Codechange: convert C-style GetTownName API to std::string returning API 2023-06-05 17:07:39 +02:00
Rubidium
14915526ad Cleanup: remove stre-style GetString 2023-06-05 11:23:31 +02:00
Patric Stout
772729cc7d Fix: when syncing width of GUI items, take padding into account (#10915) 2023-06-05 10:27:04 +02:00
Rubidium
15c75e6f45 Codechange: use std::array and std::string for high scores 2023-06-04 23:49:43 +02:00
Rubidium
c158089eff Codechange: use C++ style methods to combine a Utf8Encoded character and a formatted string 2023-06-04 23:32:02 +02:00
6ae6b65edb Cleanup: Remove doubled statements. (#10944) 2023-06-04 21:54:44 +01:00
Rubidium
a4bf45729a Change: move string validation (and assignment) to textbuf 2023-06-04 21:43:07 +02:00
Rubidium
4e39a58c59 Codechange: let town name generation use StringBuilder 2023-06-04 21:42:59 +02:00
translators
6a5ab4a9fb Update: Translations from eints
french: 3 changes by glx22
2023-06-04 18:57:10 +00:00
Rubidium
820fe8c621 Codechange: use std::string and concatenation when combining multiple formatted strings 2023-06-04 20:47:41 +02:00
Patric Stout
07add7a96e Fix: [Win32] position window in center of workspace of primary display (#10942) 2023-06-04 18:38:16 +00:00
83a318edcf Fix dec7ff6b0c: Dropdowns would close if their tooltip appeared. (#10939)
Solution is to not focus any tooltips, so that the dropdown doesn't lose focus. Tooltips don't accept any input so this does not change their behaviour.
2023-06-04 18:15:24 +00:00
rubidium42
bfcb027cb9 Fix 2dffa7d: fmt::format_to copies the iterator, so some text does not remain during formatting (#10940) 2023-06-04 19:55:47 +02:00
Rubidium
6a519f5d89 Cleanup: strecat has no uses anymore 2023-06-04 19:45:42 +02:00
Bernard Teo
2c667b1773 Doc: Fix spelling error in ScriptTileList::RemoveRectangle (#10937) 2023-06-04 17:45:18 +00:00
Patric Stout
caa0474d30 Fix: crash with tooltip on low resolution screens (#10933) 2023-06-04 16:28:58 +00:00
Rubidium
36aaa9d683 Codechange: let GetStringWithArgs use StringBuilder 2023-06-04 18:00:23 +02:00
Jonathan G Rennison
ec7f9f63f6 Feature: Add coverage button to waypoint window 2023-06-04 16:54:48 +01:00
Jonathan G Rennison
d7bf6b2c07 Feature: Highlight waypoint tiles when adjacent or distant joining 2023-06-04 16:54:48 +01:00
Jonathan G Rennison
84b53213af Codechange: Refactor viewport catchment overlay change handling 2023-06-04 16:54:48 +01:00
Patric Stout
0f3dd9c796 Fix: crash when window can't be placed on low resolution screens. (#10932)
Co-authored-by: Jonathan G Rennison <j.g.rennison@gmail.com>
2023-06-04 15:39:57 +00:00
Patric Stout
c43a23cea8 Fix: crash when not even a single row fits for dropdowns on low resolution screens (#10934) 2023-06-04 15:07:18 +00:00
ee2d0745e9 Fix #10502: Refit engine before attaching free wagons. (#10926)
Caused by incorrect order of operations when buying a train engine with refit and attaching free wagons.
2023-06-04 15:57:36 +01:00
Rubidium
87ccff16b5 Codechange: use std::string for the screenshot name/path 2023-06-04 16:53:10 +02:00
Patric Stout
0e56a73fb8 Fix: disable hardware acceleration when GPU driver crashed the game last attempt (#10928) 2023-06-04 14:40:17 +00:00
Rubidium
556b44713e Codechange: use std::string for midi filenames 2023-06-04 15:57:05 +02:00
Rubidium
84037d4a57 Codechange: use std::string for parameters in the dbg_helpers 2023-06-04 15:56:53 +02:00
Rubidium
2dffa7d0c6 Codechange: let FormatString use StringBuilder 2023-06-04 15:06:52 +02:00
Rubidium
993f90b6a0 Codechange: let GenerateDefaultSaveName return std::string 2023-06-04 14:11:13 +02:00
ac1d042550 Remove: obsolete NewGRF text unprinting. (#10884)
Co-authored-by: Rubidium <rubidium@openttd.org>
2023-06-04 13:14:56 +02:00
Patric Stout
6b1c38e303 Fix 3effb893: mention GSAsyncMode in changelog (#10924) 2023-06-04 11:10:22 +00:00
Rubidium
c384d829fe Codechange: let number formatting use StringBuilder 2023-06-04 12:24:37 +02:00
Rubidium
ed51cf117a Add: helper output iterator for formatting strings 2023-06-04 12:24:37 +02:00
Jonathan G Rennison
3effb8931c Add: [Script] GSAsyncMode to set async mode of gamescript commands (#10913)
In asynchronous mode, don't wait for result of executed command,
just fire-and-forget, and return estimated cost/result
2023-06-04 11:15:35 +02:00
Patric Stout
5821194ad1 Add: [Linux] change default scroll mode to non-mouse-lock (#10920)
Wayland doesn't support mouse warping, X11 only for native
systems (so not for remote desktop, WSLg, etc), and emscripten
neither without complications. All these cannot offer a
mouse-lock.
2023-06-04 00:10:21 +00:00
Patric Stout
0d840b4570 Codechange: remove queue_wrap / last_position from mouse movement
No backend uses it anymore, so also no longer any need to support
it.
2023-06-04 00:40:56 +02:00
Patric Stout
e83f244750 Codechange: simplify UpdateCursorPositionRelative
The function is only called with fix_at=true, so don't support
the other cases.
2023-06-04 00:40:56 +02:00
Patric Stout
a969a78f81 Fix: [SDL] unify the way X11 and Wayland handle mouse events
Basically, we drop RelativeMode completely, and use the same trick
as used by the Windows driver: read all motion events till the last
one, and use that as value.
2023-06-04 00:40:56 +02:00
8a2d550904 Codechange: Use std::reverse instead of custom implementation. (#10918) 2023-06-03 23:25:01 +01:00
Jonathan G Rennison
a2c0e6aa18 Fix #10831: Level crossing parts left barred after crossing tile removal (#10874) 2023-06-03 23:04:24 +02:00
Patric Stout
cd751a598a Fix: Wayland crash on startup due to Pango also using FontConfig (#10916)
Basically, we haven't been a good neighbour. Turns out you shouldn't
actually call FcFini when you are done, as some library might still
want to use FontConfig. And they use a shared instance for their
administration.

The idea is that you call FcInit once, and use FcConfigReference
after that to get an instance, you can release. This entry is
ref-counted, and things happen automatically based on that.

At least, I think.
2023-06-03 19:09:02 +00:00
Patric Stout
21adfa7567 Fix: track "memory installed" for surveys less precisely (#10910)
It turns out, for Windows and Linux having the exact memory allows
for easy tracing of an individual. That is exactly against the idea
of the survey. And honestly, we don't need this precision.
2023-06-03 19:07:56 +00:00
translators
7d6aff3a34 Update: Translations from eints
french: 16 changes by ottdfevr
2023-06-03 18:42:31 +00:00
Rubidium
d68b5c9162 Codechange: replace buffer + strecpy with std::string for getting clipboard contents 2023-06-03 20:14:33 +02:00
Rubidium
35f7f7e8dc Codechange: use std::string for executing the console aliases 2023-06-03 18:15:55 +02:00
2e62682f73 Codechange: Close dropdowns by class instead of id. 2023-06-03 14:17:05 +01:00
2511649938 Codechange: Use window parent association for dropdowns.
This replaces the separate window class and number properties, and
allows the window system to close dropdowns automatically.
2023-06-03 14:17:05 +01:00
dec7ff6b0c Fix: Make dropdowns self-close when losing focus. 2023-06-03 14:17:05 +01:00
a5a3a07005 Fix: GRF Parameters not displayed due to scope issue. (#10911)
Move params so it is still in scope when the text is actually drawn.
2023-06-03 11:07:59 +00:00
Rubidium
513ede7669 Codechange: use C++ strings/paths to resolve links in tars 2023-06-02 21:06:24 +02:00
Rubidium
0ab7bc7a2b Codechange: use fmt::format to create type prefixed driver names 2023-06-02 18:05:41 +02:00
Rubidium
37a3fc4df3 Codechange: replace strstr with more appropriate function 2023-06-02 17:11:08 +02:00
Rubidium
53f83c31b0 Codechange: use std::string to return the debug level information 2023-06-02 17:07:18 +02:00
Rubidium
10e12154f5 Fix: false positive warning in fmt library (backport ef55d4f of upstream fmt) 2023-06-02 11:57:23 +02:00
Rubidium
802d6cb509 Fix: memory leak when parsing (strgen) commands by moving to C++ containers 2023-06-02 11:57:23 +02:00
Rubidium
4f94655cc2 Codechange: use vector/unorder_map over custom implementation 2023-06-02 11:57:23 +02:00
Rubidium
234a143ee5 Codechange: use std::string for LangString over C-style strings 2023-06-02 11:57:23 +02:00
Rubidium
f372373e6f Codechange: use std::string/vector for language cases over manual management 2023-06-02 11:57:23 +02:00
Rubidium
6eb51666bc Codechange: use C++ file APIs for writing language files 2023-06-02 11:57:23 +02:00
Rubidium
fa0d865edd Change: set macOS deployment target to 10.15 2023-06-02 11:57:23 +02:00
0b663f709d Codechange: Sprite mapping for objects doesn't involve cargo types. (#10905)
Objects have a default sprite group and an optional purchase list sprite
group. There is no need to pretend that these are cargo IDs.
2023-06-02 08:25:13 +00:00
Jonathan G Rennison
cdb3a6288b Codechange: Remove unused CapacitiesMap typedef from struct Vehicle 2023-06-01 22:48:47 +02:00
Patric Stout
9eda419f9b Fix 646a7e62: recalc_time was not scaled properly (#10901)
This caused "runtime" to underflow or, if you are lucky, hit an
assert in ScaleToMonthly when it hits zero. But mostly underflow.
2023-06-01 12:21:33 +00:00
translators
b5b004e518 Update: Translations from eints
ukrainian: 117 changes by alextov
2023-05-31 18:42:26 +00:00
Rubidium
f29606fd14 Codechange: use std::string to cache engine/group/vehicle names 2023-05-31 19:31:09 +02:00
Rubidium
d9f8a4c380 Codechange: use std::string GetString variant 2023-05-31 19:31:09 +02:00
Rubidium
324c43eeb2 Codechange: let FiosGetDiskFreeSpace only return disk space and split FiosGetCurrentPath off 2023-05-31 10:56:33 +02:00
Rubidium
f2e704b9a7 Codechange: use std::string for FiosIsRoot 2023-05-31 10:56:33 +02:00
Rubidium
13789d1703 Codechange: use std::string for FiosIsValidFile 2023-05-31 10:56:33 +02:00
1ff0dc11d8 Fix: Land info window maximum width was not scaled. (#10894) 2023-05-31 08:54:39 +00:00
Patric Stout
0302e6f168 Codechange: initialize all values of ICURun on construction (#10892) 2023-05-30 19:17:30 +00:00
translators
c8b70e4877 Update: Translations from eints
ukrainian: 53 changes by alextov
portuguese (brazilian): 1 change by ericandradex
2023-05-30 18:40:56 +00:00
translators
e1203c3a48 Update: Translations from eints
esperanto: 51 changes by legoscia
2023-05-29 18:39:22 +00:00
d086f288cd Codechange: Remove duplicated includes. (#10888)
These are now included by stdafx.h so don't need to be included again.
2023-05-29 14:29:00 +01:00
702194cfef Change: Cargo flow legend only shows defined cargo. (#10872)
This removes the large mostly-empty grid of cargo buttons when not using a complex industry set.
2023-05-29 06:48:43 +01:00
translators
c9c6721a47 Update: Translations from eints
esperanto: 44 changes by legoscia
2023-05-28 18:42:42 +00:00
bae1897826 Change: Include font style in font name for Freetype. 2023-05-27 20:40:25 +01:00
9976293c1e Codechange: Return fontcache font name as std::string. 2023-05-27 20:40:25 +01:00
translators
90fdf17e39 Update: Translations from eints
esperanto: 28 changes by legoscia
2023-05-27 18:40:39 +00:00
Loïc Guilloux
c880157518 Fix: Check max member count in squirrel classes (#10883)
Manual cherry-pick from 23a0620658
2023-05-27 16:09:21 +00:00
8ea9c1a133 Fix #10880: Crash in object window due to incorrect parameter order. (#10881) 2023-05-26 21:29:52 +00:00
876871157f Fix: Ask FontConfig for the face index when opening fonts. (#10878)
This allows selection of the correct face in truetype fonts containing
multiple faces.
2023-05-26 18:56:13 +00:00
101e4e54a1 Fix d9a04ba446: Ensure MD5Hash is initialized. (#10876)
Not all instances need to be initialized as often they are copied or
written to, but doing all ensures no surprises.

Move the ^= operator to MD5Hash while we're at it.
2023-05-26 18:17:54 +00:00
Jonathan G Rennison
ba11467c02 Fix: Rail waypoint selection window not closed
When rail toolbar or rail waypoint build windows closed
2023-05-26 08:41:13 +02:00
584faaf064 Change: Reorganise industry accept/produce arrays. (#10853)
Use a array of struct for each cargo instead of an array for each statistic.
This makes iterating for acceptance and production much simpler.
pct_transported is now calculated when needed.
2023-05-25 21:25:46 +01:00
Loïc Guilloux
db3b086a52 Fix #10867, 8b93e45: Squirrel compile error exception type changed (#10869) 2023-05-25 12:46:27 +02:00
Rubidium
b133328737 Codechange: use std::string over strecat to create the RV capacity string 2023-05-25 05:43:00 +02:00
Rubidium
4fdde00e25 Codechange: use std::string to create the GRF parameter list 2023-05-25 05:43:00 +02:00
Rubidium
fbab94eabb Codechange: use std::string to create error message about external files 2023-05-25 05:43:00 +02:00
Rubidium
30b9e02dd9 Codechange: replace crashlog filenames with std::string in Crashlog 2023-05-25 05:42:10 +02:00
Rubidium
19304bd3d5 Codechange: replace seprintf with fmt::format for filling the crash log data 2023-05-25 05:42:10 +02:00
Rubidium
f4b0ac2bd4 Codechange: use std::string for formatting settings 2023-05-24 22:42:01 +02:00
translators
1412ea48ed Update: Translations from eints
esperanto: 268 changes by legoscia
2023-05-24 18:40:52 +00:00
09408e8e46 Codechange: Add IsCargoAccepted/Produced() helpers. 2023-05-24 17:34:11 +01:00
633f19419d Codechange: Make more use of GetCargoAccepted/ProducedIndex(). 2023-05-24 17:34:11 +01:00
Rubidium
29b20718ba Codechange: use Tthis instead of StrongTypedef, so ==/= does not compare/assign different strong typedefs 2023-05-23 20:46:32 +02:00
translators
9f0e406a51 Update: Translations from eints
esperanto: 18 changes by legoscia
2023-05-23 18:41:14 +00:00
8931e90302 Cleanup: No need to cound actual cargo to get scroll count. 2023-05-23 19:07:36 +01:00
f177ce7c9a Codechange: Base CargoArray off std::array.
This avoids needing to define array accessors and allows use of
default value initialization.
2023-05-23 19:07:36 +01:00
74e42e39a8 Codechange: Use CargoArray::GetCount() 2023-05-23 19:07:36 +01:00
Loïc Guilloux
a6c5b4ce4b Cleanup: Remove BOM/ZWNBSP in the middle of .editorconfig (#10860) 2023-05-23 12:49:47 +02:00
76516d7f70 Codechange: Use IsValidCargoID/IsValidCargoType.
IsValidCargoType() is used only for unmapped IDs.
2023-05-22 20:43:40 +01:00
c4ca6a0f74 Codechange: Rename IsCargo..Valid to IsValidCargo..
This better fits our naming pattern for this type of function.
2023-05-22 20:43:40 +01:00
translators
e2827d0e9c Update: Translations from eints
galician: 41 changes by pvillaverde
esperanto: 95 changes by legoscia
portuguese (brazilian): 18 changes by ericandradex
2023-05-22 18:40:22 +00:00
Rubidium
a19a43a4f7 Codechange: use fmt::format and time conversions over "custom" implementation 2023-05-22 15:36:09 +02:00
Rubidium
eb635b85bb Fix: work around GCC compiler bug #105120 in fmt
The fmt code pushes a pragma option, and later pops is. The intrinsics code
interacts with it via the __OPTIMIZE__ macro. This has been set by the pragma
option push, but not unset/reset to the original with the pop.
Since the pragma is only used for the GCC compiler (not Clang, not MSVC, not
ICC) and in debug mode, just remove the whole pragma handling for it.
2023-05-22 14:42:18 +02:00
Rubidium
187fa3f214 Codechange: update to fmt 10.0.0 and add formatting support for chrono and std types 2023-05-22 14:42:18 +02:00
Rubidium
6f2f38b3ed Codechange: fmt (and std::format) do explicitly not support enums out-of-the-box
That it works for the version we have packaged it pure coincidence, as that is
one of the few versions that due to a bug allow it. So add the appropriate
template specialisations to support it out-of-the-box within OpenTTD.
2023-05-22 14:42:18 +02:00
bc45c3f66c Change: Remember waypoint filter string. (#10857) 2023-05-22 08:03:20 +01:00
Rubidium
63d9bb93b8 Codechange: migrate from C-style GetString to C++-style GetString 2023-05-21 21:17:12 +02:00
Rubidium
1a179cb297 Codechange: use GetString + StrMakeValid to pass string without colours/font sizes to Debug 2023-05-21 21:17:12 +02:00
Rubidium
00695c29de Codechange: simplify news string drawing by using StrMakeValid to replaces newlines with spaces 2023-05-21 21:17:12 +02:00
translators
9610705f46 Update: Translations from eints
esperanto: 52 changes by legoscia
2023-05-21 18:40:42 +00:00
axet
60540f7df6 Change: Allow dedicated server to use threaded saves. (#10787)
Co-authored-by: Jonathan G Rennison <j.g.rennison@gmail.com>
2023-05-21 19:55:12 +02:00
Rubidium
2efd88d513 Cleanup: version of strgen/settingsgen was always $Revision$, so remove it 2023-05-21 19:39:09 +02:00
Rubidium
2dbd974d4c Codechange: prevent using (f)printf/(f)puts over fmt::print 2023-05-21 15:12:02 +02:00
Rubidium
411379f587 Codechange: replace puts with fmt::print 2023-05-21 15:12:02 +02:00
Rubidium
275ebf4509 Codechange: replace fprintf(<FILE*> with fmt::print(<FILE*> 2023-05-21 15:12:02 +02:00
Rubidium
c518293135 Codechange: replace printf with fmt::print 2023-05-21 15:12:02 +02:00
Tyler Trahan
d57046e7ec Change: Use "Via-Destination-Source" as default station cargodist display (#10851) 2023-05-21 08:57:14 -04:00
Patric Stout
0850193a38 Fix: survey result on crash only worked on Linux (#10855)
Every OS-specific crashlog handler has their own MakeCrashLog
in some form. In result, only Linux was calling the generic one.
2023-05-21 12:57:32 +02:00
translators
98dffc3157 Update: Translations from eints
catalan: 12 changes by J0anJosep
esperanto: 678 changes by legoscia
2023-05-20 18:39:31 +00:00
Rubidium
3323402aaa Codechange: rename smallvec_type to container_func and use only when needed 2023-05-20 16:53:10 +02:00
Rubidium
80d8c01814 Codechange: replace std::vector + duplicate preventing include with std::set 2023-05-20 16:53:10 +02:00
Rubidium
07860e67e2 Codechange: use fmt::format_to to format the help message 2023-05-20 16:50:03 +02:00
Loïc Guilloux
8d2a0a7da4 Fix #10846: [Squirrel] Ensure sqvector size does not overflow (#10848) 2023-05-20 14:43:22 +00:00
0cbbfd3eae Codechange: Use display list instead of exclude list for file window. (#10845)
This simplifies retrieving the correct data for each row when data is
filtered. The background FileList is left intact so that savegame data
does not have to be rescanned when the filter is changed, and sorting
still remains the task of the background FileList.
2023-05-19 21:19:00 +00:00
translators
cdb184f53b Update: Translations from eints
catalan: 14 changes by J0anJosep
dutch: 14 changes by Afoklala
2023-05-19 18:39:30 +00:00
6b87fe6540 Codechange: Use std::array for GRF(File|Config) parameters.
This simplifies comparison, copying and assignment operations.
2023-05-19 16:53:56 +01:00
c23aae96a2 Codechange: Use std::array instead of C array for automatic deep-copies. 2023-05-19 16:53:56 +01:00
Rubidium
acec34a0fe Cleanup: remove MD5SumToString in lieu of FormatArrayAsHex 2023-05-19 11:24:44 +02:00
Rubidium
d9a04ba446 Codechange: make the MD5 hash/digest/checksum variables a std::array 2023-05-19 11:24:44 +02:00
7934418133 Codechange: Remove comment alignment from GRFConfig. 2023-05-18 20:48:37 +01:00
f14479d27d Codechange: Use std::optional for GRF Parameter list. 2023-05-18 20:48:37 +01:00
c51a7f629e Codechange: GRFParameterInfo no longer needs deep-copy constructor. 2023-05-18 20:48:37 +01:00
translators
fd26658558 Update: Translations from eints
russian: 2 changes by Ln-Wolf
2023-05-18 18:41:14 +00:00
91e140c722 Codechange: Use unique_ptr for fios company properties.
This is the data used to show company names in the saveload window.
2023-05-18 12:18:30 +01:00
bf8f24f9a8 Codechange: Use unique_ptr for text layout font mapping.
This must stay a pointer as the value passed to other structures.
2023-05-18 12:18:30 +01:00
c38df2d589 Codechange: Use std::map instead of custom SmallMap. 2023-05-18 12:18:30 +01:00
72018badff Codechange: Swap SocketList map key/value around.
This map is used store socket and address together, and, other than
checking that the address does not already have a socket, the data layout
does not seem particularly important.

However, as address is the key, technically it should not be modified,
and address may self-modify itself during comparisons.
2023-05-18 12:18:30 +01:00
f454ec8d63 Fix: Don't rely on static initialization to set up sprite font caches.
The order of static initialization is undefined, so this can cause initalization
before relevant caches are initializations.
2023-05-18 12:18:30 +01:00
translators
418888ac23 Update: Translations from eints
romanian: 11 changes by bnegrut
turkish: 14 changes by densxd
2023-05-17 18:40:23 +00:00
83f2ad500e Codechange: stdarg.h include not needed as cstdarg is included. 2023-05-17 10:14:41 +01:00
56085be9bd Codechange: Move includes for common STL headers to stdafx. 2023-05-17 10:14:41 +01:00
translators
a5cf362886 Update: Translations from eints
english (au): 14 changes by krysclarke
english (us): 14 changes by 2TallTyler
vietnamese: 14 changes by KhoiCanDev
korean: 19 changes by telk5093
italian: 14 changes by Rivarossi
russian: 14 changes by Ln-Wolf
finnish: 14 changes by hpiirai
danish: 22 changes by bscargo
portuguese: 14 changes by azulcosta
polish: 14 changes by pAter-exe
2023-05-16 18:41:59 +00:00
Rubidium
e9c03f0dad Cleanup: remnants of C-style strings in saveload 2023-05-16 18:32:52 +02:00
Rubidium
52a7c69974 Codechange: rework Gamelog changes from union to classes 2023-05-16 18:32:52 +02:00
translators
389b66bd16 Update: Translations from eints 2023-05-15 18:40:31 +00:00
40f567d464 Fix #10811: Crash getting row from non-resizable widget. (#10833)
GetScrolled*FromWidget took line height from the widget's resize_y value,
however not all widgets are resizable, resulting in a division-by-zero.

Allow passing line height explicitly in cases where a widget is not
resizable.
2023-05-15 18:57:50 +01:00
e4fd9d41d3 Codechange: Use std::any_of() (#10830)
When the result of std::find_if is compared only with end()
then '!= end()' is replaced with any_of().

Just... there's only one.
2023-05-14 23:18:52 +01:00
Patric Stout
199e41c762 Codechange: use default dtor instead of empty (#10826) 2023-05-14 23:31:03 +02:00
Patric Stout
7634553d22 Feature: opt-in survey when exiting a game
On first start-up, the game will ask if you want to participate
in our automated survey. You have to opt-in, and can easily opt-out
(via the Options) at any time.

When opt-in, whenever you exit a game, a JSON blob will be send
to the survey server hosted by OpenTTD. This JSON blob contains
information that gives a global picture of the game just played:
- What settings were used
- How many humans vs AIs
- How long the game has been played
- Basic information about the OS / CPU

All this information is kept very generic, so there is no
chance we send private information to our survey server.
Nothing in the JSON blob could identify you as a person; it
mostly tells about the game played. At any time you can see
what the JSON blob includes, by pressing the "Preview Survey
Results" button in-game.
2023-05-14 23:22:02 +02:00
Patric Stout
021c45c4f6 Add: [CMake] JSON library (nlohmann) 2023-05-14 23:22:02 +02:00
Rubidium
62fda0f505 Codechange: remove manual allocation/free for SQ_instance 2023-05-14 22:54:10 +02:00
Rubidium
f9b5bc7ee6 Cleanup: the need for SQAutoFreePointers has gone 2023-05-14 22:54:10 +02:00
Rubidium
d9e93edc8b Codechange: replace 'const char *' script API parameters with std::string 2023-05-14 22:54:10 +02:00
Rubidium
b1b578f988 Cleanup: stredup-ing string variant for calling scripts 2023-05-14 22:54:10 +02:00
Rubidium
ab51175db2 Codechange: use std::string for script config 2023-05-14 22:54:10 +02:00
Rubidium
bbcb55ebc9 Codechange: use std::string as script API return type 2023-05-14 22:54:10 +02:00
Rubidium
b24a6bb8f3 Codechange: use std::string for script log calls 2023-05-14 22:54:10 +02:00
Rubidium
77177f7e8b Add: support for std::string parameters in the script API 2023-05-14 22:54:10 +02:00
Rubidium
98972a0748 Codechange: use C++ strings for constructing script file paths 2023-05-14 22:54:10 +02:00
Rubidium
20ff0bccd7 Codechange: use std::string to store script GUI's break string 2023-05-14 22:54:10 +02:00
Rubidium
48825e1a8e Codechange: rewrite script string-to-settings conversion to C++ 2023-05-14 22:54:10 +02:00
Rubidium
552d2f71a2 Codechange: use std::string for script library category 2023-05-14 22:54:10 +02:00
Rubidium
e035705239 Codechange: introduce and use std::string variant of sq_throwerror 2023-05-14 22:54:10 +02:00
Rubidium
3453c03a17 Codechange: use fmt::format to create dummy scripts 2023-05-14 22:54:10 +02:00
Rubidium
9f2fc860ad Codechange: use std::optional<std::string> for changing the script over char * 2023-05-14 22:54:10 +02:00
Rubidium
0fd9eb0faa Codechange: use std::string for script info/library finding 2023-05-14 22:54:10 +02:00
Rubidium
a30f7c83bd Codechange: use std::string for script names to load 2023-05-14 22:54:10 +02:00
Rubidium
9b0123ab66 Codechange: use std::string for script API versions 2023-05-14 22:54:10 +02:00
Rubidium
3d8d99ba11 Add: method to call script functions with std::string 2023-05-14 22:54:10 +02:00
Rubidium
4a6fdc8293 Fix: multiplication result converted to larger type
Technically unlikely to happen, though uint16 * uint16 get promoted to int and
then stored as uint64; similarly uint * uint16 remains uint and gets stored as
uint64. In both cases the value can get truncated before the change to uint64.
2023-05-14 22:09:58 +02:00
4894da67da Codechange: Pass bridge type instead of display row to BuildBridge. (#10828) 2023-05-14 19:12:26 +00:00
translators
a8daf91eea Update: Translations from eints
vietnamese: 4 changes by KhoiCanDev
hungarian: 74 changes by PstasDev
turkish: 4 changes by densxd
2023-05-14 18:40:47 +00:00
Patric Stout
8493719cf4 Fix: padding miscalculated for the network-relay and bootstrap-question GUI (#10827) 2023-05-14 15:32:45 +00:00
9eb0cca93a Fix #10823, Fix #10811: Order list has end marker row. (#10825) 2023-05-14 13:04:59 +01:00
64930c343a Codechange: Pass reference instead of pointer to GUI*Lists. (#10822)
Pointer-avoidance.
2023-05-14 09:17:44 +01:00
23ce42ad91 Codechange: Use std::move for bridge list. (#10821)
This follows the pattern for dropdown lists, and avoids new/delete and pointers.
2023-05-14 08:22:09 +01:00
385b25df63 Fix #10819, Fix #10811: GetVehicleFromDepotWndPt used widget- instead of window-relative positions. (#10820)
Pass window-relative positions instead, and adjust for relative positions where needed within the function itself. This simplifies calling code.
2023-05-13 22:18:36 +00:00
07473bfd2e Fix: Don't use a loop to test if classid is valid. (#10818)
Additionally the Object class test was broken.
2023-05-13 21:27:32 +00:00
Patric Stout
1fe7bbba8a Codechange: rework NewGRFProfiler to use ticks instead of calendar-days (#10815)
We are planning to allow things like freezing the calendar, which
makes this variable a bit problemetic. So instead, suggest to the
user how many ticks there are in a calendar day, and let them figure
out how many ticks they want.

Additionally, use a TimeoutTimer for this, instead of an end-date
variable which is checked in an IntervalTimer.
2023-05-13 23:17:11 +02:00
Rubidium
a372c59483 Codechange: replace C-style (stredup) chat completion with std::string_view 2023-05-13 22:33:27 +02:00
translators
e1b653137f Update: Translations from eints
finnish: 4 changes by hpiirai
2023-05-13 18:41:08 +00:00
a92755de81 Codechange: Use iterator erase pattern. 2023-05-13 19:18:01 +01:00
4a64064c57 Codechange: Make NEW_STATION an actual item in join station list.
Add NEW_STATION to the nearby station list to indicate that a new
station should be built. This removes special-casing for a non-existant
list item and keeps the list count and scrollbar count the same.
2023-05-13 19:18:01 +01:00
Patric Stout
d54660184a Fix: NewGRF Profile didn't stop if there were no events yet (#10816)
This meant you could have the following situation:
- You start a profile on a GRF with no events, for N days.
- The days pass, the profile should stop. It doesn't.
- The profile will never stop, even if the GRF start generating events.
- There is no real way to discover this, so .. byebye memory? :)
2023-05-13 18:23:23 +02:00
531d1ae8bc Codechange: Use GetScrolled(Row/Item)FromWidget in more places.
In many instances the clicked row position is 'manually' calculated
instead of using the GetScrolledRowFromWidget helper function, with
variations on checks. Replace with the two helpers where possible.
2023-05-12 21:45:32 +01:00
941dbadf9e Codechange: Add and use GetScrolledItemFromWidget to get a list item.
This function returns an iterator, either to the selected item or the
container's end.

This makes handling the result more robust as indices are not used.
2023-05-12 21:45:32 +01:00
Rubidium
86e5dfce3d Codechange: use std::string instead of strecat to build hotkey strings 2023-05-12 22:02:59 +02:00
Michael Lutz
72c7536325 Codechange: Use a dedicated variable for disaster vehicle action state. (#10798) 2023-05-12 21:41:36 +02:00
1a93618bd1 Fix: Road type is not available before its introduction date. 2023-05-12 21:03:13 +02:00
726d05b22b Fix: Don't list unavailable road types for game scripts. 2023-05-12 21:03:13 +02:00
5059e23ed5 Revert 8fa61533: "Fix 30ae072: when a road type is hidden, towns may not build them even when that flag is set"
This reverts commit 8fa61533f0.
2023-05-12 21:03:13 +02:00
Henry Wilson
3a03a12a9c Feature: Show the number of industries already built in the Fund New Industry window. 2023-05-12 20:48:11 +02:00
translators
a934a584a5 Update: Translations from eints
italian: 4 changes by Rivarossi
catalan: 4 changes by J0anJosep
dutch: 9 changes by Afoklala
2023-05-12 18:39:51 +00:00
da7f431812 Cleanup: widget pos_x/y are already int. (#10809)
Remove old casts left over from when pos_x/y were unsigned.
2023-05-12 18:02:51 +01:00
7e3646cf46 Codechange: Remove redundant char buffer. (#10808) 2023-05-11 21:36:11 +00:00
translators
ca31976da0 Update: Translations from eints
english (au): 4 changes by krysclarke
english (us): 4 changes by 2TallTyler
russian: 4 changes by Ln-Wolf
portuguese: 4 changes by azulcosta
polish: 8 changes by pAter-exe
2023-05-11 18:42:00 +00:00
Loïc Guilloux
7e74232e56 Change: [Actions] Use -fuse-ld=lld and Ninja for MinGW (#10785)
And some miscellaneous things while touching the file
2023-05-11 18:07:29 +00:00
61516627ad Add: NewGRF string code "9A 21" to display force from textstack. (#10782) 2023-05-11 08:06:46 +01:00
59811ec780 Codechange: Use find_if when finding things. 2023-05-11 07:58:55 +01:00
e6740046ee Codechange: Use range-for iteration. 2023-05-11 07:58:55 +01:00
cef3a2570d Codechange: Use standard iterator-erase-loop pattern. 2023-05-11 07:58:55 +01:00
a8c0d16371 Cleanup: Use std::advance instead of for-loop. 2023-05-11 07:58:55 +01:00
68782f951b Cleanup: Vector supports random access. 2023-05-11 07:58:55 +01:00
Rubidium
6d1586dd49 Codechange: use std::string instead of char* for original editor strings 2023-05-10 23:15:09 +02:00
translators
7e1123c731 Update: Translations from eints
portuguese (brazilian): 30 changes by ericandradex
2023-05-10 18:43:36 +00:00
Loïc Guilloux
3c59b8e9ec Fix: disable "redundant move" warnings for GCC (#10803)
GCC warns about redundant std::move while clang warns when they are missing, so we silence the less harmful one
2023-05-10 17:35:11 +00:00
Patric Stout
922d7aa773 Update: help out translators and do the COMMA -> DECIMAL for them (#10802) 2023-05-10 16:09:58 +02:00
Michael Lutz
7e906c7c59 Change: Preserve orders and related settings where possible when moving engines around in a train. 2023-05-10 00:35:02 +02:00
Michael Lutz
07449be876 Codechange: A vehicle that is not a front engine can't be removed from a vehicle group, so just remove a pointless function call. 2023-05-10 00:35:02 +02:00
Rubidium
1ae7eb1594 Codechange: use std::map over SmallMap and std::string of stredup(char*) 2023-05-09 23:14:48 +02:00
Rubidium
12085d088c Cleanup: remove obsolete string_compare_type 2023-05-09 23:14:48 +02:00
Rubidium
bc389a86c9 Codechange: use std::string as std::map key, instead of stredup string 2023-05-09 23:14:48 +02:00
Rubidium
72082aa7d3 Codechange: use std::string for getting a script's name 2023-05-09 23:14:48 +02:00
Rubidium
f1fb6c95fe Add: case insensitive string comparator 2023-05-09 23:14:48 +02:00
Rubidium
6e3d3c0e7c Codechange: introduce std::string variant of sq_pushstring 2023-05-09 23:14:48 +02:00
f5158c8b79 Feature: Add search filter and name text to build waypoint window. 2023-05-09 23:03:14 +02:00
dc50ff807c Change: Remove incorrect minimal size. 2023-05-09 23:03:14 +02:00
b54d7f15ac Change: Reduce size of waypoint matrix to 3 x 2. 2023-05-09 23:03:14 +02:00
0513a6ccb0 Change: Use separate names for default stations/roadstops. 2023-05-09 23:03:14 +02:00
93d49fa8b3 Fix: Make scrollwheel work on panel behind waypoint matrix. 2023-05-09 23:03:14 +02:00
bf9caa425b Change: Units-system can convert from N to kN, don't preconvert.
This allows force to passed as is and avoid premature rounding.

The AI function "GetMaxTractiveEffort" still needs to return kN to avoid breaking the API.
2023-05-09 23:02:51 +02:00
e2f583a34f Change: Standardise unit conversions and allow decimal places.
Previously the decimal_places member was mostly ignored except for
specific conversions. {DECIMAL} with 0 is the same as {COMMA} so there
is no downside to allowing any conversion to have decimals.
2023-05-09 23:02:51 +02:00
3c2f87ce1f Change: Perform unit convert with a double-precision constant.
Unit conversion is only performed for display purposes, this does not
affect lock-step mechanics.

This replaces the old multiply and shift algorithm which relies on
choosing a multipler and shift combination that gets close. Some of these
multiply/shift combinations were quite inaccurate. We can just
use (close-to) real-world numbers instead.
2023-05-09 23:02:51 +02:00
644e310506 Fix: Incorrect y-position of monospace glyphs. (#10794) 2023-05-09 23:02:06 +02:00
Patric Stout
febe394806 Codechange: replace C-style strings with C++-style strings in textfile (#10772) 2023-05-09 19:35:50 +00:00
translators
90529ea48b Update: Translations from eints
catalan: 30 changes by J0anJosep
french: 25 changes by glx22
polish: 5 changes by pAter-exe
2023-05-09 18:44:36 +00:00
6998fbf71d Fix: WWT_TEXT with SetTextStyle did not work. (#10797)
FontSize was passed to incorrect parameter of DrawString function.
2023-05-09 17:23:37 +00:00
d68c4bbd2f Change: Use iterator when drawing industry cargo window. 2023-05-09 17:39:12 +01:00
cccf4953f7 Fix: Incorrect padding on industry cargo window. 2023-05-09 17:39:12 +01:00
882f06bf14 Fix: Support more than 256 stations/waypoints/roadstops per class. (#10793)
It was already possible to define more than 256 per class, but not possible
to use them as the index used in GUI and passed through commands was limited
to a byte.
2023-05-08 18:09:33 +00:00
Patric Stout
a05ae2497f Codechange: simplify how GetCharPosition() works 2023-05-08 19:21:42 +02:00
Patric Stout
60399e17bd Codechange: C++-ify the Layouter and related functions
They all now access a std::string_view, instead of a "const char *"
or std::string (in some cases).

Additionally, GetCharAtPosition and friends now return an index
instead of a "const char *", as it makes for a more clear interface.
2023-05-08 19:21:42 +02:00
Tyler Trahan
61d1b330d1 Change: Add padding to build vehicle text filter (#10792) 2023-05-08 17:21:29 +00:00
Patric Stout
aed36a609c Fix: [ICU] crash when trying to break a non-breaking run (#10791)
Clusters from harfbuzz are indexed from the start of the buffer,
not from the start of the run analyzed. This confuses other parts
of the code that do assume they are from the start of the run.
2023-05-08 16:09:47 +00:00
bc6a4b1d08 Fix: Set up default station/waypoint classes properly. (#10789) 2023-05-08 16:42:01 +01:00
J0anJosep
c4e6d80ecf Cleanup: Remove unnecessary hangar check. 2023-05-08 17:30:21 +02: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
Rubidium
192ed55462 Change: disable precompiled headers on Linux (GCC - Dedicated) target to ensure those still build 2023-05-08 16:49:23 +02:00
Rubidium
2955ff33d7 Change: use precompiled headers for stdafx.h and 3rdparty/fmt/format.h 2023-05-08 16:49:23 +02:00
878c5d8d85 Codechange: Use SetPosition() to clamp after changing count/capacity. 2023-05-07 20:25:44 +01:00
6202eae9d5 Codechange: Rely on Scrollbar::SetPosition to clamp.
Manually clamping scrollbar bounds before calling `SetPosition()` is doubling up work that the function already does.
2023-05-07 20:25:44 +01:00
d2034d9c38 Codechange: Scrollbar methods now accept size_t.
This clears up a lot of casts from size_t to int.
2023-05-07 20:25:44 +01:00
translators
923d1b0846 Update: Translations from eints
vietnamese: 5 changes by KhoiCanDev
2023-05-07 18:39:28 +00:00
kiwitreekor
3375f25b70 Fix: Var68 for station and roadstop was broken (#10784) 2023-05-07 19:04:34 +01:00
Tyler Trahan
98d809c33b Codechange: Don't use macros for DAYS_TILL and friends (#10746) 2023-05-07 05:25:24 -04:00
8bf62dac81 Codechange: Clean up build industry window. (#10779)
* Remove left-over code that treated an invalid list selection as 'fund
many', which is actually implemented as a separate button.
* Manual list management replaced with std::vector.
* Enabled state is only needed for the current selection.
* Selected index is not required only selected type.
2023-05-07 08:19:09 +01:00
a836edd5a7 Codechange: Scrollbar::UpdatePosition() will tell if the position changed. (#10777)
So we don't need to check this manually.
2023-05-06 19:45:32 +00:00
Rubidium
fb856e16c1 Codechange: replace some min/clamp constructs to ClampTo 2023-05-06 21:26:13 +02:00
Rubidium
19ec4e8beb Codechange: replace ClampToI32/U16 with ClampTo<int32_t/uint16_t> 2023-05-06 21:26:13 +02:00
Rubidium
969a3dc0f3 Codechange: introduce generic ClampTo function to clamp to the range of a type 2023-05-06 21:26:13 +02:00
Rubidium
e33b2afd87 Codechange: pass (uint) money as Money for CmdGiveMoney 2023-05-06 21:26:13 +02:00
Rubidium
4a5a9f57c4 Fix: conversion to smaller type warnings 2023-05-06 21:26:13 +02:00
translators
97b77f0251 Update: Translations from eints
english (au): 5 changes by krysclarke
english (us): 5 changes by 2TallTyler
korean: 5 changes by telk5093
italian: 5 changes by Rivarossi
russian: 5 changes by Ln-Wolf
finnish: 5 changes by hpiirai
turkish: 5 changes by densxd
portuguese: 5 changes by azulcosta
2023-05-06 18:39:19 +00:00
Michael Lutz
b14c5aff1f Fix: [Win32] Text line breaking did not properly handle punctuation characters. (#10775) 2023-05-06 16:15:40 +00:00
Tyler Trahan
0fc21b5686 Fix: Engine age is in months, not days (#10773) 2023-05-06 11:54:38 -04:00
Loïc Guilloux
31d1a323ef Fix #10771, 3901ef9: GRFConfig.filename is now a std::string (#10774) 2023-05-06 14:58:47 +00:00
b67cf7f94a Change: Replace ScriptLog data array with std::deque. (#10770)
Due to cyclic header dependency this requires moving the data types used
by ScriptLog out of the ScriptLog class.
2023-05-06 14:54:58 +00:00
translators
5dd54e2708 Update: Translations from eints
japanese: 10 changes by fmang
vietnamese: 14 changes by KhoiCanDev
dutch: 14 changes by Afoklala
polish: 1 change by pAter-exe
2023-05-05 18:42:16 +00:00
bda754ec83 Fix: Make all settingsgen 'warnings' fatal. (#10766)
Compilation should stop If settingsgen fails to complete properly.
2023-05-05 09:22:03 +01:00
Patric Stout
a7d3c79d79 Fix c6c3d0e6: restore string-based settings in network-private settings (#10765)
By accident the SDTC_SSTR got replaced with SDTC_VAR, which breaks
many of the settings in this file.
2023-05-05 07:08:57 +00:00
Rubidium
877349c13d Codechange: use std::string for text file name resolution 2023-05-05 08:54:29 +02:00
0b72297d57 Feature: Increase number of stations/roadstops per NewGRF. 2023-05-05 07:08:40 +01:00
bc7dfd7b46 Add: Station property 1C/1D to set name/classname.
These are an alternative to the original "generic" C4xx/C5xx method,
which can only assign strings to IDs up to 256.
2023-05-05 07:08:40 +01:00
d6f35a9fd6 Change: Add placeholders for unimplemented NewGRF station properties. 2023-05-05 07:08:40 +01:00
7a86615007 Feature: Remove limit of objects per NewGRF. 2023-05-05 07:08:40 +01:00
912eb68981 Change: Extend entity override manager and station spec lists to support 16 bit IDs. 2023-05-05 07:08:40 +01:00
e5c9a3e527 Change: Read Action 3 IDs as extended-bytes for all features.
This can be done because previous the value 0xFF (which indicates an
extended byte) was reserved for this purpose. Other features which may
not have mentioned reserving 0xFF do not allow this many IDs anyway.

This makes Action 3 consistent across all features. The allowable limits
for each feature do not change.
2023-05-05 07:08:40 +01:00
10baecd81f Change: Make Action 3 debug messages more consistent. 2023-05-05 07:08:40 +01:00
glx22
045a99dd23 Codechange: Remove STR_TINY_RIGHT_ARROW 2023-05-05 07:07:54 +01:00
glx22
222e37d319 Codechange: Remove TINY_BLACK_STATION 2023-05-05 07:07:54 +01:00
glx22
b2a36ff3cc Codechange: Remove STR_TINY_GROUP and STR_TINY_BLACK_VEHICLE 2023-05-05 07:07:54 +01:00
glx22
999057a4d8 Codechange: Remove STR_SHORT_DATE 2023-05-05 07:07:54 +01:00
glx22
49eb638563 Codechange: Remove STR_ORANGE_STRING1_WHITE and STR_ORANGE_STRING1_LTBLUE. 2023-05-05 07:07:54 +01:00
61407840c6 Codechange: Remove STR_BLACK_RAW_STRING. 2023-05-05 07:07:54 +01:00
0880616851 Codechange: Remove various STRING strings. 2023-05-05 07:07:54 +01:00
4767641c8c Codechange: Remove various INT strings. 2023-05-05 07:07:54 +01:00
d5fb9e7dc6 Codechange: Remove various DATE_LONG strings. 2023-05-05 07:07:54 +01:00
a2d7642195 Codechange: Remove STR_COMPANY_MONEY. 2023-05-05 07:07:54 +01:00
f1d0a26324 Codechange: Remove STR_TINY_BLACK_DECIMAL. 2023-05-05 07:07:54 +01:00
e18f688db5 Codechange: Remove various COMMA strings. 2023-05-05 07:07:54 +01:00
5e185d5328 Codechange: Draw tooltip text in black. 2023-05-05 07:07:54 +01:00
Rubidium
3901ef9760 Codechange: use std::string for the GRF filenames 2023-05-04 23:23:32 +02:00
Rubidium
f78aa1e720 Codechange: use std::unique_ptr to manager GRFErrors in GRFConfig 2023-05-04 23:23:32 +02:00
Rubidium
a312a6c1b2 Codechange: make md5sumToString std::string compatible 2023-05-04 23:23:32 +02:00
Rubidium
51c6b8c1e4 Codechange: use fmt::format_to for gamelog message creation over seprintf 2023-05-04 23:23:32 +02:00
Patric Stout
c6c3d0e6fa Fix: no_http_content_downloads and use_relay_service as private settings (#10762)
Basically, we don't need to know those values when people send in
crash reports.
2023-05-04 22:46:02 +02:00
Jonathan G Rennison
8d501f2db1 Fix #10741: Rail platforms left partially reserved after train crash (#10751) 2023-05-04 21:45:13 +01:00
7ccdefa1c1 Change: Increase vehicle random data from 8 to 16 bits. 2023-05-04 21:42:28 +01:00
4a5e413a6c Cleanup: Remove unnecessary VehicleRandomBits()
Simple Random() assignment to byte does the same.
2023-05-04 21:42:28 +01:00
translators
ca497ce356 Update: Translations from eints
japanese: 29 changes by fmang
danish: 25 changes by bscargo
polish: 29 changes by pAter-exe
2023-05-04 18:41:18 +00:00
Tyler Trahan
6501f84b4a Codechange: Move calendar date functions inside TimerGameCalendar (#10753) 2023-05-04 13:14:12 +00:00
translators
7669aac865 Update: Translations from eints
english (us): 14 changes by 2TallTyler
2023-05-03 18:40:51 +00:00
Patric Stout
62f9bdb939 Fix: [CI] no need to build unit-tests for releases (#10759)
We don't run them anyway. And LTO can be darn slow.
2023-05-02 23:43:16 +02:00
Patric Stout
018a26d9b6 Fix: crash in emscripten when saving games (#10758)
Don't allocate 128KB on stack, but rather on the heap.
2023-05-02 21:22:09 +00:00
Patric Stout
fbad57ecf7 Change: [CI] update emscripten and liblzma to the latest version (#10757) 2023-05-02 23:12:52 +02:00
39eff18754 Codechange: Use std::vector for gamelog GRFConfig comparisons. 2023-05-02 19:47:55 +01:00
00bf42353a Codechange: Place gamelog into its own class, along with internal data.
Data is now stored in vectors to avoid manual memory management and
passing lengths around.
2023-05-02 19:47:55 +01:00
translators
47a8d12f0e Update: Translations from eints
english (au): 14 changes by krysclarke
korean: 14 changes by telk5093
italian: 14 changes by Rivarossi
russian: 15 changes by Ln-Wolf
finnish: 14 changes by hpiirai
turkish: 14 changes by densxd
portuguese: 16 changes by azulcosta
2023-05-02 18:39:14 +00:00
Patric Stout
81d4fa6999 Feature: drop ICU-lx in favour of directly interfacing with harfbuzz
This means we have RTL support again with ICU 58+. It makes use of:
- ICU for bidi-itemization
- ICU for script-itemization
- OpenTTD for style-itemization
- harfbuzz for shaping
2023-05-01 22:17:56 +02:00
Patric Stout
9cb60768fe Codechange: split implementations of ParagraphLayouterFactory into their own file 2023-05-01 22:17:56 +02:00
translators
4cceaae8dc Update: Translations from eints 2023-05-01 18:39:20 +00:00
Tyler Trahan
aa8830f57a Feature: Filter engine build menu by name and NewGRF extra text (#10519) 2023-05-01 17:02:16 +00:00
Michael Lutz
908be59699 Fix: [Win32] Wrong multi-line text layout due to incorrect whitespace handling. 2023-05-01 16:31:59 +02:00
Michael Lutz
715234502c Fix: Typo in variable name. 2023-05-01 16:31:59 +02:00
Rubidium
1f3b7e2efd Codechange: use std::string instead of stredup for saveload error messages 2023-05-01 16:23:24 +02:00
Rubidium
8665404fe0 Codechange: use std::string instead of stredup for missing glyph error messages 2023-05-01 16:23:24 +02:00
Rubidium
a931378c52 Codechange: use std::string instead of stredup/free for ScanProgressWindow 2023-05-01 16:23:24 +02:00
Rubidium
aac95eeaf5 Codechange: use std::string instead of stredup/free for stories 2023-05-01 16:23:24 +02:00
Rubidium
3342967ad9 Codechange: use std::string instead of stredup/free for goals 2023-05-01 16:23:24 +02:00
cc44aa7438 Change: Split Game options into General, Graphics and Sound tabs. (#10674) 2023-05-01 12:58:22 +01:00
003bab3c8a Change: Size space for editbox clear button by interface scale. (#10749) 2023-04-30 23:11:00 +01:00
translators
cf3cb8d2a5 Update: Translations from eints
english (au): 4 changes by krysclarke
vietnamese: 4 changes by KhoiCanDev
korean: 4 changes by telk5093
russian: 1 change by Ln-Wolf
2023-04-30 18:40:41 +00:00
a816dd1d48 Change: Remove {TINY_FONT} from cargo abbreviation strings for other translations. 2023-04-30 11:47:53 +01:00
310b3a67ad Change: Remove {TINY_FONT} from cargo abbreviation strings for English. 2023-04-30 11:47:53 +01:00
0acc57583b Fix: Force cargo abbreviation to small font in station list. 2023-04-30 11:47:53 +01:00
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
35ba49bfb4 Change: Rename text colour NWidgetPart to SetTextStyle and add font size.
This allows to set both text colour and size for any widget with default
drawing.
2023-04-30 11:47:53 +01:00
Tyler Trahan
ba3de0383a Codechange: Pass more std::string to StringFilter::AddLine() (#10743) 2023-04-30 10:23:05 +02:00
Rubidium
ee9239d293 Fix c8299304: retain support ICU < 65 2023-04-30 00:42:15 +02:00
Patric Stout
73bdd4bdd7 Fix: [CI] typo in Windows release jobname (#10742) 2023-04-29 19:59:01 +00:00
translators
de08e29cd9 Update: Translations from eints
english (us): 4 changes by 2TallTyler
2023-04-29 18:42:05 +00:00
Rubidium
ee8b1dfbc3 Fix 4dd5f994: hotkey parsing was broken 2023-04-29 14:56:41 +02:00
Rubidium
397221b94a Codechange: Make ScenarioIdentifier use std::string for the filename 2023-04-29 13:23:34 +02:00
Rubidium
3a822fcd01 Codechange: Make FiosItem's name and title std::string 2023-04-29 13:23:34 +02:00
Rubidium
ee723f26ba Codechange: Make FileToSaveLoad's title std::string and simplify assignments 2023-04-29 13:23:34 +02:00
Rubidium
f0a1ddd81c Codechange: let FiosBrowseTo return a bool 2023-04-29 13:23:34 +02:00
Rubidium
c829930440 Codechange: replace strnatcmp with C++ string capable version 2023-04-29 12:07:45 +02:00
Rubidium
df19673fbd Codechange: let convert_to_fs accept std::string 2023-04-29 12:07:45 +02:00
Rubidium
b5f96808a1 Fix: FormatArrayAsHex returns gibberish instead of a hex array 2023-04-29 11:07:57 +02:00
Kuhnovic
3991e76c96 Fix #8177: Ships with max speed overflow to near-zero speed (#10695) 2023-04-29 09:33:01 +01:00
Rubidium
4dd5f994be Codechange: replace strncasecmp with case ignoring variant of StrStarts/EndsWith 2023-04-29 10:25:25 +02:00
Rubidium
86786a7af6 Codechange: introduce StrEqualsIgnoreCase/StrCompareIgnoreCase to replace strcasecmp 2023-04-29 10:25:25 +02:00
Patric Stout
36a0818bc5 Remove: buying/selling/owning company shares (#10709) 2023-04-29 10:16:49 +02:00
1a24016964 Fix: Set TC_NO_SHADE only for shaded engine in purchase list.
Additionally use TC_FORCE to prevent additional colours in the shaded text.
2023-04-28 23:12:07 +01:00
23c46e1abf Fix: #10735: {POP_COLOUR} fails if string is drawn with extra flags. 2023-04-28 23:12:07 +01:00
translators
3ed8c35dfe Update: Translations from eints
italian: 4 changes by Rivarossi
russian: 4 changes by Ln-Wolf
finnish: 4 changes by hpiirai
turkish: 4 changes by densxd
dutch: 6 changes by Afoklala
portuguese: 4 changes by azulcosta
2023-04-28 18:42:10 +00:00
Rubidium
b221fa3c5a Codechange: use fmt::format_to instead of seprintf to create the search URL 2023-04-28 19:53:03 +02:00
Rubidium
6a8b4f3e10 Codechange: use fmt::format_to instead of seprintf to fill the PNG metadata 2023-04-28 19:53:03 +02:00
Rubidium
ef3beef7e9 Codechange: use fmt::format_to instead of seprintf to write the savegame info 2023-04-28 19:53:03 +02:00
Rubidium
33c4fbff8f Codechange: use fmt::format_to instead of seprintf to fill load crash message 2023-04-28 19:53:03 +02:00
translators
d33993cca3 Update: Translations from eints 2023-04-27 18:39:56 +00:00
Patric Stout
a255b61514 Change: [CI] Use a custom name for matrix runs (#10723)
By default, GitHub adds all arguments of the matrix between ().
This is fine sometimes, but in other times it becomes a very
lengthy line.

With this commit, we decide what is between those (), making it
a lot more readable.
2023-04-27 20:15:09 +02:00
Patric Stout
f5fad88723 Change: base autosaves intervals on real time (instead of game time) (#10655)
There are two fundamental issues with autosave:
- When fast-forwarding, it saves way too often
- When paused, it never saves

Both makes no sense. Autosaves are meant to prevent you from
accidentally losing your work. The emphasis on "your" work.

To solve both issues, the autosave now works on real time. You
can select every 10 / 30 / 60 / 120 minutes, which are similar to
what the setting was in game-months.

When you pause, autosaving will stop. Unless you make any change
to the game; then it will continue to make autosaves, even so
the game is paused. Unpausing / pausing resets this mechanism.
2023-04-27 15:21:29 +00:00
57f2d70fef Change: Use cstdint instead of rolling our own types. (#10651) 2023-04-27 10:04:18 +02:00
Rubidium
9fe853f7b5 Codechange: use fmt::format instead of vseprintf for midi command formatting 2023-04-26 18:46:17 +02:00
Rubidium
c8ff6a9f7c Codechange: replace str_fmt with std::string constructs 2023-04-26 18:46:17 +02:00
Rubidium
fce4b5ea69 Codechange: use Debug over printf for dedicated forking output 2023-04-26 18:46:17 +02:00
Rubidium
75cd790ab9 Codechange: use fmt::format for FormatHexNumber 2023-04-26 18:46:17 +02:00
Rubidium
630d3bc053 Codechange: use fmt::format instead of printf for the NewGRF profiler 2023-04-26 18:46:17 +02:00
Rubidium
3105d0b09e Codechange: replace text-buf printf with fmt::format 2023-04-26 18:46:17 +02:00
Owen Rudge
173ed81dbe Change: [Actions] Upgrade import-codesign-certs dependency in macOS build workflow 2023-04-26 15:10:47 +01:00
Charles Pigott
80bd5ad727 Codechange: Use std::strto* variants everywhere (#10720) 2023-04-26 12:56:14 +01:00
Tyler Trahan
997c936893 Codechange: Don't use bytes for months in graph GUI 2023-04-26 07:14:03 -04:00
Tyler Trahan
930f0a16d8 Codechange: Define Date/Year/Month/Day within TimerGameCalendar class 2023-04-26 07:14:03 -04:00
20d2558f1b Fix: Clear church/stadium flags when copying house substitute specs. 2023-04-26 06:46:07 +01:00
64782cf005 Fix #10627: Houses subsitute specs should only be copied on first definition.
Before #10627, substitue specs were always copied despite redefinition.
2023-04-26 06:46:07 +01:00
7535eb65e2 Codechange: Use vector instead of mallloc/free for Action 6 data. (#10713) 2023-04-26 06:45:11 +01:00
1697dff744 Change: Hide all variants from UI when (display) parent is hidden. (#10708) 2023-04-25 20:34:10 +01:00
translators
5794590b36 Update: Translations from eints
vietnamese: 1 change by KhoiCanDev
polish: 7 changes by pAter-exe
2023-04-25 18:41:18 +00:00
Rubidium
f74e26ca7e Codechange: replace error/usererror printf variant with fmt variant and rename 2023-04-25 17:55:09 +02:00
Rubidium
43c65a3fec Codechange: use std::string for base media filename/warning storage 2023-04-25 15:01:08 +02:00
b8f0513a72 Change: Draw and size video driver info like base set info.
This allows very long video driver information strings to wrap instead
of making the game options window very wide.
2023-04-25 13:27:22 +01:00
9aee502838 Change: Size Game Options description widgets after initial sizing.
Trying to update text widgets with free flowing multiline text during
UpdateWidgetSize(), as the final width is not yet known and so the
calculated height being incorrect, usually resulting in one or more
empty text lines.

The solution is to update the widget heights afterwards during
OnResize(), at which point the final widths are known. The window is
then resized if needed.

(Note this technique needs more attention if width can also change.)
2023-04-25 13:27:22 +01:00
e8df28d7f3 Add: parameter for ReInit() to reposition window to default. 2023-04-25 13:27:22 +01:00
55d981aec3 Add: Helper to update widget vertical size.
This avoids directly setting min_y outside widget code.
2023-04-25 13:27:22 +01:00
Tyler Trahan
6830e5f5f7 Cleanup: Don't use a magic number when closing processing industries (#10710) 2023-04-24 19:58:48 +00:00
Jonathan G Rennison
37392935dd Fix #10707: Incorrect type of days_in_transit in CargoPacket constructor (#10715) 2023-04-24 18:55:16 +00:00
translators
27e9a79988 Update: Translations from eints
finnish: 2 changes by hpiirai
portuguese: 1 change by azulcosta
2023-04-24 18:40:29 +00:00
Patric Stout
1c76e0904d Codechange: revive STR_TINY_BLACK_COMMA from its coma (#10714) 2023-04-24 18:33:39 +00:00
Tyler Trahan
2f495c015a Fix 7c6bf97: Don't change date and shift dates in the wrong order (#10711) 2023-04-24 17:33:03 +00:00
Patric Stout
31ad990831 Codechange: move tick-counter into TimerGameTick (#10712) 2023-04-24 16:55:40 +00:00
Patric Stout
7aa2b9ab0a Codechange: move all date-related variables inside the timer (#10706) 2023-04-24 15:56:01 +00:00
Rubidium
f5f6306af3 Codechange: use string/fmt instead of printf for ShowInfo(F) 2023-04-24 17:51:54 +02:00
Rubidium
8f24901843 Codechange: replace printf with PRINTF macros by fmt::format for scripts 2023-04-24 17:51:25 +02:00
Rubidium
484883e6e1 Cleanup: remove (unused) Squirrel code that used a hack to work around printf safety 2023-04-24 17:51:25 +02:00
Rubidium
5733142b0d Codechange: use string/fmt instead of printf for Squirrel's Raise_Error 2023-04-24 17:51:25 +02:00
Rubidium
8b93e45e22 Codechange: use string/fmt instead of printf for squirrel's PRINTFUNC 2023-04-24 17:51:25 +02:00
075671bcfc Codechange: Rename DECLARE_ENUM_AS_BIT_SET parameter to enum_type.
It works on enums not masks.
2023-04-24 09:17:37 +01:00
9f26e74e1e Codechange: Rename item_t to Item. 2023-04-24 09:17:37 +01:00
c3cea45ebc Codechange: Rename height_t/amplitude_t to Height/Amplitude. 2023-04-24 09:17:37 +01:00
3f811246b1 Codechange: Rename control_point_t to ControlPoint.
The _t suffix is reserved by POSIX 1003.1.
2023-04-24 09:17:37 +01:00
Tyler Trahan
7c6bf977e0 Cleanup: Fix and add comments to date cheat callback (#10699) 2023-04-23 21:20:56 +02:00
translators
e9f6bbada2 Update: Translations from eints
english (au): 1 change by krysclarke
english (us): 1 change by 2TallTyler
galician: 36 changes by pvillaverde
korean: 14 changes by telk5093
italian: 1 change by Rivarossi
russian: 1 change by Ln-Wolf
turkish: 2 changes by densxd
2023-04-23 18:41:11 +00:00
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
370a8d77a4 Codechange: Use simple assignment to assign specs. 2023-04-23 15:58:27 +01:00
087654501b Codechange: Initialise specs with std::fill/std::copy instead of memset/memcpy. 2023-04-23 15:58:27 +01:00
d0c71f2a9e Codechange: Use reserve/emplace when initializing object definitions.
This avoids unnecessary initialization of objects.
2023-04-23 15:58:27 +01:00
Jonathan G Rennison
a967cc4de2 Fix: Violation of strict weak ordering in engine value/running cost sorter 2023-04-23 12:52:12 +01:00
Jonathan G Rennison
684c7bbc93 Fix: Violation of strict weak ordering in TownRatingSorter
If two unrated town names compare equal in TownNameSorter
2023-04-23 12:52:12 +01:00
translators
e437b8edae Update: Translations from eints
english (au): 1 change by krysclarke
english (us): 1 change by 2TallTyler
vietnamese: 4 changes by KhoiCanDev
italian: 1 change by Rivarossi
russian: 1 change by Ln-Wolf
turkish: 1 change by EndChapter
portuguese: 1 change by azulcosta
2023-04-22 18:39:34 +00:00
Tyler Trahan
f45509848a Fix #10289: Don't silently fail when setting timetable start dates (#10690) 2023-04-21 22:36:06 +00:00
018f0f63a6 Change: Centre company face in scaled widget. (#10688) 2023-04-21 19:54:04 +01:00
translators
6b077ce25c Update: Translations from eints
english (us): 5 changes by 2TallTyler
vietnamese: 1 change by KhoiCanDev
russian: 1 change by Ln-Wolf
turkish: 33 changes by densxd
dutch: 5 changes by Afoklala
2023-04-21 18:42:16 +00:00
Tyler Trahan
ef60a93816 Fix #8302: Improve "Maintenance intervals are in percents" helptext (#10686) 2023-04-21 18:00:41 +00:00
Tyler Trahan
394192dde8 Codechange: Refactor timetable GUI (#10613) 2023-04-21 16:31:26 +01:00
Rubidium
7b539fa7c9 Fix: fmt's {:#04X} yields '0X00', not '0x0000'
Technically the 0X vs 0x is not a big problem, just not pretty. However, the
length also including the 0x results in unexpected behaviour, so it probably
better to not use it.
2023-04-20 21:39:57 +02:00
27b4b5d0a0 Codechange: Make GRF temporary engine data a vector. (#10685)
This replaces manual C-style realloc/memset/free.
2023-04-20 19:38:48 +00:00
translators
b56be83937 Update: Translations from eints
italian: 20 changes by Rivarossi
french: 5 changes by ZarTek-Creole
2023-04-20 18:42:29 +00:00
d5f9e04a55 Change: Failure to load a savegame is critical. (#10682)
Marking the error message critical ensures it is queued if multiple errors occured.
2023-04-20 17:04:07 +01:00
aeonofdiscord
36f5fe19fe Fix #10665: CheckEngines should ignore wagons when determining available vehicles at the start date. (#10673) 2023-04-19 05:41:12 -04:00
Rubidium
7088f5b7c7 Codechange: use string/fmt instead of printf for grfmsg 2023-04-18 23:21:08 +02:00
Rubidium
dfe52da1ea Codechange: use string/fmt instead of print for strgen warnings/errors/fatals 2023-04-18 23:20:53 +02:00
translators
1fd17148e1 Update: Translations from eints
english (au): 1 change by krysclarke
german: 1 change by SecretIdetity
russian: 1 change by Ln-Wolf
finnish: 5 changes by hpiirai
slovak: 15 changes by legitalk
portuguese: 1 change by azulcosta
2023-04-17 18:40:58 +00:00
SamuXarick
f8b5661d28 Change: Allow GS access to ScriptGroup functions 2023-04-17 17:59:16 +02:00
SamuXarick
f225f36c3d Change: Allow GS access to ScriptGameSettings.IsDisabledVehicleType 2023-04-17 17:59:16 +02:00
SamuXarick
fd26a44c9e Change: Allow GS access to more ScriptCompany functions 2023-04-17 17:59:16 +02:00
Andy
8b1960a41c Change: Allow GS access to more ScriptOrder functions 2023-04-17 17:59:16 +02:00
db573c8742 Fix #10660: Sprite Font scale affected by viewport zoom level limits. (#10668) 2023-04-17 00:14:03 +02:00
Charles Pigott
e20a6f8ebb Codechange: Optimise FormatNumber by removing seprintf calls (#10659) 2023-04-17 00:04:24 +02:00
Andy
15c3bc456f Change: extend callback 161 (engine name) with bit 0x22 for context 'Autoreplace - Vehicles in use' (#10666) 2023-04-17 00:02:32 +02:00
d949cfab24 Codechange: Use std:: features for NewGRF town names (#10631)
This removes manual memory (de-)allocation and list counting.
2023-04-16 21:24:54 +01:00
Rubidium
4491e45f3c Update: change {STRING} to {ZEROFILL_NUM} for STR_FORMAT_DATE_TINY/ISO 2023-04-16 21:06:20 +02:00
Rubidium
29b09523d1 Codechange: Use {ZEROFILL_NUM} instead of custom seprintf + {RAW_STRING} 2023-04-16 21:06:20 +02:00
e97bf271dc Codechange: Make SpriteType, CargoSortType, SourceType and ScriptType enum classes. (#10663)
This avoids a (soft) namespace conflict between the four ST_* enums.
2023-04-16 20:00:55 +01:00
translators
32c8e7feb8 Update: Translations from eints
english (au): 4 changes by krysclarke
vietnamese: 31 changes by KhoiCanDev
russian: 4 changes by Ln-Wolf
portuguese: 4 changes by azulcosta
2023-04-16 18:40:39 +00:00
Patric Stout
ed83c4b0da Change: replace per-AI "start_date" with a global "competitors_interval" (#10653)
The per-AI "start_date" is a lot of custom code, and was rarely
used in the way it was meant.

While at it, also ported this part over to the new timer system.
2023-04-16 20:14:22 +02:00
Rubidium
43a7e54067 Add: unit test functionality using catch2 2023-04-16 18:58:21 +02:00
Rubidium
88ead3f102 Add: catch2 v2.13.10 2023-04-16 18:58:21 +02:00
Rubidium
9b56505fec Codechange: split building into a library and executable 2023-04-16 18:58:21 +02:00
Rubidium
9e89eb5726 Codechange: move main function(s) to separate files 2023-04-16 18:58:21 +02:00
7b0797d1cd Codechange: Use unique ptrs for NewGRF specs. 2023-04-16 15:09:10 +01:00
ef6b307465 Change: Use std::vector for NewGRF spec tables.
Pointer space is allocated only for the number of IDs used, instead of
the max number of IDs for each feature.
2023-04-16 15:09:10 +01:00
15e6fc4eeb Codechange: Use iterator when mapping sprite groups. 2023-04-16 15:09:10 +01:00
Tyler Trahan
bc44158f9a Change: Allow overbuilding station and waypoint tiles (#10618) 2023-04-16 09:05:04 +02:00
translators
27b40da06a Update: Translations from eints
catalan: 14 changes by J0anJosep
portuguese: 20 changes by azulcosta
portuguese (brazilian): 15 changes by ericandradex
2023-04-15 18:39:48 +00:00
Charles Pigott
6fc28d649e Cleanup: Unused alloca definitions and includes 2023-04-15 16:57:00 +01:00
Charles Pigott
b282664242 Codechange: Replace all usages of alloca/AllocaM with more modern/less discouraged alternatives 2023-04-15 16:57:00 +01:00
rubidium42
b19f42ecd9 Codechange: Replace some p1/p2 parameter names with better names (#10658) 2023-04-15 15:11:41 +02:00
Patric Stout
387d5eb74f Codechange: validate the developer didn't schedule two timers on the same trigger/priority 2023-04-15 13:58:55 +02:00
Patric Stout
3ebc7ad16e Codechange: migrate all game-time-related timers to the new framework 2023-04-15 13:58:55 +02:00
Patric Stout
1ba4dcc924 Codechange: migrate all Window-related timers to the new framework
This means we also say goodbye to GUITimers.
2023-04-15 13:58:55 +02:00
Patric Stout
5e1bcee39b Codechange: introduce a framework for all our timers
IntervalTimer and TimeoutTimer use RAII, and can be used to replace
all the time-based timeouts, lag-detection, "execute every N" we
have.
As it uses RAII, you can safely use it as static variable, class
member, temporary variable, etc. As soon as it goes out-of-scope,
it will be safely removed.
This allows for much easier to read code when it comes to intervals.
2023-04-15 13:58:55 +02:00
rubidium42
730687080a Fix: Update some network documentation to match the new command system (#10657) 2023-04-15 09:10:09 +00:00
Tyler Trahan
646a7e625b Change: Use seconds for Linkgraph update settings (#10610) 2023-04-14 22:49:12 +02:00
translators
0e915c830c Update: Translations from eints
dutch: 15 changes by Afoklala
2023-04-14 18:39:51 +00:00
Tyler Trahan
8e04cba0c3 Change: Make tick length 27 milliseconds (#10607)
This makes a month last about 60 seconds, allowing the use of real-time units in game.

Co-authored-by: Niels Martin Hansen <nielsm@indvikleren.dk>
2023-04-14 14:50:19 +01:00
e5af5907ec Change: Make all dropdown lists extend width if necessary.
This removes the auto_width parameter from ShowDropDown(At).
2023-04-13 20:57:47 +01:00
5bc9d00735 Cleanup: Let GetStringBoundingBox deal with buffer. 2023-04-13 20:57:47 +01:00
701092003d Fix: DropDownListColourItem didn't provide width nor scale vertical padding. 2023-04-13 20:57:47 +01:00
Jonathan G Rennison
bb988f940e Fix #10638: Incorrect water infra total when building canal over object
In the case where the object is on an unowned canal tile and
the new canal tile is owned
2023-04-13 21:34:36 +02:00
translators
d04aae8428 Update: Translations from eints
danish: 18 changes by bscargo
2023-04-13 18:40:16 +00:00
ff55bfb787 Fix #10343: Don't extend town-disallowed roadtypes. (#10347)
Towns currently don't build disallowed roadtypes, however they should
also not extend disallowed roadtypes as well.

If the roadtype that cannot be extended happens to be the roadtype that
the town was going to build then this restriction is ignored.
2023-04-12 22:30:03 +01:00
5f99c8c4aa Fix: Extra viewport cannot be scrolled with right-click-close. (#10644) 2023-04-12 19:14:48 +00:00
Tyler Trahan
97cfd40649 Fix #10630: Don't allow shifting service date earlier than 0 (#10643) 2023-04-12 18:52:37 +00:00
translators
a0d8545f6c Update: Translations from eints
french: 15 changes by glx22
2023-04-12 18:42:18 +00:00
06b78a7299 Fix: Don't double-pad existing size when adding widget padding.
UpdateWidgetSize's size parameter already includes padding.
2023-04-12 18:43:15 +01:00
d93f96a442 Fix: Account for extra dropdown list padding. 2023-04-12 18:43:15 +01:00
Jonathan G Rennison
e17420777a Fix #10637: Incorrect water infra total when building multi-tile object
Wrong tile used in ownership checks
2023-04-12 16:50:45 +02:00
3b2eb11fe8 Codechange: Use cached name for all station/industry/town name formatting. (#10634)
This reuses an existing name caching mechanism to avoid "recalculating" names every time.
2023-04-11 22:50:22 +02:00
translators
d7f0c5d6d8 Update: Translations from eints
russian: 3 changes by Ln-Wolf
finnish: 7 changes by hpiirai
polish: 17 changes by pAter-exe
2023-04-11 18:42:26 +00:00
translators
9e69556e2f Update: Translations from eints
english (au): 13 changes by krysclarke
english (us): 15 changes by 2TallTyler
russian: 12 changes by Ln-Wolf
2023-04-10 18:39:57 +00:00
ce046f6d17 Fix: Abort loading savegame if road vehicle is on invalid road type. (#10622)
This can happen if NewGRFs are missing so that engine or road type definitions are wrong.
2023-04-10 19:23:18 +01:00
Charles Pigott
ce24709576 Add: Some additional debugging information when chunk sizes are incorrect 2023-04-10 18:58:48 +01:00
Charles Pigott
8aea13a85b Codechange: Use fmt for SlErrorCorruptFmt 2023-04-10 18:58:48 +01:00
246ba6f00a Fix 8361cf5a73: Missing bounds check for house specs. (#10625) 2023-04-10 15:00:34 +00:00
dP
e2f1cd44dc Change: Increase max cargo age and let min cargo payment approach zero. (#10596)
Co-authored-by: Michael Lutz <michi@icosahedron.de>
2023-04-10 12:34:28 +02:00
Artin Alavi
770df65141 Update: [Dev] Improve .editorconfig with C++ formatting rules based on OpenTTD code style (#10104) 2023-04-09 22:39:41 +02:00
translators
58e629ca84 Update: Translations from eints
korean: 8 changes by telk5093
russian: 7 changes by Ln-Wolf
finnish: 8 changes by hpiirai
2023-04-09 18:39:31 +00:00
078e27bd84 Fix #10619: Crash loading linkgraph for older savegames. (#10620) 2023-04-09 19:28:55 +01:00
Rubidium
c6ff7dad68 Add: compile time "unit tests" for GetPartialZ consistent 2023-04-09 19:00:26 +02:00
Rubidium
41ef7c88af Codechange: make a numer of Slope related functions constexpr 2023-04-09 19:00:26 +02:00
Rubidium
9d2a0f3d0b Change: make GetPartialZ consistent, meaning Z of adjacent slopes continue
Previously, on a straight line of a one corner up slope with the adjacent
steep sloop the Z would increase one step every two sub pixels, except for one
case where one sub pixel is skipped. Similarly, a steep slope with two
adjacent one corner up slopes, would have a bump in the height line along the
diagonal whenever it enters/leaves the steep slope tile.
2023-04-09 19:00:26 +02:00
Rubidium
1fcd69096c Fix: do not update a RV's Z-position when stationary while turning
When the direction of a RV changes the Z-position update logic was called,
which did nothing to the Z-position because that is only changed every other
step. By chance/luck this never triggered with RV's turning around, until
making the partial Z calculations consistent and moving the locations where
the Z-position is changed, causing the Z-position to be changed twice for
the RV that stayed at the same location.
2023-04-09 19:00:26 +02:00
Rubidium
e8af8daa68 Codechange: pass "ground vehicle" to GetTileSlopeZ since for tunnel/bridges there are two states
Previously it checked the position in non-driving direction to "guess" whether
a ground vehicle was using the function, so on tunnels/bridges it could either
return the Z of the (virtual) ground compared to the Z of the path the vehicle
would take.
2023-04-09 19:00:26 +02:00
Alberth289346
1321e48465 Fix: Update top toolbar tooltips for added features. (#10616) 2023-04-09 13:52:04 +02:00
Tyler Trahan
97bdf99239 Codechange: Add a property to graph windows for whether to draw dates (#10608) 2023-04-08 19:10:17 +00:00
translators
39c6b3def1 Update: Translations from eints
english (au): 2 changes by krysclarke
russian: 2 changes by Ln-Wolf
2023-04-08 18:46:15 +00:00
Tyler Trahan
0de5eb53fa Codechange: Use constants for service interval max/min/default values (#10611) 2023-04-08 18:04:30 +00:00
Tyler Trahan
1691640603 Fix: Specify units for value of share trading age setting (#10612) 2023-04-08 17:51:52 +00:00
f1144de509 Feature: Separate rail/road and sea/air velocity units, and add knots. (#10594)
This is achieved by packing vehicle type along with the velocity so that
the string system can decode and pick the appropriate unit.
2023-04-08 12:26:13 -04:00
glx22
3a48d6e60f Fix 991a797: [Script] Allow STRINGN consumption to be different than expected 2023-04-08 00:14:12 +02:00
Jonathan G Rennison
43cea852a6 Fix 41b414b: Validate RAW_STRING parameter values in game_script mode 2023-04-08 00:14:12 +02:00
47e12a8790 Codechange: Check that CompanyMask fits into 16 bits during compilation. 2023-04-07 22:09:55 +01:00
5199881a8d Codechange: Use correct type for linkgraph company mask. 2023-04-07 22:09:55 +01:00
65e0b0dcb7 Codechange: Be consistent with how company masks are set to all. 2023-04-07 22:09:55 +01:00
08977828cc Fix: Check ID for name is within bounds. 2023-04-07 22:09:28 +01:00
cd6c04a663 Fix: Check station ID is within bounds when copying layouts. 2023-04-07 22:09:28 +01:00
8361cf5a73 Fix: Check sprite group mapping ID is within bounds of feature. 2023-04-07 22:09:28 +01:00
96f4eb3681 Codechange: Check NewGRF feature is defined before processing any sprite group mapping.
Previously this was checked after loading ids, or repeatedly checked for
each item.
2023-04-07 22:09:28 +01:00
04215afe3f Codechange: Replace roadstop spec limit magic number with constant. 2023-04-07 22:09:28 +01:00
translators
9246789fd3 Update: Translations from eints
spanish (mexican): 2 changes by GNosii
vietnamese: 2 changes by KhoiCanDev
czech: 1 change by jachymozo
romanian: 10 changes by bnegrut
danish: 3 changes by bscargo
2023-04-07 18:39:12 +00:00
Loïc Guilloux
e4c511d403 Fix #10578: Allow to select any version of AI/GS from GUI (#10604) 2023-04-07 19:33:07 +02:00
82c70ed3b8 Change: Expose ObjectSpec vector to simplify iteration. 2023-04-02 22:42:38 +01:00
1f46f080f0 Codechange: Store objectspecs in std::vector instead of flat array. 2023-04-02 22:42:38 +01:00
93197f58b7 Codechange: Bind objectspecs to classes once all finalised. 2023-04-02 22:42:38 +01:00
02961fd7af Codechange: Use std::vector for NewGRF class lists. 2023-04-02 22:42:38 +01:00
73474b08fe Fix: Clicking on editbox clear button didn't take account of padding. (#10583) 2023-03-31 16:07:15 +01:00
c1077212d7 Codechange: Use a shared_ptr for viewport overlay. (#10586) 2023-03-31 16:06:36 +01:00
translators
c905824248 Update: Translations from eints
chinese (traditional): 14 changes by inAndyPao
danish: 1 change by bscargo
2023-03-28 18:43:33 +00:00
Tyler Trahan
e26d3de5fb Doc: Add guide to releasing OpenTTD (#10563) 2023-03-26 11:08:37 +02:00
Tyler Trahan
3611082f8e Codechange: [CodeQL] Disable CodeQL check on trivial switch statements (#10537) 2023-03-26 09:35:44 +02:00
Loïc Guilloux
9642e87bc8 Fix: [Script] Access to enum/consts defined outside of main.nut (#10573) 2023-03-25 23:07:47 +01:00
Tyler Trahan
0bf6f82305 Cleanup: Don't mix switches and early returns in widget selection 2023-03-25 18:03:16 -04:00
Tyler Trahan
066ae6f3fb Codechange: Simplify some CodeQL-flagged trivial switches 2023-03-25 18:03:16 -04:00
translators
a15e584e40 Update: Translations from eints
japanese: 27 changes by fmang
chinese (simplified): 12 changes by XiaoJi-Game
2023-03-25 18:41:51 +00:00
translators
24e9af83aa Update: Translations from eints
japanese: 22 changes by fmang
2023-03-24 18:44:41 +00:00
translators
83eb73a9b2 Update: Translations from eints
japanese: 12 changes by fmang
2023-03-23 18:42:29 +00:00
translators
1d915214a1 Update: Translations from eints
japanese: 31 changes by fmang
2023-03-21 18:42:37 +00:00
translators
d15a14bd9e Update: Translations from eints
japanese: 32 changes by fmang
danish: 7 changes by bscargo
2023-03-20 18:45:00 +00:00
Tyler Trahan
e5438891e2 Cleanup: Keep spacing saveload versions by groups of five (#10576) 2023-03-19 11:02:54 -04:00
translators
1424b7b49e Update: Translations from eints
french: 14 changes by ZarTek-Creole
2023-03-18 18:42:21 +00:00
translators
3254d65b3e Update: Translations from eints
swedish: 17 changes by joeax910
czech: 13 changes by jachymozo
danish: 3 changes by bscargo
2023-03-17 18:43:43 +00:00
translators
0bf6d80cd7 Update: Translations from eints
danish: 161 changes by bscargo
2023-03-16 18:45:39 +00:00
Rubidium
24b5033a06 Fix #10568: "can savegame be loaded check" failed in dedicated server
* If loading fails, it usually returns SL_REINIT which doesn't trigger check
 * If savegame has NewGRFs, it complains NewGRFs are not allowed in intro game
2023-03-15 22:14:29 +01:00
translators
be69aa6257 Update: Translations from eints
vietnamese: 1 change by KhoiCanDev
korean: 3 changes by telk5093
german: 30 changes by Wuzzy2
slovak: 14 changes by legitalk
dutch: 12 changes by Afoklala
2023-03-11 18:41:57 +00:00
Limyx826
64719f0e1c Doc: Add Coding Style into the repo for easier access (#10512) 2023-03-10 13:40:12 -05:00
e999aa2923 Fix: Don't (briefly) switch from title-only playlist on menu screen.
Switching playlist while on the menu screen now only changes the playlist
that will be used when out of the menu screen.
2023-03-09 20:35:24 +00:00
3b90b85439 Change: Allow jukebox lists to fill window width. 2023-03-09 20:35:24 +00:00
0c4e2ce114 Change: Resize jukebox when changing music set. 2023-03-09 20:35:24 +00:00
1ec34acb51 Fix: Truncated music-set song names cause warning log.
The music-set does not need to be selected for this to occur.

Resolved by using std::string instead of fixed buffer for song names,
which avoids manual string copying and removes the length limit.
2023-03-09 20:35:24 +00:00
2d3250923c Fix #10554: Let Scrollbar::SetPosition clamp instead of assert. (#10555) 2023-03-09 10:19:58 -05:00
Rubidium
1e4a89177e Fix: crashes to desktop from game scripts when companies disappear
When a game script is in company mode, it pretends to be another company. When
that company disappear (bankruptcy/merger), the game script still uses that
company and it keeps calling functions as if it is that company.

For example, ScriptEngine::IsBuildable internally dereferences Company without
checks, causing a null dereference for any ScriptEngine function when called
from a company scope of a company that has disappeared.

Guard against this by extending the ScriptCompanyScope::IsValid check to also
check for the company still being active.
2023-03-08 22:33:47 +01:00
Rubidium
717f79ff22 Add: deity mode enforcement checks to functions with command or company access
Command functions are those that call ScriptObject::Command, and functions
with company access are any that call ScriptObject::GetCompany. This is a bit
over-protective, but having the check everywhere makes it easier to validate
that no check is missing automatically instead of by review.
2023-03-08 22:33:47 +01:00
Rubidium
8d443d1379 Add: company mode enforcement checks to functions with command or company access
Command functions are those that call ScriptObject::Command, and functions
with company access are any that call ScriptObject::GetCompany. This is a bit
over-protective, but having the check everywhere makes it easier to validate
that no check is missing automatically instead of by review.
2023-03-08 22:33:47 +01:00
Rubidium
534f2419ad Add: precondition checks to functions that work with both valid company and deity
These are functions that either use ScriptObject::Command or ScriptObject::GetCompany.
This is a bit over-protective, but having the check everywhere makes it easier to
validate that no check is missing automatically instead of by review.

At this moment these checks will not do anything useful, as either IsValid or
IsDeity from ScriptCompanyMode returns true, but that will change later.
2023-03-08 22:33:47 +01:00
Rubidium
2fffde0891 Add: workflow and script for checking missing mode enforcements 2023-03-08 22:33:47 +01:00
Rubidium
a79f97c022 Change: upon an invalid company mode, set ERR_PRECONDITION_INVALID_COMPANY instead of ERR_PRECONDITION_INVALID 2023-03-08 22:33:47 +01:00
Joan Josep
d80f193e74 Fix: Improve grfmessage for ShipVehicleChangeInfo. (#10558) 2023-03-08 20:59:01 +00:00
translators
4af7f3e645 Update: Translations from eints
catalan: 13 changes by J0anJosep
2023-03-08 18:48:34 +00:00
Jonathan G Rennison
c74dfe393f Fix #10556: Duplication of road infrastructure count updates (#10557)
When building a road stop
2023-03-08 18:38:19 +00:00
Rubidium
3287acd114 Fix 13528bfcd0: bank balance command allows int64, GS was limited to int32 2023-03-07 23:20:04 +01:00
b6609d1833 Fix: Network server highlight invisible with RTL layout. 2023-03-07 22:05:22 +00:00
translators
df2b66ad5d Update: Translations from eints
english (au): 14 changes by krysclarke
romanian: 3 changes by bnegrut
finnish: 10 changes by hpiirai
2023-03-07 18:49:32 +00:00
Rubidium
83946ca31d Codechange: use GSCompanyMode::IsValid, IsDeity, and the precondition helpers
Direct 1:1 replacements in the code, and comments now refer to either
GSCompanyMode::IsValid or GSCompanyMode::IsDeity instead of several variations
on "company mode active" or "no company mode active".
2023-03-06 22:34:09 +01:00
Rubidium
cada2ca310 Add: GSCompanyMode::IsValid and IsDeity, and precondition enforcement helpers 2023-03-06 22:34:09 +01:00
translators
665a73b3c7 Update: Translations from eints
english (us): 12 changes by 2TallTyler
korean: 14 changes by telk5093
portuguese: 12 changes by azulcosta
polish: 16 changes by pAter-exe
2023-03-06 18:49:27 +00:00
glx22
ca149447d7 Codechange: Use SQInteger for generic numbers in script_window 2023-03-06 00:32:12 +01:00
glx22
f752d96125 Codechange: Use SQInteger for generic numbers in script_vehicle 2023-03-06 00:32:12 +01:00
glx22
4e48bf2e16 Codechange: Use SQInteger for generic numbers in script_town 2023-03-06 00:32:12 +01:00
glx22
18fe0a4046 Codechange: Use SQInteger for generic numbers in script_tilelist 2023-03-06 00:32:12 +01:00
glx22
cada18a6f8 Codechange: Use SQInteger for generic numbers in script_tile 2023-03-06 00:32:12 +01:00
glx22
07b73a8c02 Codechange: Use SQInteger for generic numbers in script_subsidy 2023-03-06 00:32:12 +01:00
glx22
cd80b31d19 Codechange: Use SQInteger for generic numbers in script_storypage 2023-03-06 00:32:12 +01:00
glx22
a9a55f2153 Codechange: Use SQInteger for generic numbers in script_station 2023-03-06 00:32:12 +01:00
glx22
446ebaa6b9 Codechange: Use SQInteger for generic numbers in script_road 2023-03-06 00:32:12 +01:00
glx22
4f6a2f31b5 Codechange: Use SQInteger for generic numbers in script_rail 2023-03-06 00:32:12 +01:00
glx22
cb2e76aae3 Codechange: Use SQInteger for generic numbers in script_priorityqueue 2023-03-06 00:32:12 +01:00
glx22
777b4d0987 Codechange: Use SQInteger for generic numbers in script_order 2023-03-06 00:32:12 +01:00
glx22
49ea69fdef Codechange: Use SQInteger for generic numbers in script_objecttype 2023-03-06 00:32:12 +01:00
glx22
0293fd41e5 Codechange: Use SQInteger for generic numbers in script_news 2023-03-06 00:32:12 +01:00
glx22
f22903ab14 Codechange: Use SQInteger for generic numbers in script_newgrf 2023-03-06 00:32:12 +01:00
glx22
ca67075397 Codechange: Use SQInteger for generic numbers in script_map 2023-03-06 00:32:12 +01:00
glx22
a225fda9fe Codechange: Use SQInteger for generic numbers in script_list 2023-03-06 00:32:12 +01:00
glx22
74ab9ee9dd Codechange: Use SQInteger for generic numbers in script_league 2023-03-06 00:32:12 +01:00
glx22
367b2ba6d1 Codechange: Use SQInteger for generic numbers in script_infrastructure 2023-03-06 00:32:12 +01:00
glx22
5eaf9d39bf Codechange: Use SQInteger for generic numbers in script_industrytype 2023-03-06 00:32:12 +01:00
glx22
6671994655 Codechange: Use SQInteger for generic numbers in script_industry 2023-03-06 00:32:12 +01:00
glx22
8eb35633ec Codechange: Use SQInteger for generic numbers in script_group 2023-03-06 00:32:12 +01:00
glx22
6ca8499e6a Codechange: Use SQInteger for generic numbers in script_goal 2023-03-06 00:32:12 +01:00
glx22
e784915b27 Codechange: Use SQInteger for generic numbers in script_gamesettings 2023-03-06 00:32:12 +01:00
glx22
6b8b4c392f Codechange: Use SQInteger for generic numbers in script_engine 2023-03-06 00:32:12 +01:00
glx22
2f40bf8097 Codechange: Use SQInteger for generic numbers in script_date 2023-03-06 00:32:12 +01:00
glx22
424ae74504 Codechange: Use SQInteger for generic numbers in script_companymode 2023-03-06 00:32:12 +01:00
glx22
89c0841d0a Codechange: Use SQInteger for generic numbers in script_company 2023-03-06 00:32:12 +01:00
glx22
7727323dbe Codechange: Use SQInteger for generic numbers in script_cargomonitor 2023-03-06 00:32:12 +01:00
glx22
40424601c6 Codechange: Use SQInteger for generic numbers in script_cargo 2023-03-06 00:32:12 +01:00
glx22
83826b1793 Codechange: Use SQInteger for generic numbers in script_bridgelist 2023-03-06 00:32:12 +01:00
glx22
58bf2f7176 Codechange: Use SQInteger for generic numbers in script_bridge 2023-03-06 00:32:12 +01:00
glx22
73561802cb Codechange: Use SQInteger for generic numbers in script_airport 2023-03-06 00:32:12 +01:00
glx22
b6f3552e4b Fix: [Script] Inconsistent precondition failure return values 2023-03-06 00:32:12 +01:00
glx22
e06a666fa2 Fix: remove ScriptController constructor from API documentation 2023-03-06 00:32:12 +01:00
glx22
67a4c5e0db Codechange: Use {fmt} for script_admin JSON generation 2023-03-06 00:32:12 +01:00
glx22
ce8cde3b8d Fix: [Script] Detect circular references in ScriptText 2023-03-05 22:24:08 +01:00
glx22
9a957f1d4b Change: [Script] Improve ScriptText validation error messages 2023-03-05 22:24:08 +01:00
Rubidium
8fa61533f0 Fix 30ae072: when a road type is hidden, towns may not build them even when that flag is set 2023-03-05 22:01:54 +01:00
translators
e60632bce6 Update: Translations from eints
italian: 12 changes by Rivarossi
russian: 14 changes by Ln-Wolf
finnish: 2 changes by hpiirai
portuguese (brazilian): 14 changes by ericandradex
2023-03-05 18:44:04 +00:00
Rubidium
30ae07269d Fix: game scripts must not build with non-existing road types 2023-03-05 07:17:38 +01:00
dP
01ebfad809 Fix 3719f60: Crash when copying non-station orders (#10540) 2023-03-04 22:52:30 +00:00
translators
16a7bc54b3 Update: Translations from eints
finnish: 2 changes by hpiirai
catalan: 2 changes by J0anJosep
2023-03-04 18:44:24 +00:00
Jonathan G Rennison
87f4d37de3 Fix #10522: Link graph line tooltip test for vertical lines (#10524) 2023-03-03 17:37:17 -05:00
Tyler Trahan
3719f60de0 Add: Use specific error message when vehicle cannot go to station/waypoint 2023-03-03 17:11:14 -05:00
Tyler Trahan
44848f4edf Add: CommandCost supports an optional second error string 2023-03-03 17:11:14 -05:00
dP
e3169c73bd Fix: Restore using founder client name as company manager name (#10535) 2023-03-03 16:04:02 -05:00
translators
ec8b2836df Update: Translations from eints
english (us): 2 changes by 2TallTyler
dutch: 2 changes by Afoklala
polish: 3 changes by pAter-exe
2023-03-03 18:44:33 +00:00
translators
58aa769282 Update: Translations from eints
vietnamese: 2 changes by KhoiCanDev
italian: 2 changes by Rivarossi
russian: 2 changes by Ln-Wolf
turkish: 3 changes by EndChapter
portuguese: 2 changes by azulcosta
2023-03-02 18:50:41 +00:00
Loïc Guilloux
2a2e51765a Cleanup 54db96b: Left-over function declaration (#10528) 2023-03-01 23:53:50 +01:00
translators
9bdcbc5af7 Update: Translations from eints
french: 3 changes by glx22
2023-03-01 18:47:27 +00:00
Jonathan G Rennison
0e4b716815 Fix: O(N^2) cost of Station::RecomputeCatchmentForAll
Station::RemoveFromAllNearbyLists does not need to be called when
all station nearby lists have been cleared and are being regenerated.
2023-03-01 16:54:57 +01:00
Jonathan G Rennison
5d0ad5625b Fix : [NewGRF] Object and road stop ignore property handlers (#10525)
* Fix: IgnoreObjectProperty did not handle object property 0x18

* Fix: IgnoreRoadStopProperty did not handle properties 0x0E - 0x12, 0x15
2023-03-01 01:19:39 +01:00
Zachary
e17c82e32b Add: maximum number of companies allowed to the client list 2023-02-28 20:52:46 +01:00
translators
6f9b3fa964 Update: Translations from eints
chinese (traditional): 7 changes by inAndyPao
2023-02-28 18:45:57 +00:00
glx22
41b414bc1c Change: [Script] Restore support of {RAW_STRING} in ScriptText 2023-02-28 18:53:17 +01:00
glx22
991a797e09 Change: [Script] Validate ScriptText parameters type and amount 2023-02-28 18:53:17 +01:00
Rubidium
728973859d Change: [Script] Automate the ScriptObject reference counting 2023-02-28 18:53:17 +01:00
glx22
a1fc4d5c0e Codechange: [Script] Merge the 3 ScriptText param arrays 2023-02-28 18:53:17 +01:00
glx22
af15dca316 Change: [Script] Extract params info from GS strings 2023-02-28 18:53:17 +01:00
Tyler Trahan
6e52ceab96 Feature: Industry directory text filter (#10518) 2023-02-28 12:20:41 -05:00
Rubidium
1eefe1c3a0 Codechange: hide Tile(Extended) into the Tile structure 2023-02-28 07:11:48 +01:00
Rubidium
580d0a6343 Codechange: make use of Tile in for all direct map accesses 2023-02-28 07:11:48 +01:00
Rubidium
7a6452d3ef Codechange: introduce Tile class for accessing map data of a single tile 2023-02-28 07:11:48 +01:00
Rubidium
7a1816a6cd Codechange: rename Tile to TileBase to be able to introduce a new Tile class 2023-02-28 07:11:48 +01:00
Rubidium
0fb0469e47 Codechange: introduce iterator to iterate over the Tiles of a Map
Note: this version is using TileIndex, but that changes later
2023-02-28 07:11:48 +01:00
Eric Long
20a1b24b45 Fix: build on platforms without native atomic 2023-02-27 17:11:29 +01:00
Chenshu Yu
eabb9db0bb Fix #9810: 'Rebuilding' a through road stop costs money (#9852) 2023-02-27 08:59:42 +00:00
Patric Stout
6fcc8727f5 Change: [Actions] cancel previous run if pushing new PR
Lately we had a few times that people pushed to their PR branch
a few times to make small changes. Sadly, this triggers all CIs
every time, which takes ~20 minutes. As we are limited in the
amount of runners we get assigned to us, this means all other CI,
even for other repositories within OpenTTD, are delayed too.

We can avoid this by simply cancelling old runs when a new PR is
pushed. There is a downside: sometimes people already push a new
commit, but still want to know if the old one passed. That will
no longer be possible with this change.
2023-02-26 23:33:15 +01:00
dP
b0542c8c49 Codechange: Don't store tree counter in the map array (#10018) 2023-02-26 16:39:44 -05:00
SamuXarick
6eabbaa751 Fix #10469, 5e14a20: [Script] League Table rating element is a int64 everywhere else 2023-02-26 22:25:13 +01: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
178249e7cc Codechange: Saveload macros for entries with a custom table name. 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
564de01d66 Remove: SmallMatrix be gone. 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
Niels Martin Hansen
2fee8ecdda Add #7525: Allow autoreplace with same model vehicle 2023-02-26 21:29:25 +01:00
Jonathan G Rennison
4c1406a4b5 Add: NewGRF road stops 2023-02-26 21:28:30 +01:00
Tyler Trahan
a18182e24b Revert 92c7551: Line drawing algorithm fix broke other cases (#10497)
This reverts commit 92c755161d.
2023-02-26 19:23:31 +00:00
translators
07fbd19da3 Update: Translations from eints
luxembourgish: 8 changes by phreeze83
2023-02-26 18:45:57 +00:00
Rubidium
947a789bf6 Codechange: split large function into smaller steps and simplify logic 2023-02-25 23:57:36 +01:00
Rubidium
8cbf1be9d6 Codechange: split large function into smaller functions with self-explanatory names 2023-02-25 23:57:36 +01:00
Rubidium
a409e4b026 Add: documention to large functions that have too little documentation according to CodeQL 2023-02-25 23:57:36 +01:00
translators
2561fad5d4 Update: Translations from eints
romanian: 1 change by bnegrut
2023-02-25 18:45:15 +00:00
dP
c73b88ddca Fix: Don't send unused tile field over the network (#10507) 2023-02-24 22:50:11 +01:00
Michael Lutz
9b3326e3fd Codechange: [Script] Use std::vector instead of a hand-rolled alternative. 2023-02-24 21:46:27 +01:00
Michael Lutz
ca3cb4d2ef Codechange: [Script] Use a class template instead of a function template for squirrel type conversion.
Class templates allow using partial template specialization, which is useful in
case one wants to have a type conversion on a type that is itself templated.
2023-02-24 21:46:27 +01:00
translators
187d330177 Update: Translations from eints
spanish (mexican): 1 change by GNosii
2023-02-24 18:48:34 +00:00
SamuXarick
b52b29b1a4 Change: Avoid crashing to the side of a train
When a road vehicle is already running on a multi level crossing, and a train shows up ahead, don't make the road vehicle crash on the side of the train.
2023-02-22 20:09:02 +01:00
SamuXarick
8351b97f52 Add: [Script] Labels for negative values of a setting 2023-02-21 00:28:21 +01:00
SamuXarick
376820c0b6 Doc: [Script] Update info descriptions 2023-02-21 00:28:21 +01:00
SamuXarick
bb2ac8b3c4 Fix: [Script] Save config item values up to 10 digits + 1 for sign + 1 for termination, enough to fit min and max int 2023-02-21 00:28:21 +01:00
SamuXarick
fde7028a95 Fix #10059: [Script] Let custom values on a config item be up to 10 digits + 1 for sign 2023-02-21 00:28:21 +01:00
SamuXarick
7b1fd3e37f Fix #10059: [Script] Clamp config item values to int32
Also prevent random_deviation to be below 0.
2023-02-21 00:28:21 +01:00
Nik Nyby
92c755161d Fix #10222: Adjust line drawing algorithm (#10491) 2023-02-20 16:18:25 -05:00
translators
8778949b6a Update: Translations from eints
english (us): 1 change by nikolas
galician: 18 changes by pvillaverde
2023-02-20 18:47:32 +00:00
translators
9ade3345f7 Update: Translations from eints
english (us): 3 changes by nikolas
galician: 1 change by pvillaverde
2023-02-19 18:43:37 +00:00
translators
4a8b8807e6 Update: Translations from eints
vietnamese: 6 changes by KhoiCanDev
korean: 1 change by telk5093
2023-02-18 18:44:22 +00:00
2376112c77 Fix #10477: Not enough space for text due to rounding down (OSX) (#10489) 2023-02-18 05:50:20 -05:00
SamuXarick
3df9321a65 Fix: Some Script::IsValidVehicle checks need to be complemented with IsPrimaryVehicle
Add: [Script] ScriptVehicle.IsPrimaryVehicle
2023-02-18 09:58:02 +01:00
glx22
3559576166 Codechange: [Script] Don't expose static buffers outside of ScriptText 2023-02-17 21:28:14 +01:00
glx22
e735370318 Change: [Script] A ScriptText with too many parameters is now a fatal error
It should never happen as adding/setting parameters already checks that anyway.
2023-02-17 21:28:14 +01:00
translators
2fdfc38da8 Update: Translations from eints
korean: 6 changes by telk5093
slovak: 8 changes by legitalk
catalan: 3 changes by J0anJosep
turkish: 5 changes by EndChapter
dutch: 1 change by Afoklala
portuguese (brazilian): 8 changes by ericandradex
polish: 2 changes by pAter-exe
2023-02-17 18:47:31 +00:00
Loïc Guilloux
4072dcff49 Fix #10486: [Script] Debug window requires AIs to be started before GS (#10487) 2023-02-17 12:24:51 +01:00
Loïc Guilloux
27cbb81df5 Fix: [Actions] vcpkg needs pkg-config to build zlib on macOS (#10488) 2023-02-16 22:35:51 +01:00
Patric Stout
fdfcb09aa3 Fix #10131: actually cancel downloads when pressing cancel 2023-02-15 23:48:06 +01:00
Patric Stout
dea2dea881 Fix: reset content download progress to zero if falling back to TCP
Otherwise this chain of events can happen:
- You already have a (partial) file downloaded
- You start the download, and HTTP fails
- This resets the download progress to the current size of the file
- The TCP download starts at a very large value (UINT32_MAX - filesize)

It now resets to 0% done when any negative value is being given.
As added bonus, we no longer have to query how much was already
downloaded.
2023-02-15 23:48:06 +01:00
Patric Stout
1c17556f96 Codechange: replace instance of char * with std::string 2023-02-15 23:48:06 +01:00
Patric Stout
0722bb3bf4 Change: try to detect the CA file/path for CURL (#10481)
The default is given compile-time, not run-time. So libcurl is
of no use to us.

Current list is kindly borrowed from
https://go.dev/src/crypto/x509/root_linux.go
2023-02-15 22:58:43 +01:00
Patric Stout
16352559f2 Change: release with (much) newer versions of dependencies for Generic Linux (#10484) 2023-02-15 22:18:23 +01:00
Patric Stout
ea90fa24f8 Codechange: move curl into a thread so simplify code (#10480)
With a thread, we can just run curl_easy_perform() and let CURL
and threads handle the blocking part.

With async solution there are too many things to keep track of,
and it makes "when to update the GUI" tricky. By using a thread
that all gets a lot simpler, as the game-thread and download-thread
run side-by-side.

This is similar to how the WinHttp backend already works.
2023-02-15 21:56:19 +01:00
translators
228b34c2bf Update: Translations from eints
english (au): 1 change by krysclarke
czech: 2 changes by jachymozo
finnish: 1 change by hpiirai
2023-02-14 18:46:38 +00:00
dP
fe2c8a1240 Codechange: Decouple INDUSTRY_CTRL into separate commands (#10475) 2023-02-14 11:29:11 +01:00
frosch
d7fcb420c4 Fix: compilation with libcurl from 2013. 2023-02-13 22:45:07 +01:00
frosch
274bcf8d80 Fix 64523709: rpm uses different package names than deb. 2023-02-13 22:45:07 +01:00
translators
04847b1208 Update: Translations from eints
english (us): 1 change by 2TallTyler
portuguese: 2 changes by ppxppy
2023-02-13 18:47:38 +00:00
translators
695ce0ab09 Update: Translations from eints
swedish: 3 changes by joeax910
italian: 1 change by Rivarossi
russian: 1 change by Ln-Wolf
ukrainian: 1 change by serg-bloim
latvian: 7 changes by lexuslatvia
2023-02-12 18:45:01 +00:00
Patric Stout
64523709bf Add: use https:// for content-service connections (#10448)
This requires the use of WinHTTP (for Windows) or libcurl (for all
others except Emscripten). Emscripten does not support http(s)
calls currently.

On Linux it requires ca-certificates to be installed, so the HTTPS
certificate can be validated. It is really likely this is installed
on any modern machine, as most connections these days are HTTPS.

(On MacOS and Windows the certificate store is filled by default)

Reminder: in case the http(s):// connection cannot be established,
OpenTTD falls back to a custom TCP-based connection to fetch the
content from the content-service. Emscripten will always do this.
2023-02-12 12:07:31 +01:00
translators
09f7f32b8d Update: Translations from eints
ukrainian: 2 changes by serg-bloim
2023-02-11 18:44:57 +00:00
Loïc Guilloux
a2c8168924 Fix #10465: Delay closing of network join progress window (#10466) 2023-02-11 12:32:45 +01:00
Bilongozhko, Serhii (Contractor)
35ad964c6b Feature: Ctrl+Click to reset late counter for the entire vehicle group. 2023-02-11 09:48:09 +01:00
SamuXarick
231935fccd Change: Show buy company dialog window even when playing in the AI company 2023-02-11 09:43:47 +01:00
SamuXarick
43ce73db86 Fix: [Script] Use Money instead of int32 for presenting the value of a company to AIs 2023-02-11 09:43:47 +01:00
Loïc Guilloux
6b99b6672e Fix: [Script] ScriptBase::Rand() return value was between -MIN(int32) and MAX(int32) (#10443)
Also ensure the parameters for ScriptBase::RandRange() and ScriptBase::Chance() are in [0-MAX(uint32)] range
2023-02-10 19:55:59 +01:00
translators
7bd475b86c Update: Translations from eints
english (au): 2 changes by krysclarke
estonian: 107 changes by RM87
romanian: 2 changes by bnegrut
finnish: 8 changes by hpiirai
dutch: 4 changes by Afoklala
portuguese: 2 changes by azulcosta
polish: 2 changes by pAter-exe
2023-02-10 18:48:19 +00:00
glx22
3278f4c7bb Fix #10280, 59645c6: Ignore double-click for unavailable town actions 2023-02-10 19:39:21 +01:00
glx22
d6aa526b69 Fix #10461, 59645c6: Properly check for _local_company validity 2023-02-10 19:39:21 +01:00
translators
59251d3c6b Update: Translations from eints
english (us): 2 changes by 2TallTyler
estonian: 110 changes by RM87
czech: 5 changes by jacobczsk
italian: 11 changes by Rivarossi
russian: 2 changes by Ln-Wolf
2023-02-09 18:45:50 +00:00
translators
b083584649 Update: Translations from eints
arabic (egypt): 30 changes by AviationGamerX
portuguese: 1 change by azulcosta
2023-02-08 18:47:55 +00:00
Tyler Trahan
f12498b633 Add: Show NewGRF name in NewGRF-created errors (#10457) 2023-02-07 15:13:32 -05:00
translators
0c36e4a771 Update: Translations from eints
english (au): 1 change by krysclarke
english (us): 1 change by 2TallTyler
vietnamese: 2 changes by KhoiCanDev
luxembourgish: 5 changes by phreeze83
catalan: 3 changes by J0anJosep
french: 11 changes by ZarTek-Creole, 5 changes by glx22
2023-02-07 18:45:46 +00:00
dP
b5bc001d42 Codechange: Swap comments for CommandHelper::Post overloads (#10454) 2023-02-07 13:55:46 +00:00
Owen Rudge
f951ce6931 Fix: Ensure logo for Windows Store common assets package is named correctly 2023-02-07 09:23:44 +00:00
translators
cb2944205c Update: Translations from eints
english (au): 4 changes by krysclarke
swedish: 16 changes by joeax910
english (us): 2 changes by 2TallTyler
chinese (simplified): 2 changes by XiaoJi-Game
hebrew: 3 changes by Boltyansky
romanian: 10 changes by kneekoo
russian: 5 changes by Ln-Wolf
portuguese: 2 changes by azulcosta
polish: 4 changes by pAter-exe
2023-02-06 18:44:47 +00:00
translators
7c998d46bd Update: Translations from eints
spanish (mexican): 22 changes by VMMF
chinese (simplified): 2 changes by XiaoJi-Game
turkish: 2 changes by EndChapter
2023-02-05 18:43:07 +00:00
glx22
b080f24bd8 Codechange: move windows common to AI and GS out of ai_gui 2023-02-05 19:27:25 +01:00
glx22
78e3c93a25 Fix: caption for GS settings window opened from debug window 2023-02-05 19:27:25 +01:00
glx22
cef9931e53 Cleanup: GS don't have "start_date" 2023-02-05 19:27:25 +01:00
translators
6aafccfb22 Update: Translations from eints
korean: 2 changes by telk5093
spanish: 2 changes by MontyMontana
portuguese: 2 changes by azulcosta
2023-02-04 18:44:14 +00:00
translators
b364b41768 Update: Translations from eints
english (us): 2 changes by 2TallTyler
finnish: 2 changes by hpiirai
catalan: 2 changes by J0anJosep
dutch: 2 changes by Afoklala
2023-02-03 18:44:54 +00:00
translators
e41af1f2bb Update: Translations from eints
portuguese (brazilian): 8 changes by ericandradex
2023-02-02 18:44:54 +00:00
SamuXarick
1f194eb94e Fix: [Script] Incorrect value for GOAL_INVALID (#10436)
* Fix: [Script] Incorrect value for GOAL_INVALID

* Cleanup: Remove unused static variable
2023-02-01 23:35:51 +01:00
Rubidium
bf8b32d193 Change: explicitly allow initial loan of 0, however show warning in UI 2023-02-01 21:41:18 +01:00
Rubidium
b7b7c11b90 Change #10077: make maximum loan a positive multiple of the loan interval
And set the minimum maximum loan to the value of loan interval, so there is
always an amount of money to lend. Compared to being allowed to set max loan
to 0 and never be allowed to lend any money.
2023-02-01 21:41:18 +01:00
SamuXarick
d0639cdc28 Fix: [Script] Incorrect subsidy SourceID value used 2023-02-01 21:17:16 +01:00
SamuXarick
4fc4874a30 Add: [Script] Let random road layout be a choice 2023-02-01 21:15:13 +01:00
SamuXarick
184ff92057 Cleanup: [Script] Pass new_rating directly to CmdTownRating (#10441) 2023-02-01 13:48:39 -05:00
translators
654a77c4f7 Update: Translations from eints
luxembourgish: 21 changes by phreeze83
2023-02-01 18:47:29 +00:00
Byoungchan Lee
12f9fbcf39 Fix: [CMake] remove cpack warning on fedora when lsb_release exists (#10437) 2023-02-01 07:41:41 +00:00
Rubidium
31869501ee Fix: make script goals work with the whole range of ClientIDs 2023-01-31 20:09:48 +01:00
Rubidium
67e1d1ad89 Fix: no need to cast enums down to int32; they will be automatically promoted to int64 2023-01-31 20:09:48 +01:00
translators
1897e98c3d Update: Translations from eints
slovak: 10 changes by legitalk
2023-01-31 18:45:28 +00:00
Michael Lutz
05ed9f56fd Feature: [NewGRF] Engine name callback. 2023-01-30 22:00:56 +01:00
Michael Lutz
2d73076056 Add: [NewGRF] Second vehicle property for additional callback flags. 2023-01-30 22:00:56 +01:00
Michael Lutz
f5394ed2ef Change: [NewGRF] Extend the D8xx (DCxx) string area up to FFFF.
This adds the Exxx and Fxxx blocks to the usable range for NewGRF
local strings. TTDPatch uses these ranges for internal strings, but as
we don't support any of them anyway, it is "free" real estate for us.
2023-01-30 22:00:56 +01:00
translators
43657cf65d Update: Translations from eints
chinese (traditional): 9 changes by wpi3
2023-01-30 18:45:30 +00:00
Loïc Guilloux
07b40c02fe Fix #10361, fe30f66: Don't try to give saved data to a dead script (#10433) 2023-01-29 22:27:29 +00:00
Jonathan G Rennison
9c915f05ec Fix: Water infrastructure accounting when building docks 2023-01-29 23:15:53 +01:00
Jonathan G Rennison
b82bcac3cd Fix #10419: Water infrastructure accounting when building ship depots 2023-01-29 23:15:53 +01:00
Rubidium
4e65ec1dc4 Codechange: do not declare functions in blocks 2023-01-29 20:28:45 +01:00
translators
5a4f0498fe Update: Translations from eints
hebrew: 6 changes by haimlm
catalan: 4 changes by J0anJosep
turkish: 7 changes by ahmetlii
2023-01-29 18:42:05 +00:00
Rubidium
8be908c919 Fix #10430, Fix 6ba55e6: display chain window causing assert 2023-01-29 18:11:38 +01:00
rubidium42
6ba55e663e Codechange: do not hide variables with other variables 2023-01-29 07:21:34 +01:00
rubidium42
1951af07c0 Codechange: do not hide parameters with local variables 2023-01-29 07:21:34 +01:00
Patric Stout
be0d65d978 Add: [Actions] upload releases to GOG automatically 2023-01-28 20:41:08 +01:00
Patric Stout
146bd74077 Change: [Actions] release Windows Store files to CDN
Currently they had a name that the rest of our system cannot
deal with correctly. "cert.pfx" is also not very descriptive from
a system as a whole.

As such, we now name it like any other file, so it can be published
safely to the CDN.
2023-01-28 20:41:08 +01:00
Patric Stout
425ba82676 Change: [Actions] split GitHub workflows into several smaller ones 2023-01-28 20:41:08 +01:00
Patric Stout
9fd88af537 Remove: [Actions] Ubuntu/Debian release binaries (instead, use the Generic) 2023-01-28 20:41:08 +01:00
Rubidium
f001e84e5e Codechange: use RAII to automatically restore _cur_dpi after use 2023-01-28 20:33:02 +01:00
Rubidium
b7a5d8e296 Codechange: add annotation to selectively force inlining in debug build 2023-01-28 20:32:45 +01:00
SamuXarick
df89c34e03 Fix 7e1e275: Measure AI Collect Garbage performance (#9924) 2023-01-28 20:18:28 +01:00
translators
4a58d197ee Update: Translations from eints
japanese: 26 changes by Azusa257
vietnamese: 4 changes by KhoiCanDev
chinese (simplified): 4 changes by XiaoJi-Game
french: 8 changes by glx22
2023-01-28 18:44:03 +00:00
Rubidium
04d10b3d2d Codechange: instead of global pointer to stack variable, just put variable in that global
Removes one indirection and a dangling pointer to a stack location
2023-01-28 17:23:30 +01:00
Rubidium
d51d08ddcb Codechange: put stack variables in global variables for gamelog/crashlog 2023-01-28 17:23:30 +01:00
Rubidium
ed7685910d Codechange: pass large objects by reference instead of value
Especially when they get passed on directly to the next function or via a
constructor into an instance variable
2023-01-28 13:43:21 +01:00
translators
dbc666905d Update: Translations from eints
czech: 10 changes by jacobczsk
dutch: 4 changes by Afoklala
2023-01-27 18:45:27 +00:00
Rubidium
7e1d272397 Cleanup: remove unused static variables 2023-01-27 07:05:49 +01:00
Rubidium
00721787e1 Fix: wrong type for INVALID_LINK_GRAPH_JOB 2023-01-27 07:05:49 +01:00
Rubidium
755e41de9f Codechange: make rounding code clearer
-O1 already optimizes it to the original hand optimized magic code
2023-01-26 23:47:55 +01:00
Rubidium
71b46db8d0 Cleanup: remove commented out code 2023-01-26 23:47:55 +01:00
Rubidium
5863d78cb4 Codechange: use commented out code, or guard by #ifdef 2023-01-26 23:47:55 +01:00
Rubidium
ae422be979 Cleanup: remove/replace trailing ; with . in comments 2023-01-26 23:47:55 +01:00
Henry Wilson
0b2567d882 Codechange: Remove shift as fast-forward key when _DEBUG is defined 2023-01-26 22:15:06 +01:00
SamuXarick
46dc6da270 Codechange: Make void tiles flood edge tiles, instead of edge tiles flooding themselves (#8517) 2023-01-26 21:57:25 +01:00
ede1201b6a Codechange: Rename override manager variables. 2023-01-26 21:39:16 +01:00
bcc53c5ad5 Codechange: Add missing this-> in override manager.
Variable scope is also tweaked in a couple of cases reducing line count.
2023-01-26 21:39:16 +01:00
eedb786872 Codechange: Use vector for NewGRF spec overrides.
This replaces C-style memory management.
2023-01-26 21:39:16 +01:00
translators
07940726d3 Update: Translations from eints
korean: 4 changes by telk5093
2023-01-26 18:45:34 +00:00
Rubidium
2fd99467ea Fix: scripts are not aware of nullptr, they only know null 2023-01-26 16:07:14 +01:00
Rubidium
f9a473bef7 Fix: missing/duplicate documentation tags for scripts 2023-01-26 16:07:14 +01:00
Rubidium
3112b387e7 Fix: warnings about obsolete settings/setting values in Doxygen configurations 2023-01-26 16:07:14 +01:00
Rubidium
41fa94bc56 Fix: scripts cannot call constructors of ScriptEvents, so remove from the documentation 2023-01-25 22:28:30 +01:00
Rubidium
042f90a9dd Fix: no ScriptEvent sub class should export constructors to scripts 2023-01-25 22:28:30 +01:00
merni-ns
2d0c1ffdb7 Change #10255: Reduce basic thickness of linkgraph GUI lines (#10410)
From 3px to 2px (multiplied by UI scale).
2023-01-25 18:06:19 +00:00
translators
01a2449489 Update: Translations from eints
finnish: 8 changes by hpiirai
polish: 4 changes by pAter-exe
2023-01-24 18:44:59 +00:00
4dfd6a096f Fix #10220: Don't select unselectable engine as default. (#10404) 2023-01-24 00:05:42 +00:00
translators
97844df123 Update: Translations from eints
spanish: 4 changes by MontyMontana
2023-01-23 18:43:48 +00:00
Tyler Trahan
9c5de7fd72 Fix #10395: When loading old saves, don't forcibly bar level crossings (#10400) 2023-01-23 18:08:19 +01:00
Rubidium
8aeef665c7 Fix #10377, Fix 94167df: bad sorting of rail vehicles when primary variant is missing 2023-01-22 21:13:17 +01:00
translators
7d502e2857 Update: Translations from eints
english (us): 4 changes by 2TallTyler
romanian: 10 changes by bnegrut
russian: 4 changes by Ln-Wolf
portuguese: 4 changes by azulcosta
2023-01-22 18:42:21 +00:00
SamuXarick
b2a5ebcfc4 Fix 3c047b1: AIGroup.GetProfitLastYear could get values different than those displayed in GUI (#10227)
* Change: Store "all time" and "since minimum age" last year profits on groups

* Fix: Update last year profit for groups when copying vehicle statistics on autoreplace

* Codechange: Refactor profit last year

* Change: Rename some group related items for clarity

* Change: Reorder the fields in GroupStatistics

That way less memory gets wasted.
2023-01-22 08:14:02 -05:00
translators
8b5fa2cc7b Update: Translations from eints
english (au): 4 changes by krysclarke
2023-01-21 18:42:26 +00:00
Rubidium
7cdc23fd64 Codechange: hide the map's size related fields in the Map structure 2023-01-21 17:11:40 +01:00
Rubidium
de6bc8e692 Codechange: move TILE_MASK to Map::WrapToMap 2023-01-21 17:11:40 +01:00
Rubidium
fe2bcd2a58 Codechange: migrate size related functions to Map structure 2023-01-21 17:11:40 +01:00
Rubidium
d481f78b24 Codechange: add map size related functions to Map structure 2023-01-21 17:11:40 +01:00
Rubidium
9c1a3b17e3 Codechange: use MapLogY() instead of FindFirstBit(MapSizeY()), MapSize() instead of MapSizeX() * MapSizeY() 2023-01-21 17:11:40 +01:00
Rubidium
22d3de8b67 Codechange: use ScriptMap size functions instead of global functions 2023-01-21 17:11:40 +01:00
Rubidium
953445a5ac Codechange: use MakeSea/AllocateMap in the oldloader instead of MemSetT 2023-01-21 17:11:40 +01:00
Andy
3b0b572ebf Change: Log AI/GS Squirrel crashes in white text for readability (#10375) 2023-01-20 22:42:57 +01:00
translators
5eb2e0fd3d Update: Translations from eints
dutch: 4 changes by Afoklala
2023-01-20 18:46:24 +00:00
Francis Herne
01be423237 Fix #10362: NewGRF bridges without speed limits.
For bridges, a max speed of 0xFFFF (i.e. no effective limit)
 is no longer displayed as a limit in the UI.

A max speed of 0 is also considered unlimited, for similarity to the
 roadtype and railtype interface.
2023-01-19 22:24:33 +01:00
translators
3c80f2d14a Update: Translations from eints
english (au): 6 changes by krysclarke
chinese (simplified): 3 changes by XiaoJi-Game, 1 change by ZZY2357
arabic (egypt): 11 changes by AviationGamerX
korean: 3 changes by telk5093
indonesian: 8 changes by K4smun1
2023-01-19 18:45:02 +00:00
translators
83d5e681fc Update: Translations from eints
vietnamese: 6 changes by chupper100
italian: 4 changes by Rivarossi
tamil: 10 changes by merni-ns
2023-01-18 18:46:14 +00:00
5801442780 Fix: Switch to OWNER_TOWN prevented OWNER_DEITY test during industry prospecting. (#10360) 2023-01-17 17:33:03 -05:00
Rubidium
8d8519c3f6 Fix #10368, Fix 994bf19: server restarting game caused clients to hit assertion
Upon closing the EndGameWindow, triggered from UnInitWindowSystem, the
HighScoreWindow would be opened and _z_windows would not be empty.
2023-01-17 22:48:39 +01:00
translators
dcc06f44bc Update: Translations from eints
english (us): 6 changes by 2TallTyler
catalan: 6 changes by J0anJosep
spanish: 5 changes by MontyMontana
portuguese: 4 changes by azulcosta
polish: 4 changes by pAter-exe
2023-01-17 18:43:58 +00:00
translators
8a6f4c22c9 Update: Translations from eints
finnish: 2 changes by hpiirai
french: 2 changes by glx22
portuguese: 2 changes by azulcosta
portuguese (brazilian): 2 changes by ericandradex
polish: 2 changes by pAter-exe
2023-01-16 18:44:06 +00:00
Tyler Trahan
dbf69fde53 Fix #10363: CargoDist setting helptext shouldn't suggest symmetric distribution for diamonds in subtropic (#10364)
* Fix #10363: CargoDist setting helptext shouldn't suggest symmetric distribution for diamonds in subtropic

* Fix: Always capitalize the first word of a sentence, even if a quoted setting name
2023-01-16 11:55:44 -05:00
translators
750d89d37b Update: Translations from eints
russian: 2 changes by Ln-Wolf
turkish: 2 changes by EndChapter
2023-01-15 18:44:57 +00:00
Rubidium
a4a819c983 Fix #9865: removing files with the console always failed 2023-01-15 14:47:05 +01:00
Rubidium
1ed0b35520 Fix #10009: bad overflow protection when taking out loans 2023-01-15 12:04:50 +01:00
2355882ec1 Codechange: Remove object enabled flag and shuffle members. (#10358)
`enabled` flag is replaced with IsEnabled() which checks if views is
non-zero.

ObjectSpec is shuffled to reduce its memory footprint.
2023-01-15 10:58:03 +00:00
Rubidium
8f9a60893d Fix #10177: company list password padlock showed after switching to single player 2023-01-15 11:52:51 +01:00
Rubidium
c578917783 Fix #10057: FallbackParagraphLayout fails to properly wrap
... during the first word after a new run has been started.
2023-01-15 11:43:22 +01:00
SamuXarick
96ec9908a0 Codechange: refactor removal of desert around river tiles 2023-01-15 00:43:41 +01:00
Rubidium
20a9e13272 Fix: inconsistent definition of copy constructor and assignment 2023-01-15 00:24:20 +01:00
Rubidium
6dfd2cad69 Fix: comparison result is always the same warnings 2023-01-15 00:24:20 +01:00
b4f0450974 Change: Display font status as aa/noaa instead of true/false. (#10352) 2023-01-14 22:39:15 +00:00
Rubidium
921c6591f9 Codechange: do not use interactive random anymore for script configuration 2023-01-14 22:00:11 +01:00
Rubidium
c5ff61c5f2 Add: script specific Randomizer instances 2023-01-14 22:00:11 +01:00
Rubidium
6abad681bd Codechange: move choice for randomizer of scripts to a single location 2023-01-14 22:00:11 +01:00
Rubidium
3373128233 Codechange: pass the randomizer directly to the town name generation 2023-01-14 22:00:11 +01:00
Rubidium
b3b8c3fd2d Codechange: pass the randomizer to use directly to the company face generation 2023-01-14 22:00:11 +01:00
rubidium42
5e6dac6fd4 Add: enable CodeQL code scanning
As a replacement to the now deprecated LGTM(.com)
2023-01-14 21:58:18 +01:00
8149ba338f Change: Check glyph size before trying to render it.
This change of order ensures that the "Font glyph is foot large" occurs
even if the glyph is too large for an alloca() allocation.
2023-01-14 20:50:59 +00:00
fa0c67b10a Change: Remove guess-work from calls to GetGlyphOutline().
This API method is intended to be called twice, so don't attempt to guess
the required size.
2023-01-14 20:50:59 +00:00
5370e910d3 Change: Use std::vector for fallback font list. 2023-01-14 20:50:59 +00:00
Rubidium
90f1768006 Codechange: add non-nullptr asserts in cases where it should never be nullptr
Though where similar calls are checked for nullptr as in those instances of
the use of that function it can actually return nullptr. In other words, write
down the assumption that the function never returns nullptr in an assert.
2023-01-14 21:15:23 +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
Rubidium
9c70c38c5e Fix: check for the existence of shadow and rotor vehicles for aircraft
Instead of just assuming that it exists in the savegame that got loaded.
2023-01-14 21:15:23 +01:00
translators
5ddfd38de6 Update: Translations from eints
norwegian (bokmal): 1 change by buzzCraft
2023-01-14 18:43:25 +00:00
Jonathan G Rennison
10e76b2788 Fix #10032: Capacities of articulated vehicles in build window
See also: #9954
2023-01-14 18:52:01 +01:00
Tyler Trahan
07fba75238 Fix: Various Wide River issues (#10348) 2023-01-14 08:20:19 -05:00
Tyler Trahan
2206c73156 Feature: Set a custom number of industries in map generation window (#10340) 2023-01-14 05:12:29 -05:00
Tyler Trahan
5c64cdcb79 Feature: Press Ctrl to build a diagonal area of trees (#10342) 2023-01-13 18:04:30 -05:00
Rubidium
b951332def Codechange: use smart pointers when creating StringIterators 2023-01-13 21:09:40 +01:00
Rubidium
b35c791d05 Codechange: use smart pointers when cloning iterators 2023-01-13 21:09:40 +01:00
Rubidium
f667a831a5 Codechange: unify creation of diagonal/orthogonal iterator using smart pointers 2023-01-13 21:09:40 +01:00
6a0d1c7c19 Fix: Link variants to parents when finalising engines. (#10346)
This ensures that definition-order of engines within the NewGRF does not matter.
2023-01-13 19:22:31 +00:00
Tyler Trahan
dced2d8c30 Fix #10333, c53f29d: Only show industry prospecting errors to local company (#10338) 2023-01-12 14:03:39 -05:00
translators
b05c21203a Update: Translations from eints
arabic (egypt): 20 changes by AviationGamerX
2023-01-12 18:47:22 +00:00
Tyler Trahan
5a2907a99f Change: Remove land generator setting from World Generation GUI (#10093) 2023-01-12 13:26:18 -05:00
translators
80322b85c2 Update: Translations from eints
swedish: 7 changes by joeax910
japanese: 17 changes by scabtert
luxembourgish: 14 changes by phreeze83
lithuanian: 80 changes by devastatorius
2023-01-11 18:47:32 +00:00
09a32f2ce1 Fix #10335: Set initial scrollbar count for object GUI. (#10336)
This previously happened when the window was resized by itself which was fixed by #10196. Explicitly set the count instead.
2023-01-11 18:26:38 +00:00
translators
70157b2ad5 Update: Translations from eints
luxembourgish: 3 changes by phreeze83
hebrew: 125 changes by haimlm
2023-01-10 18:45:18 +00:00
translators
9d13213c61 Update: Translations from eints
spanish (mexican): 3 changes by absay
2023-01-09 18:47:47 +00:00
translators
81c5c16477 Update: Translations from eints
galician: 1 change by NicoSGF64
romanian: 8 changes by ALEX11BR
2023-01-08 18:42:25 +00:00
c18a171028 Fix #10331: Starting new company during load must happen after AI start. (#10332)
This situation occurs when loading a savegame in single-player which only
has AI companies.
2023-01-08 18:09:38 +00:00
translators
7460fdb298 Update: Translations from eints
chinese (simplified): 7 changes by HansKaffee
turkish: 13 changes by rustoocas
2023-01-07 18:43:34 +00:00
blschachte
6b68de1f3e Doc: Fix typo in COMPILING.md (#10329) 2023-01-07 17:32:25 +00:00
Rubidium
46dfb309bc Fix #10309: [SDL] Uninitialized width and height when turning off full screen 2023-01-07 15:46:00 +01:00
translators
29af0f8c7b Update: Translations from eints
swedish: 18 changes by joeax910
chinese (simplified): 2 changes by HansKaffee
romanian: 3 changes by ALEX11BR
slovak: 15 changes by legitalk
tamil: 21 changes by Aswn
2023-01-06 18:46:19 +00:00
Rubidium
0251786f46 Fix: virtual call from constructor
That fills an instance variable that is only read from the Game Options window
and that is overwritten when the video driver is started. Since you cannot get
into the Game Options window without starting the video driver, it is just
pointless and wrong code that would never be noticed by the end user.
2023-01-06 19:34:35 +01:00
Rubidium
c1ff471c77 Fix: bad oddness checks
Modulo on a signed number returns negative values for negative values, so
i % 2 == 1 will only return true for positive odd numbers, whereas i % 2 != 0
returns true for both positive and negative odd numbers.
2023-01-06 19:34:35 +01:00
Rubidium
f7af9a299a Codechange: prevent suspicious pointer scaling 2023-01-06 19:34:35 +01:00
Rubidium
170f37d07f Codechange: silence some potentially uninitialized local variable errors
In these cases technically they are false positives, however dismissing the
alerts when the underlying code may make them true positives does not seem
like the safest solution.
2023-01-06 19:34:35 +01:00
Rubidium
496ec1f012 Fix: use reference and array indexing to prevent suspicious pointer scaling 2023-01-06 19:34:35 +01:00
Rubidium
fbd0f5ad7d Fix: inconsistent allocation error handling
Mix-and-matching std::bad_alloc exception handling with nullptr checks
2023-01-06 19:34:35 +01:00
Rubidium
3c54344825 Fix: comparison of narrow type with wide type in loop condition
Technically this can't be triggered with the currently returned values though.
2023-01-06 19:34:35 +01:00
Charles Pigott
e00996a18a Change: Big UFO disaster targets current location of a random train (#10290) 2023-01-06 13:05:09 +00:00
1b1aa682a6 Fix: Don't assume engclass 2 should be elrail. (#10315)
When disabling/enabling elrail, there is an assumption that `engclass` of 2
means the engine will run on elrail. While this holds for default engines,
NewGRFs can do other things.

To resolve this we store the intended railtype so that toggling elrail will
restore to the correct type.
2023-01-06 00:44:57 +00:00
Loïc Guilloux
8f350c9ae6 Fix: [Actions] preview_build failure due to git upgrade (#10323) 2023-01-05 23:25:45 +00:00
Rubidium
51049946d1 Fix: prevent corrupted GRF files to allocate stupid amounts of memory 2023-01-05 20:11:59 +01:00
translators
58068883f8 Update: Translations from eints
swedish: 33 changes by joeax910
arabic (egypt): 11 changes by AviationGamerX
luxembourgish: 3 changes by Gubius
greek: 85 changes by SStelioss
indonesian: 55 changes by indrabagus, 20 changes by K4smun1
serbian: 527 changes by nkrs
latvian: 82 changes by lexuslatvia
polish: 2 changes by pAter-exe
2023-01-05 18:48:43 +00:00
Rubidium
752cd5c0da Cleanup 84b71f7: remove G5 detector as it's not referenced anymore
The last supported Mac OS X for G5 is 10.5.8 and support for < 10.7 has already been removed.
2023-01-04 22:42:23 +01:00
Rubidium
375a5b8e3f Codechange: refactor FindClosestDepot to not use pointers, but return a struct 2023-01-04 22:30:48 +01:00
translators
b3907b1359 Update: Translations from eints
swedish: 39 changes by DonaldDuck313, 9 changes by joeax910
chinese (traditional): 62 changes by wpi3
greek: 8 changes by SStelioss
indonesian: 29 changes by indrabagus
serbian: 528 changes by nkrs
ukrainian: 82 changes by StepanIvasyn
turkish: 4 changes by jnmbk
french: 19 changes by glx22
2023-01-04 18:45:02 +00:00
Rubidium
a0694759a1 Fix: do not allow more palette colours than there are indices for the colours
Or: do not pass unchecked size from BMP file into memory allocation
2023-01-04 18:36:49 +01:00
translators
3af2c7fff6 Update: Translations from eints
swedish: 9 changes by joeax910
norwegian (bokmal): 7 changes by buzzCraft
chinese (traditional): 48 changes by wpi3
galician: 98 changes by pvillaverde
vietnamese: 13 changes by myquartz
czech: 42 changes by vladoschreiner, 40 changes by PatrikSamuelTauchim, 19 changes by adamek0202, 3 changes by LubosKolouch
chinese (simplified): 52 changes by HansKaffee
luxembourgish: 148 changes by phreeze83
hungarian: 50 changes by PstasDev, 23 changes by baliball
german: 69 changes by Wuzzy2, 4 changes by Luensche
romanian: 3 changes by kneekoo
ukrainian: 45 changes by StepanIvasyn
catalan: 12 changes by J0anJosep
turkish: 9 changes by Anceph
french: 1 change by Athozus
portuguese (brazilian): 9 changes by ericandradex
2023-01-03 18:45:43 +00: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
translators
fcbe390353 Update: Translations from eints
dutch: 10 changes by Afoklala
polish: 33 changes by pAter-exe
2023-01-02 18:46:20 +00:00
Loïc Guilloux
91ca088065 Fix #10304, fe30f66: [Scripts] Don't start GS in intro (#10305) 2023-01-02 02:13:16 +01:00
Michael Lutz
150f05dc15 Change: Heading for 14 now. (#10302) 2023-01-01 22:52:23 +01:00
1337 changed files with 132016 additions and 68255 deletions

View File

@@ -8,7 +8,7 @@ notifications:
only:
- master
only-by:
- DorpsGek
- eints-sync\[bot\]
commit-comment:
discussion:
pull-request:

View File

@@ -7,3 +7,471 @@ trim_trailing_whitespace = true
[*.{c,cpp,h,hpp}]
indent_style = tab
charset = utf-8
#indent_size = <integer>
#tab_width = <integer>
#end_of_line = <lf, cf, crlf>
### C++ specific editor config rules ###
## Visual Studio ## https://learn.microsoft.com/en-us/visualstudio/ide/cpp-editorconfig-properties?view=vs-2019 ##
# Indentation #
# Do not indent braces
cpp_indent_braces = false
# When a new line is typed, it's indented relatively to the innermost open parenthesis
cpp_indent_multi_line_relative_to = innermost_parenthesis
# Indent new lines within parenthesis
cpp_indent_within_parentheses = indent
# In existing code, do not use the setting for alignment of new lines within parentheses
cpp_indent_preserve_within_parentheses = true
# Indent case contents
cpp_indent_case_contents = true
# Indent case labels
cpp_indent_case_labels = true
# Do not indent braces following a case statement
cpp_indent_case_contents_when_block = false
# Do not indent braces of lambdas used as parameters
cpp_indent_lambda_braces_when_parameter = false
# No override for "Position of goto labels" (Unspecified)
#cpp_indent_goto_labels
# Move preprocessor directives to the leftmost column
cpp_indent_preprocessor = leftmost_column
# Do not indent access specifiers
cpp_indent_access_specifiers = false
# Indent namespace contents
cpp_indent_namespace_contents = true
# Preserve indentation of comments
cpp_indent_preserve_comments = true
# Newline #
# Keep open braces for namespaces on the same line, but add a space before the brace
cpp_new_line_before_open_brace_namespace = same_line
# Keep open braces for types/classes on the same line, but add a space before the brace
cpp_new_line_before_open_brace_type = same_line
# Move open braces for functions to a new line
cpp_new_line_before_open_brace_function = new_line
# Keep open braces for control blocks on the same line, but add a space before the brace
cpp_new_line_before_open_brace_block = same_line
# Keep open braces for lambdas on the same line, but add a space before the brace
cpp_new_line_before_open_brace_lambda = same_line
# Place scope braces on separate lines
cpp_new_line_scope_braces_on_separate_lines = true
# Do not move closing braces to the same line as opening braces for empty types
cpp_new_line_close_brace_same_line_empty_type = false
# Do not move closing braces to the same line as opening braces for empty function bodies
cpp_new_line_close_brace_same_line_empty_function = false
# Do not place 'catch' and similar keywords on a new line
cpp_new_line_before_catch = false
# Do not place 'else' on a new line
cpp_new_line_before_else = false
# Do not place 'while' in a do-while loop on a new line
cpp_new_line_before_while_in_do_while = false
# Spacing #
# Remove spaces between function names and opening parentheses of argument lists
cpp_space_before_function_open_parenthesis = remove
# Do not insert a space within parentheses of an argument list
cpp_space_within_parameter_list_parentheses = false
# Do not insert a space between parentheses when argument list is empty
cpp_space_between_empty_parameter_list_parentheses = false
# Insert space between keyword and opening parenthesis in control flow statements
cpp_space_after_keywords_in_control_flow_statements = true
# Do not insert a space within parentheses of a control statement
cpp_space_within_control_flow_statement_parentheses = false
# Do not insert a space before opening parenthesis of lambda argument lists
cpp_space_before_lambda_open_parenthesis = false
# Do not insert a space within parentheses of a C-style cast
cpp_space_within_cast_parentheses = false
# Do not insert a space after closing parenthesis of C-style cast
cpp_space_after_cast_close_parenthesis = false
# Do not insert a space within parentheses of a parenthesized expression
cpp_space_within_expression_parentheses = false
# Insert space before opening brace of blocks
cpp_space_before_block_open_brace = true
# Do not insert a space between empty braces
cpp_space_between_empty_braces = false
# Do not insert a space before opening brace of uniform initialization and initializer lists
cpp_space_before_initializer_list_open_brace = false
# No override for "Insert space within braces of uniform initialization and initializer lists" (Spacing for this varies)
#cpp_space_within_initializer_list_braces
# Preserve spaces inside uniform initialization and initializer lists
cpp_space_preserve_in_initializer_list = true
# Do not insert space before opening square brackets
cpp_space_before_open_square_bracket = false
# Do not insert space within square bracket
cpp_space_within_square_brackets = false
# Do not insert space before empty square brackets
cpp_space_before_empty_square_brackets = false
# Do not insert space between empty square brackets
cpp_space_between_empty_square_brackets = false
# Group square brackets for multi-dimensional arrays together
cpp_space_group_square_brackets = true
# Do not insert space within square brackets for lambdas
cpp_space_within_lambda_brackets = false
# Do not insert space between empty lambda brackets
cpp_space_between_empty_lambda_brackets = false
# Do not insert space before commas
cpp_space_before_comma = false
# Insert space after commas
cpp_space_after_comma = true
# Remove spaces before and after member operators
cpp_space_remove_around_member_operators = true
# Insert space before colon for base in type declarations
cpp_space_before_inheritance_colon = true
# Insert space before colon for constructors
cpp_space_before_constructor_colon = true
# Remove space before semicolons
cpp_space_remove_before_semicolon = true
# No override for "Insert space after semicolons" (Depends on if loop is unconditional)
#cpp_space_after_semicolon
# Remove spaces between unary operators and their operands
cpp_space_remove_around_unary_operator = true
# Insert spaces before and after binary operators
cpp_space_around_binary_operator = insert
# Insert spaces around assignment operators
cpp_space_around_assignment_operator = insert
# Align pointer/reference symbol to the right
cpp_space_pointer_reference_alignment = right
# Insert spaces around conditional operators
cpp_space_around_ternary_operator = insert
# Wrapping #
# Always apply New Lines settings for blocks
cpp_wrap_preserve_blocks = never
## Rider & ReSharper ## https://www.jetbrains.com/help/resharper/EditorConfig_CPP_CppBlankLinesPageScheme.html ##
# Blank Lines #
# No override for "Max blank lines in declarations" (Unspecified; Not consistent across source code)
#cpp_keep_blank_lines_in_declarations
# No override for "Max blank lines in rest of source code" (Unspecified; Not consistent across source code)
#cpp_keep_blank_lines_in_code
# No override for "Number of blank lines around class/struct/enum definition" (Unspecified; Not consistent across source code)
#cpp_blank_lines_around_class_definition
# No override for "Number of blank lines around function declarations" (Unspecified; Not consistent across source code)
#cpp_blank_lines_around_function_declaration
# No override for "Number of blank lines around function definitions" (Unspecified; Not consistent across source code)
#cpp_blank_lines_around_function_definition
# No override for "Number of blank lines around single line function definitions" (Unspecified; Not consistent across source code)
#cpp_blank_lines_around_single_line_function_definition
# No override for "Number of blank lines around namespaces" (Unspecified; Not consistent across source code)
#cpp_blank_lines_around_namespace
# No override for "Number of blank lines around other definitions and declarations" (Unspecified; Not consistent across source code)
#cpp_blank_lines_around_other_declaration
# Braces Layout #
# Keep open braces for namespace declarations on the same line, but add a space before the brace
cpp_namespace_declaration_braces = end_of_line
# Keep open braces for linkage declarations on the same line, but add a space before the brace
cpp_linkage_specification_braces = end_of_line
# Keep open braces for types/classes on the same line, but add a space before the brace
cpp_type_declaration_braces = end_of_line
# Keep open braces for namespace definitions on the same line (does not modify spacing before the brace)
cpp_place_namespace_definitions_on_same_line = true
# Move open braces for functions to a new line
cpp_invocable_declaration_braces = next_line
# Keep open braces for lambdas on the same line, but add a space before the brace
cpp_anonymous_method_declaration_braces = end_of_line
# Keep open braces for case blocks on the same line, but add a space before the brace
cpp_case_block_braces = end_of_line
# No override for "Requires expression braces" style (requires expressions are a C++20 feature)
#cpp_requires_expression_braces
# Keep open braces for all other blocks on the same line, but add a space before the brace
cpp_other_braces = end_of_line
# Only indent the insides of multi-line expression braces
cpp_expression_braces = inside
# Place the braces of empty blocks together and on the same line
cpp_empty_block_style = together_same_line
# Force line breaks within simple compound statements
cpp_simple_block_style = line_break
# No override for "Regular expression for macros starting a block" (Marco blocks aren't used)
#cpp_macro_block_begin
# No override for "Regular expression for macros ending a block" (Marco blocks aren't used)
#cpp_macro_block_end
# Tabs and indents #
# Redundant override (Already overriden globally by 'indent_style')
#cpp_indent_style
# Redundant override (Already overriden globally by 'indent_size')
#cpp_indent_size
# Redundant override (Already overriden globally by 'tab_width')
#cpp_tab_width
# Use spaces instead of tabs as indentation for precise alignment
cpp_alignment_tab_fill_style = use_spaces
# Allow alignment even if construct is located too far to the right, more than 2/3 of 'Hard wrap at' limit
cpp_allow_far_alignment = true
# Indentation and Alignment #
# No override for "Continuous line indent" (Varies throughout source code)
#cpp_continuous_line_indent
# Do not use continuous line indent in function declaration and invocation parentheses
cpp_use_continuous_line_indent_in_method_pars = false
# Do not use continuous line indent in initializer lists
cpp_use_continuous_line_indent_in_expression_braces = false
# Indent namespace members (including nested ones)
cpp_namespace_indentation = all
# No override for "Indent linkage specification block members" (Unspecified)
#cpp_linkage_specification_indentation
# Do not indent access specifier from class
cpp_indent_access_specifiers_from_class = false
# Indent class member from access specifier
cpp_indent_class_members_from_access_specifiers = true
# Do not indent if a function definition or declaration is wrapped after the type
cpp_indent_wrapped_function_names = false
# Indent 'case' labels from 'switch'
cpp_indent_switch_labels = true
# No override for "Indent function declarations' parentheses" (Varies throughout source code)
#cpp_indent_method_decl_pars
# No override for "Indent method calls' parentheses" (Varies throughout source code)
#cpp_indent_invocation_pars
# No override for "Indent statement (if, while, for, etc) parentheses" (Varies throughout source code)
#cpp_indent_statement_pars
# Do not change preprocessor directives indenting
cpp_indent_preprocessor_directives = do_not_change
# No override for "Indent C++/CLI generic constraints" (C++/CLI is not used)
#cpp_indent_type_constraints
# Align/indent comments started at the first column
cpp_indent_comment = true
# Comments that comment out code will use the indentation level of the commented code.
cpp_place_comments_at_first_column = false
# Align multiline declarators in declaration
cpp_align_multiple_declaration = true
# Align multiline function parameters
cpp_align_multiline_parameter = true
# Align multiline call arguments
cpp_align_multiline_argument = true
# Do not align first of multiline call arguments with the opening parentheses
cpp_align_first_arg_by_paren = false
# Align multiline initializer list arguments
cpp_align_multiline_expression_brace = true
# No override for "Align multiline template parameters in template declaration" (Unspecified)
#cpp_align_multiline_type_parameter
# No override for "Align multiline template arguments" (Unspecified)
#cpp_align_multiline_type_argument
# Align multiline base classes in class base clause
cpp_align_multiline_extends_list = true
# Align multiline member initializers in member initializer lists
cpp_align_multiline_ctor_init = true
# Outdent commas placed on new line
cpp_outdent_commas = true
# Do not align multiline ?: operator with first line (since alignment is incorrect)
cpp_align_ternary = none
# Do not indent aligned ?: operator (since indentation varies)
cpp_indent_aligned_ternary = false
# No override for "Align multiline chained method calls" (Unspecified)
#cpp_align_multiline_calls_chain
# No override for "Outdent '.' and '->' in chained method calls on new lines" (Unspecified)
#cpp_outdent_dots
# Do not align multiline chained binary expressions
cpp_align_multiline_binary_expressions_chain = false
# Fix column alignment in adjacent lines
cpp_int_align_fix_in_adjacent = true
# Align assignments with adjacent assignments
cpp_int_align_eq = true
# Do not align declaration names with adjacent declaration names
cpp_int_align_declaration_names = false
# Align end-of-line comments with adjacent end-of-line comments
cpp_int_align_comments = true
# Spaces #
# Do not put space before ANY commas
cpp_space_before_comma = false
# Put space after ALL commas
cpp_space_after_comma = true
# Put space before ptr in declaration of variable
cpp_space_before_ptr_in_data_member = true
# Do not put space after ptr in declaration of variable
cpp_space_after_ptr_in_data_member = false
# Put space before ptr in declaration of multiple variables
cpp_space_before_ptr_in_data_members = true
# Do not put space after ptr in declaration of multiple variables
cpp_space_after_ptr_in_data_members = false
# Put space before ptr in return type of function
cpp_space_before_ptr_in_method = true
# Do not put space after ptr in return type of function
cpp_space_after_ptr_in_method = false
# Do not put space before ptr in abstract declaration
cpp_space_before_ptr_in_abstract_decl = false
# Put space before ref in declaration of variable
cpp_space_before_ref_in_data_member = true
# Do not put space after ref in declaration of variable
cpp_space_after_ref_in_data_member = false
# Put space before ref in declaration of multiple variables
cpp_space_before_ref_in_data_members = true
# Do not put space after ref in declaration of multiple variables
cpp_space_after_ref_in_data_members = false
# Do not put space before ref in return type of function
cpp_space_before_ref_in_method = false
# Put space after ref in return type of function
cpp_space_after_ref_in_method = true
# Do not put space before ref in abstract declaration
cpp_space_before_ref_in_abstract_decl = false
# Do not put space before parentheses in function parameters
cpp_space_between_method_declaration_name_and_open_parenthesis = false
# Do not put space before parentheses in lambda parameters
cpp_space_before_lambda_parentheses = false
# Do not put space within parentheses in function parameters
cpp_space_between_method_declaration_parameter_list_parentheses = false
# Do not put space within empty parentheses in function parameters
cpp_space_between_method_declaration_empty_parameter_list_parentheses = false
# Do not put space before angle brackets in template parameters
cpp_space_before_template_params = false
# Do not put space within angle brackets in template parameters
cpp_space_within_template_params = false
# Do not put space within empty angle brackets in template parameters
cpp_space_within_empty_template_params = false
# Do not put space before angle brackets in template arguments
cpp_space_before_template_args = false
# Do not put space within angle brackets in template arguments
cpp_space_within_template_args = false
# Do not put space between closing angle brackets in template arguments
cpp_space_between_closing_angle_brackets_in_template_args = false
# Put space around '=' in alias declaration and namespace alias
cpp_space_around_alias_eq = true
# Do not put space around '->' in trailing return types
cpp_space_around_deref_in_trailing_return_type = false
# Put space before base types list colon
cpp_space_before_colon_in_inheritance_clause = true
# Put space after base types list colon
cpp_space_after_colon_in_inheritance_clause = true
# No override for "Before C++/CLI generic constraint colon" (Unspecified)
#cpp_space_before_type_parameter_constraint_colon
# No override for "After C++/CLI generic constraint colon" (Unspecified)
#cpp_space_after_type_parameter_constraint_colon
# Put space before parentheses of control statements
cpp_space_after_keywords_in_control_flow_statements = true
# Do not put space within parentheses of control statements
cpp_space_between_parentheses_of_control_flow_statements = false
# Do not put space before semicolon in 'for' statements
cpp_space_before_semicolon_in_for_statement = false
# Put space after semicolon in 'for' statements
cpp_space_after_semicolon_in_for_statement = true
# Put space before ':' in range-based for loop
cpp_space_before_for_colon = true
# Put space after ':' in range-based for loop
cpp_space_after_for_colon = true
# Do not put space before colon in switch case or label statement
cpp_space_before_colon_in_case = false
# Put space after colon in switch case or label statement
cpp_space_after_colon_in_case = true
# Put space around binary operator
cpp_space_around_binary_operator = true
# Put space around assignment operator
cpp_space_around_assignment_operator = true
# Do not put space around dot, '->', '.*' and '->.'
cpp_space_around_member_access_operator = false
# Do not put space within any parentheses
cpp_space_within_parentheses = false
# Do not put space before array subscript brackets
cpp_space_before_open_square_brackets = false
# Do not put space within array subscript brackets
cpp_space_between_square_brackets = false
# Do not put space before empty parentheses in function call and initialization
cpp_space_between_method_call_name_and_opening_parenthesis = false
# Do not put space within parentheses in cast expressions
cpp_space_between_typecast_parentheses = false
# Do not put space after parentheses in cast expressions
cpp_space_after_cast = false
# Do not put space within parentheses in function call and initialization
cpp_space_between_method_call_parameter_list_parentheses = false
# Do not put space within empty parentheses in function call and initialization
cpp_space_between_method_call_empty_parameter_list_parentheses = false
# Put space in ternary operator '? :' before '?'
cpp_space_before_ternary_quest = true
# Put space in ternary operator '? :' after '?'
cpp_space_after_ternary_quest = true
# Put space in ternary operator '? :' before ':'
cpp_space_before_ternary_colon = true
# Put space in ternary operator '? :' after ':'
cpp_space_after_ternary_colon = true
# Do not put space before uniform initialization braces
cpp_space_before_initializer_braces = false
# Do not put space within uniform initialization braces
cpp_space_within_initializer_braces = false
# Do not put space within empty uniform initialization braces
cpp_space_within_empty_initializer_braces = false
# Put space before end of line comment
cpp_space_before_trailing_comment = true
# Preserve spaces before end of line comment
cpp_disable_space_changes_before_trailing_comment = true
# Line breaks and Wrapping #
# Redundant override (Already overriden globally by 'insert_final_newline')
#cpp_insert_final_newline
# Redundant override (Already overriden earlier in Visual Studio section)
#cpp_new_line_before_else
# Do not place 'while' in a do-while loop on a new line
cpp_new_line_before_while = false
# Redundant override (Already overriden earlier in Visual Studio section)
#cpp_new_line_before_catch
# Do not change the line breaks of single embedded statements
cpp_simple_embedded_statement_style = do_not_change
# Do not change the line breaks of simple 'case' statement
cpp_simple_case_statement_style = do_not_change
# Put member function definition return type on same line
cpp_function_definition_return_type_style = on_single_line
# Put top-level function definition return type on same line
cpp_toplevel_function_definition_return_type_style = on_single_line
# Put member function declaration return type on same line
cpp_function_declaration_return_type_style = on_single_line
# Put top-level function declaration return type on same line
cpp_toplevel_function_declaration_return_type_style = on_single_line
# Force template<...> of a template declaration on new line
cpp_break_template_declaration = line_break
# No override for "Break line before the requires-clause" (requires-clause is a C++20 feature)
#cpp_line_break_before_requires_clause
# Do not change the line break before the colon in member initializer lists
cpp_member_initializer_list_style = do_not_change
# Do not change the line break after the colon in member initializer lists
cpp_line_break_after_colon_in_member_initializer_lists = do_not_change
# No override for "Break line before comma in member initializer lists" (Varies throughout source code)
#cpp_line_break_before_comma_in_member_initializer_lists
# No override for "Break line after comma in member initializer lists" (Varies throughout source code)
#cpp_line_break_after_comma_in_member_initializer_lists
# No override for "Allow C++/CLI generic constraints on the same line" (C++/CLI is not used)
#cpp_place_type_constraints_on_same_line
# No override for "Keep existing line breaks" (Varies throughout source code; depends on developer preference)
#cpp_keep_user_linebreaks
# No override for "Hard wrap at _ characters" (Unspecified)
#cpp_max_line_length
# Do not prefer wrap before ','
cpp_wrap_before_comma = false
# Do not prefer wrap before ',' in base clause
cpp_wrap_before_comma_in_base_clause = false
# No override for "Wrap ternary expression" (Varies throughout source code)
#cpp_wrap_ternary_expr_style
# No override for "Prefer wrap before '?' and ':' in ternary expressions" (Varies throughout source code)
#cpp_wrap_before_ternary_opsigns
# No override for "Prefer wrap before ':'" (Varies throughout source code)
#cpp_wrap_before_colon
# No override for "Prefer wrap before first C++/CLI generic constraint" (C++/CLI is not used)
#cpp_wrap_before_first_type_parameter_constraint
# No override for "Wrap multiple C++/CLI generic constraints" (C++/CLI is not used)
#cpp_wrap_multiple_type_parameter_constraints_style
# No override for "Wrap enum definition" (Varies throughout source code)
#cpp_wrap_enumeration_style
# No override for "Wrap braced initializer list" (Varies throughout source code)
#cpp_wrap_braced_init_list_style
# No override for "Wrap base classes list" (Varies throughout source code)
#cpp_wrap_base_clause_style
# No override for "Wrap constructor initializer" (Varies throughout source code)
#cpp_wrap_ctor_initializer_style
# No override for "Wrap formal parameters" (Varies throughout source code)
#cpp_wrap_parameters_style
# Do not prefer wrap before '(' in declaration
cpp_wrap_before_declaration_lpar = false
# Prefer wrap after '(' in declaration
cpp_wrap_after_declaration_lpar = true
# Do not prefer wrap before ')' in declaration
cpp_wrap_before_declaration_rpar = false
# No override for "Wrap invocation arguments" (Varies throughout source code)
#cpp_wrap_arguments_style
# Do not prefer wrap before '(' in invocation
cpp_wrap_before_invocation_lpar = false
# Prefer wrap after '(' in invocation
cpp_wrap_after_invocation_lpar = true
# Do not prefer wrap before ')' in invocation
cpp_wrap_before_invocation_rpar = false
# Prefer wrap after '{' in initializer lists
cpp_wrap_after_expression_lbrace = true
# Do not prefer wrap before '}' in initializer lists
cpp_wrap_before_expression_rbrace = false

View File

@@ -42,7 +42,7 @@ Some things are not automated, and forgotten often. This list is a reminder for
* This PR touches english.txt or translations? Check the [guidelines](https://github.com/OpenTTD/OpenTTD/blob/master/docs/eints.md)
* This PR affects the save game format? (label 'savegame upgrade')
* This PR affects the GS/AI API? (label 'needs review: Script API')
* ai_changelog.hpp, gs_changelog.hpp need updating.
* ai_changelog.hpp, game_changelog.hpp need updating.
* The compatibility wrappers (compat_*.nut) need updating.
* This PR affects the NewGRF API? (label 'needs review: NewGRF')
* newgrf_debug_data.h may need updating.

12
.github/codeql/codeql-config.yml vendored Normal file
View File

@@ -0,0 +1,12 @@
name: openttd
queries:
- uses: security-and-quality
query-filters:
- exclude:
id:
# Only feasible way is to move away from fopen; fopen_s is optional C11 and not implemented on most platforms.
- cpp/world-writable-file-creation
# Basically OpenTTD's coding style for adding things like ..._INVALID to enumerations
- cpp/irregular-enum-init
# Our GUI code tends to use switches for OnClick handlers, DrawWidget, and UpdateWidgetSize. Sometimes GUIs just don't have many elements, but we want to keep consistency.
- cpp/trivial-switch

10
.github/dependabot.yml vendored Normal file
View File

@@ -0,0 +1,10 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "monthly"
groups:
actions:
patterns:
- "*"

View File

@@ -0,0 +1,71 @@
"""
Script to scan the OpenTTD's script API for functions that miss checks for the
function being called from the right mode (deity or company mode).
When a function calls either ScriptObject::Command or ScriptObject::GetCompany
then the function is considered dangerous. When one of the mode enforcement
macros from script_error.hpp, i.e. EnforceDeityMode, EnforceCompanyModeValid or
EnforceDeityOrCompanyModeValid, are called in the function, then we consider
that the function has mode enforcement.
Any dangerous function for which no enforcement is found are emitted as errors.
"""
import glob
import re
import sys
def check_mode_enforcement(path):
errors = []
with open(path, "r") as reader:
mode_enforcement_found = False
dangerous_function = False
for line in reader:
# Line does not start with a tab and have <word>::<word>. That looks like the begin of a function, so reset the state.
if re.match(r"^[^\t].*\w::\w", line):
mode_enforcement_found = False
dangerous_function = False
currentFunction = line
continue
if re.match(
r"\t(EnforceDeityMode|EnforceCompanyModeValid|EnforceCompanyModeValid_Void|EnforceDeityOrCompanyModeValid|EnforceDeityOrCompanyModeValid_Void)\(",
line,
):
# Mode enforcement macro found
mode_enforcement_found = True
continue
if re.match(r".*(ScriptObject::Command|ScriptObject::GetCompany).*", line):
# Dangerous function found
dangerous_function = True
continue
# Line with only a closing bracket. That looks like the end of a function, so check for the dangerous function without mode enforcement
if re.match(r"^}$", line) and dangerous_function and not mode_enforcement_found:
function_name = currentFunction.rstrip("\n").replace("/* static */ ", "")
errors.append(f"{path}: {function_name}")
return errors
def main():
errors = []
for path in sorted(glob.glob("src/script/api/*.cpp")):
# Skip a number of files that yield only false positives
if path.endswith(("script_object.cpp", "script_companymode.cpp", "script_controller.cpp", "script_game.cpp")):
continue
errors.extend(check_mode_enforcement(path))
if errors:
print("Mode enforcement was expected in the following files/functions:")
print("\n".join(errors))
sys.exit(1)
print("OK")
if __name__ == "__main__":
main()

View File

@@ -210,11 +210,10 @@ def main():
errors.append(f"ERROR: {string} is (possibly) no longer needed.")
if errors:
for error in errors:
print(error)
print("\n".join(errors))
sys.exit(1)
else:
print("OK")
print("OK")
if __name__ == "__main__":

View File

@@ -9,6 +9,10 @@ on:
env:
CTEST_OUTPUT_ON_FAILURE: 1
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
jobs:
emscripten:
name: Emscripten
@@ -16,17 +20,17 @@ jobs:
runs-on: ubuntu-20.04
container:
# If you change this version, change the number in the cache step too.
image: emscripten/emsdk:3.1.28
image: emscripten/emsdk:3.1.42
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: /emsdk/upstream/emscripten/cache
key: 3.1.28-${{ runner.os }}
key: 3.1.42-${{ runner.os }}
- name: Patch Emscripten to support LZMA
run: |
@@ -61,37 +65,56 @@ jobs:
echo "::group::Build"
echo "Running on $(nproc) cores"
cmake --build . -j $(nproc)
cmake --build . -j $(nproc) --target openttd
echo "::endgroup::"
linux:
name: Linux
strategy:
fail-fast: false
matrix:
include:
- compiler: clang
cxxcompiler: clang++
libsdl: libsdl2-dev
- compiler: gcc
- name: Clang - Debug
compiler: clang-15
cxxcompiler: clang++-15
libraries: libsdl2-dev
- name: Clang - Release
compiler: clang-15
cxxcompiler: clang++-15
libraries: libsdl2-dev
extra-cmake-parameters: -DCMAKE_BUILD_TYPE=RelWithDebInfo -DOPTION_USE_ASSERTS=OFF
- name: GCC - SDL2
compiler: gcc
cxxcompiler: g++
libsdl: libsdl2-dev
- compiler: gcc
libraries: libsdl2-dev
- name: GCC - SDL1.2
compiler: gcc
cxxcompiler: g++
libsdl: libsdl1.2-dev
- compiler: gcc
libraries: libsdl1.2-dev
- name: GCC - Dedicated
compiler: gcc
cxxcompiler: g++
extra-cmake-parameters: -DOPTION_DEDICATED=ON -DCMAKE_CXX_FLAGS_INIT="-DRANDOM_DEBUG"
libraries: grfcodec
extra-cmake-parameters: -DOPTION_DEDICATED=ON -DCMAKE_CXX_FLAGS_INIT="-DRANDOM_DEBUG" -DCMAKE_DISABLE_PRECOMPILE_HEADERS=ON
# Compile without SDL / SDL2, as that should compile fine too.
runs-on: ubuntu-20.04
name: Linux (${{ matrix.name }})
runs-on: ubuntu-latest
env:
CC: ${{ matrix.compiler }}
CXX: ${{ matrix.cxxcompiler }}
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup vcpkg caching
uses: actions/github-script@v7
with:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
core.exportVariable('VCPKG_BINARY_SOURCES', 'clear;x-gha,readwrite')
- name: Install dependencies
run: |
@@ -102,13 +125,25 @@ jobs:
echo "::group::Install dependencies"
sudo apt-get install -y --no-install-recommends \
liballegro4-dev \
libcurl4-openssl-dev \
libfontconfig-dev \
libharfbuzz-dev \
libicu-dev \
liblzma-dev \
liblzo2-dev \
${{ matrix.libsdl }} \
${{ matrix.libraries }} \
zlib1g-dev \
# EOF
echo "::group::Install vcpkg dependencies"
# Disable vcpkg integration, as we mostly use system libraries.
mv vcpkg.json vcpkg-disabled.json
# We only use breakpad from vcpkg, as its CMake files
# are a bit special. So the Ubuntu's variant doesn't work.
vcpkg install breakpad
echo "::endgroup::"
env:
DEBIAN_FRONTEND: noninteractive
@@ -137,7 +172,7 @@ jobs:
cd build
echo "::group::CMake"
cmake .. ${{ matrix.extra-cmake-parameters }}
cmake .. -DCMAKE_TOOLCHAIN_FILE=/usr/local/share/vcpkg/scripts/buildsystems/vcpkg.cmake ${{ matrix.extra-cmake-parameters }}
echo "::endgroup::"
echo "::group::Build"
@@ -147,12 +182,18 @@ jobs:
- name: Test
run: |
cd build
ctest -j $(nproc) --timeout 120
(
cd build
ctest -j $(nproc) --timeout 120
)
# Re-enable vcpkg.
mv vcpkg-disabled.json vcpkg.json
# Check no tracked files have been modified.
git diff --exit-code
macos:
name: Mac OS
strategy:
fail-fast: false
matrix:
@@ -160,49 +201,28 @@ jobs:
- arch: x64
full_arch: x86_64
name: Mac OS (${{ matrix.arch }})
runs-on: macos-latest
env:
MACOSX_DEPLOYMENT_TARGET: 10.13
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Install dependencies
env:
HOMEBREW_NO_AUTO_UPDATE: 1
HOMEBREW_NO_INSTALL_CLEANUP: 1
run: |
brew install \
pkg-config \
# EOF
- name: Prepare cache key
id: key
run: |
echo "image=$ImageOS-$ImageVersion" >> $GITHUB_OUTPUT
- name: Enable vcpkg cache
uses: actions/cache@v3
- name: Setup vcpkg caching
uses: actions/github-script@v7
with:
path: /usr/local/share/vcpkg/installed
key: ${{ steps.key.outputs.image }}-vcpkg-${{ matrix.arch }}-0 # Increase the number whenever dependencies are modified
restore-keys: |
${{ steps.key.outputs.image }}-vcpkg-${{ matrix.arch }}
- name: Prepare vcpkg
run: |
vcpkg install --triplet=${{ matrix.arch }}-osx \
liblzma \
libpng \
lzo \
zlib \
# EOF
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
core.exportVariable('VCPKG_BINARY_SOURCES', 'clear;x-gha,readwrite')
- name: Install OpenGFX
run: |
mkdir -p ~/Documents/OpenTTD/baseset
cd ~/Documents//OpenTTD/baseset
cd ~/Documents/OpenTTD/baseset
echo "::group::Download OpenGFX"
curl -L https://cdn.openttd.org/opengfx-releases/0.6.0/opengfx-0.6.0-all.zip -o opengfx-all.zip
@@ -223,7 +243,7 @@ jobs:
cd build
echo "::group::CMake"
cmake ${GITHUB_WORKSPACE} \
cmake .. \
-DCMAKE_OSX_ARCHITECTURES=${{ matrix.full_arch }} \
-DVCPKG_TARGET_TRIPLET=${{ matrix.arch }}-osx \
-DCMAKE_TOOLCHAIN_FILE=/usr/local/share/vcpkg/scripts/buildsystems/vcpkg.cmake \
@@ -241,46 +261,27 @@ jobs:
ctest -j $(sysctl -n hw.logicalcpu) --timeout 120
windows:
name: Windows
strategy:
fail-fast: false
matrix:
os: [windows-latest, windows-2019]
arch: [x86, x64]
name: Windows (${{ matrix.os }} / ${{ matrix.arch }})
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Prepare cache key
id: key
shell: powershell
run: |
# Work around caching failure with GNU tar
New-Item -Type Junction -Path vcpkg -Target c:\vcpkg
Write-Output "image=$env:ImageOS-$env:ImageVersion" >> $env:GITHUB_OUTPUT
- name: Enable vcpkg cache
uses: actions/cache@v3
- name: Setup vcpkg caching
uses: actions/github-script@v7
with:
path: vcpkg/installed
key: ${{ steps.key.outputs.image }}-vcpkg-${{ matrix.arch }}-0 # Increase the number whenever dependencies are modified
restore-keys: |
${{ steps.key.outputs.image }}-vcpkg-${{ matrix.arch }}
- name: Prepare vcpkg
shell: bash
run: |
vcpkg install --triplet=${{ matrix.arch }}-windows-static \
liblzma \
libpng \
lzo \
zlib \
# EOF
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
core.exportVariable('VCPKG_BINARY_SOURCES', 'clear;x-gha,readwrite')
- name: Install OpenGFX
shell: bash
@@ -308,6 +309,8 @@ jobs:
- name: Build
shell: bash
env:
NINJA_STATUS: "[%f/%t -- %e] " # [finished_edges/total_edges -- elapsed_time], default value is "[%f/%t] "
run: |
mkdir build
cd build
@@ -327,13 +330,11 @@ jobs:
- name: Test
shell: bash
run: |
cd ${GITHUB_WORKSPACE}/build
cd build
ctest --timeout 120
msys2:
name: msys2
strategy:
fail-fast: false
matrix:
@@ -343,11 +344,13 @@ jobs:
- msystem: MINGW32
arch: i686
name: MinGW (${{ matrix.arch }})
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup MSYS2
uses: msys2/setup-msys2@v2
@@ -361,6 +364,8 @@ jobs:
mingw-w64-${{ matrix.arch }}-gcc
mingw-w64-${{ matrix.arch }}-lzo2
mingw-w64-${{ matrix.arch }}-libpng
mingw-w64-${{ matrix.arch }}-lld
mingw-w64-${{ matrix.arch }}-ninja
- name: Install OpenGFX
shell: bash
@@ -383,24 +388,28 @@ jobs:
- name: Build
shell: msys2 {0}
env:
NINJA_STATUS: "[%f/%t -- %e] " # [finished_edges/total_edges -- elapsed_time], default value is "[%f/%t] "
run: |
mkdir build
cd build
echo "::group::CMake"
cmake .. -G"MSYS Makefiles"
cmake .. \
-GNinja \
-DCMAKE_CXX_FLAGS="-fuse-ld=lld" \
# EOF
echo "::endgroup::"
echo "::group::Build"
echo "Running on $(nproc) cores"
cmake --build . -j $(nproc)
cmake --build .
echo "::endgroup::"
- name: Test
shell: msys2 {0}
run: |
cd build
ctest -j $(nproc) --timeout 120
ctest --timeout 120
check_annotations:
name: Check Annotations
@@ -417,4 +426,4 @@ jobs:
steps:
- name: Check annotations
uses: OpenTTD/actions/annotation-check@v3
uses: OpenTTD/actions/annotation-check@v5

85
.github/workflows/codeql.yml vendored Normal file
View File

@@ -0,0 +1,85 @@
name: CodeQL
on:
push:
branches:
- master
pull_request:
# The branches below must be a subset of the branches above
branches:
- master
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install dependencies
run: |
echo "::group::Update apt"
sudo apt-get update
echo "::endgroup::"
echo "::group::Install dependencies"
sudo apt-get install -y --no-install-recommends \
liballegro4-dev \
libcurl4-openssl-dev \
libfontconfig-dev \
libharfbuzz-dev \
libicu-dev \
liblzma-dev \
liblzo2-dev \
libsdl2-dev \
zlib1g-dev \
# EOF
echo "::endgroup::"
env:
DEBIAN_FRONTEND: noninteractive
- name: Set number of make jobs
run: |
echo "MAKEFLAGS=-j$(nproc)" >> $GITHUB_ENV
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: cpp
config-file: ./.github/codeql/codeql-config.yml
- name: Autobuild
uses: github/codeql-action/autobuild@v3
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: /language:cpp
upload: False
output: sarif-results
- name: Filter out table & generated code
uses: advanced-security/filter-sarif@v1
with:
patterns: |
+**/*.*
-**/table/*.*
-**/generated/**/*.*
-**/tests/*.*
input: sarif-results/cpp.sarif
output: sarif-results/cpp.sarif
- name: Upload results
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: sarif-results/cpp.sarif

View File

@@ -3,6 +3,10 @@ name: Commit checker
on:
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
jobs:
commit-checker:
name: Commit checker
@@ -10,12 +14,12 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 4
- name: Get pull-request commits
uses: OpenTTD/actions/checkout-pull-request@v2
uses: OpenTTD/actions/checkout-pull-request@v5
- name: Check commits
uses: OpenTTD/OpenTTD-git-hooks@main

103
.github/workflows/preview-build.yml vendored Normal file
View File

@@ -0,0 +1,103 @@
name: Preview build
on:
workflow_call:
secrets:
PREVIEW_CLOUDFLARE_API_TOKEN:
description: API token to upload a preview to Cloudflare Pages
required: true
PREVIEW_CLOUDFLARE_ACCOUNT_ID:
description: Account ID to upload a preview to Cloudflare Pages
required: true
jobs:
preview:
name: Build preview
environment:
name: preview
url: https://preview.openttd.org/pr${{ github.event.pull_request.number }}/
runs-on: ubuntu-latest
container:
# If you change this version, change the number in the cache step too.
image: emscripten/emsdk:3.1.42
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Name branch
run: |
git config --global --add safe.directory ${GITHUB_WORKSPACE}
git checkout -b pr${{ github.event.pull_request.number }}
- name: Setup cache
uses: actions/cache@v4
with:
path: /emsdk/upstream/emscripten/cache
key: 3.1.42-${{ runner.os }}
- name: Patch Emscripten to support LZMA
run: |
cd /emsdk/upstream/emscripten
patch -p1 < ${GITHUB_WORKSPACE}/os/emscripten/emsdk-liblzma.patch
- name: Build (host tools)
run: |
mkdir build-host
cd build-host
echo "::group::CMake"
cmake .. -DOPTION_TOOLS_ONLY=ON
echo "::endgroup::"
echo "::group::Build"
echo "Running on $(nproc) cores"
make -j$(nproc) tools
echo "::endgroup::"
- name: Install GCC problem matcher
uses: ammaraskar/gcc-problem-matcher@master
- name: Build
run: |
mkdir build
cd build
echo "::group::CMake"
emcmake cmake .. \
-DHOST_BINARY_DIR=../build-host \
-DCMAKE_BUILD_TYPE=Release \
# EOF
echo "::endgroup::"
echo "::group::Build"
echo "Running on $(nproc) cores"
cmake --build . -j $(nproc) --target openttd
echo "::endgroup::"
- name: Prepare preview
run: |
mkdir public
cp build/openttd.data public/
cp build/openttd.html public/
cp build/openttd.js public/
cp build/openttd.wasm public/
# Ensure we use the latest version of npm; the one we get with current
# emscripten doesn't allow running "npx wrangler" as root.
# Current emscripten can't install npm>=10.0.0 because node is too old.
npm install -g npm@9
- name: Publish preview
uses: cloudflare/pages-action@v1
with:
apiToken: ${{ secrets.PREVIEW_CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.PREVIEW_CLOUDFLARE_ACCOUNT_ID }}
projectName: ${{ vars.PREVIEW_CLOUDFLARE_PROJECT_NAME }}
directory: public
branch: pr${{ github.event.pull_request.number }}

20
.github/workflows/preview.yml vendored Normal file
View File

@@ -0,0 +1,20 @@
name: Preview
on:
pull_request_target:
types:
- labeled
- synchronize
branches:
- master
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
cancel-in-progress: true
jobs:
preview:
if: ${{ (github.event.action == 'labeled' && github.event.label.name == 'preview') || (github.event.action != 'labeled' && contains(github.event.pull_request.labels.*.name, 'preview')) }}
name: Preview
uses: ./.github/workflows/preview-build.yml
secrets: inherit

View File

@@ -1,133 +0,0 @@
name: Preview build
on:
repository_dispatch:
types:
- Preview*
jobs:
preview:
name: Build preview
runs-on: ubuntu-20.04
container:
# If you change this version, change the number in the cache step too.
image: emscripten/emsdk:3.1.28
steps:
- name: Update deployment status to in progress
uses: octokit/request-action@v2.x
with:
route: POST /repos/{owner}/{repo}/deployments/{deployment_id}/statuses
mediaType: |
previews:
- ant-man
- flash
owner: ${{ github.event.repository.owner.login }}
repo: ${{ github.event.repository.name }}
deployment_id: ${{ github.event.client_payload.deployment_id }}
state: in_progress
env:
GITHUB_TOKEN: ${{ secrets.PREVIEW_GITHUB_TOKEN }}
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ github.event.client_payload.sha }}
- name: Name branch
run: |
name=$(echo "${{ github.event.client_payload.folder }}")
git checkout -b ${name}
- name: Setup cache
uses: actions/cache@v3
with:
path: /emsdk/upstream/emscripten/cache
key: 3.1.28-${{ runner.os }}
- name: Patch Emscripten to support LZMA
run: |
cd /emsdk/upstream/emscripten
patch -p1 < ${GITHUB_WORKSPACE}/os/emscripten/emsdk-liblzma.patch
- name: Build (host tools)
run: |
mkdir build-host
cd build-host
echo "::group::CMake"
cmake .. -DOPTION_TOOLS_ONLY=ON
echo "::endgroup::"
echo "::group::Build"
echo "Running on $(nproc) cores"
make -j$(nproc) tools
echo "::endgroup::"
- name: Install GCC problem matcher
uses: ammaraskar/gcc-problem-matcher@master
- name: Build
run: |
mkdir build
cd build
echo "::group::CMake"
emcmake cmake .. \
-DHOST_BINARY_DIR=../build-host \
-DCMAKE_BUILD_TYPE=Release \
# EOF
echo "::endgroup::"
echo "::group::Build"
echo "Running on $(nproc) cores"
emmake make -j$(nproc)
echo "::endgroup::"
- name: Publish preview
run: |
pip3 install awscli
aws s3 cp --only-show-errors build/openttd.data s3://${{ secrets.PREVIEW_S3_BUCKET }}/${{ github.event.client_payload.folder }}/
aws s3 cp --only-show-errors build/openttd.html s3://${{ secrets.PREVIEW_S3_BUCKET }}/${{ github.event.client_payload.folder }}/
aws s3 cp --only-show-errors build/openttd.js s3://${{ secrets.PREVIEW_S3_BUCKET }}/${{ github.event.client_payload.folder }}/
aws s3 cp --only-show-errors build/openttd.wasm s3://${{ secrets.PREVIEW_S3_BUCKET }}/${{ github.event.client_payload.folder }}/
# Invalidate the cache of the CloudFront distribution
aws cloudfront create-invalidation --distribution-id ${{ secrets.PREVIEW_CF_DISTRIBUTION_ID }} --paths "/${{ github.event.client_payload.folder }}/*"
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
- name: Update deployment status to success
uses: octokit/request-action@v2.x
with:
route: POST /repos/{owner}/{repo}/deployments/{deployment_id}/statuses
mediaType: |
previews:
- ant-man
- flash
owner: ${{ github.event.repository.owner.login }}
repo: ${{ github.event.repository.name }}
deployment_id: ${{ github.event.client_payload.deployment_id }}
state: success
environment_url: https://preview.openttd.org/${{ github.event.client_payload.folder }}/
env:
GITHUB_TOKEN: ${{ secrets.PREVIEW_GITHUB_TOKEN }}
- if: failure()
name: Update deployment status to failure
uses: octokit/request-action@v2.x
with:
route: POST /repos/{owner}/{repo}/deployments/{deployment_id}/statuses
mediaType: |
previews:
- ant-man
- flash
owner: ${{ github.event.repository.owner.login }}
repo: ${{ github.event.repository.name }}
deployment_id: ${{ github.event.client_payload.deployment_id }}
state: failure
env:
GITHUB_TOKEN: ${{ secrets.PREVIEW_GITHUB_TOKEN }}

View File

@@ -1,66 +0,0 @@
name: Preview label
on:
pull_request_target:
types:
- labeled
env:
TEAM_CORE_DEVELOPER: core-developers
jobs:
check_preview_label:
name: Check for preview label
if: github.event.action == 'labeled' && github.event.label.name == 'preview'
runs-on: ubuntu-20.04
steps:
- name: Check if label was added by core developer
id: core_developer
continue-on-error: true
uses: octokit/request-action@v2.x
with:
route: GET /orgs/OpenTTD/teams/${{ env.TEAM_CORE_DEVELOPER }}/memberships/${{ github.event.sender.login }}
env:
GITHUB_TOKEN: ${{ secrets.PREVIEW_GITHUB_TOKEN }}
- if: steps.core_developer.outcome == 'failure'
name: Remove preview label if not core developer
uses: octokit/request-action@v2.x
with:
route: DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels/preview
owner: ${{ github.event.repository.owner.login }}
repo: ${{ github.event.repository.name }}
issue_number: ${{ github.event.number }}
env:
GITHUB_TOKEN: ${{ secrets.PREVIEW_GITHUB_TOKEN }}
- if: steps.core_developer.outcome == 'success'
name: Create deployment
id: deployment
uses: octokit/request-action@v2.x
with:
route: POST /repos/{owner}/{repo}/deployments
mediaType: |
previews:
- ant-man
- flash
owner: ${{ github.event.repository.owner.login }}
repo: ${{ github.event.repository.name }}
ref: ${{ github.event.pull_request.head.sha }}
task: deploy:preview
auto_merge: false
required_contexts: "[]"
environment: preview-pr-${{ github.event.number }}
description: "Preview for Pull Request #${{ github.event.number }}"
env:
GITHUB_TOKEN: ${{ secrets.PREVIEW_GITHUB_TOKEN }}
- if: steps.core_developer.outcome == 'success'
name: Trigger 'preview build'
uses: peter-evans/repository-dispatch@v2
with:
token: ${{ secrets.PREVIEW_GITHUB_TOKEN }}
event-type: "Preview build #${{ github.event.number }}"
client-payload: '{"folder": "pr${{ github.event.number }}", "sha": "${{ github.event.pull_request.head.sha }}", "deployment_id": "${{ fromJson(steps.deployment.outputs.data).id }}"}'

View File

@@ -1,66 +0,0 @@
name: Preview push
on:
pull_request_target:
types:
- synchronize
jobs:
check_new_preview:
name: Check preview needs update
runs-on: ubuntu-20.04
steps:
- name: Check if earlier preview exists
id: earlier_preview
uses: octokit/request-action@v2.x
with:
route: GET /repos/{owner}/{repo}/deployments
owner: ${{ github.event.repository.owner.login }}
repo: ${{ github.event.repository.name }}
environment: preview-pr-${{ github.event.number }}
per_page: 1
env:
GITHUB_TOKEN: ${{ secrets.PREVIEW_GITHUB_TOKEN }}
- if: toJson(fromJson(steps.earlier_preview.outputs.data)) != '[]'
name: Check for preview label
id: preview_label
uses: octokit/request-action@v2.x
with:
route: GET /repos/{owner}/{repo}/issues/{issue_number}/labels
owner: ${{ github.event.repository.owner.login }}
repo: ${{ github.event.repository.name }}
issue_number: ${{ github.event.number }}
env:
GITHUB_TOKEN: ${{ secrets.PREVIEW_GITHUB_TOKEN }}
- if: toJson(fromJson(steps.earlier_preview.outputs.data)) != '[]' && contains(fromJson(steps.preview_label.outputs.data).*.name, 'preview')
name: Create deployment
id: deployment
uses: octokit/request-action@v2.x
with:
route: POST /repos/{owner}/{repo}/deployments
mediaType: |
previews:
- ant-man
- flash
owner: ${{ github.event.repository.owner.login }}
repo: ${{ github.event.repository.name }}
ref: ${{ github.event.pull_request.head.sha }}
task: deploy:preview
auto_merge: false
required_contexts: "[]"
environment: preview-pr-${{ github.event.number }}
description: "Preview for Pull Request #${{ github.event.number }}"
env:
GITHUB_TOKEN: ${{ secrets.PREVIEW_GITHUB_TOKEN }}
- if: toJson(fromJson(steps.earlier_preview.outputs.data)) != '[]' && contains(fromJson(steps.preview_label.outputs.data).*.name, 'preview')
name: Trigger 'preview build'
uses: peter-evans/repository-dispatch@v2
with:
token: ${{ secrets.PREVIEW_GITHUB_TOKEN }}
event-type: "Preview build #${{ github.event.number }}"
client-payload: '{"folder": "pr${{ github.event.number }}", "sha": "${{ github.event.pull_request.head.sha }}", "deployment_id": "${{ fromJson(steps.deployment.outputs.data).id }}"}'

View File

@@ -15,7 +15,7 @@ jobs:
steps:
- name: Download source
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: internal-source
@@ -78,7 +78,7 @@ jobs:
echo "::endgroup::"
- name: Store bundles
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: openttd-docs
path: build/bundles/*.tar.xz

View File

@@ -2,20 +2,26 @@ name: Release (Linux)
on:
workflow_call:
inputs:
survey_key:
required: false
type: string
default: ""
jobs:
linux:
name: Linux (Generic)
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
container:
# manylinux2014 is based on CentOS 7, but already has a lot of things
# manylinux_2_28 is based on AlmaLinux 8, and already has a lot of things
# installed and preconfigured. It makes it easier to build OpenTTD.
image: quay.io/pypa/manylinux2014_x86_64
# This distro is based on glibc 2.28, released in 2018.
image: quay.io/pypa/manylinux_2_28_x86_64
steps:
- name: Download source
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: internal-source
@@ -23,40 +29,102 @@ jobs:
run: |
tar -xf source.tar.gz --strip-components=1
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Enable Rust cache
uses: Swatinem/rust-cache@v2
- name: Setup vcpkg caching
uses: actions/github-script@v7
with:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
core.exportVariable('VCPKG_BINARY_SOURCES', 'clear;x-gha,readwrite')
- name: Install dependencies
run: |
echo "::group::Install dependencies"
echo "::group::Install system dependencies"
# perl-IPC-Cmd, wget, and zip are needed to run vcpkg.
# autoconf-archive is needed to build ICU.
yum install -y \
fontconfig-devel \
freetype-devel \
libicu-devel \
libpng-devel \
lzo-devel \
SDL2-devel \
autoconf-archive \
perl-IPC-Cmd \
wget \
xz-devel \
zlib-devel \
zip \
# EOF
# aclocal looks first in /usr/local/share/aclocal, and if that doesn't
# exist only looks in /usr/share/aclocal. We have files in both that
# are important. So copy the latter to the first, and we are good to
# go.
cp /usr/share/aclocal/* /usr/local/share/aclocal/
echo "::endgroup::"
# The yum variant of fluidsynth depends on all possible audio drivers,
# like jack, ALSA, pulseaudio, etc. This is not really useful for us,
# as we route the output of fluidsynth back via our sound driver, and
# as such do not use these audio driver outputs at all. So instead,
# we compile fluidsynth ourselves, with as little dependencies as
# possible. This currently means it picks up SDL2, but this is fine,
# as we need SDL2 anyway.
# as such do not use these audio driver outputs at all.
# The vcpkg variant of fluidsynth depends on ALSA. Similar issue here.
# So instead, we compile fluidsynth ourselves, with as few
# dependencies as possible. We do it before anything else is installed,
# to make sure it doesn't pick up on any of the drivers.
echo "::group::Install fluidsynth"
wget https://github.com/FluidSynth/fluidsynth/archive/v2.1.6.tar.gz
tar xf v2.1.6.tar.gz
wget https://github.com/FluidSynth/fluidsynth/archive/v2.3.3.tar.gz
tar xf v2.3.3.tar.gz
(
cd fluidsynth-2.1.6
cd fluidsynth-2.3.3
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=/usr
cmake --build . -j $(nproc)
cmake --install .
)
echo "::group::Install audio drivers"
# These audio libs are to make sure the SDL version of vcpkg adds
# sound-support; these libraries are not added to the resulting
# binary, but the headers are used to enable them in SDL.
yum install -y \
alsa-lib-devel \
pulseaudio-libs-devel \
# EOF
echo "::endgroup::"
echo "::group::Install video drivers"
# These video libs are to make sure the SDL version of vcpkg adds
# video-support; these libraries are not added to the resulting
# binary, but the headers are used to enable them in SDL.
yum install -y \
libX11-devel \
libXcursor-devel \
libXext-devel \
libXfixes-devel \
libXi-devel \
libxkbcommon-devel \
libXrandr-devel \
libXScrnSaver-devel \
mesa-libEGL-devel \
mesa-libGL-devel \
mesa-libGLES-devel \
wayland-devel \
wayland-protocols-devel \
# EOF
echo "::endgroup::"
# We use vcpkg for our dependencies, to get more up-to-date version.
echo "::group::Install vcpkg and dependencies"
git clone https://github.com/microsoft/vcpkg /vcpkg
(
cd /vcpkg
./bootstrap-vcpkg.sh -disableMetrics
)
echo "::group::Install breakpad dependencies"
cargo install dump_syms
echo "::endgroup::"
- name: Install GCC problem matcher
@@ -69,16 +137,23 @@ jobs:
echo "::group::CMake"
cmake ${GITHUB_WORKSPACE} \
-DCMAKE_TOOLCHAIN_FILE=/vcpkg/scripts/buildsystems/vcpkg.cmake \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DOPTION_SURVEY_KEY=${{ inputs.survey_key }} \
-DOPTION_PACKAGE_DEPENDENCIES=ON \
# EOF
echo "::endgroup::"
echo "::group::Build"
echo "Running on $(nproc) cores"
cmake --build . -j $(nproc)
cmake --build . -j $(nproc) --target openttd
echo "::endgroup::"
- name: Create breakpad symbols
run: |
cd build
dump_syms ./openttd --inlines --store symbols
- name: Create bundles
run: |
cd ${GITHUB_WORKSPACE}/build
@@ -93,8 +168,15 @@ jobs:
echo "::endgroup::"
- name: Store bundles
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: openttd-linux-generic
path: build/bundles
retention-days: 5
- name: Store symbols
uses: actions/upload-artifact@v4
with:
name: symbols-linux-generic
path: build/symbols
retention-days: 5

View File

@@ -2,18 +2,23 @@ name: Release (MacOS)
on:
workflow_call:
inputs:
survey_key:
required: false
type: string
default: ""
jobs:
macos:
name: MacOS
runs-on: macos-11
runs-on: macos-latest
env:
MACOSX_DEPLOYMENT_TARGET: 10.13
steps:
- name: Download source
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: internal-source
@@ -21,42 +26,34 @@ jobs:
run: |
tar -xf source.tar.gz --strip-components=1
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Enable Rust cache
uses: Swatinem/rust-cache@v2
- name: Setup vcpkg caching
uses: actions/github-script@v7
with:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
core.exportVariable('VCPKG_BINARY_SOURCES', 'clear;x-gha,readwrite')
- name: Install dependencies
env:
HOMEBREW_NO_AUTO_UPDATE: 1
HOMEBREW_NO_INSTALL_CLEANUP: 1
run: |
echo "::group::Install brew dependencies"
brew install \
pandoc \
pkg-config \
# EOF
echo "::endgroup::"
- name: Prepare cache key
id: key
run: |
echo "image=$ImageOS-$ImageVersion" >> $GITHUB_OUTPUT
- name: Enable vcpkg cache
uses: actions/cache@v3
with:
path: /usr/local/share/vcpkg/installed
key: ${{ steps.key.outputs.image }}-vcpkg-release-0 # Increase the number whenever dependencies are modified
restore-keys: |
${{ steps.key.outputs.image }}-vcpkg-release
${{ steps.key.outputs.image }}-vcpkg-x64
- name: Prepare vcpkg
run: |
vcpkg install \
liblzma:x64-osx \
liblzma:arm64-osx \
libpng:x64-osx \
libpng:arm64-osx \
lzo:x64-osx \
lzo:arm64-osx \
zlib:x64-osx \
zlib:arm64-osx \
# EOF
echo "::group::Install breakpad dependencies"
cargo install dump_syms
echo "::endgroup::"
- name: Install GCC problem matcher
uses: ammaraskar/gcc-problem-matcher@master
@@ -79,7 +76,7 @@ jobs:
echo "::endgroup::"
- name: Import code signing certificates
uses: Apple-Actions/import-codesign-certs@v1
uses: Apple-Actions/import-codesign-certs@v2
with:
# The certificates in a PKCS12 file encoded as a base64 string
p12-file-base64: ${{ secrets.APPLE_DEVELOPER_CERTIFICATE_P12_BASE64 }}
@@ -100,12 +97,13 @@ jobs:
-DCMAKE_TOOLCHAIN_FILE=/usr/local/share/vcpkg/scripts/buildsystems/vcpkg.cmake \
-DHOST_BINARY_DIR=${GITHUB_WORKSPACE}/build-host \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DOPTION_SURVEY_KEY=${{ inputs.survey_key }} \
# EOF
echo "::endgroup::"
echo "::group::Build"
echo "Running on $(sysctl -n hw.logicalcpu) cores"
cmake --build . -j $(sysctl -n hw.logicalcpu)
cmake --build . -j $(sysctl -n hw.logicalcpu) --target openttd
echo "::endgroup::"
- name: Build x64
@@ -120,6 +118,7 @@ jobs:
-DCMAKE_TOOLCHAIN_FILE=/usr/local/share/vcpkg/scripts/buildsystems/vcpkg.cmake \
-DHOST_BINARY_DIR=${GITHUB_WORKSPACE}/build-host \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DOPTION_SURVEY_KEY=${{ inputs.survey_key }} \
-DCPACK_BUNDLE_APPLE_CERT_APP=${{ secrets.APPLE_DEVELOPER_CERTIFICATE_ID }} \
"-DCPACK_BUNDLE_APPLE_CODESIGN_PARAMETER=--deep -f --options runtime" \
-DAPPLE_UNIVERSAL_PACKAGE=1 \
@@ -128,9 +127,21 @@ jobs:
echo "::group::Build"
echo "Running on $(sysctl -n hw.logicalcpu) cores"
cmake --build . -j $(sysctl -n hw.logicalcpu)
cmake --build . -j $(sysctl -n hw.logicalcpu) --target openttd
echo "::endgroup::"
- name: Create breakpad symbols
run: |
cd build-x64
mkdir dSYM
dsymutil ./openttd -o dSYM/openttd
dump_syms ./dSYM/openttd --inlines --store symbols
cd ../build-arm64
mkdir dSYM
dsymutil ./openttd -o dSYM/openttd
dump_syms ./dSYM/openttd --inlines --store ../build-x64/symbols
- name: Create bundles
run: |
cd build-x64
@@ -151,19 +162,19 @@ jobs:
rm -f bundles/*.sha256
echo "::endgroup::"
- name: Install gon
env:
HOMEBREW_NO_AUTO_UPDATE: 1
HOMEBREW_NO_INSTALL_CLEANUP: 1
run: |
brew tap mitchellh/gon
brew install mitchellh/gon/gon
- name: Notarize
env:
AC_USERNAME: ${{ secrets.APPLE_DEVELOPER_APP_USERNAME }}
AC_PASSWORD: ${{ secrets.APPLE_DEVELOPER_APP_PASSWORD }}
AC_TEAM_ID: ${{ secrets.APPLE_DEVELOPER_TEAM_ID }}
run: |
if [ -z "${AC_USERNAME}" ]; then
# We may be running on a fork that doesn't have notarization secrets set up; skip this step
echo No notarization secrets set up, skipping.
exit 0
fi
xcrun notarytool store-credentials --apple-id "${AC_USERNAME}" --password "${AC_PASSWORD}" --team-id "${AC_TEAM_ID}" openttd
cd build-x64
../os/macosx/notarize.sh
@@ -191,8 +202,15 @@ jobs:
mv _CPack_Packages/*/Bundle/openttd-*.zip bundles/
- name: Store bundles
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: openttd-macos-universal
path: build-x64/bundles
retention-days: 5
- name: Store symbols
uses: actions/upload-artifact@v4
with:
name: symbols-macos-universal
path: build-x64/symbols
retention-days: 5

View File

@@ -11,6 +11,8 @@ on:
value: ${{ jobs.source.outputs.trigger_type }}
folder:
value: ${{ jobs.source.outputs.folder }}
survey_key:
value: ${{ jobs.source.outputs.survey_key }}
jobs:
source:
@@ -23,18 +25,19 @@ jobs:
is_tag: ${{ steps.metadata.outputs.is_tag }}
trigger_type: ${{ steps.metadata.outputs.trigger_type }}
folder: ${{ steps.metadata.outputs.folder }}
survey_key: ${{ steps.survey_key.outputs.survey_key }}
steps:
- name: Checkout (Release)
if: github.event_name == 'release'
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
# We generate a changelog; for this we need the full git log.
fetch-depth: 0
- name: Checkout (Manual)
if: github.event_name == 'workflow_dispatch'
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.ref }}
# We generate a changelog; for this we need the full git log.
@@ -42,7 +45,7 @@ jobs:
- name: Checkout (Trigger)
if: github.event_name == 'repository_dispatch'
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: ${{ github.event.client_payload.ref }}
# We generate a changelog; for this we need the full git log.
@@ -146,6 +149,24 @@ jobs:
FOLDER_NIGHTLIES: openttd-nightlies
FOLDER_BRANCHES: openttd-branches
- name: Generate survey key
id: survey_key
run: |
if [ -z "${{ vars.SURVEY_TYPE }}" ]; then
echo "SURVEY_TYPE variable not found; most likely running in a fork. Skipping step."
SURVEY_KEY=""
else
PAYLOAD='{"version":"${{ steps.metadata.outputs.version }}","type":"${{ vars.SURVEY_TYPE }}"}'
echo "${{ secrets.SURVEY_SIGNING_KEY }}" > survey_signing_key.pem
SIGNATURE=$(echo -n "${PAYLOAD}" | openssl dgst -sha256 -sign survey_signing_key.pem | base64 -w0)
rm -f survey_signing_key.pem
SURVEY_KEY=$(curl -f -s -X POST -d "${PAYLOAD}" -H "Content-Type: application/json" -H "X-Signature: ${SIGNATURE}" https://survey-participate.openttd.org/create-survey-key/${{ vars.SURVEY_TYPE }})
fi
echo "survey_key=${SURVEY_KEY}" >> $GITHUB_OUTPUT
- name: Remove VCS information
run: |
rm -rf .git
@@ -172,14 +193,14 @@ jobs:
echo "::endgroup::"
- name: Store bundles
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: openttd-source
path: build/bundles/*
retention-days: 5
- name: Store source (for other jobs)
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: internal-source
path: source.tar.gz

View File

@@ -15,7 +15,7 @@ jobs:
steps:
- name: Download source
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: internal-source
@@ -25,17 +25,17 @@ jobs:
tar -xf source.tar.gz --strip-components=1
- name: Download x86 build
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: openttd-windows-x86
- name: Download x64 build
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: openttd-windows-x64
- name: Download arm64 build
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: openttd-windows-arm64
@@ -185,7 +185,7 @@ jobs:
move output\OpenTTD.appxbundle bundles\internal\openttd-${{ inputs.version }}-windows-store.appxbundle
- name: Store bundles
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: openttd-windows-store
path: builds/bundles

View File

@@ -3,14 +3,16 @@ name: Release (Windows)
on:
workflow_call:
inputs:
survey_key:
required: false
type: string
default: ""
is_tag:
required: true
type: string
jobs:
windows:
name: Windows
strategy:
fail-fast: false
matrix:
@@ -22,11 +24,13 @@ jobs:
- arch: arm64
host: x64_arm64
name: Windows (${{ matrix.arch }})
runs-on: windows-latest
steps:
- name: Download source
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: internal-source
@@ -35,37 +39,30 @@ jobs:
run: |
tar -xf source.tar.gz --strip-components=1
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Enable Rust cache
uses: Swatinem/rust-cache@v2
- name: Setup vcpkg caching
uses: actions/github-script@v7
with:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
core.exportVariable('VCPKG_BINARY_SOURCES', 'clear;x-gha,readwrite')
- name: Install dependencies
shell: bash
run: |
echo "::group::Install choco dependencies"
choco install pandoc
echo "::endgroup::"
- name: Prepare cache key
id: key
shell: powershell
run: |
# Work around caching failure with GNU tar
New-Item -Type Junction -Path vcpkg -Target c:\vcpkg
Write-Output "image=$env:ImageOS-$env:ImageVersion" >> $env:GITHUB_OUTPUT
- name: Enable vcpkg cache
uses: actions/cache@v3
with:
path: vcpkg/installed
key: ${{ steps.key.outputs.image }}-vcpkg-${{ matrix.arch }}-0 # Increase the number whenever dependencies are modified
restore-keys: |
${{ steps.key.outputs.image }}-vcpkg-${{ matrix.arch }}
- name: Prepare vcpkg
shell: bash
run: |
vcpkg install --triplet=${{ matrix.arch }}-windows-static \
liblzma \
libpng \
lzo \
zlib \
# EOF
echo "::group::Install breakpad dependencies"
cargo install dump_syms
echo "::endgroup::"
- name: Install MSVC problem matcher
uses: ammaraskar/msvc-problem-matcher@master
@@ -128,12 +125,13 @@ jobs:
-DOPTION_USE_NSIS=ON \
-DHOST_BINARY_DIR=${GITHUB_WORKSPACE}/build-host \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DOPTION_SURVEY_KEY=${{ inputs.survey_key }} \
-DWINDOWS_CERTIFICATE_COMMON_NAME="${WINDOWS_CERTIFICATE_COMMON_NAME}" \
# EOF
echo "::endgroup::"
echo "::group::Build"
cmake --build .
cmake --build . --target openttd
echo "::endgroup::"
env:
WINDOWS_CERTIFICATE_COMMON_NAME: ${{ secrets.WINDOWS_CERTIFICATE_COMMON_NAME }}
@@ -152,16 +150,23 @@ jobs:
-DCMAKE_TOOLCHAIN_FILE="c:\vcpkg\scripts\buildsystems\vcpkg.cmake" \
-DHOST_BINARY_DIR=${GITHUB_WORKSPACE}/build-host \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DOPTION_SURVEY_KEY=${{ inputs.survey_key }} \
-DWINDOWS_CERTIFICATE_COMMON_NAME="${WINDOWS_CERTIFICATE_COMMON_NAME}" \
# EOF
echo "::endgroup::"
echo "::group::Build"
cmake --build .
cmake --build . --target openttd
echo "::endgroup::"
env:
WINDOWS_CERTIFICATE_COMMON_NAME: ${{ secrets.WINDOWS_CERTIFICATE_COMMON_NAME }}
- name: Create breakpad symbols
shell: bash
run: |
cd build
dump_syms openttd.pdb --inlines --store symbols
- name: Create bundles
shell: bash
run: |
@@ -170,10 +175,13 @@ jobs:
cpack
echo "::endgroup::"
echo "::group::Prepare PDB to be bundled"
PDB=$(ls bundles/*.zip | cut -d/ -f2 | sed 's/.zip$/.pdb/')
cp openttd.pdb bundles/${PDB}
xz -9 bundles/${PDB}
echo "::group::Move PDB and exe to symbols"
PDB_FOLDER=$(find symbols -mindepth 2 -type d)
cp openttd.pdb ${PDB_FOLDER}/
EXE_FOLDER=symbols/openttd.exe/$(grep "INFO CODE_ID" symbols/*/*/openttd.sym | cut -d\ -f3)
mkdir -p ${EXE_FOLDER}
cp openttd.exe ${EXE_FOLDER}/
echo "::endgroup::"
echo "::group::Cleanup"
@@ -194,8 +202,15 @@ jobs:
WINDOWS_CERTIFICATE_COMMON_NAME: ${{ secrets.WINDOWS_CERTIFICATE_COMMON_NAME }}
- name: Store bundles
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: openttd-windows-${{ matrix.arch }}
path: build/bundles
retention-days: 5
- name: Store symbols
uses: actions/upload-artifact@v4
with:
name: symbols-windows-${{ matrix.arch }}
path: build/symbols
retention-days: 5

View File

@@ -38,6 +38,9 @@ jobs:
uses: ./.github/workflows/release-linux.yml
secrets: inherit
with:
survey_key: ${{ needs.source.outputs.survey_key }}
macos:
name: MacOS
needs: source
@@ -45,6 +48,9 @@ jobs:
uses: ./.github/workflows/release-macos.yml
secrets: inherit
with:
survey_key: ${{ needs.source.outputs.survey_key }}
windows:
name: Windows
needs: source
@@ -54,6 +60,7 @@ jobs:
with:
is_tag: ${{ needs.source.outputs.is_tag }}
survey_key: ${{ needs.source.outputs.survey_key }}
windows-store:
name: Windows Store
@@ -69,8 +76,8 @@ jobs:
with:
version: ${{ needs.source.outputs.version }}
upload-aws:
name: Upload (AWS)
upload:
name: Upload
needs:
- source
- docs
@@ -83,7 +90,26 @@ jobs:
# The always() makes sure the rest is always evaluated.
if: always() && needs.source.result == 'success' && needs.docs.result == 'success' && needs.linux.result == 'success' && needs.macos.result == 'success' && needs.windows.result == 'success' && (needs.windows-store.result == 'success' || needs.windows-store.result == 'skipped')
uses: ./.github/workflows/upload-aws.yml
runs-on: ubuntu-latest
# This job is empty, but ensures no upload job starts before all targets finished and are successful.
steps:
- name: Build completed
run: |
true
upload-cdn:
name: Upload (CDN)
needs:
- source
- upload
# As windows-store is condition, we need to check ourselves if we need to run.
# The always() makes sure the rest is always evaluated.
# Yes, you even need to do this if you yourself don't depend on the condition.
if: always() && needs.source.result == 'success' && needs.upload.result == 'success'
uses: ./.github/workflows/upload-cdn.yml
secrets: inherit
with:
@@ -95,11 +121,13 @@ jobs:
name: Upload (Steam)
needs:
- source
- linux
- macos
- windows
- upload
if: needs.source.outputs.trigger_type == 'new-master' || needs.source.outputs.trigger_type == 'new-tag'
# As windows-store is condition, we need to check ourselves if we need to run.
# The always() makes sure the rest is always evaluated.
# Yes, you even need to do this if you yourself don't depend on the condition.
# Additionally, only nightlies and releases go to Steam; not PRs.
if: always() && needs.source.result == 'success' && needs.upload.result == 'success' && (needs.source.outputs.trigger_type == 'new-master' || needs.source.outputs.trigger_type == 'new-tag')
uses: ./.github/workflows/upload-steam.yml
secrets: inherit
@@ -112,11 +140,13 @@ jobs:
name: Upload (GOG)
needs:
- source
- linux
- macos
- windows
- upload
if: needs.source.outputs.trigger_type == 'new-tag'
# As windows-store is condition, we need to check ourselves if we need to run.
# The always() makes sure the rest is always evaluated.
# Yes, you even need to do this if you yourself don't depend on the condition.
# Additionally, only releases go to GOG; not nightlies or PRs.
if: always() && needs.source.result == 'success' && needs.upload.result == 'success' && needs.source.outputs.trigger_type == 'new-tag'
uses: ./.github/workflows/upload-gog.yml
secrets: inherit

View File

@@ -0,0 +1,22 @@
name: Script missing mode enforcement
on:
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
jobs:
script-missing-mode-enforcement:
name: Script missing mode enforcement
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Check for finding script functions that require company/deity mode enforcement/checks
run: |
set -ex
python3 .github/script-missing-mode-enforcement.py

View File

@@ -3,6 +3,10 @@ name: Unused strings
on:
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
jobs:
unused-strings:
name: Unused strings
@@ -10,7 +14,7 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Check for unused strings
run: |

View File

@@ -1,76 +0,0 @@
name: Upload (AWS)
on:
workflow_call:
inputs:
version:
required: true
type: string
folder:
required: true
type: string
trigger_type:
required: true
type: string
jobs:
upload:
name: Upload (AWS)
runs-on: ubuntu-20.04
steps:
- name: Download all bundles
uses: actions/download-artifact@v3
- name: Calculate checksums
run: |
echo "::group::Move bundles to a single folder"
mkdir bundles
mv openttd-*/* bundles/
echo "::endgroup::"
cd bundles
for i in $(ls openttd-*); do
echo "::group::Calculating checksums for ${i}"
openssl dgst -r -md5 -hex $i > $i.md5sum
openssl dgst -r -sha1 -hex $i > $i.sha1sum
openssl dgst -r -sha256 -hex $i > $i.sha256sum
echo "::endgroup::"
done
# Some targets generate files that are meant for our-eyes-only.
# They are stored in the "internal" folder, and contains bundles
# for targets like Windows Store. No user has a benefit of knowing
# they exist, hence: internal.
if [ -e internal ]; then
cd internal
for i in $(ls openttd-*); do
echo "::group::Calculating checksums for ${i}"
openssl dgst -r -md5 -hex $i > $i.md5sum
openssl dgst -r -sha1 -hex $i > $i.sha1sum
openssl dgst -r -sha256 -hex $i > $i.sha256sum
echo "::endgroup::"
done
fi
- name: Upload bundles to AWS
run: |
aws s3 cp --recursive --only-show-errors bundles/ s3://${{ secrets.CDN_S3_BUCKET }}/${{ inputs.folder }}/${{ inputs.version }}/
# We do not invalidate the CloudFront distribution here. The trigger
# for "New OpenTTD release" first updated the manifest files and
# creates an index.html. We invalidate after that, so everything
# becomes visible at once.
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: ${{ secrets.AWS_REGION }}
- name: Trigger 'New OpenTTD release'
uses: peter-evans/repository-dispatch@v2
with:
token: ${{ secrets.DEPLOYMENT_TOKEN }}
repository: OpenTTD/workflows
event-type: ${{ inputs.trigger_type }}
client-payload: '{"version": "${{ inputs.version }}", "folder": "${{ inputs.folder }}"}'

138
.github/workflows/upload-cdn.yml vendored Normal file
View File

@@ -0,0 +1,138 @@
name: Upload (CDN)
on:
workflow_call:
inputs:
version:
required: true
type: string
folder:
required: true
type: string
trigger_type:
required: true
type: string
jobs:
prepare:
name: Prepare
runs-on: ubuntu-latest
steps:
- name: Download all bundles
uses: actions/download-artifact@v4
- name: Calculate checksums
run: |
echo "::group::Move bundles to a single folder"
mkdir bundles
mv openttd-*/* bundles/
echo "::endgroup::"
cd bundles
for i in $(ls openttd-*); do
echo "::group::Calculating checksums for ${i}"
openssl dgst -r -md5 -hex $i > $i.md5sum
openssl dgst -r -sha1 -hex $i > $i.sha1sum
openssl dgst -r -sha256 -hex $i > $i.sha256sum
echo "::endgroup::"
done
# Some targets generate files that are meant for our-eyes-only.
# They are stored in the "internal" folder, and contains bundles
# for targets like Windows Store. No user has a benefit of knowing
# they exist, hence: internal.
if [ -e internal ]; then
cd internal
for i in $(ls openttd-*); do
echo "::group::Calculating checksums for ${i}"
openssl dgst -r -md5 -hex $i > $i.md5sum
openssl dgst -r -sha1 -hex $i > $i.sha1sum
openssl dgst -r -sha256 -hex $i > $i.sha256sum
echo "::endgroup::"
done
fi
- name: Merge symbols
run: |
mkdir symbols
cp -R symbols-*/* symbols/
# Compress all files as gzip, to reduce cost of storage on the CDN.
for i in $(find symbols -mindepth 2 -type f); do
gzip ${i}
done
# Leave a mark in each folder what version actually created the symbol file.
for i in $(find symbols -mindepth 2 -type d); do
touch ${i}/.${{ inputs.version }}.txt
done
- name: Store bundles
uses: actions/upload-artifact@v4
with:
name: cdn-bundles
path: bundles/*
retention-days: 5
- name: Store breakpad symbols
uses: actions/upload-artifact@v4
with:
name: cdn-symbols
path: symbols/*
retention-days: 5
publish-bundles:
needs:
- prepare
name: Publish bundles
uses: OpenTTD/actions/.github/workflows/rw-cdn-upload.yml@v5
secrets:
CDN_SIGNING_KEY: ${{ secrets.CDN_SIGNING_KEY }}
DEPLOYMENT_APP_ID: ${{ secrets.DEPLOYMENT_APP_ID }}
DEPLOYMENT_APP_PRIVATE_KEY: ${{ secrets.DEPLOYMENT_APP_PRIVATE_KEY }}
with:
artifact-name: cdn-bundles
folder: ${{ inputs.folder }}
version: ${{ inputs.version }}
publish-symbols:
needs:
- prepare
name: Publish symbols
uses: OpenTTD/actions/.github/workflows/rw-symbols-upload.yml@v5
secrets:
SYMBOLS_SIGNING_KEY: ${{ secrets.SYMBOLS_SIGNING_KEY }}
with:
artifact-name: cdn-symbols
repository: OpenTTD
docs:
if: ${{ inputs.trigger_type == 'new-master' }}
needs:
- publish-bundles
name: Publish docs
runs-on: ubuntu-latest
steps:
- name: Generate access token
id: generate_token
uses: tibdex/github-app-token@v2
with:
app_id: ${{ secrets.DEPLOYMENT_APP_ID }}
private_key: ${{ secrets.DEPLOYMENT_APP_PRIVATE_KEY }}
repositories: >-
["OpenTTD/workflows"]
- name: Trigger 'Publish Docs'
uses: peter-evans/repository-dispatch@v3
with:
token: ${{ steps.generate_token.outputs.token }}
repository: OpenTTD/workflows
event-type: publish-docs
client-payload: '{"version": "${{ inputs.version }}", "folder": "${{ inputs.folder }}"}'

View File

@@ -14,8 +14,35 @@ jobs:
runs-on: ubuntu-20.04
steps:
- name: Download all bundles
uses: actions/download-artifact@v3
- name: Download source
uses: actions/download-artifact@v4
with:
name: internal-source
path: internal-source
- name: Download bundle (Windows x86)
uses: actions/download-artifact@v4
with:
name: openttd-windows-x86
path: openttd-windows-x86
- name: Download bundle (Windows x64)
uses: actions/download-artifact@v4
with:
name: openttd-windows-x64
path: openttd-windows-x64
- name: Download bundle (MacOS)
uses: actions/download-artifact@v4
with:
name: openttd-macos-universal
path: openttd-macos-universal
- name: Download bundle (Linux)
uses: actions/download-artifact@v4
with:
name: openttd-linux-generic
path: openttd-linux-generic
- name: Install GOG Galaxy Build Creator
run: |

View File

@@ -17,8 +17,35 @@ jobs:
runs-on: ubuntu-20.04
steps:
- name: Download all bundles
uses: actions/download-artifact@v3
- name: Download source
uses: actions/download-artifact@v4
with:
name: internal-source
path: internal-source
- name: Download bundle (Windows x86)
uses: actions/download-artifact@v4
with:
name: openttd-windows-x86
path: openttd-windows-x86
- name: Download bundle (Windows x64)
uses: actions/download-artifact@v4
with:
name: openttd-windows-x64
path: openttd-windows-x64
- name: Download bundle (MacOS)
uses: actions/download-artifact@v4
with:
name: openttd-macos-universal
path: openttd-macos-universal
- name: Download bundle (Linux)
uses: actions/download-artifact@v4
with:
name: openttd-linux-generic
path: openttd-linux-generic
- name: Setup steamcmd
uses: CyberAndrii/setup-steamcmd@v1

1
.gitignore vendored
View File

@@ -5,3 +5,4 @@ docs/aidocs/*
docs/gamedocs/*
docs/source/*
/out
/vcpkg_installed

View File

@@ -1,11 +1,12 @@
cmake_minimum_required(VERSION 3.9)
cmake_minimum_required(VERSION 3.16)
if(NOT BINARY_NAME)
set(BINARY_NAME openttd)
endif()
project(${BINARY_NAME}
VERSION 13.2
VERSION 14.0
LANGUAGES CXX
)
if(CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR)
@@ -22,7 +23,7 @@ if (EMSCRIPTEN)
endif()
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake")
set(CMAKE_OSX_DEPLOYMENT_TARGET 10.13)
set(CMAKE_OSX_DEPLOYMENT_TARGET 10.15)
# Use GNUInstallDirs to allow customisation
# but set our own default data and bin dir
@@ -41,7 +42,7 @@ set_directory_options()
include(Static)
set_static_if_needed()
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED YES)
set(CMAKE_CXX_EXTENSIONS NO)
@@ -124,6 +125,19 @@ find_package(LibLZMA)
find_package(LZO)
find_package(PNG)
if(WIN32 OR EMSCRIPTEN)
# Windows uses WinHttp for HTTP requests.
# Emscripten uses Javascript for HTTP requests.
else()
# All other targets use libcurl.
find_package(CURL)
endif()
# Breakpad doesn't support emscripten.
if(NOT EMSCRIPTEN)
find_package(unofficial-breakpad)
endif()
if(NOT OPTION_DEDICATED)
if(NOT WIN32)
find_package(Allegro)
@@ -134,12 +148,17 @@ if(NOT OPTION_DEDICATED)
find_package(SDL)
endif()
find_package(Fluidsynth)
find_package(Fontconfig)
find_package(ICU OPTIONAL_COMPONENTS i18n lx)
if(Freetype_FOUND)
find_package(Fontconfig)
endif()
find_package(Harfbuzz)
find_package(ICU OPTIONAL_COMPONENTS i18n)
endif()
endif()
endif()
if(APPLE)
enable_language(OBJCXX)
find_package(Iconv)
find_library(AUDIOTOOLBOX_LIBRARY AudioToolbox)
@@ -170,6 +189,12 @@ if(UNIX AND NOT APPLE AND NOT OPTION_DEDICATED)
if(NOT SDL_FOUND AND NOT SDL2_FOUND AND NOT ALLEGRO_FOUND)
message(FATAL_ERROR "SDL, SDL2 or Allegro is required for this platform")
endif()
if(HARFBUZZ_FOUND AND NOT ICU_i18n_FOUND)
message(WARNING "HarfBuzz depends on ICU i18n to function; HarfBuzz will be disabled")
endif()
if(NOT HARFBUZZ_FOUND)
message(WARNING "Without HarfBuzz and ICU i18n the game will not be able to render right-to-left languages correctly")
endif()
endif()
if(APPLE)
if(NOT AUDIOTOOLBOX_LIBRARY)
@@ -207,6 +232,7 @@ if(OPTION_PACKAGE_DEPENDENCIES)
set(CMAKE_BUILD_WITH_INSTALL_RPATH ON)
endif()
include(CTest)
include(SourceList)
# Needed by rev.cpp
@@ -216,15 +242,31 @@ include_directories(${CMAKE_SOURCE_DIR}/src/3rdparty/squirrel/include)
include(MSVCFilters)
add_executable(openttd WIN32 ${GENERATED_SOURCE_FILES})
add_library(openttd_lib OBJECT ${GENERATED_SOURCE_FILES})
add_executable(openttd WIN32)
add_executable(openttd_test)
set_target_properties(openttd PROPERTIES OUTPUT_NAME "${BINARY_NAME}")
# All other files are added via target_sources()
if(MSVC)
# Add DPI manifest to project; other WIN32 targets get this via ottdres.rc
target_sources(openttd PRIVATE "${CMAKE_SOURCE_DIR}/os/windows/openttd.manifest")
# If target -static is used, switch our project to static (/MT) too.
# If the target ends on -static-md, it will remain dynamic (/MD).
if(VCPKG_TARGET_TRIPLET MATCHES "-static" AND NOT VCPKG_TARGET_TRIPLET MATCHES "-md")
set_property(TARGET openttd_lib PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
set_property(TARGET openttd PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
set_property(TARGET openttd_test PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
endif()
endif()
target_precompile_headers(openttd_lib
PRIVATE
src/stdafx.h
src/core/format.hpp
)
add_subdirectory(${CMAKE_SOURCE_DIR}/bin)
add_subdirectory(${CMAKE_SOURCE_DIR}/src)
add_subdirectory(${CMAKE_SOURCE_DIR}/media)
@@ -232,17 +274,25 @@ add_subdirectory(${CMAKE_SOURCE_DIR}/media)
add_dependencies(openttd
find_version)
target_link_libraries(openttd
target_link_libraries(openttd_lib
openttd::languages
openttd::settings
openttd::media
openttd::basesets
openttd::script_api
Threads::Threads
)
target_link_libraries(openttd
openttd_lib
openttd::media
openttd::basesets
)
target_link_libraries(openttd_test PRIVATE openttd_lib)
include(Catch)
catch_discover_tests(openttd_test)
if(HAIKU)
target_link_libraries(openttd "be" "network" "midi")
target_link_libraries(openttd_lib "be" "network" "midi")
endif()
if(IPO_FOUND)
@@ -259,6 +309,15 @@ link_package(ZLIB TARGET ZLIB::ZLIB ENCOURAGED)
link_package(LIBLZMA TARGET LibLZMA::LibLZMA ENCOURAGED)
link_package(LZO)
if(NOT WIN32 AND NOT EMSCRIPTEN)
link_package(CURL ENCOURAGED)
target_link_libraries(openttd_lib ${CMAKE_DL_LIBS})
endif()
if(NOT EMSCRIPTEN)
link_package(unofficial-breakpad TARGET unofficial::breakpad::libbreakpad_client ENCOURAGED)
endif()
if(NOT OPTION_DEDICATED)
link_package(Fluidsynth)
link_package(SDL)
@@ -266,7 +325,7 @@ if(NOT OPTION_DEDICATED)
link_package(Allegro)
link_package(FREETYPE TARGET Freetype::Freetype)
link_package(Fontconfig TARGET Fontconfig::Fontconfig)
link_package(ICU_lx)
link_package(Harfbuzz TARGET harfbuzz::harfbuzz)
link_package(ICU_i18n)
if(SDL2_FOUND AND OPENGL_FOUND AND UNIX)
@@ -285,7 +344,7 @@ include(CheckAtomic)
if(APPLE)
link_package(Iconv TARGET Iconv::Iconv)
target_link_libraries(openttd
target_link_libraries(openttd_lib
${AUDIOTOOLBOX_LIBRARY}
${AUDIOUNIT_LIBRARY}
${COCOA_LIBRARY}
@@ -304,6 +363,7 @@ if(EMSCRIPTEN)
target_link_libraries(WASM::WASM INTERFACE "-s ALLOW_MEMORY_GROWTH=1")
target_link_libraries(WASM::WASM INTERFACE "-s INITIAL_MEMORY=33554432")
target_link_libraries(WASM::WASM INTERFACE "-s DISABLE_EXCEPTION_CATCHING=0")
target_link_libraries(WASM::WASM INTERFACE "-s WASM_BIGINT")
add_definitions(-s DISABLE_EXCEPTION_CATCHING=0)
# Export functions to Javascript.
@@ -319,6 +379,23 @@ if(EMSCRIPTEN)
target_link_libraries(WASM::WASM INTERFACE "--preload-file ${CMAKE_BINARY_DIR}/lang/english.lng@/lang/english.lng")
target_link_libraries(WASM::WASM INTERFACE "--preload-file ${CMAKE_SOURCE_DIR}/bin/ai@/ai")
target_link_libraries(WASM::WASM INTERFACE "--preload-file ${CMAKE_SOURCE_DIR}/bin/game@/game")
# Documentation files for the in-game text file viewer
target_link_libraries(WASM::WASM INTERFACE "--preload-file ${CMAKE_SOURCE_DIR}/README.md@/README.md")
target_link_libraries(WASM::WASM INTERFACE "--preload-file ${CMAKE_SOURCE_DIR}/CREDITS.md@/CREDITS.md")
target_link_libraries(WASM::WASM INTERFACE "--preload-file ${CMAKE_SOURCE_DIR}/CONTRIBUTING.md@/CONTRIBUTING.md")
target_link_libraries(WASM::WASM INTERFACE "--preload-file ${CMAKE_SOURCE_DIR}/COPYING.md@/COPYING.md")
target_link_libraries(WASM::WASM INTERFACE "--preload-file ${CMAKE_SOURCE_DIR}/known-bugs.txt@/known-bugs.txt")
target_link_libraries(WASM::WASM INTERFACE "--preload-file ${CMAKE_SOURCE_DIR}/changelog.txt@/changelog.txt")
target_link_libraries(WASM::WASM INTERFACE "--preload-file ${CMAKE_SOURCE_DIR}/docs/admin_network.md@/docs/admin_network.md")
target_link_libraries(WASM::WASM INTERFACE "--preload-file ${CMAKE_SOURCE_DIR}/docs/debugging_desyncs.md@/docs/debugging_desyncs.md")
target_link_libraries(WASM::WASM INTERFACE "--preload-file ${CMAKE_SOURCE_DIR}/docs/desync.md@/docs/desync.md")
target_link_libraries(WASM::WASM INTERFACE "--preload-file ${CMAKE_SOURCE_DIR}/docs/directory_structure.md@/docs/directory_structure.md")
target_link_libraries(WASM::WASM INTERFACE "--preload-file ${CMAKE_SOURCE_DIR}/docs/eints.md@/docs/eints.md")
target_link_libraries(WASM::WASM INTERFACE "--preload-file ${CMAKE_SOURCE_DIR}/docs/linkgraph.md@/docs/linkgraph.md")
target_link_libraries(WASM::WASM INTERFACE "--preload-file ${CMAKE_SOURCE_DIR}/docs/logging_and_performance_metrics.md@/docs/logging_and_performance_metrics.md")
target_link_libraries(WASM::WASM INTERFACE "--preload-file ${CMAKE_SOURCE_DIR}/docs/multiplayer.md@/docs/multiplayer.md")
target_link_libraries(WASM::WASM INTERFACE "--preload-file ${CMAKE_SOURCE_DIR}/docs/savegame_format.md@/docs/savegame_format.md")
target_link_libraries(WASM::WASM INTERFACE "--preload-file ${CMAKE_SOURCE_DIR}/docs/symbol_server.md@/docs/symbol_server.md")
# We use IDBFS for persistent storage.
target_link_libraries(WASM::WASM INTERFACE "-lidbfs.js")
@@ -364,12 +441,14 @@ if(WIN32)
-DPSAPI_VERSION=1
)
target_link_libraries(openttd
target_link_libraries(openttd_lib
ws2_32
winmm
imm32
usp10
psapi
winhttp
bcrypt
)
endif()
@@ -377,8 +456,9 @@ if(CMAKE_SIZEOF_VOID_P EQUAL 8)
add_definitions(-DPOINTER_IS_64BIT)
endif()
include(CreateRegression)
create_regression()
enable_testing()
add_subdirectory(regression)
if(APPLE OR WIN32)
find_package(Pandoc)

488
CODINGSTYLE.md Normal file
View File

@@ -0,0 +1,488 @@
**Why a set coding style is important** <br>
This project is an open source project. To get open source working as intended, many people should be able to comprehend the code. This implies that there is a well documented and uniform flow of code.
That does not necessarily mean that a contributor should not write optimised yet cryptic code - one should always care about performance. However, other developers need to understand the code which means complicated parts of code **must** have good documentation.
**Why we require that EVERYTHING is documented**<br>
What is simple to some might appear very complicated to others. Documentation helps these others. Anyone should be able to improve the code. But the main reason is, that when patch contributors want their patches added to the common codebase, the code needs to be reviewed by one or more developers. Documentation makes reviewing much easier.
## Coding style for OpenTTD
### Functions
* Function names use [CamelCase](http://www.wikipedia.org/wiki/Camelcase) without underscores.
* Opening curly bracket **{** for a function starts on the next line.
* Use Foo() instead of Foo(void).
```c++
void ThisIsAFunction()
{
}
```
### Variables
* Variable names are all lowercase, and use "_" as separator.
* Global variables are preceded by an underscore. ("_") Use descriptive names because leading underscores are often used for system / compiler variables.
* Own members of classes should always be referenced using "this->"
* Pointers and references should have their reference symbol next to the name (compatibility with current code).
* Variables that are declared below one another should have their type, name or reference operator, and assignment operator aligned by spaces.
* There are set names for many variables. Those are (but not limited to): Vehicle *u, *v, *w; Station *st; Town *t; Window *w; Engine *e.
* For multiple instances, use numbers "*t1, *t2" or postfixes "*st_from, *st_to".
* Declare variables upon first usage.
* Declare iterators in their loop.
* There is a space between '*' and 'const' in "const pointers"
```c++
int number = 10;
Vehicle *u_first_wagon = v->next;
int value = v->value;
uint32 _global_variable = 3750;
static const char * const _global_array[] = {
"first string",
"second string",
"another string",
"last string followed by comma",
};
protected:
char protected_array[10];
for (int i = 0;;);
```
* Give the variables expedient names, this increases the readability of the code
```c++
bool is_maglev_train = true;
if (!is_maglev_train) DoSomething();
```
* Some people like to introduce copies of variables to increase readability, which can waste memory. However, in some cases, especially in code pieces which are often called, it makes sense to cache some calculated variables.
```c++
/* Unoptimized code:
* foo is not touched inside the loop!
*/
for (uint8 i = 0; i < 100000; i++) {
/* Do something */
if (value_to_check == (foo * 4) % 5 + 6) DoSomething();
/* Do something else */
}
/* Better:
* The used value of foo is calculated outside the loop.
*/
const uint32 bar = (foo * 4) % 5 + 6;
for (uint8 i = 0; i < 100000; i++) {
/* Do something */
if (value_to_check == bar) DoSomething();
/* Do something else */
}
```
### Enumerations / static consts
* Enumerations store integers that belong logically together (railtypes, string IDs, etc.).
* Enumeration names also use CamelCase.
* Unscoped enumerators are all caps with "_" between the words.
* Scoped enumerators are use CamelCase.
* Enums are not used to store single numbers.
* Enums have consecutive numbers OR
* Enums have consecutive powers of two. Powers of two (bits) are written in hex or with the shift operator.
* Enums may have special enumerators: "_BEGIN", "\_END", and "INVALID\_"). See example.
* The invalid always has 0xFF, 0xFFFF, 0xFFFFFFFF as a value.
* Other special values are consecutively less than the invalid.
* Variables that hold enumerators should have the type of the enumeration.
```c++
enum DiagDirection {
DIAGDIR_BEGIN = 0,
DIAGDIR_NE = 0,
DIAGDIR_SE = 1,
DIAGDIR_SW = 2,
DIAGDIR_NW = 3,
DIAGDIR_END,
INVALID_DIAGDIR = 0xFF,
BROKEN_DIAGDIR = 0xFE,
};
enum {
DEPOT_SERVICE = (1 << 0),
DEPOT_MASS_SEND = (1 << 1),
DEPOT_DONT_CANCEL = (1 << 2),
DEPOT_LOCATE_HANGAR = (1 << 3),
};
DiagDirection enterdir = DIAGDIR_NE;
```
* Numbers that store single or uncorrelated data are static consts. Those may use the naming conventions of enums.
Example:
```c++
static const int MAXIMUM_STATIONS = 42;
```
* Enums are useful in GUI code: When widgets are enumerated, they are easier to access during many operations. Additionally changes caused by modified widget sequences require less code adapting. If a widget is used like this, its enum name should be present in a comment behind the corresponding widget definition.
```c++
/** Enum referring to the widgets of the build rail depot window */
enum BuildRailDepotWidgets {
BRDW_CLOSEBOX = 0,
BRDW_CAPTION,
BRDW_BACKGROUND,
BRDW_DEPOT_NE,
BRDW_DEPOT_SE,
BRDW_DEPOT_SW,
BRDW_DEPOT_NW,
};
/* ... */
/** Widget definition of the build rail depot window */
static const Widget _build_depot_widgets[] = {
{ WWT_CLOSEBOX, RESIZE_NONE, 7, 0, 10, 0, 13, STR_00C5, STR_..}, // BRDW_CLOSEBOX
{ WWT_CAPTION, RESIZE_NONE, 7, 11, 139, 0, 13, STR_..., STR_...}, // BRDW_CAPTION
{ WWT_PANEL, RESIZE_NONE, 7, 0, 139, 14, 121, 0x0, STR_NULL}, // BRDW_BACKGROUND
{ WWT_PANEL, RESIZE_NONE, 14, 71, 136, 17, 66, 0x0, STR_..}, // BRDW_DEPOT_NE
{ WWT_PANEL, RESIZE_NONE, 14, 71, 136, 69, 118, 0x0, STR_..}, // BRDW_DEPOT_SE
{ WWT_PANEL, RESIZE_NONE, 14, 3, 68, 69, 118, 0x0, STR_..}, // BRDW_DEPOT_SW
{ WWT_PANEL, RESIZE_NONE, 14, 3, 68, 17, 66, 0x0, STR_..}, // BRDW_DEPOT_NW
{ WIDGETS_END},
};
```
* Comments on the enum values should start with "///<" to enable doxygen documentation
```c++
enum SomeEnumeration {
SE_BEGIN = 0, ///< Begin of the enumeration, used for iterations
SE_FOO = 0, ///< Used for xy
SE_BAR, ///< Another value of the enumeration
SE_SUB, ///< Special case for z
SE_END, ///< End of the enumeration, used for iterations
};
```
### Control flow
* Put a space before the parentheses in **if**, **switch**, **for** and **while** statements.
* Use curly braces and put the contained statements on their own lines (e.g., don't put them directly after the **if**).
* Opening curly bracket **{** stays on the first line, closing curly bracket **}** gets a line to itself (except for the **}** preceding an **else**, which should be on the same line as the **else**).
* When only a single statement is contained, the brackets can be omitted. In this case, put the single statement on the same line as the preceding keyword (**if**, **while**, etc.). Note that this is only allowed for if statements without an **else** clause.
* All fall throughs must be documented, using a **FALLTHROUGH** define/macro.
* The NOT_REACHED() macro can be used in default constructs that should never be reached.
* Unconditional loops are written with **`for (;;) {`**
```c++
if (a == b) {
Foo();
} else {
Bar();
}
if (very_large_checks &&
spread_over_two_lines) {
Foo();
}
if (a == b) Foo();
switch (a) {
case 0: DoSomethingShort(); break;
case 1:
DoSomething();
FALLTHROUGH;
case 2:
DoMore();
b = a;
break;
case 3: {
int r = 2;
DoEvenMore(a);
FALLTHROUGH;
}
case 4: {
int q = 345;
DoIt();
break;
}
default:
NOT_REACHED();
}
for (int i = 0; i < 10; i++) {
Foo();
Bar();
}
```
### Classes
* Classes names also use CamelCase.
* Classes should have "public", "protected", and "private" sections.
* Within these section the order is: types, static const members, static members, members, constructors / destructors, static methods, methods.
* Deviations from above order are allowed when the code dictates it (e.g. a static const is needed for a typedef)
* Methods and members ought to be grouped logically.
* All those sorting rules sometimes conflict which one another. Please use common sense what increases legibility of the code in such a case.
* The method implementation should indicate if it is virtual or similar by using a comment.
* Very short methods can have one-line definition (if defined in the class scope).
```c++
class ThisIsAClass {
public:
typedef Titem_ *ItemPtr;
private:
static const int MAX_SIZE = 500;
int size;
ItemPtr *items;
public:
explicit ThisIsAClass();
~ThisIsAClass();
int GetSize() { return this->size; }
virtual void Method();
};
/*virtual*/ void Class::Method()
{
this->size *= 2;
}
```
### Templates
Templates are a very powerful C++ tool, but they can easily confuse beginners. Thus:
* Templates are to be documented in a very clear and verbose manner. Never assume anything in the documentation.
* the template keyword and the template layout get a separate line. typenames are either "T" or preceded by a "T", integers get a single capital letter or a descriptive name preceded by "T".
```c++
template <typename T, typename Tsomething, int N, byte Tnumber_of_something>
int Func();
```
* If you are writing one or more template class in the dedicated header file, use file.hpp for its name instead of file.h. This will let others know that it is template library (includes also implementation), not just header with declarations.
### Other important rules
* Put a space before and after binary operators: "a + b", "a == b", "a & b", "a <<= b", etc.. Exceptions are ".", "->" and "[]" (no spaces) and "," (just space after it).
* Put parenthesis where it improves readability: "*(b++)" instead of "*b++", and "if ((a & b) && c == 2)" instead of "if (a & b && c == 2)".
* Do not put external declarations in implementation (i.e. cpp) files.
* Use const where possible.
* Do not typedef enums and structs.
* Don't treat non-flags as flags: use "if (char_pointer != nullptr && *char_pointer != '\0')", not "if (char_pointer && *char_pointer)".
* Use "free(p)" instead of "if (p != nullptr) free(p)". "free(nullptr)" doesn't hurt anyone.
* No trailing whitespace. The Github workflows will not allow tabs or space on the end of lines.
* Only use tabs to indent from the start of the line.
* Line length is unlimited. In practice it may be useful to split a long line. When splitting, add two tabs in front of the second part.
* The '#' of preprocessor instructions goes into the first column of a line. Indenting is done after the '#' (using tabs again).
* Use /* */ for single line comments.
* Use // at the end of a command line to indicate comments.
** However, use /* */ after # preprocessor statements as // causes warnings in some compilers and/or might have unwanted side effects.
* C++ is defined using the ASCII character set. Do not use other character sets, not even in comments.
* OpenTTD includes some Objective-C sources (*.mm, used by OSX), which has a special object method invocation syntax: "[ obj doStuff:foo ]". Please use spaces on the inside of the brackets to differentiate from the C array syntax.
## Documentation
We use [Doxygen](http://doxygen.org/) to automatically generate documentation from the source code. It scans the source files for *recognizable* comments.
* **Make your comments recognizable.**
Doxygen only comments starting with the following style:
```c++
/**
///<
```
Use /** for multi-line comment blocks. Use ///< for single line comments for variables. Use //!< for single-line comments in the NoAI .hpp files.
For comments blocks inside a function always use /* */ or //. Use // only if the comment is on the same line as an instruction, otherwise use /* */.
### Files
* Put a @file command in a JavaDoc style comment at the start of the file, followed by a description.
```c++
/**
* @file
* This is the brief description.
* This is the detailed description here and on the following lines.
*/
```
> ### Warning
> If a file lacks a **file comment block** then NO entities in that file will be documented by Doxygen!
### Functions
* The documentation should be as close to the actual code as possible to maximise the chance of staying in sync.
* Comments for functions go in the .cpp file.
* Comments for inlines go in the .h/.hpp file.
* Small inlines can have a short 3 or 4 line JavaDoc style comment.
* Completely document larger functions.
* Document obvious parameters and return values too!
```c++
/**
* A brief explanation of what the function does and/or what purpose it serves.
* Then follows a more detailed explanation of the function that can span multiple lines.
*
* @param foo Explanation of the foo parameter
* @param bar Explanation of the bar parameter
* @return The sum of foo and bar (@return can be omitted if the return type is void)
*
* @see SomeOtherFunc()
* @see SOME_ENUM
*
* @bug Some bug description
* @bug Another bug description which continues in the next line
* and ends with the following blank line
*
* @todo Some to-do entry
*/
static int FooBar(int foo, int bar)
{
return foo + bar;
}
```
### Classes
* Document structs similarly to functions:
```c++
/**
* A short description of the struct.
* More detailed description of the its usage.
*
* @see [link to anything of interest]
*/
struct foo {
}
```
### JavaDoc structural commands
This table shows the commands you should use with OpenTTD. The full list is [here](http://www.stack.nl/~dimitri/doxygen/commands.html).
| Command | Action | Example |
| ------- | -------- | ------- |
| **@attention** | Starts a paragraph where a message that needs attention may be entered. The paragraph will be indented. | @attention Whales crossing! |
| **@brief** | Starts a paragraph that serves as a brief description. For classes and files the brief description will be used in lists and at the start of the documentation page. For class and file members, the brief description will be placed at the declaration of the member and prepended to the detailed description. A brief description may span several lines (although it is advised to keep it brief!). | @brief This is the brief description. |
| **@bug** | Starts a paragraph where one or more bugs may be reported. The paragraph will be indented. Multiple adjacent @bug commands will be joined into a single paragraph. Each bug description will start on a new line. Alternatively, one @bug command may mention several bugs. | @bug Memory leak in here? |
| **@note** | Starts a paragraph where a note can be entered. The paragraph will be indented. | @note Might be slow |
| **@todo** | Starts a paragraph where a TODO item is described. The description will also add an item to a separate TODO list. The two instances of the description will be cross-referenced. Each item in the TODO list will be preceded by a header that indicates the origin of the item. | @todo Better error checking |
| **@warning** | Starts a paragraph where one or more warning messages may be entered. The paragraph will be indented. | @warning Not thread safe! |
| | <small>**Function related commands**</small> | |
| **@return** | Starts a return value description for a function. | @return a character pointer |
| **@param** | Starts a parameter description for a function parameter with name <parameter-name>. Followed by a description of the parameter. The existence of the parameter is checked and a warning is given if the documentation of this (or any other) parameter is missing or not present in the function declaration or definition.<br><br>The @param command has an optional attribute specifying the direction of the attribute. Possible values are "in" and "out". | @param n The number of bytes to copy<br>@param[out] dest The memory area to copy to.<br>@param[in] src The memory area to copy from. |
| **@see** | Starts a paragraph where one or more cross-references to classes, functions, methods, variables, files or URL may be specified. Two names joined by either :: or # are understood as referring to a class and one of its members. One of several overloaded methods or constructors may be selected by including a parenthesized list of argument types after the method name. [Here](http://www.stack.nl/~dimitri/doxygen/autolink.html) you can find detailed information about this feature. | @see OtherFunc() |
| **@b** | Displays the following word using a bold font. Equivalent to &lt;b&gt;word&lt;/b&gt;. To put multiple words in bold use &lt;b&gt;multiple words&lt;/b&gt;.| ...@b this and @b that... |
| **@c / @p** | Displays the parameter <word> using a typewriter font. You can use this command to refer to member function parameters in the running text. To have multiple words in typewriter font use &lt;tt&gt;multiple words&lt;/tt&gt;. | ... the @p x and @p y coordinates are used to... |
| **@arg / @li** | This command has one argument that continues until the first blank line or until another @arg / @li is encountered. The command can be used to generate a simple, not nested list of arguments. Each argument should start with an @arg / @li command. | @arg @c AlignLeft left alignment.<br>@arg @c AlignCenter center alignment.<br>@arg @c AlignRight right alignment |
| **@n** | Forces a new line. Equivalent to and inspired by the printf function. |@n |
### More on Doxygen and JavaDoc
Doxygen knows two different kinds of comments:
* *Brief descriptions*: one-liners that describe the function roughly ([example](http://docs.openttd.org/annotated.html))
* *Detailed descriptions*: as the name suggests, these contain the detailed function/purpose of the entity they describe ([example](http://docs.openttd.org/structBridge.html))
You can omit either one or put them into different places but there's only one brief and one detailed description allowed for the same entity.
Doxygen knows three modes for documenting an entity:
* Before the entity
* After the entity
* In a different file
The latter is a little harder to maintain since the prototype of the entity it describes then is stored in several places (e.g. the .h file and the file with the descriptions). Also while it makes the code easier to read it also makes it easier to omit the important step of updating the description of an entity if it was changed - and we all know why that shouldn't happen ;)<br>
Because of those reasons, we will only use the first two documentation schemes.
Doxygen supports both Qt and JavaDoc comment styles:
* Qt style example: **int i; //!< The counter for the main loop**
* JavaDoc style example: **int i; /*\*< The counter for the main loop \*/**
It also supports more comment styles but those two are the ones which are standardized. For OTTD we'll be using the JavaDoc style. One of the reasons is that it has a feature that the Qt style doesn't offer: JavaDoc style comment blocks will automatically start a brief description which ends at the first dot followed by a space or new line. Everything after that will also be part of the detailed description.
The general structure of a JavaDoc style comment is
```c++
/**
* This is the brief description. And this sentence contains some further explanations that will appear in the detailed description only.
*/
```
and the resulting descriptions of that block would be:
* *Brief description*: This is the brief description.
* *Detailed description*: This is the brief description. And this sentence contains some further explanations that will appear in the detailed description only.
The distinction between the brief and detailed descriptions is made by the dot followed by a space/newline, so if you want to use that inside the brief description you need to escape the space/newline:
```c++
/**
* This is a brief description (e.g.\ using only a few words). Details go here.
*/
```
If you're doing a one-line comment, use:
```c++
int i; ///< This is the description.
```
Also in the comment block you can include so-called structural commands which tell Doxygen what follows. In general, their area of effect begins after the command word and ends when a blank line or some other command is encountered. Also, multiple occurrences of the same structural command within a comment block or the referring entity will be joined in the documentation output usually.
## Commit message
To achieve a coherent whole and to make changelog writing easier, here are some guidelines for commit messages.
There is a check-script on the git server (also available for clients, see below) to make sure we all follow those rules.
The first line of a message must match:
```
<keyword>( #<issue>| <commit>(, (<keyword> #<issue>|<commit>))*)?: ([<section])? <Details>
```
Keywords are:
* Add, Feature: Adding new stuff. Difference between "Feature" and "Add" is somewhat subjective. "Feature" for user-point-of-view stuff, "Add" for other.
* Change: Changing behaviour from user-point-of-view.
* Remove: Removing something from user-point-of-view.
* Codechange, Cleanup: Changes without intentional change of behaviour from user-point-of-view. Difference between "Codechange" and "Cleanup" is somewhat subjective.
* Fix, Revert: Fixing stuff.
* Doc, Update: Documentation changes, version increments, translator commits.
* Prepare: Preparation for bigger changes. Rarely used.
If you commit a fix for an [issue](https://github.com/OpenTTD/OpenTTD/issues), add the corresponding issue number in the form of #NNNN. Do it as well if you implement a feature with a matching entry.
In the case of bugfixes, if you know what revision the bug was introduced (eg regression), please mention that revision as well just after the prefix. Finding the trouble-causing revision is highly encouraged as it makes backporting/branching/releases that much easier.
To further structure the changelog, you can add sections. Example are:
* "Network" for network specific changes
* "NewGRF" for NewGRF additions
* "YAPP", "NPF", for changes in these features
* "OSX", "Debian", "win32", for OS-specific packaging changes
Further explanations, general bitching, etc. don't go into the first line. Use a new line for those.
Complete examples:
* Fix: [YAPF] Infinite loop in pathfinder.
* Fix #5926: [YAPF] Infinite loop in pathfinder.
* Fix 80dffae130: Warning about unsigned unary minus.
* Fix #6673, 99bb3a95b4: Store the map variety setting in the samegame.
* Revert d9065fbfbe, Fix #5922: ClientSizeChanged is only called via WndProcGdi which already has the mutex.
* Fix #1264, Fix #2037, Fix #2038, Fix #2110: Rewrite the autoreplace kernel.
## Other tips
### Remove trailing whitespace
To find out if/where you have trailing whitespace, you can use the following (unix/bash) command:
```
grep -n -R --include "*.[ch]" '[ ]$' * | grep --invert-match ".diff" | grep --invert-match ".patch"
```
Automatically removing whitespace is also possible with the following shell script (Note that it only checks .c, .cpp, .h, .hpp and .mm files):
```
#!/bin/sh
IFS='
'
for i in Makefile `find . -name \*.c -o -name \*.cpp -o -name \*.h -o -name \*.hpp -o -name \*.mm`
do
(
echo '%s/[ ]\{1,\}$/'
echo w
echo q
) | ed $i 2> /dev/null > /dev/null
done
```
### Install the client-side git commit hooks
The client-side hooks perform various checks when you commit changes locally.
* Whitespace and indentation checks.
* **Coding style** checks.
Get the hooks:
```
git clone https://github.com/OpenTTD/OpenTTD-git-hooks.git openttd_hooks
```
Install the hooks, assuming "openttd" is your work tree folder:
```
cd openttd/.git/hooks
ln -s -t . ../../../openttd_hooks/hooks/*
```

View File

@@ -4,20 +4,25 @@
OpenTTD makes use of the following external libraries:
- (encouraged) breakpad: creates minidumps on crash
- (encouraged) zlib: (de)compressing of old (0.3.0-1.0.5) savegames, content downloads,
heightmaps
- (encouraged) liblzma: (de)compressing of savegames (1.1.0 and later)
- (encouraged) libpng: making screenshots and loading heightmaps
- (optional) liblzo2: (de)compressing of old (pre 0.3.0) savegames
For Linux, the following additional libraries are used (for non-dedicated only):
For Linux, the following additional libraries are used:
- (encouraged) libcurl: content downloads
- libSDL2: hardware access (video, sound, mouse)
- libfreetype: loading generic fonts and rendering them
- libfontconfig: searching for fonts, resolving font names to actual fonts
- harfbuzz: handling of right-to-left scripts (e.g. Arabic and Persian) (required libicu)
- libicu: handling of right-to-left scripts (e.g. Arabic and Persian) and
natural sorting of strings
If you are building a dedicated-server only, you don't need the last four.
OpenTTD does not require any of the libraries to be present, but without
liblzma you cannot open most recent savegames and without zlib you cannot
open most older savegames or use the content downloading system.
@@ -33,7 +38,7 @@ OpenTTD needs the Platform SDK, if it isn't installed already. This can be
done during installing Visual Studio, by selecting
`Visual C++ MFC for x86 and x64` (and possibly
`Visual C++ ATL for x86 and x64` depending on your version). If not, you
can get download it as [MS Windows Platform SDK](https://developer.microsoft.com/en-US/windows/downloads/windows-10-sdk).
can get download it as [MS Windows Platform SDK](https://developer.microsoft.com/en-us/windows/downloads/windows-sdk).
Install the SDK by following the instructions as given.
@@ -45,6 +50,7 @@ by following the `Quick Start` instructions of their
After this, you can install the dependencies OpenTTD needs. We advise to use
the `static` versions, and OpenTTD currently needs the following dependencies:
- breakpad
- liblzma
- libpng
- lzo
@@ -53,8 +59,8 @@ the `static` versions, and OpenTTD currently needs the following dependencies:
To install both the x64 (64bit) and x86 (32bit) variants (though only one is necessary), you can use:
```ps
.\vcpkg install liblzma:x64-windows-static libpng:x64-windows-static lzo:x64-windows-static zlib:x64-windows-static
.\vcpkg install liblzma:x86-windows-static libpng:x86-windows-static lzo:x86-windows-static zlib:x86-windows-static
.\vcpkg install --triplet=x64-windows-static
.\vcpkg install --triplet=x86-windows-static
```
You can open the folder (as a CMake project). CMake will be detected, and you can compile from there.
@@ -97,7 +103,7 @@ Via CMake, several options can be influenced to get different types of
builds.
- `-DCMAKE_BUILD_TYPE=RelWithDebInfo`: build a release build. This is
significant faster than a debug build, but has far less useful information
significantly faster than a debug build, but has far less useful information
in case of a crash.
- `-DOPTION_DEDICATED=ON`: build OpenTTD without a GUI. Useful if you are
running a headless server, as it requires less libraries to operate.

View File

@@ -14,7 +14,7 @@ In return, they should reciprocate that respect in addressing your issue or asse
The [issue tracker](https://github.com/OpenTTD/OpenTTD/issues) is the preferred channel for [bug reports](#bug-reports), but please respect the following restrictions:
* Please **do not** use the issue tracker for help playing or using OpenTTD.
Please try [irc](https://wiki.openttd.org/en/Development/IRC%20channel), or the [forums](https://www.tt-forums.net/)
Please try [irc](https://wiki.openttd.org/en/Development/IRC%20channel), [Discord](https://discord.gg/openttd), or the [forums](https://www.tt-forums.net/)
* Please **do not** derail or troll issues. Keep the discussion on topic and respect the opinions of others.
@@ -23,7 +23,7 @@ Use [GitHub's "reactions" feature](https://github.com/blog/2119-add-reactions-to
We reserve the right to delete comments which violate this rule.
* Please **do not** open issues or pull requests regarding add-on content in NewGRF, GameScripts, AIs, etc.
These are created by third-parties. Please try [irc](https://wiki.openttd.org/en/Development/IRC%20channel) or the [forums](https://www.tt-forums.net/) to discuss these.
These are created by third-parties. Please try [irc](https://wiki.openttd.org/en/Development/IRC%20channel), [Discord](https://discord.gg/openttd), or the [forums](https://www.tt-forums.net/) to discuss these.
* Please use [the web translator](https://translator.openttd.org/) to submit corrections and improvements to translations of the game.
@@ -108,11 +108,11 @@ Pull requests should fit with the [goals of the project](./CONTRIBUTING.md#proje
Every pull request should have a clear scope, with no unrelated commits.
[Code style](https://wiki.openttd.org/en/Development/Coding%20style) must be complied with for pull requests to be accepted; this also includes [commit message format](https://wiki.openttd.org/en/Development/Coding%20style#commit-message).
[Code style](./CODINGSTYLE.md) must be complied with for pull requests to be accepted; this also includes [commit message format](./CODINGSTYLE.md#commit-message).
Adhering to the following process is the best way to get your work included in the project:
1. [Fork](https://help.github.com/fork-a-repo/) the project, clone your fork, and configure the remotes:
1. [Fork](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/fork-a-repo) the project, clone your fork, and configure the remotes:
```bash
git clone https://github.com/<your-username>/OpenTTD.git openttd
@@ -136,7 +136,7 @@ contain your feature, change, or fix:
git checkout upstream/master -b <topic-branch-name>
```
4. Commit your changes in logical chunks. Please adhere to these [git commit message guidelines](https://wiki.openttd.org/en/Development/Coding%20style#commit-message) or your code is unlikely to be merged into the main project.
4. Commit your changes in logical chunks. Please adhere to these [git commit message guidelines](./CODINGSTYLE.md#commit-message) or your code is unlikely to be merged into the main project.
Use Git's [interactive rebase](https://docs.github.com/en/get-started/using-git/about-git-rebase) feature to tidy up your commits before making them public.
5. Locally rebase the upstream development branch into your topic branch:
@@ -172,7 +172,7 @@ The results of the CI tests will show on your pull request.
By clicking on Details you can further zoom in; in case of a failure it will show you why it failed.
In case of success it will report how awesome you were.
Tip: [commit message format](https://wiki.openttd.org/en/Development/Coding%20style#commit-message) is a common reason for pull requests to fail validation.
Tip: [commit message format](./CODINGSTYLE.md#commit-message) is a common reason for pull requests to fail validation.
### Are there any development docs?
@@ -182,6 +182,16 @@ There is no single source for OpenTTD development docs. It's a complex project w
A good entry point is [Development](https://wiki.openttd.org/en/Development/) on the OpenTTD wiki; this provides links to wiki documentation and other sources.
The GitHub repo also includes some non-comprehensive documentation in [/docs](./docs).
These include:
- When to [change other languages and when not to](./docs/eints.md).
- The [savegame format](./docs/savegame_format.md).
- The [release process](./docs/releasing_openttd.md).
- Some [notes on the link graph algorithm](./docs/linkgraph.md).
- The [network game coordinator](./docs/game_coordinator.md).
- How to use [the admin port for network games](./docs/admin_network.md), also useful for multiplayer server hosts.
- The [performance metrics and logging features](./docs/logging_and_performance_metrics.md), also useful for add-on developers.
- How [symbol server and analysis works](./docs/symbol_server.md).
- And several miscellaneous files detailing internal data structures and graphics measurements and palettes.
You may also want the guide to [compiling OpenTTD](./COMPILING.md).
@@ -256,7 +266,7 @@ This is inevitable, because it is a main feature of git.
If you are concerned about your privacy, we strongly recommend to use "Anonymous &lt;anonymous@openttd.org&gt;" as the git commit author. We might refuse anonymous contributions if malicious intent is suspected.
Please note that the contributor identity, once given, is used for copyright verification and to provide proof should a malicious commit be made.
As such, the [EU GDPR](https://www.eugdpr.org/key-changes.html) "right to be forgotten" does not apply, as this is an overriding legitimate interest.
As such, the [EU GDPR](https://gdpr.eu) "right to be forgotten" does not apply, as this is an overriding legitimate interest.
Please also note that your commit is public and as such will potentially be processed by many third-parties.
Git's distributed nature makes it impossible to track where exactly your commit, and thus your personal data, will be stored and be processed.

View File

@@ -1,5 +1,5 @@
This is the license which applies to OpenTTD with the exception of some
3rd party modules. See [./README.md](./README.md) for details
3rd party modules. See [our readme](./README.md) for details
GNU General Public License
==========================

View File

@@ -56,6 +56,7 @@
- George - Canal/Lock graphics
- Andrew Parkhouse (andythenorth) - River graphics
- David Dallaston (Pikka) - Tram tracks
- Richard Wheeler (zephyris) - OpenTTD TrueType font
- All Translators - For their support to make OpenTTD a truly international game
- Bug Reporters - Thanks for all bug reports
- Chris Sawyer - For an amazing game!

View File

@@ -292,8 +292,8 @@ PREDEFINED = WITH_ZLIB \
WITH_PNG \
WITH_FONTCONFIG \
WITH_FREETYPE \
WITH_HARFBUZZ \
WITH_ICU_I18N \
WITH_ICU_LX \
UNICODE \
_UNICODE \
_GNU_SOURCE \

View File

@@ -11,9 +11,10 @@
- 1.6) [OpenTTD directories](#16-openttd-directories)
- 1.7) [Compiling OpenTTD](#17-compiling-openttd)
- 2.0) [Contact and community](#20-contact-and-community)
- 2.1) [Contributing to OpenTTD](#21-contributing-to-openttd)
- 2.2) [Reporting bugs](#22-reporting-bugs)
- 2.3) [Translating](#23-translating)
- 2.1) [Multiplayer games](#21-multiplayer-games)
- 2.2) [Contributing to OpenTTD](#22-contributing-to-openttd)
- 2.3) [Reporting bugs](#23-reporting-bugs)
- 2.4) [Translating](#24-translating)
- 3.0) [Licensing](#30-licensing)
- 4.0) [Credits](#40-credits)
@@ -77,9 +78,9 @@ For some platforms, you will need to refer to [the installation guide](https://w
The free data files, split into OpenGFX for graphics, OpenSFX for sounds and
OpenMSX for music can be found at:
- https://www.openttd.org/downloads/opengfx-releases/latest for OpenGFX
- https://www.openttd.org/downloads/opensfx-releases/latest for OpenSFX
- https://www.openttd.org/downloads/openmsx-releases/latest for OpenMSX
- [OpenGFX](https://www.openttd.org/downloads/opengfx-releases/latest)
- [OpenSFX](https://www.openttd.org/downloads/opensfx-releases/latest)
- [OpenMSX](https://www.openttd.org/downloads/openmsx-releases/latest)
Please follow the readme of these packages about the installation procedure.
The Windows installer can optionally download and install these packages.
@@ -117,6 +118,15 @@ Most types of add-on content can be downloaded within OpenTTD via the 'Check Onl
Add-on content can also be installed manually, but that's more complicated; the [OpenTTD wiki](https://wiki.openttd.org/) may offer help with that, or the [OpenTTD directory structure guide](./docs/directory_structure.md).
### 1.5.1) Social Integration
OpenTTD has the ability to load plugins to integrate with Social Platforms like Steam, Discord, etc.
To enable such integration, the plugin for the specific platform has to be downloaded and stored in the `social_integration` folder.
See [OpenTTD's website](https://www.openttd.org), under Downloads, for what plugins are available.
### 1.6) OpenTTD directories
OpenTTD uses its own directory structure to store game data, add-on content etc.
@@ -144,12 +154,19 @@ If you want to compile OpenTTD from source, instructions can be found in [COMPIL
- the OpenTTD wiki has a [page listing OpenTTD communities](https://wiki.openttd.org/en/Community/Community) including some in languages other than English
### 2.1) Contributing to OpenTTD
### 2.1) Multiplayer games
You can play OpenTTD with others, either cooperatively or competitively.
See the [multiplayer documentation](./docs/multiplayer.md) for more details.
### 2.2) Contributing to OpenTTD
We welcome contributors to OpenTTD. More information for contributors can be found in [CONTRIBUTING.md](./CONTRIBUTING.md)
### 2.2) Reporting bugs
### 2.3) Reporting bugs
Good bug reports are very helpful. We have a [guide to reporting bugs](./CONTRIBUTING.md#bug-reports) to help with this.
@@ -157,7 +174,7 @@ Desyncs in multiplayer are complex to debug and report (some software developmen
Instructions can be found in [debugging and reporting desyncs](./docs/debugging_desyncs.md).
### 2.3) Translating
### 2.4) Translating
OpenTTD is translated into many languages. Translations are added and updated via the [online translation tool](https://translator.openttd.org).
@@ -174,12 +191,26 @@ See `src/3rdparty/squirrel/COPYRIGHT` for the complete license text.
The md5 implementation in `src/3rdparty/md5` is licensed under the Zlib license.
See the comments in the source files in `src/3rdparty/md5` for the complete license text.
The implementations of Posix `getaddrinfo` and `getnameinfo` for OS/2 in `src/3rdparty/os2` are distributed partly under the GNU Lesser General Public License 2.1, and partly under the (3-clause) BSD license.
The exact licensing terms can be found in `src/3rdparty/os2/getaddrinfo.c` resp. `src/3rdparty/os2/getnameinfo.c`.
The fmt implementation in `src/3rdparty/fmt` is licensed under the MIT license.
See `src/3rdparty/fmt/LICENSE.rst` for the complete license text.
The nlohmann json implementation in `src/3rdparty/nlohmann` is licensed under the MIT license.
See `src/3rdparty/nlohmann/LICENSE.MIT` for the complete license text.
The OpenGL API in `src/3rdparty/opengl` is licensed under the MIT license.
See `src/3rdparty/opengl/khrplatform.h` for the complete license text.
The catch2 implementation in `src/3rdparty/catch2` is licensed under the Boost Software License, Version 1.0.
See `src/3rdparty/catch2/LICENSE.txt` for the complete license text.
The icu scriptrun implementation in `src/3rdparty/icu` is licensed under the Unicode license.
See `src/3rdparty/icu/LICENSE` for the complete license text.
The monocypher implementation in `src/3rdparty/monocypher` is licensed under the 2-clause BSD and CC-0 license.
See `src/3rdparty/monocypher/LICENSE.md` for the complete license text.
The OpenTTD Social Integration API in `src/3rdparty/openttd_social_integration_api` is licensed under the MIT license.
See `src/3rdparty/openttd_social_integration_api/LICENSE` for the complete license text.
## 4.0 Credits

View File

@@ -14,6 +14,7 @@ set(AI_COMPAT_SOURCE_FILES
${CMAKE_CURRENT_SOURCE_DIR}/compat_1.11.nut
${CMAKE_CURRENT_SOURCE_DIR}/compat_12.nut
${CMAKE_CURRENT_SOURCE_DIR}/compat_13.nut
${CMAKE_CURRENT_SOURCE_DIR}/compat_14.nut
)
foreach(AI_COMPAT_SOURCE_FILE IN LISTS AI_COMPAT_SOURCE_FILES)

View File

@@ -4,3 +4,5 @@
* OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
*/
AILog.Info("13 API compatibility in effect.");

6
bin/ai/compat_14.nut Normal file
View File

@@ -0,0 +1,6 @@
/*
* This file is part of OpenTTD.
* OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
* OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
*/

View File

@@ -11,6 +11,7 @@ set(GS_COMPAT_SOURCE_FILES
${CMAKE_CURRENT_SOURCE_DIR}/compat_1.11.nut
${CMAKE_CURRENT_SOURCE_DIR}/compat_12.nut
${CMAKE_CURRENT_SOURCE_DIR}/compat_13.nut
${CMAKE_CURRENT_SOURCE_DIR}/compat_14.nut
)
foreach(GS_COMPAT_SOURCE_FILE IN LISTS GS_COMPAT_SOURCE_FILES)

View File

@@ -4,3 +4,5 @@
* OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
*/
GSLog.Info("13 API compatibility in effect.");

6
bin/game/compat_14.nut Normal file
View File

@@ -0,0 +1,6 @@
/*
* This file is part of OpenTTD.
* OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
* OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
*/

View File

@@ -1,150 +1,3 @@
13.2.1 (2023-06-11)
------------------------------------------------------------------------
Fix: [Win32] use full monitor resolution for fullscreen (#10985)
13.2 (2023-06-10)
------------------------------------------------------------------------
Change: [Win32] position window in center of workspace of primary display (#10942)
Change: Automatically disable hardware acceleration when GPU driver crashed the game last attempt (#10928)
Change: [Linux] Default scroll mode to non-mouse-lock (#10920)
Change: Include font style in font name for Freetype (#10879)
Fix: Don't restore backed up vehicle name if it's no longer unique (#10979)
Fix #10975: Train name wrongly marked as unique when joining trains (#10976)
Fix: Crash when not even a single row fits for dropdowns on low resolution screens (#10934)
Fix: Crash with tooltip on low resolution screens (#10933)
Fix: Crash when window can't be placed on low resolution screens (#10932)
Fix #10502: Apply engine refit before attaching free wagons (#10926)
Fix: Wayland crash on startup due to Pango also using FontConfig (#10916)
Fix: When syncing width of GUI items, take padding into account (#10915)
Fix: Make dropdowns self-close when losing focus (#10912)
Fix: Land info window maximum width was not scaled (#10894)
Fix: Check max member count in squirrel classes (#10883)
Fix: Ask FontConfig for the face index when opening fonts (#10878)
Fix #10831: Level crossing parts left barred after crossing tile removal (#10874)
Fix: Rail waypoint selection window not closed when parent windows closed (#10873)
Fix #10846: [Script] Crash on trying to allocate an excessively large array (#10848)
Fix: [Win32] Text line breaking did not properly handle punctuation characters (#10775)
Fix: [Emscripten] Crash when saving games (#10758)
Fix: [Win32] Wrong multi-line text layout due to incorrect whitespace handling (#10752)
Fix #10741: Rail platforms left partially reserved after train crash (#10751)
Fix: Shaded engines in purchase list incorrectly shaded (#10736)
Fix #10735: [NewGRF] {POP_COLOUR} fails if string is drawn with extra flags (#10736)
Fix #8177: Ships with max speed overflow to near-zero speed (#10695)
Fix #10289: Don't silently fail when setting timetable start dates (#10690)
Fix #8302: Improve "Maintenance intervals are in percents" helptext (#10686)
Fix #10665: "No vehicles are available yet" message did not appear correctly on non-temperate climates (#10673)
Fix #10630: Don't allow shifting service date earlier than year 0 (#10643)
Fix #10637, #10638: Incorrect water infrastructure totals when building certain object types (#10639, #10640)
Fix: Abort loading savegame if road vehicle is on invalid road type (#10622)
13.1 (2023-04-10)
------------------------------------------------------------------------
Add: [NewGRF] Engine name callback for nested variants. (#10399)
Fix: Improve main toolbar tooltips (#10616)
Fix: [NewGRF] Additional validation for Action3 (+others) (#10601)
Fix: Clear button for editbox didn't take account of padding (#10583)
Fix: [Script] Access to enum/consts defined outside of main.nut (#10573)
Fix #10568: Bogus warning when loading a save with a NewGRFs on dedicated servers (#10572)
Fix #10554: Crash when scrolling in the autoreplace window with collapsed variants (#10555)
Fix: Network server highlight invisible with RTL languages. (#10551)
Fix: Client name was not being used as company manager name (#10535)
Fix: Prevent road vehicles on crossing from crashing into the side of a train (#10496)
Fix #10477: [macOS] Calculation for window sizes when using custom fonts was being rounded incorrectly (#10489)
Fix #10486: Crash in debug window when GS started before AIs (#10487)
Fix #10469: [Script] Negative numbers in League Table window were sorted incorrectly (#10471)
Fix #10465: Crash on timeout if user never enters a password for server (#10466)
Fix #10280, #10461: Crash on opening town windows as a spectator (#10462)
Fix #10059: Script config values stored in the config file could cause crashes (#10444)
13.0 (2023-02-05)
------------------------------------------------------------------------
Change #10077: Make maximum loan a positive multiple of the loan interval (#10355)
Fix #10361: [Script] Don't try to give saved data to a dead script (#10433)
Fix #10419: Water infrastructure accounting when building ship depots and docks (#10432)
13.0-RC2 (2023-01-28)
------------------------------------------------------------------------
Feature: Press Ctrl to build a diagonal area of trees (#10342)
Feature: Set a custom number of industries in map generation window (#10340)
Change: Display font status as aa/noaa instead of true/false (#10352)
Fix: [Script] Improved API documentation for scripts (#10413, #10412)
Fix #10255: Reduce basic thickness of linkgraph GUI lines (#10410)
Fix #10220: Don't select unselectable engine as default (#10404)
Fix #10395: When loading old saves, don't forcibly bar level crossings (#10400)
Fix #10377: Bad sorting of rail vehicles when primary variant is missing (#10378)
Fix #10368: Server restarting game caused clients to hit assertion (#10369)
Fix #10362: NewGRF bridges without speed limits (#10365)
Fix #10363: CargoDist setting helptext shouldn't suggest symmetric distribution for diamonds in subtropic (#10364)
Fix: [Script] Switch to OWNER_TOWN prevented OWNER_DEITY test during industry prospecting (#10360)
Fix #10009: Bad overflow protection when taking out loans (#10359)
Fix #9865: Removing files with the console always failed (#10357)
Fix #10057: FallbackParagraphLayout fails to properly wrap (#10356)
Fix #10177: Company list password padlock showed after switching to single player (#10354)
Fix: Various Wide River issues (#10348)
Fix: Link variants to parents when finalising engines (#10346)
Fix #10333: Only show industry prospecting errors to local company (#10338)
Fix #10335: Set initial scrollbar count for object GUI (#10336)
Fix #10331: Starting new company during load must happen after AI start (#10332)
Fix #10309: [SDL] Uninitialized width and height when turning off full screen (#10328)
Fix #10032: Capacities of articulated vehicles in build window (#10326)
Fix: Improve handling of corrupt NewGRF or image files (#10321, #10316)
Fix: [NewGRF] Don't assume engclass 2 should be elrail (#10315)
Fix: [Script] AIGroup.GetProfitLastYear could get values different than those displayed in GUI (#10227)
Fix #10304: [Scripts] Don't start GS in intro game (#10305)
Fix: [Script] Copy compat files for version 13 (#10303)
13.0-RC1 (2023-01-01)
------------------------------------------------------------------------
Feature: 'font' console command to configure fonts within game (#10278)
Feature: Ctrl-click to bulk edit timetable speeds/waiting times (#10265)
Feature: [NewGRF] Vehicle variants in expandable purchase list (#10220)
Feature: Expand all towns in the scenario editor (#10215)
Add: [NewGRF] Slope-aware and roadtype-specific one-way sprites (#10282)
Change: Display text files in black (#10291)
Change: Make vehicle list dropdown buttons resize to fit strings (#10286)
Change: [NewGRF] Support flipping shorter engines without explicit support (#10262)
Change: Separate ground sprite from foundation sprite offsets (#10256)
Change: Vertically centre sprite font relative to TrueType font (#10254)
Change: [macOS] Set minimum macOS version to 10.13 (#10253)
Change: Use lowered not disabled widget for current vehicle details tab (#10252)
Change: Various improvements to NewGRF sprite aligner (#10249)
Change: reset_engines console command now rerandomises introduction dates and reliability (#10220)
Change: Show error message on failed industry prospecting (#10202)
Fix: Local authority window rating list height ignored icon sizes (#10285)
Fix #10150: Town signs could be truncated when using custom fonts (#10283)
Fix #8971: Resize QueryStrings with interface scale change (#10281)
Fix #10274: Crash when rescanning scripts with GS selected (#10276)
Fix #10151: Use smaller padding for signs (#10272)
Fix #10263: [Script] Restore tile validation for commands (#10269)
Fix: Missing scrollbar for rail/roadtype dropdowns (#10264)
Fix #10260: Incorrect rect height drawing image in vehicle details (#10261)
Fix #10257: Incorrect catenary position on sloped bridge heads (#10258)
Fix: Vertically centre chat prompt (#10250)
Fix #10214: League and graph buttons in toolbar did not have a default action (#10246)
Fix #10242: Allow a space for text shadow when clipping text (#10243)
Fix #10206: Fully disable scripts in intro game (#10241)
Fix #10218: Don't try to create river tiles along incorrect slopes (#10235)
Fix #10208: [NewGRF] Allow using a specific underlay for road/tram tunnels (#10233)
Fix #10224: Don't change fast-forward mode while saving (#10230)
Fix #10147: Sound effect volume slider no longer set volume (#10228)
Fix #10223: Crash when vehicle cloning fails on order cloning (#10225)
Fix: Maximum space for engine preview image was never scaled (#10219)
Fix #10216: Crash when upgrading savegame with crashed vehicles (#10217)
Fix #10212: [Script] Nested ScriptAccounting scopes not restored properly (#10213)
Fix #10114: Incorrect drag-highlight position with non-power-of-2 scaling (#10211)
Fix #10198: Rearrange Intro GUI to make button rows narrower (#10203)
Fix: Missing extra padding when drawing tooltip text (#10201)
Fix: Bad alignment of button icons when using the original baseset (#10200)
Fix: Signal icons incorrectly positioned in UI (#10199)
Fix #10021: Object GUI resized when switching between different objects (#10196)
Fix #9720: Delay start of GS/AI to after loading of savegame (#9745)
13.0-beta2 (2022-11-27)
------------------------------------------------------------------------
Feature: Allow AI/GS to be fully modified in scenario editor (#10152)

206
cmake/Catch.cmake Normal file
View File

@@ -0,0 +1,206 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
#[=======================================================================[.rst:
Catch
-----
This module defines a function to help use the Catch test framework.
The :command:`catch_discover_tests` discovers tests by asking the compiled test
executable to enumerate its tests. This does not require CMake to be re-run
when tests change. However, it may not work in a cross-compiling environment,
and setting test properties is less convenient.
This command is intended to replace use of :command:`add_test` to register
tests, and will create a separate CTest test for each Catch test case. Note
that this is in some cases less efficient, as common set-up and tear-down logic
cannot be shared by multiple test cases executing in the same instance.
However, it provides more fine-grained pass/fail information to CTest, which is
usually considered as more beneficial. By default, the CTest test name is the
same as the Catch name; see also ``TEST_PREFIX`` and ``TEST_SUFFIX``.
.. command:: catch_discover_tests
Automatically add tests with CTest by querying the compiled test executable
for available tests::
catch_discover_tests(target
[TEST_SPEC arg1...]
[EXTRA_ARGS arg1...]
[WORKING_DIRECTORY dir]
[TEST_PREFIX prefix]
[TEST_SUFFIX suffix]
[PROPERTIES name1 value1...]
[TEST_LIST var]
[REPORTER reporter]
[OUTPUT_DIR dir]
[OUTPUT_PREFIX prefix}
[OUTPUT_SUFFIX suffix]
)
``catch_discover_tests`` sets up a post-build command on the test executable
that generates the list of tests by parsing the output from running the test
with the ``--list-test-names-only`` argument. This ensures that the full
list of tests is obtained. Since test discovery occurs at build time, it is
not necessary to re-run CMake when the list of tests changes.
However, it requires that :prop_tgt:`CROSSCOMPILING_EMULATOR` is properly set
in order to function in a cross-compiling environment.
Additionally, setting properties on tests is somewhat less convenient, since
the tests are not available at CMake time. Additional test properties may be
assigned to the set of tests as a whole using the ``PROPERTIES`` option. If
more fine-grained test control is needed, custom content may be provided
through an external CTest script using the :prop_dir:`TEST_INCLUDE_FILES`
directory property. The set of discovered tests is made accessible to such a
script via the ``<target>_TESTS`` variable.
The options are:
``target``
Specifies the Catch executable, which must be a known CMake executable
target. CMake will substitute the location of the built executable when
running the test.
``TEST_SPEC arg1...``
Specifies test cases, wildcarded test cases, tags and tag expressions to
pass to the Catch executable with the ``--list-test-names-only`` argument.
``EXTRA_ARGS arg1...``
Any extra arguments to pass on the command line to each test case.
``WORKING_DIRECTORY dir``
Specifies the directory in which to run the discovered test cases. If this
option is not provided, the current binary directory is used.
``TEST_PREFIX prefix``
Specifies a ``prefix`` to be prepended to the name of each discovered test
case. This can be useful when the same test executable is being used in
multiple calls to ``catch_discover_tests()`` but with different
``TEST_SPEC`` or ``EXTRA_ARGS``.
``TEST_SUFFIX suffix``
Similar to ``TEST_PREFIX`` except the ``suffix`` is appended to the name of
every discovered test case. Both ``TEST_PREFIX`` and ``TEST_SUFFIX`` may
be specified.
``PROPERTIES name1 value1...``
Specifies additional properties to be set on all tests discovered by this
invocation of ``catch_discover_tests``.
``TEST_LIST var``
Make the list of tests available in the variable ``var``, rather than the
default ``<target>_TESTS``. This can be useful when the same test
executable is being used in multiple calls to ``catch_discover_tests()``.
Note that this variable is only available in CTest.
``REPORTER reporter``
Use the specified reporter when running the test case. The reporter will
be passed to the Catch executable as ``--reporter reporter``.
``OUTPUT_DIR dir``
If specified, the parameter is passed along as
``--out dir/<test_name>`` to Catch executable. The actual file name is the
same as the test name. This should be used instead of
``EXTRA_ARGS --out foo`` to avoid race conditions writing the result output
when using parallel test execution.
``OUTPUT_PREFIX prefix``
May be used in conjunction with ``OUTPUT_DIR``.
If specified, ``prefix`` is added to each output file name, like so
``--out dir/prefix<test_name>``.
``OUTPUT_SUFFIX suffix``
May be used in conjunction with ``OUTPUT_DIR``.
If specified, ``suffix`` is added to each output file name, like so
``--out dir/<test_name>suffix``. This can be used to add a file extension to
the output e.g. ".xml".
#]=======================================================================]
#------------------------------------------------------------------------------
function(catch_discover_tests TARGET)
cmake_parse_arguments(
""
""
"TEST_PREFIX;TEST_SUFFIX;WORKING_DIRECTORY;TEST_LIST;REPORTER;OUTPUT_DIR;OUTPUT_PREFIX;OUTPUT_SUFFIX"
"TEST_SPEC;EXTRA_ARGS;PROPERTIES"
${ARGN}
)
if(NOT _WORKING_DIRECTORY)
set(_WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")
endif()
if(NOT _TEST_LIST)
set(_TEST_LIST ${TARGET}_TESTS)
endif()
## Generate a unique name based on the extra arguments
string(SHA1 args_hash "${_TEST_SPEC} ${_EXTRA_ARGS} ${_REPORTER} ${_OUTPUT_DIR} ${_OUTPUT_PREFIX} ${_OUTPUT_SUFFIX}")
string(SUBSTRING ${args_hash} 0 7 args_hash)
# Define rule to generate test list for aforementioned test executable
set(ctest_include_file "${CMAKE_CURRENT_BINARY_DIR}/${TARGET}_include-${args_hash}.cmake")
set(ctest_tests_file "${CMAKE_CURRENT_BINARY_DIR}/${TARGET}_tests-${args_hash}.cmake")
get_property(crosscompiling_emulator
TARGET ${TARGET}
PROPERTY CROSSCOMPILING_EMULATOR
)
add_custom_command(
TARGET ${TARGET} POST_BUILD
BYPRODUCTS "${ctest_tests_file}"
COMMAND "${CMAKE_COMMAND}"
-D "TEST_TARGET=${TARGET}"
-D "TEST_EXECUTABLE=$<TARGET_FILE:${TARGET}>"
-D "TEST_EXECUTOR=${crosscompiling_emulator}"
-D "TEST_WORKING_DIR=${_WORKING_DIRECTORY}"
-D "TEST_SPEC=${_TEST_SPEC}"
-D "TEST_EXTRA_ARGS=${_EXTRA_ARGS}"
-D "TEST_PROPERTIES=${_PROPERTIES}"
-D "TEST_PREFIX=${_TEST_PREFIX}"
-D "TEST_SUFFIX=${_TEST_SUFFIX}"
-D "TEST_LIST=${_TEST_LIST}"
-D "TEST_REPORTER=${_REPORTER}"
-D "TEST_OUTPUT_DIR=${_OUTPUT_DIR}"
-D "TEST_OUTPUT_PREFIX=${_OUTPUT_PREFIX}"
-D "TEST_OUTPUT_SUFFIX=${_OUTPUT_SUFFIX}"
-D "CTEST_FILE=${ctest_tests_file}"
-P "${_CATCH_DISCOVER_TESTS_SCRIPT}"
VERBATIM
)
file(WRITE "${ctest_include_file}"
"if(EXISTS \"${ctest_tests_file}\")\n"
" include(\"${ctest_tests_file}\")\n"
"else()\n"
" add_test(${TARGET}_NOT_BUILT-${args_hash} ${TARGET}_NOT_BUILT-${args_hash})\n"
"endif()\n"
)
if(NOT ${CMAKE_VERSION} VERSION_LESS "3.10.0")
# Add discovered tests to directory TEST_INCLUDE_FILES
set_property(DIRECTORY
APPEND PROPERTY TEST_INCLUDE_FILES "${ctest_include_file}"
)
else()
# Add discovered tests as directory TEST_INCLUDE_FILE if possible
get_property(test_include_file_set DIRECTORY PROPERTY TEST_INCLUDE_FILE SET)
if (NOT ${test_include_file_set})
set_property(DIRECTORY
PROPERTY TEST_INCLUDE_FILE "${ctest_include_file}"
)
else()
message(FATAL_ERROR
"Cannot set more than one TEST_INCLUDE_FILE"
)
endif()
endif()
endfunction()
###############################################################################
set(_CATCH_DISCOVER_TESTS_SCRIPT
${CMAKE_CURRENT_LIST_DIR}/CatchAddTests.cmake
CACHE INTERNAL "Catch2 full path to CatchAddTests.cmake helper file"
)

135
cmake/CatchAddTests.cmake Normal file
View File

@@ -0,0 +1,135 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
set(prefix "${TEST_PREFIX}")
set(suffix "${TEST_SUFFIX}")
set(spec ${TEST_SPEC})
set(extra_args ${TEST_EXTRA_ARGS})
set(properties ${TEST_PROPERTIES})
set(reporter ${TEST_REPORTER})
set(output_dir ${TEST_OUTPUT_DIR})
set(output_prefix ${TEST_OUTPUT_PREFIX})
set(output_suffix ${TEST_OUTPUT_SUFFIX})
set(script)
set(suite)
set(tests)
function(add_command NAME)
set(_args "")
# use ARGV* instead of ARGN, because ARGN splits arrays into multiple arguments
math(EXPR _last_arg ${ARGC}-1)
foreach(_n RANGE 1 ${_last_arg})
set(_arg "${ARGV${_n}}")
if(_arg MATCHES "[^-./:a-zA-Z0-9_]")
set(_args "${_args} [==[${_arg}]==]") # form a bracket_argument
else()
set(_args "${_args} ${_arg}")
endif()
endforeach()
set(script "${script}${NAME}(${_args})\n" PARENT_SCOPE)
endfunction()
# Run test executable to get list of available tests
if(NOT EXISTS "${TEST_EXECUTABLE}")
message(FATAL_ERROR
"Specified test executable '${TEST_EXECUTABLE}' does not exist"
)
endif()
execute_process(
COMMAND ${TEST_EXECUTOR} "${TEST_EXECUTABLE}" ${spec} --list-test-names-only
OUTPUT_VARIABLE output
RESULT_VARIABLE result
WORKING_DIRECTORY "${TEST_WORKING_DIR}"
)
# Catch --list-test-names-only reports the number of tests, so 0 is... surprising
if(${result} EQUAL 0)
message(WARNING
"Test executable '${TEST_EXECUTABLE}' contains no tests!\n"
)
elseif(${result} LESS 0)
message(FATAL_ERROR
"Error running test executable '${TEST_EXECUTABLE}':\n"
" Result: ${result}\n"
" Output: ${output}\n"
)
endif()
string(REPLACE "\n" ";" output "${output}")
# Run test executable to get list of available reporters
execute_process(
COMMAND ${TEST_EXECUTOR} "${TEST_EXECUTABLE}" ${spec} --list-reporters
OUTPUT_VARIABLE reporters_output
RESULT_VARIABLE reporters_result
WORKING_DIRECTORY "${TEST_WORKING_DIR}"
)
if(${reporters_result} EQUAL 0)
message(WARNING
"Test executable '${TEST_EXECUTABLE}' contains no reporters!\n"
)
elseif(${reporters_result} LESS 0)
message(FATAL_ERROR
"Error running test executable '${TEST_EXECUTABLE}':\n"
" Result: ${reporters_result}\n"
" Output: ${reporters_output}\n"
)
endif()
string(FIND "${reporters_output}" "${reporter}" reporter_is_valid)
if(reporter AND ${reporter_is_valid} EQUAL -1)
message(FATAL_ERROR
"\"${reporter}\" is not a valid reporter!\n"
)
endif()
# Prepare reporter
if(reporter)
set(reporter_arg "--reporter ${reporter}")
endif()
# Prepare output dir
if(output_dir AND NOT IS_ABSOLUTE ${output_dir})
set(output_dir "${TEST_WORKING_DIR}/${output_dir}")
if(NOT EXISTS ${output_dir})
file(MAKE_DIRECTORY ${output_dir})
endif()
endif()
# Parse output
foreach(line ${output})
set(test ${line})
# Escape characters in test case names that would be parsed by Catch2
set(test_name ${test})
foreach(char , [ ])
string(REPLACE ${char} "\\${char}" test_name ${test_name})
endforeach(char)
# ...add output dir
if(output_dir)
string(REGEX REPLACE "[^A-Za-z0-9_]" "_" test_name_clean ${test_name})
set(output_dir_arg "--out ${output_dir}/${output_prefix}${test_name_clean}${output_suffix}")
endif()
# ...and add to script
add_command(add_test
"${prefix}${test}${suffix}"
${TEST_EXECUTOR}
"${TEST_EXECUTABLE}"
"${test_name}"
${extra_args}
"${reporter_arg}"
"${output_dir_arg}"
)
add_command(set_tests_properties
"${prefix}${test}${suffix}"
PROPERTIES
WORKING_DIRECTORY "${TEST_WORKING_DIR}"
${properties}
)
list(APPEND tests "${prefix}${test}${suffix}")
endforeach()
# Create a list of all discovered tests, which users may use to e.g. set
# properties on the tests
add_command(set ${TEST_LIST} ${tests})
# Write CTest script
file(WRITE "${CTEST_FILE}" "${script}")

View File

@@ -83,5 +83,5 @@ else()
endif()
if(HAVE_CXX_ATOMICS_WITH_LIB OR HAVE_CXX_ATOMICS64_WITH_LIB)
target_link_libraries(openttd atomic)
target_link_libraries(openttd_lib atomic)
endif()

View File

@@ -4,23 +4,6 @@
#
macro(compile_flags)
if(MSVC)
if(VCPKG_TARGET_TRIPLET MATCHES "-static" AND NOT VCPKG_TARGET_TRIPLET MATCHES "-md")
# Switch to MT (static) instead of MD (dynamic) binary
# For MSVC two generators are available
# - a command line generator (Ninja) using CMAKE_BUILD_TYPE to specify the
# configuration of the build tree
# - an IDE generator (Visual Studio) using CMAKE_CONFIGURATION_TYPES to
# specify all configurations that will be available in the generated solution
list(APPEND MSVC_CONFIGS "${CMAKE_BUILD_TYPE}" "${CMAKE_CONFIGURATION_TYPES}")
# Set usage of static runtime for all configurations
foreach(MSVC_CONFIG ${MSVC_CONFIGS})
string(TOUPPER "CMAKE_CXX_FLAGS_${MSVC_CONFIG}" MSVC_FLAGS)
string(REPLACE "/MD" "/MT" ${MSVC_FLAGS} "${${MSVC_FLAGS}}")
endforeach()
endif()
# "If /Zc:rvalueCast is specified, the compiler follows section 5.4 of the
# C++11 standard". We need C++11 for the way we use threads.
add_compile_options(/Zc:rvalueCast)
@@ -33,6 +16,13 @@ macro(compile_flags)
endif()
endif()
# Our strings are UTF-8.
if(MSVC)
add_compile_options(/utf-8)
else()
add_compile_options(-finput-charset=utf-8)
endif()
# Add some -D flags for Debug builds. We cannot use add_definitions(), because
# it does not appear to support the $<> tags.
add_compile_options(
@@ -55,9 +45,13 @@ macro(compile_flags)
set(IS_STABLE_RELEASE "$<AND:$<NOT:$<CONFIG:Debug>>,$<NOT:$<BOOL:${OPTION_USE_ASSERTS}>>>")
if(MSVC)
add_compile_options(/W3)
if(MSVC_VERSION GREATER 1929 AND CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
# Starting with version 19.30, there is an optimisation bug, see #9966 for details
add_compile_options(
/W3
/w34100 # 'identifier' : unreferenced formal parameter
/w34189 # 'identifier' : local variable is initialized but not referenced
)
if(MSVC_VERSION GREATER 1929 AND MSVC_VERSION LESS 1937 AND CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
# Starting with version 19.30 (fixed in version 19.37), there is an optimisation bug, see #9966 for details
# This flag disables the broken optimisation to work around the bug
add_compile_options(/d2ssa-rse-)
endif()
@@ -76,9 +70,8 @@ macro(compile_flags)
-Wformat=2
-Winit-self
-Wnon-virtual-dtor
-Wsuggest-override
# Often parameters are unused, which is fine.
-Wno-unused-parameter
# We use 'ABCD' multichar for SaveLoad chunks identifiers
-Wno-multichar
@@ -89,22 +82,6 @@ macro(compile_flags)
-fno-strict-aliasing
)
# When we are a stable release (Release build + USE_ASSERTS not set),
# assertations are off, which trigger a lot of warnings. We disable
# these warnings for these releases.
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
add_compile_options(
"$<${IS_STABLE_RELEASE}:-Wno-unused-variable>"
"$<${IS_STABLE_RELEASE}:-Wno-unused-but-set-parameter>"
"$<${IS_STABLE_RELEASE}:-Wno-unused-but-set-variable>"
)
else()
add_compile_options(
"$<${IS_STABLE_RELEASE}:-Wno-unused-variable>"
"$<${IS_STABLE_RELEASE}:-Wno-unused-parameter>"
)
endif()
# Ninja processes the output so the output from the compiler
# isn't directly to a terminal; hence, the default is
# non-coloured output. We can override this to get nicely

View File

@@ -1,16 +1,13 @@
# Macro which contains all bits and pieces to create a single grf file based
# on NFO and PNG files.
#
# create_grf_command()
# create_grf_command(NFO_SOURCE_FILES nfo_file1 ... PNG_SOURCE_FILES png_file1 ...)
#
function(create_grf_command)
set(EXTRA_PNG_SOURCE_FILES ${ARGV})
cmake_parse_arguments(GRF "" "" "NFO_SOURCE_FILES;PNG_SOURCE_FILES" ${ARGN})
get_filename_component(GRF_SOURCE_FOLDER_NAME "${CMAKE_CURRENT_SOURCE_DIR}" NAME)
get_filename_component(GRF_BINARY_FILE ${CMAKE_CURRENT_SOURCE_DIR}/../${GRF_SOURCE_FOLDER_NAME}.grf ABSOLUTE)
file(GLOB_RECURSE GRF_PNG_SOURCE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/*.png)
file(GLOB_RECURSE GRF_NFO_SOURCE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/*.nfo)
set(GRF_PNG_SOURCE_FILES ${GRF_PNG_SOURCE_FILES} ${EXTRA_PNG_SOURCE_FILES})
# Copy over all the PNG files to the correct folder
foreach(GRF_PNG_SOURCE_FILE IN LISTS GRF_PNG_SOURCE_FILES)
@@ -28,12 +25,13 @@ function(create_grf_command)
list(APPEND GRF_PNG_BINARY_FILES ${GRF_PNG_BINARY_FILE})
endforeach()
add_custom_command(OUTPUT ${GRF_BINARY_FILE}
add_custom_command(OUTPUT ${GRF_BINARY_FILE} ${GRF_BINARY_FILE}.hash
COMMAND ${CMAKE_COMMAND}
-DGRF_SOURCE_FOLDER=${CMAKE_CURRENT_SOURCE_DIR}
-DGRF_BINARY_FILE=${GRF_BINARY_FILE}
-DNFORENUM_EXECUTABLE=${NFORENUM_EXECUTABLE}
-DGRFCODEC_EXECUTABLE=${GRFCODEC_EXECUTABLE}
-DGRFID_EXECUTABLE=${GRFID_EXECUTABLE}
-P ${CMAKE_SOURCE_DIR}/cmake/scripts/CreateGRF.cmake
MAIN_DEPENDENCY ${CMAKE_SOURCE_DIR}/cmake/scripts/CreateGRF.cmake
DEPENDS ${GRF_PNG_BINARY_FILES}

View File

@@ -3,20 +3,15 @@
# 'ctest'. The first is prefered, as it is more verbose, and takes care of
# dependencies correctly.
#
# create_regression()
# create_regression(file1 ...)
#
macro(create_regression)
# Find all the files in the regression folder; they need to be copied to the
# build folder before we can run the regression
file(GLOB_RECURSE REGRESSION_SOURCE_FILES ${CMAKE_SOURCE_DIR}/regression/*)
set(REGRESSION_SOURCE_FILES ${ARGN})
foreach(REGRESSION_SOURCE_FILE IN LISTS REGRESSION_SOURCE_FILES)
string(REPLACE "${CMAKE_SOURCE_DIR}/regression/" "" REGRESSION_SOURCE_FILE_NAME "${REGRESSION_SOURCE_FILE}")
string(CONCAT REGRESSION_BINARY_FILE "${CMAKE_BINARY_DIR}/ai/" "${REGRESSION_SOURCE_FILE_NAME}")
if("${REGRESSION_SOURCE_FILE_NAME}" STREQUAL "regression.cfg")
continue()
endif()
add_custom_command(OUTPUT ${REGRESSION_BINARY_FILE}
COMMAND ${CMAKE_COMMAND} -E copy
${REGRESSION_SOURCE_FILE}
@@ -28,59 +23,36 @@ macro(create_regression)
list(APPEND REGRESSION_BINARY_FILES ${REGRESSION_BINARY_FILE})
endforeach()
# Copy the regression configuration in a special folder, so all autogenerated
# folders end up in the same place after running regression.
add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/regression/regression.cfg
COMMAND ${CMAKE_COMMAND} -E copy
${CMAKE_SOURCE_DIR}/regression/regression.cfg
${CMAKE_BINARY_DIR}/regression/regression.cfg
MAIN_DEPENDENCY ${CMAKE_SOURCE_DIR}/regression/regression.cfg
COMMENT "Copying ${REGRESSION_SOURCE_FILE_NAME} regression file"
)
list(APPEND REGRESSION_BINARY_FILES ${CMAKE_BINARY_DIR}/regression/regression.cfg)
get_filename_component(REGRESSION_TEST_NAME "${CMAKE_CURRENT_SOURCE_DIR}" NAME)
# Create a new target which copies all regression files
add_custom_target(regression_files
ALL # this is needed because 'make test' doesn't resolve dependencies, and otherwise this is never executed
# Create a new target which copies regression files
add_custom_target(regression_${REGRESSION_TEST_NAME}_files
DEPENDS
${REGRESSION_BINARY_FILES}
)
enable_testing()
add_dependencies(regression_files regression_${REGRESSION_TEST_NAME}_files)
# Find all the tests we have, and create a target for them
file(GLOB REGRESSION_TESTS ${CMAKE_SOURCE_DIR}/regression/*)
foreach(REGRESSION_TEST IN LISTS REGRESSION_TESTS)
get_filename_component(REGRESSION_TEST_NAME "${REGRESSION_TEST}" NAME)
add_custom_target(regression_${REGRESSION_TEST_NAME}
COMMAND ${CMAKE_COMMAND}
-DOPENTTD_EXECUTABLE=$<TARGET_FILE:openttd>
-DEDITBIN_EXECUTABLE=${EDITBIN_EXECUTABLE}
-DREGRESSION_TEST=${REGRESSION_TEST_NAME}
-P "${CMAKE_SOURCE_DIR}/cmake/scripts/Regression.cmake"
DEPENDS openttd regression_${REGRESSION_TEST_NAME}_files
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
COMMENT "Running regression test ${REGRESSION_TEST_NAME}"
)
if("${REGRESSION_TEST_NAME}" STREQUAL "regression.cfg")
continue()
endif()
# Also make sure that 'make test' runs the regression
add_test(NAME regression_${REGRESSION_TEST_NAME}
COMMAND ${CMAKE_COMMAND}
-DOPENTTD_EXECUTABLE=$<TARGET_FILE:openttd>
-DEDITBIN_EXECUTABLE=${EDITBIN_EXECUTABLE}
-DREGRESSION_TEST=${REGRESSION_TEST_NAME}
-P "${CMAKE_SOURCE_DIR}/cmake/scripts/Regression.cmake"
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
)
add_custom_target(regression_${REGRESSION_TEST_NAME}
COMMAND ${CMAKE_COMMAND}
-DOPENTTD_EXECUTABLE=$<TARGET_FILE:openttd>
-DEDITBIN_EXECUTABLE=${EDITBIN_EXECUTABLE}
-DREGRESSION_TEST=${REGRESSION_TEST_NAME}
-P "${CMAKE_SOURCE_DIR}/cmake/scripts/Regression.cmake"
DEPENDS openttd regression_files
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
COMMENT "Running regression test ${REGRESSION_TEST_NAME}"
)
# Also make sure that 'make test' runs the regression
add_test(NAME regression_${REGRESSION_TEST_NAME}
COMMAND ${CMAKE_COMMAND}
-DOPENTTD_EXECUTABLE=$<TARGET_FILE:openttd>
-DEDITBIN_EXECUTABLE=${EDITBIN_EXECUTABLE}
-DREGRESSION_TEST=${REGRESSION_TEST_NAME}
-P "${CMAKE_SOURCE_DIR}/cmake/scripts/Regression.cmake"
WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
list(APPEND REGRESSION_TARGETS regression_${REGRESSION_TEST_NAME})
endforeach()
# Create a new target which runs the regression
add_custom_target(regression
DEPENDS ${REGRESSION_TARGETS})
add_dependencies(regression regression_${REGRESSION_TEST_NAME})
endmacro()

View File

@@ -2,6 +2,7 @@
#
find_program(GRFCODEC_EXECUTABLE grfcodec)
find_program(GRFID_EXECUTABLE grfid)
find_program(NFORENUM_EXECUTABLE nforenum)
include(FindPackageHandleStandardArgs)
@@ -9,5 +10,6 @@ find_package_handle_standard_args(Grfcodec
FOUND_VAR GRFCODEC_FOUND
REQUIRED_VARS
GRFCODEC_EXECUTABLE
GRFID_EXECUTABLE
NFORENUM_EXECUTABLE
)

65
cmake/FindHarfbuzz.cmake Normal file
View File

@@ -0,0 +1,65 @@
#[=======================================================================[.rst:
FindHarfBuzz
-------
Finds the harfbuzz library.
Result Variables
^^^^^^^^^^^^^^^^
This will define the following variables:
``Harfbuzz_FOUND``
True if the system has the harfbuzz library.
``Harfbuzz_INCLUDE_DIRS``
Include directories needed to use harfbuzz.
``Harfbuzz_LIBRARIES``
Libraries needed to link to harfbuzz.
``Harfbuzz_VERSION``
The version of the harfbuzz library which was found.
Cache Variables
^^^^^^^^^^^^^^^
The following cache variables may also be set:
``Harfbuzz_INCLUDE_DIR``
The directory containing ``hb.h``.
``Harfbuzz_LIBRARY``
The path to the harfbuzz library.
#]=======================================================================]
find_package(PkgConfig QUIET)
pkg_check_modules(PC_Harfbuzz QUIET harfbuzz)
find_path(Harfbuzz_INCLUDE_DIR
NAMES hb.h
PATHS ${PC_Harfbuzz_INCLUDE_DIRS}
)
find_library(Harfbuzz_LIBRARY
NAMES harfbuzz
PATHS ${PC_Harfbuzz_LIBRARY_DIRS}
)
set(Harfbuzz_VERSION ${PC_Harfbuzz_VERSION})
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Harfbuzz
FOUND_VAR Harfbuzz_FOUND
REQUIRED_VARS
Harfbuzz_LIBRARY
Harfbuzz_INCLUDE_DIR
VERSION_VAR Harfbuzz_VERSION
)
if(Harfbuzz_FOUND)
set(Harfbuzz_LIBRARIES ${Harfbuzz_LIBRARY})
set(Harfbuzz_INCLUDE_DIRS ${Harfbuzz_INCLUDE_DIR})
endif()
mark_as_advanced(
Harfbuzz_INCLUDE_DIR
Harfbuzz_LIBRARY
)

View File

@@ -9,7 +9,7 @@ FindICU
Finds components of the ICU library.
Accepted components are: uc, i18n, le, lx, io
Accepted components are: uc, i18n, le, lx, io, data
Result Variables
^^^^^^^^^^^^^^^^
@@ -31,7 +31,7 @@ This will define the following variables:
find_package(PkgConfig QUIET)
set(ICU_KNOWN_COMPONENTS "uc" "i18n" "le" "lx" "io")
set(ICU_KNOWN_COMPONENTS "uc" "i18n" "le" "lx" "io" "data")
foreach(MOD_NAME IN LISTS ICU_FIND_COMPONENTS)
if(NOT MOD_NAME IN_LIST ICU_KNOWN_COMPONENTS)

View File

@@ -55,7 +55,7 @@ find_library(LZO_LIBRARY
# name as the optimized file. This is not always the case, but so far
# experiences has shown that in those case vcpkg CMake files do the right
# thing.
if(VCPKG_TOOLCHAIN AND LZO_LIBRARY)
if(VCPKG_TOOLCHAIN AND LZO_LIBRARY AND LZO_LIBRARY MATCHES "${VCPKG_INSTALLED_DIR}")
if(LZO_LIBRARY MATCHES "/debug/")
set(LZO_LIBRARY_DEBUG ${LZO_LIBRARY})
string(REPLACE "/debug/lib/" "/lib/" LZO_LIBRARY_RELEASE ${LZO_LIBRARY})

View File

@@ -37,12 +37,31 @@ install(DIRECTORY
install(FILES
${CMAKE_SOURCE_DIR}/COPYING.md
${CMAKE_SOURCE_DIR}/README.md
${CMAKE_SOURCE_DIR}/CREDITS.md
${CMAKE_SOURCE_DIR}/CONTRIBUTING.md
${CMAKE_SOURCE_DIR}/changelog.txt
${CMAKE_SOURCE_DIR}/docs/multiplayer.md
${CMAKE_SOURCE_DIR}/known-bugs.txt
DESTINATION ${DOCS_DESTINATION_DIR}
COMPONENT docs)
install(FILES
${CMAKE_SOURCE_DIR}/docs/admin_network.md
${CMAKE_SOURCE_DIR}/docs/debugging_desyncs.md
${CMAKE_SOURCE_DIR}/docs/desync.md
${CMAKE_SOURCE_DIR}/docs/directory_structure.md
${CMAKE_SOURCE_DIR}/docs/eints.md
${CMAKE_SOURCE_DIR}/docs/game_coordinator.md
${CMAKE_SOURCE_DIR}/docs/linkgraph.md
${CMAKE_SOURCE_DIR}/docs/logging_and_performance_metrics.md
${CMAKE_SOURCE_DIR}/docs/multiplayer.md
${CMAKE_SOURCE_DIR}/docs/savegame_format.md
${CMAKE_SOURCE_DIR}/docs/symbol_server.md
${CMAKE_SOURCE_DIR}/docs/obg_format.txt
${CMAKE_SOURCE_DIR}/docs/obm_format.txt
${CMAKE_SOURCE_DIR}/docs/obs_format.txt
DESTINATION ${DOCS_DESTINATION_DIR}/docs
COMPONENT docs)
# A Linux manual only makes sense when using FHS. Otherwise it is a very odd
# file with little context to what it is.
if(OPTION_INSTALL_FHS)
@@ -164,7 +183,7 @@ elseif(UNIX)
OUTPUT_STRIP_TRAILING_WHITESPACE
)
if(LSB_RELEASE_ID)
if(LSB_RELEASE_ID STREQUAL "Ubuntu" OR LSB_RELEASE_ID STREQUAL "Debian")
if(LSB_RELEASE_ID STREQUAL "Ubuntu" OR LSB_RELEASE_ID STREQUAL "Debian" OR LSB_RELEASE_ID STREQUAL "Linuxmint")
execute_process(COMMAND ${LSB_RELEASE_EXEC} -cs
OUTPUT_VARIABLE LSB_RELEASE_CODENAME
OUTPUT_STRIP_TRAILING_WHITESPACE
@@ -173,6 +192,10 @@ elseif(UNIX)
set(CPACK_GENERATOR "DEB")
include(PackageDeb)
elseif(LSB_RELEASE_ID STREQUAL "Fedora")
set(PLATFORM "fedora")
set(CPACK_GENERATOR "RPM")
include(PackageRPM)
else()
set(UNSUPPORTED_PLATFORM_NAME "LSB-based Linux distribution '${LSB_RELEASE_ID}'")
endif()

View File

@@ -3,18 +3,21 @@ function(link_package NAME)
if(${NAME}_FOUND)
string(TOUPPER "${NAME}" UCNAME)
# Some libraries have a dash, which is not allowed in a preprocessor macro.
string(REPLACE "-" "_" UCNAME "${UCNAME}")
add_definitions(-DWITH_${UCNAME})
# Some libraries' cmake packages (looking at you, SDL2) leave trailing whitespace in the link commands,
# which (later) cmake considers to be an error. Work around this with by stripping the incoming string.
if(LP_TARGET AND TARGET ${LP_TARGET})
string(STRIP "${LP_TARGET}" LP_TARGET)
target_link_libraries(openttd ${LP_TARGET})
target_link_libraries(openttd_lib ${LP_TARGET})
message(STATUS "${NAME} found -- -DWITH_${UCNAME} -- ${LP_TARGET}")
else()
string(STRIP "${${NAME}_LIBRARY}" ${NAME}_LIBRARY)
string(STRIP "${${NAME}_LIBRARIES}" ${NAME}_LIBRARIES)
include_directories(${${NAME}_INCLUDE_DIRS} ${${NAME}_INCLUDE_DIR})
target_link_libraries(openttd ${${NAME}_LIBRARIES} ${${NAME}_LIBRARY})
target_link_libraries(openttd_lib ${${NAME}_LIBRARIES} ${${NAME}_LIBRARY})
message(STATUS "${NAME} found -- -DWITH_${UCNAME} -- ${${NAME}_INCLUDE_DIRS} ${${NAME}_INCLUDE_DIR} -- ${${NAME}_LIBRARIES} ${${NAME}_LIBRARY}")
endif()
elseif(LP_ENCOURAGED)

View File

@@ -56,7 +56,7 @@ function(set_options)
option(OPTION_DEDICATED "Build dedicated server only (no GUI)" OFF)
option(OPTION_INSTALL_FHS "Install with Filesystem Hierarchy Standard folders" ${DEFAULT_OPTION_INSTALL_FHS})
option(OPTION_USE_ASSERTS "Use assertions; leave enabled for nightlies, betas, and RCs" OFF)
option(OPTION_USE_ASSERTS "Use assertions; leave enabled for nightlies, betas, and RCs" ON)
if(EMSCRIPTEN)
# Although pthreads is supported, it is not in a way yet that is
# useful for us.
@@ -67,10 +67,13 @@ function(set_options)
option(OPTION_USE_NSIS "Use NSIS to create windows installer; enable only for stable releases" OFF)
option(OPTION_TOOLS_ONLY "Build only tools target" OFF)
option(OPTION_DOCS_ONLY "Build only docs target" OFF)
option(OPTION_ALLOW_INVALID_SIGNATURE "Allow loading of content with invalid signatures" OFF)
if (OPTION_DOCS_ONLY)
set(OPTION_TOOLS_ONLY ON PARENT_SCOPE)
endif()
option(OPTION_SURVEY_KEY "Survey-key to use for the opt-in survey (empty if you have none)" "")
endfunction()
# Show the values of the generic options.
@@ -84,6 +87,17 @@ function(show_options)
message(STATUS "Option Use assert - ${OPTION_USE_ASSERTS}")
message(STATUS "Option Use threads - ${OPTION_USE_THREADS}")
message(STATUS "Option Use NSIS - ${OPTION_USE_NSIS}")
if(OPTION_SURVEY_KEY)
message(STATUS "Option Survey Key - USED")
else()
message(STATUS "Option Survey Key - NOT USED")
endif()
if(OPTION_ALLOW_INVALID_SIGNATURE)
message(STATUS "Option Allow Invalid Signature - USED")
message(WARNING "Ignoring invalid signatures is a security risk! Use with care!")
endif()
endfunction()
# Add the definitions for the options that are selected.
@@ -104,4 +118,12 @@ function(add_definitions_based_on_options)
else()
add_definitions(-DNDEBUG)
endif()
if(OPTION_SURVEY_KEY)
add_definitions(-DSURVEY_KEY="${OPTION_SURVEY_KEY}")
endif()
if(OPTION_ALLOW_INVALID_SIGNATURE)
add_definitions(-DALLOW_INVALID_SIGNATURE)
endif()
endfunction()

View File

@@ -1,12 +1,4 @@
# Add a file to be compiled.
#
# add_files([file1 ...] CONDITION condition [condition ...])
#
# CONDITION is a complete statement that can be evaluated with if().
# If it evaluates true, the source files will be added; otherwise not.
# For example: ADD_IF SDL_FOUND AND Allegro_FOUND
#
function(add_files)
function(_add_files_tgt tgt)
cmake_parse_arguments(PARAM "" "" "CONDITION" ${ARGN})
set(PARAM_FILES "${PARAM_UNPARSED_ARGUMENTS}")
@@ -17,10 +9,44 @@ function(add_files)
endif()
foreach(FILE IN LISTS PARAM_FILES)
target_sources(openttd PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/${FILE})
# Some IDEs are not happy with duplicated filenames, so we detect that before adding the file.
get_target_property(${tgt}_FILES ${tgt} SOURCES)
if(${tgt}_FILES MATCHES "/${FILE}(;|$)")
string(REGEX REPLACE "(^|.+;)([^;]+/${FILE})(;.+|$)" "\\2" RES "${${tgt}_FILES}")
# Ignore header files duplicates in 3rdparty.
if(NOT (${FILE} MATCHES "\.h" AND (${RES} MATCHES "3rdparty" OR ${CMAKE_CURRENT_SOURCE_DIR} MATCHES "3rdparty")))
message(FATAL_ERROR "${tgt}: ${CMAKE_CURRENT_SOURCE_DIR}/${FILE} filename is a duplicate of ${RES}")
endif()
endif()
target_sources(${tgt} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/${FILE})
endforeach()
endfunction()
# Add a file to be compiled.
#
# add_files([file1 ...] CONDITION condition [condition ...])
#
# CONDITION is a complete statement that can be evaluated with if().
# If it evaluates true, the source files will be added; otherwise not.
# For example: ADD_IF SDL_FOUND AND Allegro_FOUND
#
function(add_files)
_add_files_tgt(openttd_lib ${ARGV})
endfunction()
# Add a test file to be compiled.
#
# add_test_files([file1 ...] CONDITION condition [condition ...])
#
# CONDITION is a complete statement that can be evaluated with if().
# If it evaluates true, the source files will be added; otherwise not.
# For example: ADD_IF SDL_FOUND AND Allegro_FOUND
#
function(add_test_files)
_add_files_tgt(openttd_test ${ARGV})
endfunction()
# This function works around an 'issue' with CMake, where
# set_source_files_properties() only works in the scope of the file. We want
# to set properties for the source file on a more global level. To solve this,

View File

@@ -58,6 +58,7 @@ list(SORT ${PLACE_HOLDER})
string(REPLACE ";" "\n" ${PLACE_HOLDER} "${${PLACE_HOLDER}}")
# Get the grf md5
file(MD5 ${BASESET_EXTRAGRF_FILE} ORIG_EXTRA_GRF_MD5)
file(READ ${BASESET_EXTRAGRF_FILE}.hash ORIG_EXTRA_GRF_MD5)
string(STRIP ${ORIG_EXTRA_GRF_MD5} ORIG_EXTRA_GRF_MD5)
configure_file(${BASESET_SOURCE_FILE} ${BASESET_BINARY_FILE})

View File

@@ -11,6 +11,9 @@ endif()
if(NOT GRFCODEC_EXECUTABLE)
message(FATAL_ERROR "Script needs GRFCODEC_EXECUTABLE defined")
endif()
if(NOT GRFID_EXECUTABLE)
message(FATAL_ERROR "Script needs GRFID_EXECUTABLE defined")
endif()
if(NOT GRF_SOURCE_FOLDER)
message(FATAL_ERROR "Script needs GRF_SOURCE_FOLDER defined")
endif()
@@ -18,6 +21,9 @@ if(NOT GRF_BINARY_FILE)
message(FATAL_ERROR "Script needs GRF_BINARY_FILE defined")
endif()
# Remove the existing output so failures never go unnoticed
file(REMOVE ${GRF_BINARY_FILE} ${GRF_BINARY_FILE}.hash)
get_filename_component(GRF_SOURCE_FOLDER_NAME "${GRF_SOURCE_FOLDER}" NAME)
file(WRITE sprites/${GRF_SOURCE_FOLDER_NAME}.nfo "")
@@ -47,7 +53,7 @@ if(RESULT)
message(FATAL_ERROR "NFORenum failed")
endif()
execute_process(COMMAND ${GRFCODEC_EXECUTABLE} -n -s -e -p1 ${GRF_SOURCE_FOLDER_NAME}.grf RESULT_VARIABLE RESULT)
execute_process(COMMAND ${GRFCODEC_EXECUTABLE} -n -s -e -g2 -p1 ${GRF_SOURCE_FOLDER_NAME}.grf RESULT_VARIABLE RESULT)
if(RESULT)
if(NOT RESULT MATCHES "^[0-9]*$")
message(FATAL_ERROR "Failed to run GRFCodec (${RESULT}), please check GRFCODEC_EXECUTABLE variable")
@@ -55,4 +61,15 @@ if(RESULT)
message(FATAL_ERROR "GRFCodec failed")
endif()
execute_process(COMMAND ${GRFID_EXECUTABLE} -m ${GRF_SOURCE_FOLDER_NAME}.grf OUTPUT_VARIABLE GRFID_HASH RESULT_VARIABLE RESULT)
if(RESULT)
if(NOT RESULT MATCHES "^[0-9]*$")
message(FATAL_ERROR "Failed to run GRFID (${RESULT}), please check GRFID_EXECUTABLE variable")
endif()
message(FATAL_ERROR "GRFID failed")
endif()
file(WRITE ${GRF_BINARY_FILE}.hash ${GRFID_HASH})
# Copy build files back to the source directory.
execute_process(COMMAND ${CMAKE_COMMAND} -E copy ${GRF_SOURCE_FOLDER_NAME}.grf ${GRF_BINARY_FILE})

View File

@@ -54,6 +54,9 @@ string(REPLACE "0x(nil)" "0x00000000" REGRESSION_RESULT "${REGRESSION_RESULT}")
string(REPLACE "0x0000000000000000" "0x00000000" REGRESSION_RESULT "${REGRESSION_RESULT}")
string(REPLACE "0x0x0" "0x00000000" REGRESSION_RESULT "${REGRESSION_RESULT}")
# Convert path separators
string(REPLACE "\\" "/" REGRESSION_RESULT "${REGRESSION_RESULT}")
# Remove timestamps if any
string(REGEX REPLACE "\[[0-9-]+ [0-9:]+\] " "" REGRESSION_RESULT "${REGRESSION_RESULT}")
@@ -62,6 +65,7 @@ string(REPLACE "\ndbg: [script]" "\n" REGRESSION_RESULT "${REGRESSION_RESULT}")
string(REPLACE "\n " "\nERROR: " REGRESSION_RESULT "${REGRESSION_RESULT}")
string(REPLACE "\nERROR: [1] " "\n" REGRESSION_RESULT "${REGRESSION_RESULT}")
string(REPLACE "\n[P] " "\n" REGRESSION_RESULT "${REGRESSION_RESULT}")
string(REPLACE "\n[S] " "\n" REGRESSION_RESULT "${REGRESSION_RESULT}")
string(REGEX REPLACE "dbg: ([^\n]*)\n?" "" REGRESSION_RESULT "${REGRESSION_RESULT}")
# Read the expected result

View File

@@ -28,25 +28,27 @@ endmacro()
macro(dump_class_templates NAME)
string(REGEX REPLACE "^Script" "" REALNAME ${NAME})
string(APPEND SQUIRREL_EXPORT "\n template <> inline ${NAME} *GetParam(ForceType<${NAME} *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, nullptr); return (${NAME} *)instance; }")
string(APPEND SQUIRREL_EXPORT "\n template <> inline ${NAME} &GetParam(ForceType<${NAME} &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, nullptr); return *(${NAME} *)instance; }")
string(APPEND SQUIRREL_EXPORT "\n template <> inline const ${NAME} *GetParam(ForceType<const ${NAME} *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, nullptr); return (${NAME} *)instance; }")
string(APPEND SQUIRREL_EXPORT "\n template <> inline const ${NAME} &GetParam(ForceType<const ${NAME} &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, nullptr); return *(${NAME} *)instance; }")
string(APPEND SQUIRREL_EXPORT "\n template <> struct Param<${NAME} *> { static inline ${NAME} *Get(HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, nullptr); return (${NAME} *)instance; } };")
string(APPEND SQUIRREL_EXPORT "\n template <> struct Param<${NAME} &> { static inline ${NAME} &Get(HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, nullptr); return *(${NAME} *)instance; } };")
string(APPEND SQUIRREL_EXPORT "\n template <> struct Param<const ${NAME} *> { static inline const ${NAME} *Get(HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, nullptr); return (${NAME} *)instance; } };")
string(APPEND SQUIRREL_EXPORT "\n template <> struct Param<const ${NAME} &> { static inline const ${NAME} &Get(HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, nullptr); return *(${NAME} *)instance; } };")
if("${NAME}" STREQUAL "ScriptEvent")
string(APPEND SQUIRREL_EXPORT "\n template <> inline int Return<${NAME} *>(HSQUIRRELVM vm, ${NAME} *res) { if (res == nullptr) { sq_pushnull(vm); return 1; } Squirrel::CreateClassInstanceVM(vm, \"${REALNAME}\", res, nullptr, DefSQDestructorCallback<${NAME}>, true); return 1; }")
string(APPEND SQUIRREL_EXPORT "\n template <> struct Return<${NAME} *> { static inline int Set(HSQUIRRELVM vm, ${NAME} *res) { if (res == nullptr) { sq_pushnull(vm); return 1; } Squirrel::CreateClassInstanceVM(vm, \"${REALNAME}\", res, nullptr, DefSQDestructorCallback<${NAME}>, true); return 1; } };")
elseif("${NAME}" STREQUAL "ScriptText")
string(APPEND SQUIRREL_EXPORT "\n")
string(APPEND SQUIRREL_EXPORT "\n template <> inline Text *GetParam(ForceType<Text *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) {")
string(APPEND SQUIRREL_EXPORT "\n if (sq_gettype(vm, index) == OT_INSTANCE) {")
string(APPEND SQUIRREL_EXPORT "\n return GetParam(ForceType<ScriptText *>(), vm, index, ptr);")
string(APPEND SQUIRREL_EXPORT "\n template <> struct Param<Text *> {")
string(APPEND SQUIRREL_EXPORT "\n static inline Text *Get(HSQUIRRELVM vm, int index) {")
string(APPEND SQUIRREL_EXPORT "\n if (sq_gettype(vm, index) == OT_INSTANCE) {")
string(APPEND SQUIRREL_EXPORT "\n return Param<ScriptText *>::Get(vm, index);")
string(APPEND SQUIRREL_EXPORT "\n }")
string(APPEND SQUIRREL_EXPORT "\n if (sq_gettype(vm, index) == OT_STRING) {")
string(APPEND SQUIRREL_EXPORT "\n return new RawText(Param<const std::string &>::Get(vm, index));")
string(APPEND SQUIRREL_EXPORT "\n }")
string(APPEND SQUIRREL_EXPORT "\n return nullptr;")
string(APPEND SQUIRREL_EXPORT "\n }")
string(APPEND SQUIRREL_EXPORT "\n if (sq_gettype(vm, index) == OT_STRING) {")
string(APPEND SQUIRREL_EXPORT "\n return new RawText(GetParam(ForceType<const char *>(), vm, index, ptr));")
string(APPEND SQUIRREL_EXPORT "\n }")
string(APPEND SQUIRREL_EXPORT "\n return nullptr;")
string(APPEND SQUIRREL_EXPORT "\n }")
string(APPEND SQUIRREL_EXPORT "\n };")
else()
string(APPEND SQUIRREL_EXPORT "\n template <> inline int Return<${NAME} *>(HSQUIRRELVM vm, ${NAME} *res) { if (res == nullptr) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, \"${REALNAME}\", res, nullptr, DefSQDestructorCallback<${NAME}>, true); return 1; }")
string(APPEND SQUIRREL_EXPORT "\n template <> struct Return<${NAME} *> { static inline int Set(HSQUIRRELVM vm, ${NAME} *res) { if (res == nullptr) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, \"${REALNAME}\", res, nullptr, DefSQDestructorCallback<${NAME}>, true); return 1; } };")
endif()
endmacro()
@@ -69,13 +71,23 @@ reset_reader()
file(STRINGS "${SCRIPT_API_FILE}" SOURCE_LINES)
set(NUM_LINE 0)
macro(doxygen_check)
if(NOT "${DOXYGEN_SKIP}" STREQUAL "")
message(FATAL_ERROR "${SCRIPT_API_FILE}:${NUM_LINE}: a DOXYGEN_API block was not properly closed")
endif()
endmacro()
foreach(LINE IN LISTS SOURCE_LINES)
math(EXPR NUM_LINE "${NUM_LINE} + 1")
# Ignore special doxygen blocks
if("${LINE}" MATCHES "^#ifndef DOXYGEN_API")
doxygen_check()
set(DOXYGEN_SKIP "next")
continue()
endif()
if("${LINE}" MATCHES "^#ifdef DOXYGEN_API")
doxygen_check()
set(DOXYGEN_SKIP "true")
continue()
endif()
@@ -84,10 +96,10 @@ foreach(LINE IN LISTS SOURCE_LINES)
continue()
endif()
if("${LINE}" MATCHES "^#else")
if("${DOXYGEN_SKIP}" STREQUAL "next")
if(DOXYGEN_SKIP STREQUAL "next")
set(DOXYGEN_SKIP "true")
else()
unset(DOXYGEN_SKIP)
elseif(DOXYGEN_SKIP STREQUAL "true")
set(DOXYGEN_SKIP "false")
endif()
continue()
endif()
@@ -297,8 +309,8 @@ foreach(LINE IN LISTS SOURCE_LINES)
endif()
string(APPEND SQUIRREL_EXPORT "\n /* Allow enums to be used as Squirrel parameters */")
foreach(ENUM IN LISTS ENUMS)
string(APPEND SQUIRREL_EXPORT "\n template <> inline ${ENUM} GetParam(ForceType<${ENUM}>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQInteger tmp; sq_getinteger(vm, index, &tmp); return (${ENUM})tmp; }")
string(APPEND SQUIRREL_EXPORT "\n template <> inline int Return<${ENUM}>(HSQUIRRELVM vm, ${ENUM} res) { sq_pushinteger(vm, (int32)res); return 1; }")
string(APPEND SQUIRREL_EXPORT "\n template <> struct Param<${ENUM}> { static inline ${ENUM} Get(HSQUIRRELVM vm, int index) { SQInteger tmp; sq_getinteger(vm, index, &tmp); return (${ENUM})tmp; } };")
string(APPEND SQUIRREL_EXPORT "\n template <> struct Return<${ENUM}> { static inline int Set(HSQUIRRELVM vm, ${ENUM} res) { sq_pushinteger(vm, res); return 1; } };")
endforeach()
endif()
@@ -330,13 +342,13 @@ foreach(LINE IN LISTS SOURCE_LINES)
endif()
string(APPEND SQUIRREL_EXPORT "\n")
string(APPEND SQUIRREL_EXPORT "\ntemplate <> const char *GetClassName<${CLS}, ST_${APIUC}>() { return \"${API_CLS}\"; }")
string(APPEND SQUIRREL_EXPORT "\ntemplate <> const char *GetClassName<${CLS}, ScriptType::${APIUC}>() { return \"${API_CLS}\"; }")
string(APPEND SQUIRREL_EXPORT "\n")
# Then do the registration functions of the class.
string(APPEND SQUIRREL_EXPORT "\nvoid SQ${API_CLS}_Register(Squirrel *engine)")
string(APPEND SQUIRREL_EXPORT "\n{")
string(APPEND SQUIRREL_EXPORT "\n DefSQClass<${CLS}, ST_${APIUC}> SQ${API_CLS}(\"${API_CLS}\");")
string(APPEND SQUIRREL_EXPORT "\n DefSQClass<${CLS}, ScriptType::${APIUC}> SQ${API_CLS}(\"${API_CLS}\");")
if("${SUPER_CLS}" STREQUAL "Text" OR "${SUPER_CLS}" STREQUAL "ScriptObject" OR "${SUPER_CLS}" STREQUAL "AIAbstractiveList::Valuator")
string(APPEND SQUIRREL_EXPORT "\n SQ${API_CLS}.PreRegister(engine);")
else()
@@ -625,10 +637,12 @@ foreach(LINE IN LISTS SOURCE_LINES)
string(APPEND TYPES "p")
elseif("${PARAM}" MATCHES "^Array")
string(APPEND TYPES "a")
elseif("${PARAM}" MATCHES "^struct Array")
elseif("${PARAM}" MATCHES "^const Array")
string(APPEND TYPES "a")
elseif("${PARAM}" MATCHES "^Text")
string(APPEND TYPES ".")
elseif("${PARAM}" MATCHES "^std::string")
string(APPEND TYPES ".")
else()
string(APPEND TYPES "x")
endif()
@@ -664,4 +678,6 @@ foreach(LINE IN LISTS SOURCE_LINES)
endif()
endforeach()
doxygen_check()
configure_file(${SCRIPT_API_SOURCE_FILE} ${SCRIPT_API_BINARY_FILE})

View File

@@ -53,4 +53,7 @@ Do NOT remove the dmp_cmds savegames of a desync you have reported until the
desync has been fixed; if you, by accident, send us the wrong savegames we
will not be able to reproduce the desync and thus will be unable to fix it.
## More information
You can find more theory on the causes and debugging of desyncs in the
[desync documentation](./desync.md).

View File

@@ -19,14 +19,14 @@ your operating system:
- Windows:
- `C:\My Documents\OpenTTD` (95, 98, ME)
- `C:\Documents and Settings\<username>\My Documents\OpenTTD` (2000, XP)
- `C:\Users\<username>\Documents\OpenTTD` (Vista, 7, 8.1, 10)
- `C:\Users\<username>\Documents\OpenTTD` (7, 8.1, 10, 11)
- macOS: `~/Documents/OpenTTD`
- Linux: `$XDG_DATA_HOME/openttd` which is usually `~/.local/share/openttd`
when built with XDG base directory support, otherwise `~/.openttd`
3. The shared directory
- Windows:
- `C:\Documents and Settings\All Users\Shared Documents\OpenTTD` (2000, XP)
- `C:\Users\Public\Documents\OpenTTD` (Vista, 7, 8.1, 10)
- `C:\Users\Public\Documents\OpenTTD` (7, 8.1, 10, 11)
- macOS: `/Library/Application Support/OpenTTD`
- Linux: not available
4. The binary directory (where the OpenTTD executable is)

View File

@@ -25,6 +25,10 @@ The translators will decide whether, where and how to apply your suggestion.
Sorry, we don't offer this option.
Only when there is a consistency problem that needs addressing, this can be done via a PR.
We are very strict about this, and in general all PRs making translation changes will be closed.
But if it is really needed, and the change is not a revert of any older change, a PR can be created to do mass changes to a translation.
### I want to change the language definition (plural form, genders, cases) of a translation.
Please [create an issue](https://github.com/OpenTTD/OpenTTD/issues/new/choose) for this.

View File

@@ -807,8 +807,6 @@
</table>
</li>
<li>m2 bits 5..4: ground density</li>
<li>m2 bits 3..0: update counter, incremented on every periodic processing.<br>
on wraparound the growth status is updated (or, if it's <tt>3</tt>, a random action is taken)</li>
<li>m3 bits 7..0: type of trees:
<table>
<tr>
@@ -991,13 +989,17 @@
</tr>
</table>
</li>
<li>m6 bit 7: rail station / waypoint may have catenary pylons</li>
<li>m6 bit 6: rail station / waypoint may have catenary wires</li>
<li>m6 bits 5..3: the station type (rail, airport, truck, bus, oilrig, dock, buoy, waypoint)</li>
<li>m6 bit 2: pbs reservation state for railway stations/waypoints</li>
<li>m6 bit 0: rail station / waypoint is blocked</li>
<li>m7 bits 4..0: <a href="#OwnershipInfo">owner</a> of road (road stops)</li>
<li>m7: animation frame (railway stations/waypoints, airports)</li>
<li>m8 bits 11..6: <a href="#TramType">Tramtype</a></li>
<li>m8 bits 5..0: <a href="#TrackType">track type</a> for railway stations/waypoints</li>
<li>m8 bits 5..0: custom road stop id; 0 means standard graphics</li>
</ul>
</td>
</tr>

View File

@@ -188,7 +188,7 @@ the array so you can quickly see what is used and what is not.
<td class="bits" rowspan=2><span class="used" title="Random bits">XXXX</span> <span class="free">OOOO</span></td>
<td class="bits" rowspan=2><span class="used" title="Custom station specifications ID">XXXX XXXX</span></td>
<td class="bits"><span class="used" title="Graphics index">XXXX XXXX</span></td>
<td class="bits" rowspan=2><span class="free">OO</span><span class="used" title="Station type">XXX</span> <span class="used" title="Reserved track">X</span><span class="free">OO</span></td>
<td class="bits" rowspan=2><span class="used" title="May have pylons">X</span><span class="used" title="May have wires">X</span><span class="used" title="Station type">XXX</span> <span class="used" title="Reserved track">X</span><span class="free">O</span><span class="used" title="Tile is blocked">X</span></td>
<td class="bits" rowspan=2><span class="used" title="Animation frame">XXXX XXXX</span></td>
<td class="bits" rowspan=2><span class="free">OOOO OOOO OO</span><span class="used" title="Railway type">XX XXXX</span></td>
</tr>
@@ -203,7 +203,7 @@ the array so you can quickly see what is used and what is not.
<td class="bits"><span class="usable" title="Graphics index">OOOO O</span><span class="used" title="Graphics index: 00 (exit towards NE), 01 (exit towards SE), 02 (exit towards SW), 03 (exit towards NW), 04 (drive through X), 05 (drive through Y)">XXX</span></td>
<td class="bits" rowspan=5><span class="free">OO</span><span class="used" title="Station type">XX X</span><span class="free">OOO</span></td>
<td class="bits"><span class="free">OOO</span><span class="used" title="Owner of road">X XXXX</span></td>
<td class="bits"><span class="free">OOOO</span> <span class="used" title="Tram type">XXXX XX<span class="free">OO OOOO</span></td>
<td class="bits"><span class="free">OOOO</span> <span class="used" title="Tram type">XXXX XX</span> <span class="used" title="Custom road stops specifications ID">XXXXXX</span></td>
</tr>
<tr>
<td class="caption">airport</td>

View File

@@ -193,6 +193,9 @@ If it is, and your server still isn't showing up, start OpenTTD with
`-d net=4` as extra argument. This will show debug message related to the
network, including communication to/from the Game Coordinator.
See the [Game Coordinator documentation](./game_coordinator.md) for more
technical information about the Game Coordinator service.
### My server warns a lot about getaddrinfo taking N seconds
This could be a transient issue with your (local) DNS server, but if the

View File

@@ -1,6 +1,6 @@
.\" Hey, EMACS: -*- nroff -*-
.\" Please adjust this date whenever revising the manpage.
.Dd October 13, 2014
.Dd August 12, 2023
.Dt OPENTTD 6
.Os
.Sh NAME
@@ -8,18 +8,17 @@
.Nd open source clone of the Microprose game \(lqTransport Tycoon Deluxe\(rq
.Sh SYNOPSIS
.Nm
.Op Fl efhx
.Op Fl efhQxX
.Op Fl b Ar blitter
.Op Fl c Ar config_file
.Op Fl d Op Ar level | Ar cat Ns = Ns Ar lvl Ns Op , Ns Ar ...
.Op Fl D Oo Ar host Oc Ns Op : Ns Ar port
.Op Fl g Op Ar savegame
.Op Fl g Op Ar file
.Op Fl G Ar seed
.Op Fl I Ar graphicsset
.Op Fl l Ar host Ns Op : Ns Ar port
.Op Fl m Ar driver
.Op Fl M Ar musicset
.Op Fl n Ar host Ns Oo : Ns Ar port Oc Ns Op # Ns Ar player
.Op Fl n Ar host Ns Oo : Ns Ar port Oc Ns Op # Ns Ar company
.Op Fl p Ar password
.Op Fl P Ar password
.Op Fl q Ar savegame
@@ -29,7 +28,7 @@
.Op Fl t Ar year
.Op Fl v Ar driver
.Sh OPTIONS
.Bl -tag -width "-n host[:port][#player]"
.Bl -tag -width "-n host[:port][#company]"
.It Fl b Ar blitter
Select the blitter
.Ar blitter ;
@@ -63,11 +62,11 @@ Start in world editor mode.
.It Fl f
Fork into background (dedicated server only, see
.Fl D ) .
.It Fl g Op Ar savegame
.It Fl g Op Ar file
Load
.Ar savegame
at start or start a new game if omitted.
.Ar savegame
.Ar file
(can be either a savegame, scenario, or heightmap) at start or start a new game if omitted.
.Ar file
must be either an absolute path or one relative to the current path or one of
the search paths.
.It Fl G Ar seed
@@ -82,11 +81,6 @@ Select the graphics set
see
.Fl h
for a full list.
.It Fl l Ar host Ns Op : Ns Ar port
Redirect
.Fn DEBUG
output; see
.Fl D .
.It Fl m Ar driver
Select the music driver
.Ar driver ;
@@ -99,8 +93,8 @@ Select the music set
see
.Fl h
for a full list.
.It Fl n Ar host Ns Oo : Ns Ar port Oc Ns Op # Ns Ar player
Join a network game, optionally specifying a port to connect to and player to
.It Fl n Ar host Ns Oo : Ns Ar port Oc Ns Op # Ns Ar company
Join a network game, optionally specifying a port to connect to and company to
play as.
.It Fl p Ar password
Password used to join server.
@@ -112,6 +106,14 @@ Only useful with
.Fl n .
.It Fl q Ar savegame
Write some information about the specified savegame and exit.
.It Fl Q
Don't scan for/load NewGRF files on startup.
.Pp
Passing
.Fl Q
twice (so,
.Fl QQ
) will disable NewGRF scanning/loading entirely.
.It Fl r Ar width Ns x Ns Ar height
Set the resolution to
.Ar width
@@ -141,6 +143,8 @@ see
for a full list.
.It Fl x
Do not automatically save to config file on exit.
.It Fl X
Do not use global folders to search for files.
.El
.Sh SEE ALSO
.Lk https://wiki.openttd.org "Wiki"

48
docs/releasing_openttd.md Normal file
View File

@@ -0,0 +1,48 @@
# Releasing OpenTTD
This guide is for OpenTTD developers/maintainers, to release a new version of OpenTTD.
## Step 0: Branch or Backport
* If this is a beta version release, skip this step.
* If this is an RC1 (first Release Candidate) build, create a new branch `release/nn` where `nn` is the major version number, then apply changes similar to [PR#9573](https://github.com/OpenTTD/OpenTTD/pull/9573). You also need to forwardport the changelog, as in [PR#10113](https://github.com/OpenTTD/OpenTTD/pull/10113).
* Update CMakeLists.txt
* Add a new (empty) AI compatibility script in bin/ai/
* Add the new version to CheckAPIVersion in src/ai/ai_info.cpp + src/game/game_info.cpp
* Add the new version to src/script/api/ai_changelog.hpp + src/script/api/game_changelog.hpp
* Update the version of regression in bin/ai/regression/regression_info.nut
* Add a note to src/saveload/saveload.h about which savegame version is used in the branch.
* If this is a later RC or release build and the release branch already exists, you'll need to backport fixes and language from master to this branch, which were merged after the branch diverged from master. You can use these two helper scripts: https://github.com/OpenTTD/scripts/tree/main/backport
## Step 1: Prepare changelog documentation
1. Update the [changelog](../changelog.txt) with new changes since the last release.
* Changelog entries are typically PR titles, but can be edited to be more helpful without context.
* Don't include fixes to things which haven't previously been released (like fixes to features which are in the same changelog).
* Order the entries by importance: `Feature > Add > Change > Fix`, then numerically by PR number.
2. Create a changelog PR, get approval, and merge.
* For beta releases, target master, otherwise target the release branch.
## Step 2: Prepare website release announcement
1. Go to https://github.com/OpenTTD/website/new/main/_posts and write a new announcement post. See a [previous example](https://github.com/OpenTTD/website/pull/238) for a template.
2. Create a new branch for this post and open a PR for it.
3. Write announcement text for socials like Forum/Discord/Twitter/Reddit and include it in the PR.
4. Create a Steam news image for that post and include it in the PR.
5. Check the website post (preview link via checks page) and make corrections. We usually just use the GitHub web interface for this and squash the result later.
6. Get this PR approved, but do not merge yet.
## Step 3: Make the actual OpenTTD release
1. Go to https://github.com/OpenTTD/OpenTTD/releases/new and create a new tag matching the release number. For the body of the release, see any older release. "Set as a pre-release" for a beta or RC, set as latest for a real release.
2. Merge website PR.
3. Wait for the OpenTTD release checks to be complete.
4. Check that website links to the new release are working and correct, using the [staging website](https://www-staging.openttd.org/).
5. If this is a full release, ask orudge to update the Microsoft Store and TrueBrain to move the release from the "testing" to "default" branch on Steam.
## Step 4: Tell the world
1. Tag and create a website release to trigger the actions that update the website.
2. After the website is live, make announcements on social media. You may need to coordinate with other developers who can make posts on Twitter, Reddit, Steam, and GOG.

34
docs/symbol_server.md Normal file
View File

@@ -0,0 +1,34 @@
# OpenTTD's Symbol Server
For all official releases, OpenTTD collects the Breakpad Symbols (SYM-files) and Microsoft's Symbols (PDB-files), and publishes them on our own Symbol Server (https://symbols.openttd.org).
These symbol files are needed to analyze `crash.dmp` files as attached to issues by users.
A `crash.dmp` is created on Windows, Linux, and MacOS when a crash happens.
This combined with the `crash.log` should give a pretty good indication what was going on at the moment the game crashed.
## Analyzing a crash.dmp
### MSVC
In MSVC you can add the above URL as Symbol Server (and please enable MSVC's for all other libraries), allowing you to analyze `crash.dmp`.
Now simply open up the `crash.dmp`, and start debugging.
### All other platforms
The best tool to use is `minidump-stackwalk` as published in the Rust's cargo index:
```bash
cargo install minidump-stackwalk
```
For how to install Rust, please see [here](https://doc.rust-lang.org/cargo/getting-started/installation.html).
Now run the tool like:
```bash
minidump-stackwalk <crash.dmp> --symbols-url https://symbols.openttd.org
```
For convenience, the above Symbol Server also check with Mozilla's Symbol Server in case any other library but OpenTTD is requested.
This means files like `libc`, `kernel32.dll`, etc are all available on the above mentioned Symbol Server.

View File

@@ -18,6 +18,10 @@ set(BASESET_OTHER_SOURCE_FILES
${CMAKE_CURRENT_SOURCE_DIR}/opntitle.dat
${CMAKE_CURRENT_SOURCE_DIR}/orig_extra.grf
${CMAKE_CURRENT_SOURCE_DIR}/../openttd.32.bmp
${CMAKE_CURRENT_SOURCE_DIR}/OpenTTD-Sans.ttf
${CMAKE_CURRENT_SOURCE_DIR}/OpenTTD-Serif.ttf
${CMAKE_CURRENT_SOURCE_DIR}/OpenTTD-Small.ttf
${CMAKE_CURRENT_SOURCE_DIR}/OpenTTD-Mono.ttf
)
# Done by the subdirectories, if nforenum / grfcodec is installed
@@ -49,6 +53,7 @@ foreach(BASESET_SOURCE_FILE IN LISTS BASESET_SOURCE_FILES)
MAIN_DEPENDENCY ${BASESET_SOURCE_FILE}
DEPENDS ${LANG_SOURCE_FILES}
${BASESET_EXTRAGRF_FILE}
${BASESET_EXTRAGRF_FILE}.hash
${CMAKE_SOURCE_DIR}/cmake/scripts/Baseset.cmake
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Generating ${BASESET_SOURCE_FILE_NAME} baseset metadata file"
@@ -62,7 +67,7 @@ foreach(BASESET_OTHER_SOURCE_FILE IN LISTS BASESET_OTHER_SOURCE_FILES)
get_filename_component(BASESET_OTHER_SOURCE_FILE_NAME "${BASESET_OTHER_SOURCE_FILE}" NAME)
set(BASESET_OTHER_BINARY_FILE "${CMAKE_BINARY_DIR}/baseset/${BASESET_OTHER_SOURCE_FILE_NAME}")
add_custom_command(OUTPUT ${BASESET_OTHER_BINARY_FILE}
add_custom_command_timestamp(OUTPUT ${BASESET_OTHER_BINARY_FILE}
COMMAND ${CMAKE_COMMAND} -E copy
${BASESET_OTHER_SOURCE_FILE}
${BASESET_OTHER_BINARY_FILE}

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,6 @@
# OpenTTD TrueType font
The OpenTTD TrueType font was created by Zephyris and is maintained on [Github](https://github.com/zephyris/openttd-ttf).
It is licensed under GPL-2.0.
The currently included files correspond to release v0.4.

Binary file not shown.

View File

@@ -0,0 +1 @@
4f03553f614a06d86dc06376db3353c7

View File

@@ -5,5 +5,47 @@
# working on it / have the tools installed.
if(GRFCODEC_FOUND)
include(CreateGrfCommand)
create_grf_command()
create_grf_command(
NFO_SOURCE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/airports.nfo
${CMAKE_CURRENT_SOURCE_DIR}/airport_preview.nfo
${CMAKE_CURRENT_SOURCE_DIR}/aqueduct.nfo
${CMAKE_CURRENT_SOURCE_DIR}/autorail.nfo
${CMAKE_CURRENT_SOURCE_DIR}/canals.nfo
${CMAKE_CURRENT_SOURCE_DIR}/chars.nfo
${CMAKE_CURRENT_SOURCE_DIR}/elrails.nfo
${CMAKE_CURRENT_SOURCE_DIR}/foundations.nfo
${CMAKE_CURRENT_SOURCE_DIR}/mono.nfo
${CMAKE_CURRENT_SOURCE_DIR}/oneway.nfo
${CMAKE_CURRENT_SOURCE_DIR}/openttd.nfo
${CMAKE_CURRENT_SOURCE_DIR}/openttdgui.nfo
${CMAKE_CURRENT_SOURCE_DIR}/palette.nfo
${CMAKE_CURRENT_SOURCE_DIR}/roadstops.nfo
${CMAKE_CURRENT_SOURCE_DIR}/signals.nfo
${CMAKE_CURRENT_SOURCE_DIR}/sloped_tracks.nfo
${CMAKE_CURRENT_SOURCE_DIR}/tramtracks.nfo
${CMAKE_CURRENT_SOURCE_DIR}/tunnel_portals.nfo
${CMAKE_CURRENT_SOURCE_DIR}/2ccmap.nfo
PNG_SOURCE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/airports.png
${CMAKE_CURRENT_SOURCE_DIR}/airport_preview.png
${CMAKE_CURRENT_SOURCE_DIR}/aqueduct.png
${CMAKE_CURRENT_SOURCE_DIR}/autorail.png
${CMAKE_CURRENT_SOURCE_DIR}/canals.png
${CMAKE_CURRENT_SOURCE_DIR}/canal_locks.png
${CMAKE_CURRENT_SOURCE_DIR}/chars.png
${CMAKE_CURRENT_SOURCE_DIR}/elrails.png
${CMAKE_CURRENT_SOURCE_DIR}/foundations.png
${CMAKE_CURRENT_SOURCE_DIR}/mono.png
${CMAKE_CURRENT_SOURCE_DIR}/oneway.png
${CMAKE_CURRENT_SOURCE_DIR}/openttdgui.png
${CMAKE_CURRENT_SOURCE_DIR}/openttdgui_build_tram.png
${CMAKE_CURRENT_SOURCE_DIR}/openttdgui_convert_road.png
${CMAKE_CURRENT_SOURCE_DIR}/openttdgui_convert_tram.png
${CMAKE_CURRENT_SOURCE_DIR}/openttdgui_group_livery.png
${CMAKE_CURRENT_SOURCE_DIR}/roadstops.png
${CMAKE_CURRENT_SOURCE_DIR}/signals.png
${CMAKE_CURRENT_SOURCE_DIR}/sloped_tracks.png
${CMAKE_CURRENT_SOURCE_DIR}/tramtracks.png
${CMAKE_CURRENT_SOURCE_DIR}/tramtracks_bare_depot.png
${CMAKE_CURRENT_SOURCE_DIR}/tunnel_portals.png
)
endif()

View File

@@ -5,233 +5,233 @@
//
-1 * 0 0C "Monospaced characters (Liberation Mono)"
-1 * 0 12 01 03 60 20 00
-1 sprites/mono.png 8bpp 10 30 7 13 0 0 normal
-1 sprites/mono.png 8bpp 25 30 7 13 0 0 normal
-1 sprites/mono.png 8bpp 40 30 7 13 0 0 normal
-1 sprites/mono.png 8bpp 55 30 7 13 0 0 normal
-1 sprites/mono.png 8bpp 70 30 7 13 0 0 normal
-1 sprites/mono.png 8bpp 85 30 7 13 0 0 normal
-1 sprites/mono.png 8bpp 100 30 7 13 0 0 normal
-1 sprites/mono.png 8bpp 115 30 7 13 0 0 normal
-1 sprites/mono.png 8bpp 130 30 7 13 0 0 normal
-1 sprites/mono.png 8bpp 145 30 7 13 0 0 normal
-1 sprites/mono.png 8bpp 160 30 7 13 0 0 normal
-1 sprites/mono.png 8bpp 175 30 7 13 0 0 normal
-1 sprites/mono.png 8bpp 190 30 7 13 0 0 normal
-1 sprites/mono.png 8bpp 205 30 7 13 0 0 normal
-1 sprites/mono.png 8bpp 220 30 7 13 0 0 normal
-1 sprites/mono.png 8bpp 235 30 7 13 0 0 normal
-1 sprites/mono.png 8bpp 250 30 7 13 0 0 normal
-1 sprites/mono.png 8bpp 265 30 7 13 0 0 normal
-1 sprites/mono.png 8bpp 280 30 7 13 0 0 normal
-1 sprites/mono.png 8bpp 295 30 7 13 0 0 normal
-1 sprites/mono.png 8bpp 310 30 7 13 0 0 normal
-1 sprites/mono.png 8bpp 325 30 7 13 0 0 normal
-1 sprites/mono.png 8bpp 340 30 7 13 0 0 normal
-1 sprites/mono.png 8bpp 355 30 7 13 0 0 normal
-1 sprites/mono.png 8bpp 370 30 7 13 0 0 normal
-1 sprites/mono.png 8bpp 385 30 7 13 0 0 normal
-1 sprites/mono.png 8bpp 400 30 7 13 0 0 normal
-1 sprites/mono.png 8bpp 415 30 7 13 0 0 normal
-1 sprites/mono.png 8bpp 430 30 7 13 0 0 normal
-1 sprites/mono.png 8bpp 445 30 7 13 0 0 normal
-1 sprites/mono.png 8bpp 460 30 7 13 0 0 normal
-1 sprites/mono.png 8bpp 475 30 7 13 0 0 normal
-1 sprites/mono.png 8bpp 10 50 7 13 0 0 normal
-1 sprites/mono.png 8bpp 25 50 7 13 0 0 normal
-1 sprites/mono.png 8bpp 40 50 7 13 0 0 normal
-1 sprites/mono.png 8bpp 55 50 7 13 0 0 normal
-1 sprites/mono.png 8bpp 70 50 7 13 0 0 normal
-1 sprites/mono.png 8bpp 85 50 7 13 0 0 normal
-1 sprites/mono.png 8bpp 100 50 7 13 0 0 normal
-1 sprites/mono.png 8bpp 115 50 7 13 0 0 normal
-1 sprites/mono.png 8bpp 130 50 7 13 0 0 normal
-1 sprites/mono.png 8bpp 145 50 7 13 0 0 normal
-1 sprites/mono.png 8bpp 160 50 7 13 0 0 normal
-1 sprites/mono.png 8bpp 175 50 7 13 0 0 normal
-1 sprites/mono.png 8bpp 190 50 7 13 0 0 normal
-1 sprites/mono.png 8bpp 205 50 7 13 0 0 normal
-1 sprites/mono.png 8bpp 220 50 7 13 0 0 normal
-1 sprites/mono.png 8bpp 235 50 7 13 0 0 normal
-1 sprites/mono.png 8bpp 250 50 7 13 0 0 normal
-1 sprites/mono.png 8bpp 265 50 7 13 0 0 normal
-1 sprites/mono.png 8bpp 280 50 7 13 0 0 normal
-1 sprites/mono.png 8bpp 295 50 7 13 0 0 normal
-1 sprites/mono.png 8bpp 310 50 7 13 0 0 normal
-1 sprites/mono.png 8bpp 325 50 7 13 0 0 normal
-1 sprites/mono.png 8bpp 340 50 7 13 0 0 normal
-1 sprites/mono.png 8bpp 355 50 7 13 0 0 normal
-1 sprites/mono.png 8bpp 370 50 7 13 0 0 normal
-1 sprites/mono.png 8bpp 385 50 7 13 0 0 normal
-1 sprites/mono.png 8bpp 400 50 7 13 0 0 normal
-1 sprites/mono.png 8bpp 415 50 7 13 0 0 normal
-1 sprites/mono.png 8bpp 430 50 7 13 0 0 normal
-1 sprites/mono.png 8bpp 445 50 7 13 0 0 normal
-1 sprites/mono.png 8bpp 460 50 7 13 0 0 normal
-1 sprites/mono.png 8bpp 475 50 7 13 0 0 normal
-1 sprites/mono.png 8bpp 10 70 7 13 0 0 normal
-1 sprites/mono.png 8bpp 25 70 7 13 0 0 normal
-1 sprites/mono.png 8bpp 40 70 7 13 0 0 normal
-1 sprites/mono.png 8bpp 55 70 7 13 0 0 normal
-1 sprites/mono.png 8bpp 70 70 7 13 0 0 normal
-1 sprites/mono.png 8bpp 85 70 7 13 0 0 normal
-1 sprites/mono.png 8bpp 100 70 7 13 0 0 normal
-1 sprites/mono.png 8bpp 115 70 7 13 0 0 normal
-1 sprites/mono.png 8bpp 130 70 7 13 0 0 normal
-1 sprites/mono.png 8bpp 145 70 7 13 0 0 normal
-1 sprites/mono.png 8bpp 160 70 7 13 0 0 normal
-1 sprites/mono.png 8bpp 175 70 7 13 0 0 normal
-1 sprites/mono.png 8bpp 190 70 7 13 0 0 normal
-1 sprites/mono.png 8bpp 205 70 7 13 0 0 normal
-1 sprites/mono.png 8bpp 220 70 7 13 0 0 normal
-1 sprites/mono.png 8bpp 235 70 7 13 0 0 normal
-1 sprites/mono.png 8bpp 250 70 7 13 0 0 normal
-1 sprites/mono.png 8bpp 265 70 7 13 0 0 normal
-1 sprites/mono.png 8bpp 280 70 7 13 0 0 normal
-1 sprites/mono.png 8bpp 295 70 7 13 0 0 normal
-1 sprites/mono.png 8bpp 310 70 7 13 0 0 normal
-1 sprites/mono.png 8bpp 325 70 7 13 0 0 normal
-1 sprites/mono.png 8bpp 340 70 7 13 0 0 normal
-1 sprites/mono.png 8bpp 355 70 7 13 0 0 normal
-1 sprites/mono.png 8bpp 370 70 7 13 0 0 normal
-1 sprites/mono.png 8bpp 385 70 7 13 0 0 normal
-1 sprites/mono.png 8bpp 400 70 7 13 0 0 normal
-1 sprites/mono.png 8bpp 415 70 7 13 0 0 normal
-1 sprites/mono.png 8bpp 430 70 7 13 0 0 normal
-1 sprites/mono.png 8bpp 445 70 7 13 0 0 normal
-1 sprites/mono.png 8bpp 460 70 7 13 0 0 normal
-1 sprites/mono.png 8bpp 475 70 7 13 0 0 normal
-1 sprites/mono.png 8bpp 10 30 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 25 30 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 40 30 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 55 30 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 70 30 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 85 30 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 100 30 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 115 30 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 130 30 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 145 30 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 160 30 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 175 30 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 190 30 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 205 30 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 220 30 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 235 30 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 250 30 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 265 30 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 280 30 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 295 30 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 310 30 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 325 30 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 340 30 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 355 30 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 370 30 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 385 30 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 400 30 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 415 30 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 430 30 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 445 30 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 460 30 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 475 30 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 10 50 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 25 50 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 40 50 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 55 50 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 70 50 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 85 50 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 100 50 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 115 50 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 130 50 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 145 50 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 160 50 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 175 50 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 190 50 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 205 50 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 220 50 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 235 50 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 250 50 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 265 50 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 280 50 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 295 50 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 310 50 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 325 50 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 340 50 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 355 50 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 370 50 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 385 50 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 400 50 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 415 50 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 430 50 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 445 50 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 460 50 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 475 50 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 10 70 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 25 70 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 40 70 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 55 70 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 70 70 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 85 70 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 100 70 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 115 70 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 130 70 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 145 70 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 160 70 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 175 70 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 190 70 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 205 70 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 220 70 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 235 70 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 250 70 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 265 70 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 280 70 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 295 70 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 310 70 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 325 70 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 340 70 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 355 70 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 370 70 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 385 70 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 400 70 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 415 70 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 430 70 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 445 70 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 460 70 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 475 70 7 13 0 -2 normal
-1 * 0 12 01 03 80 80 00
-1 sprites/mono.png 8bpp 10 90 7 13 0 0 normal
-1 sprites/mono.png 8bpp 25 90 7 13 0 0 normal
-1 sprites/mono.png 8bpp 40 90 7 13 0 0 normal
-1 sprites/mono.png 8bpp 55 90 7 13 0 0 normal
-1 sprites/mono.png 8bpp 70 90 7 13 0 0 normal
-1 sprites/mono.png 8bpp 85 90 7 13 0 0 normal
-1 sprites/mono.png 8bpp 100 90 7 13 0 0 normal
-1 sprites/mono.png 8bpp 115 90 7 13 0 0 normal
-1 sprites/mono.png 8bpp 130 90 7 13 0 0 normal
-1 sprites/mono.png 8bpp 145 90 7 13 0 0 normal
-1 sprites/mono.png 8bpp 160 90 7 13 0 0 normal
-1 sprites/mono.png 8bpp 175 90 7 13 0 0 normal
-1 sprites/mono.png 8bpp 190 90 7 13 0 0 normal
-1 sprites/mono.png 8bpp 205 90 7 13 0 0 normal
-1 sprites/mono.png 8bpp 220 90 7 13 0 0 normal
-1 sprites/mono.png 8bpp 235 90 7 13 0 0 normal
-1 sprites/mono.png 8bpp 250 90 7 13 0 0 normal
-1 sprites/mono.png 8bpp 265 90 7 13 0 0 normal
-1 sprites/mono.png 8bpp 280 90 7 13 0 0 normal
-1 sprites/mono.png 8bpp 295 90 7 13 0 0 normal
-1 sprites/mono.png 8bpp 310 90 7 13 0 0 normal
-1 sprites/mono.png 8bpp 325 90 7 13 0 0 normal
-1 sprites/mono.png 8bpp 340 90 7 13 0 0 normal
-1 sprites/mono.png 8bpp 355 90 7 13 0 0 normal
-1 sprites/mono.png 8bpp 370 90 7 13 0 0 normal
-1 sprites/mono.png 8bpp 385 90 7 13 0 0 normal
-1 sprites/mono.png 8bpp 400 90 7 13 0 0 normal
-1 sprites/mono.png 8bpp 415 90 7 13 0 0 normal
-1 sprites/mono.png 8bpp 430 90 7 13 0 0 normal
-1 sprites/mono.png 8bpp 445 90 7 13 0 0 normal
-1 sprites/mono.png 8bpp 460 90 7 13 0 0 normal
-1 sprites/mono.png 8bpp 475 90 7 13 0 0 normal
-1 sprites/mono.png 8bpp 10 110 7 13 0 0 normal
-1 sprites/mono.png 8bpp 25 110 7 13 0 0 normal
-1 sprites/mono.png 8bpp 40 110 7 13 0 0 normal
-1 sprites/mono.png 8bpp 55 110 7 13 0 0 normal
-1 sprites/mono.png 8bpp 70 110 7 13 0 0 normal
-1 sprites/mono.png 8bpp 85 110 7 13 0 0 normal
-1 sprites/mono.png 8bpp 100 110 7 13 0 0 normal
-1 sprites/mono.png 8bpp 115 110 7 13 0 0 normal
-1 sprites/mono.png 8bpp 130 110 7 13 0 0 normal
-1 sprites/mono.png 8bpp 145 110 7 13 0 0 normal
-1 sprites/mono.png 8bpp 160 110 7 13 0 0 normal
-1 sprites/mono.png 8bpp 175 110 7 13 0 0 normal
-1 sprites/mono.png 8bpp 190 110 7 13 0 0 normal
-1 sprites/mono.png 8bpp 205 110 7 13 0 0 normal
-1 sprites/mono.png 8bpp 220 110 7 13 0 0 normal
-1 sprites/mono.png 8bpp 235 110 7 13 0 0 normal
-1 sprites/mono.png 8bpp 250 110 7 13 0 0 normal
-1 sprites/mono.png 8bpp 265 110 7 13 0 0 normal
-1 sprites/mono.png 8bpp 280 110 7 13 0 0 normal
-1 sprites/mono.png 8bpp 295 110 7 13 0 0 normal
-1 sprites/mono.png 8bpp 310 110 7 13 0 0 normal
-1 sprites/mono.png 8bpp 325 110 7 13 0 0 normal
-1 sprites/mono.png 8bpp 340 110 7 13 0 0 normal
-1 sprites/mono.png 8bpp 355 110 7 13 0 0 normal
-1 sprites/mono.png 8bpp 370 110 7 13 0 0 normal
-1 sprites/mono.png 8bpp 385 110 7 13 0 0 normal
-1 sprites/mono.png 8bpp 400 110 7 13 0 0 normal
-1 sprites/mono.png 8bpp 415 110 7 13 0 0 normal
-1 sprites/mono.png 8bpp 430 110 7 13 0 0 normal
-1 sprites/mono.png 8bpp 445 110 7 13 0 0 normal
-1 sprites/mono.png 8bpp 460 110 7 13 0 0 normal
-1 sprites/mono.png 8bpp 475 110 7 13 0 0 normal
-1 sprites/mono.png 8bpp 10 130 7 13 0 0 normal
-1 sprites/mono.png 8bpp 25 130 7 13 0 0 normal
-1 sprites/mono.png 8bpp 40 130 7 13 0 0 normal
-1 sprites/mono.png 8bpp 55 130 7 13 0 0 normal
-1 sprites/mono.png 8bpp 70 130 7 13 0 0 normal
-1 sprites/mono.png 8bpp 85 130 7 13 0 0 normal
-1 sprites/mono.png 8bpp 100 130 7 13 0 0 normal
-1 sprites/mono.png 8bpp 115 130 7 13 0 0 normal
-1 sprites/mono.png 8bpp 130 130 7 13 0 0 normal
-1 sprites/mono.png 8bpp 145 130 7 13 0 0 normal
-1 sprites/mono.png 8bpp 160 130 7 13 0 0 normal
-1 sprites/mono.png 8bpp 175 130 7 13 0 0 normal
-1 sprites/mono.png 8bpp 190 130 7 13 0 0 normal
-1 sprites/mono.png 8bpp 205 130 7 13 0 0 normal
-1 sprites/mono.png 8bpp 220 130 7 13 0 0 normal
-1 sprites/mono.png 8bpp 235 130 7 13 0 0 normal
-1 sprites/mono.png 8bpp 250 130 7 13 0 0 normal
-1 sprites/mono.png 8bpp 265 130 7 13 0 0 normal
-1 sprites/mono.png 8bpp 280 130 7 13 0 0 normal
-1 sprites/mono.png 8bpp 295 130 7 13 0 0 normal
-1 sprites/mono.png 8bpp 310 130 7 13 0 0 normal
-1 sprites/mono.png 8bpp 325 130 7 13 0 0 normal
-1 sprites/mono.png 8bpp 340 130 7 13 0 0 normal
-1 sprites/mono.png 8bpp 355 130 7 13 0 0 normal
-1 sprites/mono.png 8bpp 370 130 7 13 0 0 normal
-1 sprites/mono.png 8bpp 385 130 7 13 0 0 normal
-1 sprites/mono.png 8bpp 400 130 7 13 0 0 normal
-1 sprites/mono.png 8bpp 415 130 7 13 0 0 normal
-1 sprites/mono.png 8bpp 430 130 7 13 0 0 normal
-1 sprites/mono.png 8bpp 445 130 7 13 0 0 normal
-1 sprites/mono.png 8bpp 460 130 7 13 0 0 normal
-1 sprites/mono.png 8bpp 475 130 7 13 0 0 normal
-1 sprites/mono.png 8bpp 10 150 7 13 0 0 normal
-1 sprites/mono.png 8bpp 25 150 7 13 0 0 normal
-1 sprites/mono.png 8bpp 40 150 7 13 0 0 normal
-1 sprites/mono.png 8bpp 55 150 7 13 0 0 normal
-1 sprites/mono.png 8bpp 70 150 7 13 0 0 normal
-1 sprites/mono.png 8bpp 85 150 7 13 0 0 normal
-1 sprites/mono.png 8bpp 100 150 7 13 0 0 normal
-1 sprites/mono.png 8bpp 115 150 7 13 0 0 normal
-1 sprites/mono.png 8bpp 130 150 7 13 0 0 normal
-1 sprites/mono.png 8bpp 145 150 7 13 0 0 normal
-1 sprites/mono.png 8bpp 160 150 7 13 0 0 normal
-1 sprites/mono.png 8bpp 175 150 7 13 0 0 normal
-1 sprites/mono.png 8bpp 190 150 7 13 0 0 normal
-1 sprites/mono.png 8bpp 205 150 7 13 0 0 normal
-1 sprites/mono.png 8bpp 220 150 7 13 0 0 normal
-1 sprites/mono.png 8bpp 235 150 7 13 0 0 normal
-1 sprites/mono.png 8bpp 250 150 7 13 0 0 normal
-1 sprites/mono.png 8bpp 265 150 7 13 0 0 normal
-1 sprites/mono.png 8bpp 280 150 7 13 0 0 normal
-1 sprites/mono.png 8bpp 295 150 7 13 0 0 normal
-1 sprites/mono.png 8bpp 310 150 7 13 0 0 normal
-1 sprites/mono.png 8bpp 325 150 7 13 0 0 normal
-1 sprites/mono.png 8bpp 340 150 7 13 0 0 normal
-1 sprites/mono.png 8bpp 355 150 7 13 0 0 normal
-1 sprites/mono.png 8bpp 370 150 7 13 0 0 normal
-1 sprites/mono.png 8bpp 385 150 7 13 0 0 normal
-1 sprites/mono.png 8bpp 400 150 7 13 0 0 normal
-1 sprites/mono.png 8bpp 415 150 7 13 0 0 normal
-1 sprites/mono.png 8bpp 430 150 7 13 0 0 normal
-1 sprites/mono.png 8bpp 445 150 7 13 0 0 normal
-1 sprites/mono.png 8bpp 460 150 7 13 0 0 normal
-1 sprites/mono.png 8bpp 475 150 7 13 0 0 normal
-1 sprites/mono.png 8bpp 10 90 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 25 90 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 40 90 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 55 90 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 70 90 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 85 90 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 100 90 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 115 90 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 130 90 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 145 90 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 160 90 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 175 90 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 190 90 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 205 90 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 220 90 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 235 90 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 250 90 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 265 90 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 280 90 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 295 90 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 310 90 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 325 90 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 340 90 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 355 90 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 370 90 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 385 90 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 400 90 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 415 90 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 430 90 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 445 90 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 460 90 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 475 90 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 10 110 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 25 110 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 40 110 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 55 110 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 70 110 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 85 110 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 100 110 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 115 110 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 130 110 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 145 110 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 160 110 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 175 110 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 190 110 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 205 110 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 220 110 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 235 110 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 250 110 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 265 110 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 280 110 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 295 110 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 310 110 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 325 110 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 340 110 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 355 110 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 370 110 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 385 110 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 400 110 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 415 110 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 430 110 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 445 110 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 460 110 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 475 110 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 10 130 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 25 130 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 40 130 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 55 130 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 70 130 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 85 130 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 100 130 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 115 130 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 130 130 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 145 130 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 160 130 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 175 130 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 190 130 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 205 130 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 220 130 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 235 130 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 250 130 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 265 130 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 280 130 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 295 130 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 310 130 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 325 130 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 340 130 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 355 130 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 370 130 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 385 130 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 400 130 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 415 130 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 430 130 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 445 130 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 460 130 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 475 130 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 10 150 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 25 150 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 40 150 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 55 150 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 70 150 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 85 150 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 100 150 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 115 150 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 130 150 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 145 150 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 160 150 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 175 150 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 190 150 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 205 150 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 220 150 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 235 150 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 250 150 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 265 150 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 280 150 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 295 150 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 310 150 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 325 150 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 340 150 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 355 150 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 370 150 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 385 150 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 400 150 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 415 150 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 430 150 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 445 150 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 460 150 7 13 0 -2 normal
-1 sprites/mono.png 8bpp 475 150 7 13 0 -2 normal
//U+0178 Latin Capital Letter Y With Diaeresis (only needed for mono as it is in the base set, but relocated by some code)
-1 * 0 12 01 03 01 78 01
-1 sprites/mono.png 8bpp 370 230 7 13 0 0 normal
-1 sprites/mono.png 8bpp 370 230 7 13 0 -2 normal

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1 @@
5fdc049a7a0ada4c280239f15bc38174

View File

@@ -6,9 +6,35 @@
if(GRFCODEC_FOUND)
include(CreateGrfCommand)
create_grf_command(
# We share some files with 'openttd' grf
${CMAKE_CURRENT_SOURCE_DIR}/../openttd/airports.png
${CMAKE_CURRENT_SOURCE_DIR}/../openttd/canals.png
${CMAKE_CURRENT_SOURCE_DIR}/../openttd/chars.png
NFO_SOURCE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/rivers/arctic.nfo
${CMAKE_CURRENT_SOURCE_DIR}/rivers/rapids.nfo
${CMAKE_CURRENT_SOURCE_DIR}/rivers/temperate.nfo
${CMAKE_CURRENT_SOURCE_DIR}/rivers/toyland.nfo
${CMAKE_CURRENT_SOURCE_DIR}/rivers/toyland_rapids.nfo
${CMAKE_CURRENT_SOURCE_DIR}/rivers/tropic.nfo
${CMAKE_CURRENT_SOURCE_DIR}/airports_orig_extra.nfo
${CMAKE_CURRENT_SOURCE_DIR}/canals_extra.nfo
${CMAKE_CURRENT_SOURCE_DIR}/chars_orig_extra.nfo
${CMAKE_CURRENT_SOURCE_DIR}/fix_graphics.nfo
${CMAKE_CURRENT_SOURCE_DIR}/fix_gui_icons.nfo
${CMAKE_CURRENT_SOURCE_DIR}/orig_extra.nfo
${CMAKE_CURRENT_SOURCE_DIR}/shore.nfo
PNG_SOURCE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/rivers/arctic_brown.png
${CMAKE_CURRENT_SOURCE_DIR}/rivers/arctic_snowy.png
${CMAKE_CURRENT_SOURCE_DIR}/rivers/rapids.png
${CMAKE_CURRENT_SOURCE_DIR}/rivers/rapids_shading.png
${CMAKE_CURRENT_SOURCE_DIR}/rivers/temperate.png
${CMAKE_CURRENT_SOURCE_DIR}/rivers/toyland.png
${CMAKE_CURRENT_SOURCE_DIR}/rivers/toyland_rapids.png
${CMAKE_CURRENT_SOURCE_DIR}/rivers/toyland_rapids_shading.png
${CMAKE_CURRENT_SOURCE_DIR}/rivers/tropic_desert.png
${CMAKE_CURRENT_SOURCE_DIR}/rivers/tropic_forest.png
${CMAKE_CURRENT_SOURCE_DIR}/fix_graphics.png
${CMAKE_CURRENT_SOURCE_DIR}/fix_gui_icons.png
${CMAKE_CURRENT_SOURCE_DIR}/shore.png
# We share some files with 'openttd' grf
${CMAKE_CURRENT_SOURCE_DIR}/../openttd/airports.png
${CMAKE_CURRENT_SOURCE_DIR}/../openttd/canals.png
${CMAKE_CURRENT_SOURCE_DIR}/../openttd/chars.png
)
endif()

View File

@@ -79,6 +79,7 @@
#include "airports_orig_extra.nfo"
#include "canals_extra.nfo"
#include "rivers/rapids.nfo"
#include "rivers/toyland_rapids.nfo"
#include "rivers/temperate.nfo"
#include "rivers/arctic.nfo"
#include "rivers/tropic.nfo"

View File

@@ -5,115 +5,243 @@
//
-1 * 0 0C "Rapid graphics"
-1 * 4 01 05 01 04
-1 sprites/rapids.png 8bpp 10 10 64 23 -31 0 normal
-1 sprites/rapids.png 8bpp 90 10 64 39 -31 -8 normal
-1 sprites/rapids.png 8bpp 170 10 64 23 -31 0 normal
-1 sprites/rapids.png 8bpp 250 10 64 39 -31 -8 normal
-1 sprites/rapids.png 8bpp 10 10 64 23 -31 0 normal
| sprites/rapids_shading.png 32bpp 10 10 64 23 -31 0 normal
| sprites/rapids.png mask 10 10
-1 sprites/rapids.png 8bpp 90 10 64 39 -31 -8 normal
| sprites/rapids_shading.png 32bpp 90 10 64 39 -31 -8 normal
| sprites/rapids.png mask 90 10
-1 sprites/rapids.png 8bpp 170 10 64 23 -31 0 normal
| sprites/rapids_shading.png 32bpp 170 10 64 23 -31 0 normal
| sprites/rapids.png mask 170 10
-1 sprites/rapids.png 8bpp 250 10 64 39 -31 -8 normal
| sprites/rapids_shading.png 32bpp 250 10 64 39 -31 -8 normal
| sprites/rapids.png mask 250 10
-1 * 7 02 05 00 01 00 00 00
-1 * 4 01 05 01 04
-1 sprites/rapids.png 8bpp 10 60 64 23 -31 0 normal
-1 sprites/rapids.png 8bpp 90 60 64 39 -31 -8 normal
-1 sprites/rapids.png 8bpp 170 60 64 23 -31 0 normal
-1 sprites/rapids.png 8bpp 250 60 64 39 -31 -8 normal
-1 sprites/rapids.png 8bpp 10 60 64 23 -31 0 normal
| sprites/rapids_shading.png 32bpp 10 60 64 23 -31 0 normal
| sprites/rapids.png mask 10 60
-1 sprites/rapids.png 8bpp 90 60 64 39 -31 -8 normal
| sprites/rapids_shading.png 32bpp 90 60 64 39 -31 -8 normal
| sprites/rapids.png mask 90 60
-1 sprites/rapids.png 8bpp 170 60 64 23 -31 0 normal
| sprites/rapids_shading.png 32bpp 170 60 64 23 -31 0 normal
| sprites/rapids.png mask 170 60
-1 sprites/rapids.png 8bpp 250 60 64 39 -31 -8 normal
| sprites/rapids_shading.png 32bpp 250 60 64 39 -31 -8 normal
| sprites/rapids.png mask 250 60
-1 * 7 02 05 01 01 00 00 00
-1 * 4 01 05 01 04
-1 sprites/rapids.png 8bpp 10 110 64 23 -31 0 normal
-1 sprites/rapids.png 8bpp 90 110 64 39 -31 -8 normal
-1 sprites/rapids.png 8bpp 170 110 64 23 -31 0 normal
-1 sprites/rapids.png 8bpp 250 110 64 39 -31 -8 normal
-1 sprites/rapids.png 8bpp 10 110 64 23 -31 0 normal
| sprites/rapids_shading.png 32bpp 10 110 64 23 -31 0 normal
| sprites/rapids.png mask 10 110
-1 sprites/rapids.png 8bpp 90 110 64 39 -31 -8 normal
| sprites/rapids_shading.png 32bpp 90 110 64 39 -31 -8 normal
| sprites/rapids.png mask 90 110
-1 sprites/rapids.png 8bpp 170 110 64 23 -31 0 normal
| sprites/rapids_shading.png 32bpp 170 110 64 23 -31 0 normal
| sprites/rapids.png mask 170 110
-1 sprites/rapids.png 8bpp 250 110 64 39 -31 -8 normal
| sprites/rapids_shading.png 32bpp 250 110 64 39 -31 -8 normal
| sprites/rapids.png mask 250 110
-1 * 7 02 05 02 01 00 00 00
-1 * 4 01 05 01 04
-1 sprites/rapids.png 8bpp 10 160 64 23 -31 0 normal
-1 sprites/rapids.png 8bpp 90 160 64 39 -31 -8 normal
-1 sprites/rapids.png 8bpp 170 160 64 23 -31 0 normal
-1 sprites/rapids.png 8bpp 250 160 64 39 -31 -8 normal
-1 sprites/rapids.png 8bpp 10 160 64 23 -31 0 normal
| sprites/rapids_shading.png 32bpp 10 160 64 23 -31 0 normal
| sprites/rapids.png mask 10 160
-1 sprites/rapids.png 8bpp 90 160 64 39 -31 -8 normal
| sprites/rapids_shading.png 32bpp 90 160 64 39 -31 -8 normal
| sprites/rapids.png mask 90 160
-1 sprites/rapids.png 8bpp 170 160 64 23 -31 0 normal
| sprites/rapids_shading.png 32bpp 170 160 64 23 -31 0 normal
| sprites/rapids.png mask 170 160
-1 sprites/rapids.png 8bpp 250 160 64 39 -31 -8 normal
| sprites/rapids_shading.png 32bpp 250 160 64 39 -31 -8 normal
| sprites/rapids.png mask 250 160
-1 * 7 02 05 03 01 00 00 00
-1 * 4 01 05 01 04
-1 sprites/rapids.png 8bpp 10 210 64 23 -31 0 normal
-1 sprites/rapids.png 8bpp 90 210 64 39 -31 -8 normal
-1 sprites/rapids.png 8bpp 170 210 64 23 -31 0 normal
-1 sprites/rapids.png 8bpp 250 210 64 39 -31 -8 normal
-1 sprites/rapids.png 8bpp 10 210 64 23 -31 0 normal
| sprites/rapids_shading.png 32bpp 10 210 64 23 -31 0 normal
| sprites/rapids.png mask 10 210
-1 sprites/rapids.png 8bpp 90 210 64 39 -31 -8 normal
| sprites/rapids_shading.png 32bpp 90 210 64 39 -31 -8 normal
| sprites/rapids.png mask 90 210
-1 sprites/rapids.png 8bpp 170 210 64 23 -31 0 normal
| sprites/rapids_shading.png 32bpp 170 210 64 23 -31 0 normal
| sprites/rapids.png mask 170 210
-1 sprites/rapids.png 8bpp 250 210 64 39 -31 -8 normal
| sprites/rapids_shading.png 32bpp 250 210 64 39 -31 -8 normal
| sprites/rapids.png mask 250 210
-1 * 7 02 05 04 01 00 00 00
-1 * 4 01 05 01 04
-1 sprites/rapids.png 8bpp 10 260 64 23 -31 0 normal
-1 sprites/rapids.png 8bpp 90 260 64 39 -31 -8 normal
-1 sprites/rapids.png 8bpp 170 260 64 23 -31 0 normal
-1 sprites/rapids.png 8bpp 250 260 64 39 -31 -8 normal
-1 sprites/rapids.png 8bpp 10 260 64 23 -31 0 normal
| sprites/rapids_shading.png 32bpp 10 260 64 23 -31 0 normal
| sprites/rapids.png mask 10 260
-1 sprites/rapids.png 8bpp 90 260 64 39 -31 -8 normal
| sprites/rapids_shading.png 32bpp 90 260 64 39 -31 -8 normal
| sprites/rapids.png mask 90 260
-1 sprites/rapids.png 8bpp 170 260 64 23 -31 0 normal
| sprites/rapids_shading.png 32bpp 170 260 64 23 -31 0 normal
| sprites/rapids.png mask 170 260
-1 sprites/rapids.png 8bpp 250 260 64 39 -31 -8 normal
| sprites/rapids_shading.png 32bpp 250 260 64 39 -31 -8 normal
| sprites/rapids.png mask 250 260
-1 * 7 02 05 05 01 00 00 00
-1 * 4 01 05 01 04
-1 sprites/rapids.png 8bpp 10 310 64 23 -31 0 normal
-1 sprites/rapids.png 8bpp 90 310 64 39 -31 -8 normal
-1 sprites/rapids.png 8bpp 170 310 64 23 -31 0 normal
-1 sprites/rapids.png 8bpp 250 310 64 39 -31 -8 normal
-1 sprites/rapids.png 8bpp 10 310 64 23 -31 0 normal
| sprites/rapids_shading.png 32bpp 10 310 64 23 -31 0 normal
| sprites/rapids.png mask 10 310
-1 sprites/rapids.png 8bpp 90 310 64 39 -31 -8 normal
| sprites/rapids_shading.png 32bpp 90 310 64 39 -31 -8 normal
| sprites/rapids.png mask 90 310
-1 sprites/rapids.png 8bpp 170 310 64 23 -31 0 normal
| sprites/rapids_shading.png 32bpp 170 310 64 23 -31 0 normal
| sprites/rapids.png mask 170 310
-1 sprites/rapids.png 8bpp 250 310 64 39 -31 -8 normal
| sprites/rapids_shading.png 32bpp 250 310 64 39 -31 -8 normal
| sprites/rapids.png mask 250 310
-1 * 7 02 05 06 01 00 00 00
-1 * 4 01 05 01 04
-1 sprites/rapids.png 8bpp 10 360 64 23 -31 0 normal
-1 sprites/rapids.png 8bpp 90 360 64 39 -31 -8 normal
-1 sprites/rapids.png 8bpp 170 360 64 23 -31 0 normal
-1 sprites/rapids.png 8bpp 250 360 64 39 -31 -8 normal
-1 sprites/rapids.png 8bpp 10 360 64 23 -31 0 normal
| sprites/rapids_shading.png 32bpp 10 360 64 23 -31 0 normal
| sprites/rapids.png mask 10 360
-1 sprites/rapids.png 8bpp 90 360 64 39 -31 -8 normal
| sprites/rapids_shading.png 32bpp 90 360 64 39 -31 -8 normal
| sprites/rapids.png mask 90 360
-1 sprites/rapids.png 8bpp 170 360 64 23 -31 0 normal
| sprites/rapids_shading.png 32bpp 170 360 64 23 -31 0 normal
| sprites/rapids.png mask 170 360
-1 sprites/rapids.png 8bpp 250 360 64 39 -31 -8 normal
| sprites/rapids_shading.png 32bpp 250 360 64 39 -31 -8 normal
| sprites/rapids.png mask 250 360
-1 * 7 02 05 07 01 00 00 00
-1 * 4 01 05 01 04
-1 sprites/rapids.png 8bpp 10 410 64 23 -31 0 normal
-1 sprites/rapids.png 8bpp 90 410 64 39 -31 -8 normal
-1 sprites/rapids.png 8bpp 170 410 64 23 -31 0 normal
-1 sprites/rapids.png 8bpp 250 410 64 39 -31 -8 normal
-1 sprites/rapids.png 8bpp 10 410 64 23 -31 0 normal
| sprites/rapids_shading.png 32bpp 10 410 64 23 -31 0 normal
| sprites/rapids.png mask 10 410
-1 sprites/rapids.png 8bpp 90 410 64 39 -31 -8 normal
| sprites/rapids_shading.png 32bpp 90 410 64 39 -31 -8 normal
| sprites/rapids.png mask 90 410
-1 sprites/rapids.png 8bpp 170 410 64 23 -31 0 normal
| sprites/rapids_shading.png 32bpp 170 410 64 23 -31 0 normal
| sprites/rapids.png mask 170 410
-1 sprites/rapids.png 8bpp 250 410 64 39 -31 -8 normal
| sprites/rapids_shading.png 32bpp 250 410 64 39 -31 -8 normal
| sprites/rapids.png mask 250 410
-1 * 7 02 05 08 01 00 00 00
-1 * 4 01 05 01 04
-1 sprites/rapids.png 8bpp 10 460 64 23 -31 0 normal
-1 sprites/rapids.png 8bpp 90 460 64 39 -31 -8 normal
-1 sprites/rapids.png 8bpp 170 460 64 23 -31 0 normal
-1 sprites/rapids.png 8bpp 250 460 64 39 -31 -8 normal
-1 sprites/rapids.png 8bpp 10 460 64 23 -31 0 normal
| sprites/rapids_shading.png 32bpp 10 460 64 23 -31 0 normal
| sprites/rapids.png mask 10 460
-1 sprites/rapids.png 8bpp 90 460 64 39 -31 -8 normal
| sprites/rapids_shading.png 32bpp 90 460 64 39 -31 -8 normal
| sprites/rapids.png mask 90 460
-1 sprites/rapids.png 8bpp 170 460 64 23 -31 0 normal
| sprites/rapids_shading.png 32bpp 170 460 64 23 -31 0 normal
| sprites/rapids.png mask 170 460
-1 sprites/rapids.png 8bpp 250 460 64 39 -31 -8 normal
| sprites/rapids_shading.png 32bpp 250 460 64 39 -31 -8 normal
| sprites/rapids.png mask 250 460
-1 * 7 02 05 09 01 00 00 00
-1 * 4 01 05 01 04
-1 sprites/rapids.png 8bpp 10 510 64 23 -31 0 normal
-1 sprites/rapids.png 8bpp 90 510 64 39 -31 -8 normal
-1 sprites/rapids.png 8bpp 170 510 64 23 -31 0 normal
-1 sprites/rapids.png 8bpp 250 510 64 39 -31 -8 normal
-1 sprites/rapids.png 8bpp 10 510 64 23 -31 0 normal
| sprites/rapids_shading.png 32bpp 10 510 64 23 -31 0 normal
| sprites/rapids.png mask 10 510
-1 sprites/rapids.png 8bpp 90 510 64 39 -31 -8 normal
| sprites/rapids_shading.png 32bpp 90 510 64 39 -31 -8 normal
| sprites/rapids.png mask 90 510
-1 sprites/rapids.png 8bpp 170 510 64 23 -31 0 normal
| sprites/rapids_shading.png 32bpp 170 510 64 23 -31 0 normal
| sprites/rapids.png mask 170 510
-1 sprites/rapids.png 8bpp 250 510 64 39 -31 -8 normal
| sprites/rapids_shading.png 32bpp 250 510 64 39 -31 -8 normal
| sprites/rapids.png mask 250 510
-1 * 7 02 05 0A 01 00 00 00
-1 * 4 01 05 01 04
-1 sprites/rapids.png 8bpp 10 560 64 23 -31 0 normal
-1 sprites/rapids.png 8bpp 90 560 64 39 -31 -8 normal
-1 sprites/rapids.png 8bpp 170 560 64 23 -31 0 normal
-1 sprites/rapids.png 8bpp 250 560 64 39 -31 -8 normal
-1 sprites/rapids.png 8bpp 10 560 64 23 -31 0 normal
| sprites/rapids_shading.png 32bpp 10 560 64 23 -31 0 normal
| sprites/rapids.png mask 10 560
-1 sprites/rapids.png 8bpp 90 560 64 39 -31 -8 normal
| sprites/rapids_shading.png 32bpp 90 560 64 39 -31 -8 normal
| sprites/rapids.png mask 90 560
-1 sprites/rapids.png 8bpp 170 560 64 23 -31 0 normal
| sprites/rapids_shading.png 32bpp 170 560 64 23 -31 0 normal
| sprites/rapids.png mask 170 560
-1 sprites/rapids.png 8bpp 250 560 64 39 -31 -8 normal
| sprites/rapids_shading.png 32bpp 250 560 64 39 -31 -8 normal
| sprites/rapids.png mask 250 560
-1 * 7 02 05 0B 01 00 00 00
-1 * 4 01 05 01 04
-1 sprites/rapids.png 8bpp 10 610 64 23 -31 0 normal
-1 sprites/rapids.png 8bpp 90 610 64 39 -31 -8 normal
-1 sprites/rapids.png 8bpp 170 610 64 23 -31 0 normal
-1 sprites/rapids.png 8bpp 250 610 64 39 -31 -8 normal
-1 sprites/rapids.png 8bpp 10 610 64 23 -31 0 normal
| sprites/rapids_shading.png 32bpp 10 610 64 23 -31 0 normal
| sprites/rapids.png mask 10 610
-1 sprites/rapids.png 8bpp 90 610 64 39 -31 -8 normal
| sprites/rapids_shading.png 32bpp 90 610 64 39 -31 -8 normal
| sprites/rapids.png mask 90 610
-1 sprites/rapids.png 8bpp 170 610 64 23 -31 0 normal
| sprites/rapids_shading.png 32bpp 170 610 64 23 -31 0 normal
| sprites/rapids.png mask 170 610
-1 sprites/rapids.png 8bpp 250 610 64 39 -31 -8 normal
| sprites/rapids_shading.png 32bpp 250 610 64 39 -31 -8 normal
| sprites/rapids.png mask 250 610
-1 * 7 02 05 0C 01 00 00 00
-1 * 4 01 05 01 04
-1 sprites/rapids.png 8bpp 10 660 64 23 -31 0 normal
-1 sprites/rapids.png 8bpp 90 660 64 39 -31 -8 normal
-1 sprites/rapids.png 8bpp 170 660 64 23 -31 0 normal
-1 sprites/rapids.png 8bpp 250 660 64 39 -31 -8 normal
-1 sprites/rapids.png 8bpp 10 660 64 23 -31 0 normal
| sprites/rapids_shading.png 32bpp 10 660 64 23 -31 0 normal
| sprites/rapids.png mask 10 660
-1 sprites/rapids.png 8bpp 90 660 64 39 -31 -8 normal
| sprites/rapids_shading.png 32bpp 90 660 64 39 -31 -8 normal
| sprites/rapids.png mask 90 660
-1 sprites/rapids.png 8bpp 170 660 64 23 -31 0 normal
| sprites/rapids_shading.png 32bpp 170 660 64 23 -31 0 normal
| sprites/rapids.png mask 170 660
-1 sprites/rapids.png 8bpp 250 660 64 39 -31 -8 normal
| sprites/rapids_shading.png 32bpp 250 660 64 39 -31 -8 normal
| sprites/rapids.png mask 250 660
-1 * 7 02 05 0D 01 00 00 00
-1 * 4 01 05 01 04
-1 sprites/rapids.png 8bpp 10 710 64 23 -31 0 normal
-1 sprites/rapids.png 8bpp 90 710 64 39 -31 -8 normal
-1 sprites/rapids.png 8bpp 170 710 64 23 -31 0 normal
-1 sprites/rapids.png 8bpp 250 710 64 39 -31 -8 normal
-1 sprites/rapids.png 8bpp 10 710 64 23 -31 0 normal
| sprites/rapids_shading.png 32bpp 10 710 64 23 -31 0 normal
| sprites/rapids.png mask 10 710
-1 sprites/rapids.png 8bpp 90 710 64 39 -31 -8 normal
| sprites/rapids_shading.png 32bpp 90 710 64 39 -31 -8 normal
| sprites/rapids.png mask 90 710
-1 sprites/rapids.png 8bpp 170 710 64 23 -31 0 normal
| sprites/rapids_shading.png 32bpp 170 710 64 23 -31 0 normal
| sprites/rapids.png mask 170 710
-1 sprites/rapids.png 8bpp 250 710 64 39 -31 -8 normal
| sprites/rapids_shading.png 32bpp 250 710 64 39 -31 -8 normal
| sprites/rapids.png mask 250 710
-1 * 7 02 05 0E 01 00 00 00
-1 * 4 01 05 01 04
-1 sprites/rapids.png 8bpp 10 760 64 23 -31 0 normal
-1 sprites/rapids.png 8bpp 90 760 64 39 -31 -8 normal
-1 sprites/rapids.png 8bpp 170 760 64 23 -31 0 normal
-1 sprites/rapids.png 8bpp 250 760 64 39 -31 -8 normal
-1 sprites/rapids.png 8bpp 10 760 64 23 -31 0 normal
| sprites/rapids_shading.png 32bpp 10 760 64 23 -31 0 normal
| sprites/rapids.png mask 10 760
-1 sprites/rapids.png 8bpp 90 760 64 39 -31 -8 normal
| sprites/rapids_shading.png 32bpp 90 760 64 39 -31 -8 normal
| sprites/rapids.png mask 90 760
-1 sprites/rapids.png 8bpp 170 760 64 23 -31 0 normal
| sprites/rapids_shading.png 32bpp 170 760 64 23 -31 0 normal
| sprites/rapids.png mask 170 760
-1 sprites/rapids.png 8bpp 250 760 64 39 -31 -8 normal
| sprites/rapids_shading.png 32bpp 250 760 64 39 -31 -8 normal
| sprites/rapids.png mask 250 760
-1 * 7 02 05 0F 01 00 00 00
-1 * 39 02 05 10 80 00 01 10

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

View File

@@ -3,7 +3,7 @@
// OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
// See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
//
-1 * 0 0C "Toyland river graphics by andythenorth (Andrew Parkhouse)"
-1 * 0 0C "Toyland river graphics by zephyris (Richard Wheeler)"
-1 * 4 01 05 01 3C
-1 sprites/toyland.png 8bpp 10 10 38 19 -5 0 normal
-1 sprites/toyland.png 8bpp 58 10 38 18 -5 13 normal

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 34 KiB

View File

@@ -0,0 +1,73 @@
// This file is part of OpenTTD.
// OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
// OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
// See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
//
-1 * 0 0C "Toyland rapid graphics by zephyris (Richard Wheeler)"
-1 * 4 01 05 01 04
-1 sprites/toyland_rapids.png 8bpp 10 10 64 23 -31 0 normal
| sprites/toyland_rapids_shading.png 32bpp 10 10 64 23 -31 0 normal
| sprites/toyland_rapids.png mask 10 10
-1 sprites/toyland_rapids.png 8bpp 90 10 64 39 -31 -8 normal
| sprites/toyland_rapids_shading.png 32bpp 90 10 64 39 -31 -8 normal
| sprites/toyland_rapids.png mask 90 10
-1 sprites/toyland_rapids.png 8bpp 170 10 64 23 -31 0 normal
| sprites/toyland_rapids_shading.png 32bpp 170 10 64 23 -31 0 normal
| sprites/toyland_rapids.png mask 170 10
-1 sprites/toyland_rapids.png 8bpp 250 10 64 39 -31 -8 normal
| sprites/toyland_rapids_shading.png 32bpp 250 10 64 39 -31 -8 normal
| sprites/toyland_rapids.png mask 250 10
-1 * 7 02 05 00 01 00 00 00
-1 * 4 01 05 01 04
-1 sprites/toyland_rapids.png 8bpp 10 60 64 23 -31 0 normal
| sprites/toyland_rapids_shading.png 32bpp 10 60 64 23 -31 0 normal
| sprites/toyland_rapids.png mask 10 60
-1 sprites/toyland_rapids.png 8bpp 90 60 64 39 -31 -8 normal
| sprites/toyland_rapids_shading.png 32bpp 90 60 64 39 -31 -8 normal
| sprites/toyland_rapids.png mask 90 60
-1 sprites/toyland_rapids.png 8bpp 170 60 64 23 -31 0 normal
| sprites/toyland_rapids_shading.png 32bpp 170 60 64 23 -31 0 normal
| sprites/toyland_rapids.png mask 170 60
-1 sprites/toyland_rapids.png 8bpp 250 60 64 39 -31 -8 normal
| sprites/toyland_rapids_shading.png 32bpp 250 60 64 39 -31 -8 normal
| sprites/toyland_rapids.png mask 250 60
-1 * 7 02 05 01 01 00 00 00
-1 * 4 01 05 01 04
-1 sprites/toyland_rapids.png 8bpp 10 110 64 23 -31 0 normal
| sprites/toyland_rapids_shading.png 32bpp 10 110 64 23 -31 0 normal
| sprites/toyland_rapids.png mask 10 110
-1 sprites/toyland_rapids.png 8bpp 90 110 64 39 -31 -8 normal
| sprites/toyland_rapids_shading.png 32bpp 90 110 64 39 -31 -8 normal
| sprites/toyland_rapids.png mask 90 110
-1 sprites/toyland_rapids.png 8bpp 170 110 64 23 -31 0 normal
| sprites/toyland_rapids_shading.png 32bpp 170 110 64 23 -31 0 normal
| sprites/toyland_rapids.png mask 170 110
-1 sprites/toyland_rapids.png 8bpp 250 110 64 39 -31 -8 normal
| sprites/toyland_rapids_shading.png 32bpp 250 110 64 39 -31 -8 normal
| sprites/toyland_rapids.png mask 250 110
-1 * 7 02 05 02 01 00 00 00
-1 * 4 01 05 01 04
-1 sprites/toyland_rapids.png 8bpp 10 160 64 23 -31 0 normal
| sprites/toyland_rapids_shading.png 32bpp 10 160 64 23 -31 0 normal
| sprites/toyland_rapids.png mask 10 160
-1 sprites/toyland_rapids.png 8bpp 90 160 64 39 -31 -8 normal
| sprites/toyland_rapids_shading.png 32bpp 90 160 64 39 -31 -8 normal
| sprites/toyland_rapids.png mask 90 160
-1 sprites/toyland_rapids.png 8bpp 170 160 64 23 -31 0 normal
| sprites/toyland_rapids_shading.png 32bpp 170 160 64 23 -31 0 normal
| sprites/toyland_rapids.png mask 170 160
-1 sprites/toyland_rapids.png 8bpp 250 160 64 39 -31 -8 normal
| sprites/toyland_rapids_shading.png 32bpp 250 160 64 39 -31 -8 normal
| sprites/toyland_rapids.png mask 250 160
-1 * 7 02 05 03 01 00 00 00
-1 * 39 02 05 10 80 00 01 04
00 00
01 00
02 00
03 00
-1 * 6 07 83 01 \7! 03 01
-1 * 7 03 05 01 05 00 10 00

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

View File

@@ -1,4 +1,4 @@
FROM emscripten/emsdk:3.1.28
FROM emscripten/emsdk:3.1.42
COPY emsdk-liblzma.patch /
RUN cd /emsdk/upstream/emscripten && patch -p1 < /emsdk-liblzma.patch

View File

@@ -7,7 +7,7 @@ It takes care of a few things:
First, build the docker image by navigating in the folder this `README.md` is in, and executing:
```
docker build -t emsdk-lzma .
docker build -t emsdk-openttd .
```
Next, navigate back to the root folder of this project.
@@ -15,15 +15,15 @@ Next, navigate back to the root folder of this project.
Now we build the host tools first:
```
mkdir build-host
docker run -it --rm -v $(pwd):$(pwd) -u $(id -u):$(id -g) --workdir $(pwd)/build-host emsdk-lzma cmake .. -DOPTION_TOOLS_ONLY=ON
docker run -it --rm -v $(pwd):$(pwd) -u $(id -u):$(id -g) --workdir $(pwd)/build-host emsdk-lzma make -j$(nproc) tools
docker run -it --rm -v $(pwd):$(pwd) -u $(id -u):$(id -g) --workdir $(pwd)/build-host emsdk-openttd cmake .. -DOPTION_TOOLS_ONLY=ON
docker run -it --rm -v $(pwd):$(pwd) -u $(id -u):$(id -g) --workdir $(pwd)/build-host emsdk-openttd make -j$(nproc) tools
```
Finally, we build the actual game:
```
mkdir build
docker run -it --rm -v $(pwd):$(pwd) -u $(id -u):$(id -g) --workdir $(pwd)/build emsdk-lzma emcmake cmake .. -DHOST_BINARY_DIR=../build-host -DCMAKE_BUILD_TYPE=Release -DOPTION_USE_ASSERTS=OFF
docker run -it --rm -v $(pwd):$(pwd) -u $(id -u):$(id -g) --workdir $(pwd)/build emsdk-lzma emmake make -j$(nproc)
docker run -it --rm -v $(pwd):$(pwd) -u $(id -u):$(id -g) --workdir $(pwd)/build emsdk-openttd emcmake cmake .. -DHOST_BINARY_DIR=../build-host -DCMAKE_BUILD_TYPE=Release -DOPTION_USE_ASSERTS=OFF
docker run -it --rm -v $(pwd):$(pwd) -u $(id -u):$(id -g) --workdir $(pwd)/build emsdk-openttd emmake make -j$(nproc)
```
In the `build` folder you will now see `openttd.html`.

View File

@@ -1,5 +1,5 @@
# LibLZMA is a recent addition to the emscripten SDK, so it is possible
# someone hasn't updated their SDK yet. Test out if the SDK supports LibLZMA.
# LibLZMA is a custom addition to the emscripten SDK, so it is possible
# someone patched their SDK. Test out if the SDK supports LibLZMA.
include(CheckCXXSourceCompiles)
set(CMAKE_REQUIRED_FLAGS "-sUSE_LIBLZMA=1")

View File

@@ -1,30 +1,20 @@
From 90dd4d4c6b1cedec338ff5b375fffca93700f7bc Mon Sep 17 00:00:00 2001
From 84d0e9112d5c87a714abd21ec8547921f46f37b5 Mon Sep 17 00:00:00 2001
From: milek7 <me@milek7.pl>
Date: Tue, 8 Dec 2020 01:03:31 +0100
Subject: [PATCH] Add liblzma port
---
Source: https://github.com/emscripten-core/emscripten/pull/12990
src/settings.js | 4 ++
tools/ports/liblzma.py | 151 +++++++++++++++++++++++++++++++++++++++++
tools/settings.py | 1 +
3 files changed, 156 insertions(+)
create mode 100644 tools/ports/liblzma.py
Modifed by OpenTTD to have the bare minimum needed to work. Otherwise there
are constantly conflicts when trying to apply this patch to different versions
of emsdk.
diff --git a/tools/settings.py b/tools/settings.py
--- a/tools/settings.py
+++ b/tools/settings.py
@@ -40,6 +40,7 @@ PORTS_SETTINGS = {
'USE_SDL_NET',
'USE_SDL_GFX',
'USE_LIBJPEG',
+ 'USE_LIBLZMA',
'USE_OGG',
'USE_REGAL',
'USE_BOOST_HEADERS',
diff --git a/src/settings.js b/src/settings.js
index f93140d..7b6bec9 100644
--- a/src/settings.js
+++ b/src/settings.js
@@ -1450,6 +1450,10 @@ var USE_GIFLIB = false;
@@ -1451,6 +1451,10 @@ var USE_GIFLIB = false;
// [compile+link]
var USE_LIBJPEG = false;
@@ -35,9 +25,9 @@ diff --git a/src/settings.js b/src/settings.js
// 1 = use libpng from emscripten-ports
// [compile+link]
var USE_LIBPNG = false;
diff --git a/tools/ports/liblzma.py b/tools/ports/liblzma.py
new file mode 100644
index 0000000..6872a8b
--- /dev/null
+++ b/tools/ports/liblzma.py
@@ -0,0 +1,151 @@
@@ -51,8 +41,8 @@ new file mode 100644
+import logging
+from pathlib import Path
+
+VERSION = '5.4.0'
+HASH = '29b2cd25bb5b234b329ffe9547692d2c29be393db9d8d4ce70a66dfdaebd54433e79a89d80c57e58cd4559c3c68b9845507d5fedf3eec1c528a81e3d9ddbd811'
+VERSION = '5.4.2'
+HASH = '149f980338bea3d66de1ff5994b2b236ae1773135eda68b62b009df0c9dcdf5467f8cb2c06da95a71b6556d60bd3d21f475feced34d5dfdb80ee95416a2f9737'
+
+
+def needed(settings):
@@ -192,3 +182,17 @@ new file mode 100644
+#endif
+#define VERSION "5.4.0"
+'''
diff --git a/tools/settings.py b/tools/settings.py
index 10d6ca0..827e4a9 100644
--- a/tools/settings.py
+++ b/tools/settings.py
@@ -40,6 +40,7 @@ PORTS_SETTINGS = {
'USE_SDL_NET',
'USE_SDL_GFX',
'USE_LIBJPEG',
+ 'USE_LIBLZMA',
'USE_OGG',
'USE_REGAL',
'USE_BOOST_HEADERS',
--
2.34.1

View File

@@ -1,8 +1,8 @@
Module.arguments.push('-mnull', '-snull', '-vsdl:relative_mode');
Module.arguments.push('-mnull', '-snull', '-vsdl');
Module['websocket'] = { url: function(host, port, proto) {
/* openttd.org hosts a WebSocket proxy for the content service. */
if (host == "content.openttd.org" && port == 3978 && proto == "tcp") {
return "wss://content.openttd.org/";
return "wss://bananas-server.openttd.org/";
}
/* Everything else just tries to make a default WebSocket connection.
@@ -30,46 +30,47 @@ Module.preRun.push(function() {
Module.addRunDependency('syncfs');
FS.syncfs(true, function (err) {
/* FS.mkdir() tends to fail if parent folders do not exist. */
if (!FS.analyzePath(content_download_dir).exists) {
FS.mkdir(content_download_dir);
}
if (!FS.analyzePath(content_download_dir + '/baseset').exists) {
FS.mkdir(content_download_dir + '/baseset');
}
/* Check if the OpenGFX baseset is already downloaded. */
if (!FS.analyzePath(content_download_dir + '/baseset/opengfx-0.6.0.tar').exists) {
window.openttd_downloaded_opengfx = true;
FS.createPreloadedFile(content_download_dir + '/baseset', 'opengfx-0.6.0.tar', 'https://installer.cdn.openttd.org/emscripten/opengfx-0.6.0.tar', true, true);
} else {
/* Fake dependency increase, so the counter is stable. */
Module.addRunDependency('opengfx');
Module.removeRunDependency('opengfx');
}
Module.removeRunDependency('syncfs');
});
window.openttd_syncfs_shown_warning = false;
window.openttd_syncfs = function() {
window.openttd_syncfs = function(callback) {
/* Copy the virtual FS to the persistent storage. */
FS.syncfs(false, function (err) { });
FS.syncfs(false, function (err) {
/* On first time, warn the user about the volatile behaviour of
* persistent storage. */
if (!window.openttd_syncfs_shown_warning) {
window.openttd_syncfs_shown_warning = true;
Module.onWarningFs();
}
/* On first time, warn the user about the volatile behaviour of
* persistent storage. */
if (!window.openttd_syncfs_shown_warning) {
window.openttd_syncfs_shown_warning = true;
Module.onWarningFs();
}
if (callback) callback();
});
}
window.openttd_exit = function() {
Module.onExit();
window.openttd_syncfs(Module.onExit);
}
window.openttd_abort = function() {
Module.onAbort();
window.openttd_syncfs(Module.onAbort);
}
window.openttd_bootstrap = function(current, total) {
Module.onBootstrap(current, total);
}
window.openttd_bootstrap_failed = function() {
Module.onBootstrapFailed();
}
window.openttd_bootstrap_reload = function() {
window.openttd_syncfs(function() {
Module.onBootstrapReload();
setTimeout(function() {
location.reload();
}, 1000);
});
}
window.openttd_server_list = function() {
@@ -123,11 +124,3 @@ Module.preRun.push(function() {
return ret;
}
});
Module.postRun.push(function() {
/* Check if we downloaded OpenGFX; if so, sync the virtual FS back to the
* IDBFS so OpenGFX is stored persistent. */
if (window['openttd_downloaded_opengfx']) {
FS.syncfs(false, function (err) { });
}
});

View File

@@ -75,7 +75,6 @@
}
#message {
color: #101010;
height: 54px;
padding: 4px 4px;
}
@@ -144,6 +143,8 @@
})(),
setStatus: function(text) {
if (document.getElementById("canvas").style.display == "none") return;
var m = text.match(/^([^(]+)\((\d+(\.\d+)?)\/(\d+)\)$/);
if (m) {
@@ -171,6 +172,27 @@
document.getElementById("message").innerHTML = "Preparing game ...";
},
onBootstrap: function(current, total) {
document.getElementById("canvas").style.display = "none";
document.getElementById("title").innerHTML = "Missing base graphics";
document.getElementById("message").innerHTML = "OpenTTD is downloading base graphics.<br/><br/>" + current + " / " + total + " bytes downloaded.";
},
onBootstrapFailed: function(current, total) {
document.getElementById("canvas").style.display = "none";
document.getElementById("title").innerHTML = "Missing base graphics";
document.getElementById("message").innerHTML = "Failed to download base graphics.<br/>The game cannot start without base graphics.<br/><br/>Please check your Internet connection and/or the console log.<br/>Reload your browser to try again.";
},
onBootstrapReload: function() {
document.getElementById("canvas").style.display = "none";
document.getElementById("title").innerHTML = "Missing base graphics";
document.getElementById("message").innerHTML = "Downloading base graphics done.<br/><br/>Your browser will reload to start the game.";
},
onExit: function() {
document.getElementById("canvas").style.display = "none";

View File

@@ -0,0 +1,10 @@
--- a/usr/include/elf.h 2023-12-30 13:46:27.038645199 +0100
+++ b/usr/include/elf.h 2023-12-30 13:46:42.278641893 +0100
@@ -365,6 +365,7 @@
required */
#define SHF_GROUP (1 << 9) /* Section is member of a group. */
#define SHF_TLS (1 << 10) /* Section hold thread-local data. */
+#define SHF_COMPRESSED (1 << 11) /* Section with compressed data. */
#define SHF_MASKOS 0x0ff00000 /* OS-specific. */
#define SHF_MASKPROC 0xf0000000 /* Processor-specific */
#define SHF_ORDERED (1 << 30) /* Special ordering requirement

Some files were not shown because too many files have changed in this diff Show More