Commit Graph

29919 Commits

Author SHA1 Message Date
translators
ad7738cff8 Update: Translations from eints
catalan: 12 changes by J0anJosep
latvian: 9 changes by lexuslatvia
2024-12-10 04:45:45 +00:00
Peter Nelson
f8e9ee6fec
Codefix: Scenario climate selection buttons shouldn't include size of (unset) integer. (#13161) 2024-12-09 23:42:14 +00:00
translators
95d22bac89 Update: Translations from eints
chinese (traditional): 10 changes by KogentaSan
galician: 9 changes by pvillaverde
korean: 9 changes by telk5093
russian: 10 changes by Ln-Wolf
polish: 1 change by pAter-exe
2024-12-09 04:46:17 +00:00
Peter Nelson
1e77fd0b61
Codechange: Remove unnecessary 'return_cmd_error` macro. (#13160)
This macro is a leftover from when errors used to be packed into a single int32_t.

`return CommandCost` is clearer, and doesn't need a macro.
2024-12-08 18:02:30 +00:00
Peter Nelson
369e8a6fe9 Cleanup: Remove unused-strings hack for _TINY string variants. 2024-12-08 10:23:52 +00:00
Peter Nelson
5575c0ba5a Codechange: Deduplicate text effect strings.
Small viewport signs are drawn with FS_SMALL, so there is no need to duplicate text effect strings for both normal and small versions.

This also avoids an extra string format when text effect positions are updated.
2024-12-08 10:23:52 +00:00
translators
d0d5a18120 Update: Translations from eints
english (au): 1 change by krysclarke
norwegian (bokmal): 8 changes by eriksorngard
chinese (simplified): 1 change by WenSimEHRP
greek: 1 change by gh658804
russian: 52 changes by Ln-Wolf
finnish: 1 change by hpiirai
french: 1 change by glx22
portuguese: 1 change by azulcosta
portuguese (brazilian): 1 change by pasantoro
2024-12-08 04:44:40 +00:00
Peter Nelson
7af16bff11
Codechange: Use vector for GRFFile parameters instead of array. (#13157)
This simplifies assigning default parameters and removes the param_end member.
2024-12-07 22:08:59 +00:00
Peter Nelson
3d73c95080
Fix: Potential out-of-bounds reads due to uninitialised string parameters. (#13153)
If string parameters are not set correctly, FormatString can read out of bounds and crash the game.

This does not fix the root cause, just a nasty symptom.
2024-12-07 15:48:49 +00:00
Peter Nelson
f5d78f9eba
Change: [NewGRF] Install translation tables into overridden NewGRF. (#12879)
When a NewGRF overrides another, any translation table that the overriding NewGRF installs will also be installed in the target file.

This allows the overridden NewGRF to make use of a cargo or rail/road type translation table without directly modifying the original file.
2024-12-07 11:26:53 +00:00
Peter Nelson
caead883a5
Fix 560ee2442d: MinGW package is -libogg, not -ogg. (#13152) 2024-12-07 11:03:29 +00:00
translators
04621d1be3 Update: Translations from eints
chinese (simplified): 8 changes by WenSimEHRP
dutch: 8 changes by Afoklala
portuguese: 8 changes by azulcosta
polish: 3 changes by pAter-exe
2024-12-07 04:45:11 +00:00
Peter Nelson
560ee2442d Add: Support sound effects in Ogg Opus format. 2024-12-06 18:41:35 +00:00
Peter Nelson
8b00661b22 Change: Add sound memory usage to framerate window. 2024-12-06 18:41:35 +00:00
Peter Nelson
ce5279a8dc Codechange: Implement SoundLoader interface and cache loaded sounds in memory.
Sounds are loaded into memory on first use, using the SoundLoader interface to support format conversion. Sounds are retained in memory to avoid reloading every time a sound is played.

This deduplicates WAV header parsing between NewGRF and baseset sounds, and will allow different audio formats to be supported.
2024-12-06 18:41:35 +00:00
Peter Nelson
7e8bcf44f7 Codechange: ProviderManager class to support self-registration of providers.
This is based loosely on TimerManager.
2024-12-06 18:41:35 +00:00
Peter Nelson
bccf5343f4 Codechange: Use a type alias for mixer channel masking. 2024-12-06 18:41:35 +00:00
Peter Nelson
cba329d9e2
Add: Translatable list separator. (#13149)
Some languages should use a separator other than ", " to separate list items, so it is now a translatable string.
2024-12-06 12:32:36 +00:00
rubidium42
ef76f0e758 Codechange: use default virtual destructors over empty destructors 2024-12-06 22:30:19 +10:00
Koen Bussemaker
701cb2e9d7 Codechange: Move two way signal EOL to a more logical place 2024-12-06 09:27:32 +01:00
translators
ca148022f7 Update: Translations from eints
english (au): 8 changes by krysclarke
greek: 8 changes by gh658804
russian: 8 changes by Ln-Wolf
finnish: 8 changes by hpiirai
french: 11 changes by glx22
portuguese (brazilian): 8 changes by pasantoro
polish: 8 changes by pAter-exe
2024-12-06 04:45:53 +00:00
SamuXarick
005c47c322 Codechange: Use Map::Iterate() on CreateDesertOrRainForest routine 2024-12-06 10:33:11 +10:00
SamuXarick
913d6eceb0 Codechange: Use Map::Iterate() on waypoint conversion
Still maintains the same logic as before when determining valid and invalid waypoints.
2024-12-06 10:33:11 +10:00
SamuXarick
7d0b1cd002 Codechange: Replace while loop with Map::Iterate() 2024-12-06 10:33:11 +10:00
SamuXarick
10e2d1ca36 Codechange: Use Map::Iterate() to iterate tiles 2024-12-06 10:33:11 +10:00
Peter Nelson
cfb995b6e9
Codechange: Reimplement engine sort order with std::rotate. (#13124) 2024-12-05 22:17:40 +00:00
Peter Nelson
f56b6756f1 Codechange: Sort EngineOverrideManager for fast lookups.
Allows quickly finding the EngineID given the type, grfid and local id of an engine, instead a linear scan.

This can reduce loading time when lots of engines are present and also affects performance in-game.
Lookup can be on the order of 10000 times faster.
2024-12-05 18:17:58 +00:00
Peter Nelson
01d1ea6264 Codechange: Add Slide container helper function.
This function will move the selected range between first and last to position, rotating elements as necessary.

Returns iterators to the new positions.
2024-12-05 18:17:58 +00:00
Peter Nelson
bc2513975f Codechange: Don't inherit EngineOverrideManager from std::vector.
Inheriting from std::vector means some operations are needlessly complex, and shouldn't really be done anyway.
2024-12-05 18:17:58 +00:00
Peter Nelson
e73d6fcaac Codechange: Store grfid with entity grfprops.
This allows using the grfid without having to dereference the grffile pointer.

Uses no extra storage as it fits within otherwise wasted padding space.
2024-12-05 18:17:58 +00:00
Peter Nelson
e750d10cee
Codechange: Use std::array for per-NewGRF rail/road type maps. (#13142)
This allows initialisation to be simplified.
2024-12-05 18:17:25 +00:00
translators
7469858f1f Update: Translations from eints
norwegian (bokmal): 3 changes by eriksorngard
latvian: 3 changes by lexuslatvia
2024-12-05 04:46:10 +00:00
Peter Nelson
62da507aba
Codechange: Update minimum CMake version to 3.16 for all parts. (#13141)
The main CMakeList requires 3.16, so bump all other files to match.
2024-12-04 14:12:57 +00:00
Peter Nelson
6f8e30c55d
Codechange: Use unique_ptr throughout instead of new raw pointer for company news data. (#13148)
The pointer was already captured and converted to a unqiue_ptr, but hidden within the call stack.

This now makes it clearer that the object passed to Add.*NewsItem will become owned by the news item.
2024-12-04 12:18:34 +00:00
Peter Nelson
2ff18a4f05
Fix: String parameter not set when determining width of smallmap contour labels. (#13145) 2024-12-04 12:18:17 +00:00
Peter Nelson
efcafe49f7
Fix: [NewGRF] New engines did not have a default cargo type set. (#13146)
Engines defined outside the original range did not have their cargo type/cargo label fields initialised properly.
If these engines are also not assigned a cargo type, they would therefore use the cargo in slot 0 instead of falling back to first refittable.
2024-12-03 21:59:22 +00:00
Peter Nelson
9e182871c7 Add: Show house information in house placer. 2024-12-02 00:48:46 +00:00
Peter Nelson
041b9181f9 Codechange: Extract code to build cargo acceptance string for re-use. 2024-12-02 00:48:46 +00:00
Peter Nelson
2ede94bc40 Codechange: Adapt functions to get accepted cargo of prototype house. 2024-12-02 00:48:46 +00:00
Peter Nelson
3a158c7609 Change: Call custom house name callback in House Picker. 2024-12-02 00:48:46 +00:00
Peter Nelson
6a07f28103 Codechange: Store animated tile state in map to improve performance.
This allows animated tiles to be added and removed without searching in the animated tile list, providing a performance improvement when there are lots of animated tiles.

Save game version is bumped so that animated tile state can be converted.
2024-12-01 21:19:28 +00:00
Peter Nelson
44de8d77bf Codechange: Move station tile flag cached bits from m6 to m3.
This frees up bits 0..1 of m6 for all tile types.

No savegame bump is needed as these bits are always reset on load.
2024-12-01 21:19:28 +00:00
Peter Nelson
be505ec459 Add: Accessor to test if a tile may be animated. 2024-12-01 21:19:28 +00:00
Peter Nelson
3a310f1802
Codechange: Store GRFConfig parameters in a vector. (#13137)
All GRFConfigs have space allocated for parameters, but only configured GRFConfigs need them.

Using a vector instead means that space is only used when parameters are used.
2024-12-01 15:15:21 +00:00
Peter Nelson
e28617fda6
Codefix: Avoiding passing new raw pointer into a smart pointer. (#13138)
Use `std::make_shared` or `std::make_unique` instead of `reset(new ...)`.
2024-12-01 14:22:41 +00:00
Peter Nelson
46176a81e3
Add #12975: Cargo class bits 13 and 14 now define potable and non-potable. (#12979) 2024-12-01 13:48:18 +00:00
Peter Nelson
910dd65710 Change: Improve news window layouts.
* Use appropriate container widget nesting with padding, instead of single-sided padding.
* Use layer widget to allow main news message to overlay close box and date widgets, to more closely match the old fixed-pixel layout.
2024-12-01 09:44:11 +00:00
Peter Nelson
60f1618cc7 Add: Widget layer container widget type, NWID_LAYER.
This widget allows child widgets to be overlaid on top of each other.

Very similar to NWID_SELECTION except all layers are always visible.
2024-12-01 09:44:11 +00:00
translators
1885bd7166 Update: Translations from eints
portuguese: 5 changes by azulcosta
2024-12-01 04:47:46 +00:00
Peter Nelson
30bda88e97
Codefix: NWidgetStacked::AdjustPaddingForZoom duplicates inherited method. (#13135) 2024-11-30 23:15:17 +00:00