1
0
Fork 0
Commit Graph

23105 Commits (f404f3154e51cd592ead7ab80c3ee69a0460eaa3)

Author SHA1 Message Date
translators f74b0cf984 Update: Translations from eints
chinese (simplified): 2 changes by WenSimEHRP
2024-12-24 04:44:12 +00:00
Peter Nelson b35284d3dd
Fix 6a07f28103: Clearing animated tiles may lead to invalid state. (#13192) 2024-12-23 22:35:43 +01:00
Peter Nelson 1cf3a2a726
Codechange: No need to call DeleteAnimatedTile and DoClearSquare. (#13191)
DoClearSquare calls DeleteAnimatedTile itself so this is effectively a duplicate call.
2024-12-23 19:08:03 +00:00
Peter Nelson c72542431a
Change: Increase house type limit from 512 to 4096. (#12288)
This moves HouseType from m4+m3[6] to m8 making it 'easier' to access.
2024-12-22 18:14:06 +00:00
SamuXarick 8e948af3bc Codefix: Ensure assertions are properly encapsulated within WITH_ASSERT directive 2024-12-22 14:02:13 +01:00
SamuXarick de908e08b2 Codefix: Remove duplicated include 2024-12-22 14:01:40 +01:00
Rubidium 54d58a08f3 Codechange: use (better) named constants for the bridge sprite table 2024-12-22 13:59:18 +01:00
Peter Nelson 2176d49a39
Revert: "Codechange: remove parameter which value can always be deduced" (#13183)
This reverts commit dfb74e25f7.
2024-12-21 19:49:02 +00:00
Peter Nelson 2c740cf7e7
Change: Hide buttons in Found Town window that can't be used. (#13182)
When allowed to found towns in game, some buttons are disabled as they are only available in the scenario editor.

Instead of disabling these buttons, completely hide them when in game.
2024-12-21 18:31:21 +00:00
Peter Nelson 59680867c3 Codechange: Use structured bindings when iterating font_mapping. 2024-12-20 19:05:08 +00:00
Peter Nelson c78e309b16 Codefix: Use snake_case instead of camelCase in layouters. 2024-12-20 19:05:08 +00:00
Rubidium d623aa0dfb Fix: no need to guard free() 2024-12-20 19:08:10 +01:00
Loïc Guilloux fefa18fb03
Fix c91d4104f8: \u200B is not allowed in translations (#13179) 2024-12-20 17:07:55 +00:00
Yakov Lipkovich be02b54744
Doc: fix typo in script_vehicle.hpp (#13177) 2024-12-20 08:42:57 -05:00
translators c91d4104f8 Update: Translations from eints
danish: 25 changes by bscargo
2024-12-20 04:44:17 +00:00
translators 07fb13cd29 Update: Translations from eints
chinese (simplified): 154 changes by WenSimEHRP
2024-12-19 04:44:42 +00:00
Peter Nelson c4424aa894
Codechange: Use correct char type in RemapNewGRFStringControlCode. (#13173) 2024-12-18 12:58:23 +00:00
Jonathan G Rennison e3e3cb13c6 Change: Include new cargo classes in dump cargo types console command 2024-12-18 07:50:33 +01:00
translators e78cd7d6e9 Update: Translations from eints
swedish: 1 change by joeax910
chinese (simplified): 13 changes by tinygrox
polish: 2 changes by pAter-exe
2024-12-18 04:44:43 +00:00
translators 07fb7d20db Update: Translations from eints
russian: 1 change by Ln-Wolf
polish: 13 changes by pAter-exe
2024-12-17 04:46:40 +00:00
translators 6ba6ae5e6f Update: Translations from eints
vietnamese: 9 changes by KhoiCanDev
chinese (simplified): 18 changes by tinygrox
2024-12-16 04:45:51 +00:00
translators 8bf2ab62d9 Update: Translations from eints
norwegian (bokmal): 1 change by eriksorngard
chinese (simplified): 9 changes by tinygrox
2024-12-15 04:43:59 +00:00
Eri the Switch 69ee8a8480 Add: Implement 2D map scrolling under SDL2 (#13167)
Use a base multiplier to keep the existing option range (1-15).

SDL2 >= 2.18 allows for considerably smoother scrolling, but
basic support for earlier versions is included.
2024-12-14 15:43:31 +00:00
Eri the Switch 32dfb37b9d Change: Use floats for tracking 2D scrolling
This ensures the smoothest experience possible when dragging map
around with 2D scrolling.
2024-12-14 15:43:31 +00:00
translators 25cf382971 Update: Translations from eints
english (us): 12 changes by 2TallTyler
dutch: 1 change by Afoklala
polish: 10 changes by pAter-exe
2024-12-14 04:44:40 +00:00
Valeri 5d8e98207d
Codechange: Use lowercase name for winnls.h (#13170)
Fixes cross-compilation under MXE.
2024-12-13 19:55:53 +01:00
translators 15059bc253 Update: Translations from eints
swedish: 8 changes by joeax910
2024-12-13 04:45:31 +00:00
Peter Nelson eacec144b0
Fix 56510b5d7b: CargoArray does need to be initialised... (#13168) 2024-12-12 19:33:55 +00:00
Peter Nelson e30c5e6b9e
Codechange: Return pair from instead of optional out parameter. (#13166)
GetVehicleDefaultCapacity() has a pointer as an optional out parameter, but it is always used.

Return a std::pair instead.
2024-12-12 08:57:30 +00:00
Peter Nelson 56510b5d7b
Codechange: Use CargoArray for linkgraph refresher. (#13165)
`uint capacities[NUM_CARGO]` looks a lot like CargoArray.
2024-12-11 19:24:58 +00:00
translators 677bd52c65 Update: Translations from eints
polish: 67 changes by pAter-exe
2024-12-11 04:45:53 +00:00
SamuXarick 1e259b7f47
Codefix: Missing this-> in Kdtree (#13095) 2024-12-10 17:30:55 +00:00
Peter Nelson aa461fca68
Codechange: A transparent FrameRect doesn't care about colours. (#13162) 2024-12-10 05:00:46 +00:00
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 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
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
Peter Nelson 568bb1f5da
Change: [UI] Improve visual padding of vehicle news items. (#13134) 2024-11-30 15:29:36 +00:00
Peter Nelson 61cbdef92d
Codechange: Make AyStarStatus an enum class. (#13129)
This enforces type-safety.
2024-11-30 14:23:32 +00:00
translators 8d394c697c Update: Translations from eints
dutch: 2 changes by Afoklala
polish: 2 changes by pAter-exe
2024-11-30 04:46:18 +00:00
Peter Nelson b6aece5b88
Fix 51bd344f10: Incorrect translation table used for older NewGRFs. (#13131)
Incorrect logic was used to select the default translation table for older GRFs.
2024-11-29 07:46:08 +00:00
Peter Nelson fe0afef36f
Codechange: Use unique_ptr instead of raw pointer for string layouts. (#13128) 2024-11-27 23:38:57 +00:00
SamuXarick cf7710fb61
Codechange 8e9603b: Replace int32_t with AyStarStatus (#13127) 2024-11-27 23:26:07 +00:00
Peter Nelson 9bc64b553b
Codechange: Cache callback spritegroups. (#13111)
Each callback result requires a pool memory allocation, each of which is 24 bytes.

Build a cache of results so that if the same result is used later it refers to the same group.
2024-11-27 23:25:35 +00:00
Jonathan G Rennison f5a6a31e4a
Codefix: Avoid divide by 0 in div/mod type varaction2 adjusts (#13123) 2024-11-27 23:24:46 +00:00
Peter Nelson 23e252ad40
Codechange: Replace FontMap's std::map with std::vector. (#13126) 2024-11-27 12:36:56 +00:00
Peter Nelson 8b8cd9ae2d Codechange: Use vector for town PSA storage. 2024-11-27 12:35:27 +00:00
Peter Nelson 177e2ebf80 Codechange: Support saveload of reference vectors.
This uses the same data format as reference lists, but for vectors, so allows data structures to be changed without affecting savegame format.
2024-11-27 12:35:27 +00:00
translators e7c63de55d Update: Translations from eints
korean: 2 changes by telk5093
ukrainian: 7 changes by CodyMaster3
2024-11-27 04:49:29 +00:00
SamuXarick 8e9603bd33
Codechange: Rename and return AyStarStatus instead of int (#13125)
- Rename enum AystarStatus to AyStarStatus.
- Return AyStarStatus instead of int for AyStar::Main and AyStar::Loop functions.
2024-11-27 00:10:06 +01:00
translators 7c3b0e5c9c Update: Translations from eints
polish: 1 change by pAter-exe
2024-11-26 04:49:08 +00:00
Peter Nelson a3437df7b7
Fix #13121: Crash when clicking on scrollbar if contents don't need scrolling. (#13122) 2024-11-25 08:20:20 +00:00
translators 5b02f51e17 Update: Translations from eints
galician: 7 changes by pvillaverde
vietnamese: 3 changes by KhoiCanDev
polish: 12 changes by pAter-exe
2024-11-25 04:48:28 +00:00
Peter Nelson 0446123194
Change: Show company finances column if it has any values in it. (#13112)
This solves finances not being show if the company inauguration date is in the future.

Current period is now always shown in the same position instead of moving for the first 2 years.
2024-11-24 11:59:30 +00:00
Peter Nelson 0c04966dc3
Fix #13022: Ensure minimum size of scrollbar slider. (#13119)
When there are many more items than fit in a list, the scrollbar slider scales to fit but there is no minimum size. It becomes too small to click on and use.

Ensure scrollbar slider is at least the same size as the buttons either end.
2024-11-24 11:50:04 +00:00
Peter Nelson 0b0b4f50c4
Fix: Crash when exiting game with highscore window open. (#13118) 2024-11-24 10:36:21 +00:00
Peter Nelson fa1849b855 Codechange: Use std::range::find_if where possible. 2024-11-24 10:36:03 +00:00
Peter Nelson 059a4b22f7 Codechange: Use projection-based std::range::find where possible.
This simplifies matching by class members and avoids wordy lambdas.
2024-11-24 10:36:03 +00:00
Peter Nelson 876d53282e Codechange: Use std::ranges::count(_if). 2024-11-24 10:36:03 +00:00
Peter Nelson 3be0166801 Codechange: Use std::ranges::find where possible.
Replace `std::find(range.begin(), range.end(), ...)` with `std::ranges::find(range, ...)`.
2024-11-24 10:36:03 +00:00
Peter Nelson 1f18894408
Change: Determine industry directory width only on visible rows. (#13097)
When rebuilding the industry directory list, the width of every item in the list is obtained to get the maximum width required for the horizontal scrollbar. This can take considerable time if there are a lot of industries.

Instead, calculate only for the visible rows, and grow as needed.
2024-11-24 06:51:58 +00:00
translators 9399a92a4f Update: Translations from eints
english (au): 2 changes by krysclarke
swedish: 4 changes by joeax910
chinese (traditional): 2 changes by KogentaSan
chinese (simplified): 3 changes by WenSimEHRP
greek: 4 changes by gh658804
russian: 3 changes by Ln-Wolf
finnish: 4 changes by hpiirai
portuguese (brazilian): 3 changes by pasantoro
polish: 46 changes by pAter-exe
2024-11-24 04:46:32 +00:00
Loïc Guilloux 681b1928b4
Fix #13110: [Script] convert table keys to string when generating JSON (#13113) 2024-11-23 13:46:33 +01:00
Peter Nelson b890dab2b4
Change: Treat recolour sprites as regular sprites in the SpriteCache. (#13107)
Recolour sprites are loaded when seen, instead of being loaded when needed. This could result in the sprite cache being filled up with recolour sprites, and also mean that replacing recolour sprites didn't release the previously allocated memory.

Instead, allow recolour sprites to be loaded as needed and freed when unneeded, like regular sprites.
2024-11-23 12:14:46 +00:00
Peter Nelson 00ae20fa02
Codechange: Tidy up GRFParameterInfo. (#13114)
Use member-initialisation, reorder members to reduce space, and prefer references.

SetValue/GetValue are moved to GRFConfig as they set the config's parameter values.
2024-11-23 12:13:52 +00:00
Jonathan G Rennison b84a164590 Codechange: Avoid unnecessary re-reads/seeks in RandomAccessFile::ReadBlock 2024-11-23 21:48:22 +10:00
Peter Nelson 653e5e8b63 Codechange: Use std::visit for formatting script strings. 2024-11-23 10:55:41 +00:00
Peter Nelson 43da3e7693 Codechange: Use std::visit for ScriptDataVariant. 2024-11-23 10:55:41 +00:00
Peter Nelson d875ac8947 Add: const operator->() for ScirptObjectRef. 2024-11-23 10:55:41 +00:00
translators 26ae50baf9 Update: Translations from eints
english (au): 1 change by krysclarke
chinese (traditional): 1 change by KogentaSan
korean: 5 changes by telk5093
greek: 1 change by gh658804
dutch: 1 change by KevinHeijsteeg2
2024-11-23 04:47:22 +00:00
Peter Nelson a4b4095232
Codechange: Shuffle Engine members around to reduce size. (#13115)
Reduces overall size of Engine from 752 to 720 bytes.
2024-11-22 23:58:13 +00:00
Peter Nelson 16038879e4
Codechange: Speed up industry generation using industry-type checks. (#13094)
Store a list of industries per industry type. This allows industry generation checks which only consider a specific industry type to check a reduced set of industries, leading to a potential performance increase.

This also removes the need to track industry type counts as well.
2024-11-22 23:17:24 +00:00
Peter Nelson a951896364 Add: Add cargo transported to industry production graph. 2024-11-22 20:47:51 +00:00
Peter Nelson 22035a4f2a Add: Ability to show and filter different datasets on the same graph. 2024-11-22 20:47:51 +00:00
Peter Nelson 598fdf04a4 Codechange: Use vector instead of fixed array for graph data. 2024-11-22 20:47:51 +00:00
felixprigge 67a0fccfad
Fix: [Timetable] Use days as precision in day mode for accurate timetable syncing (#12683)
Co-authored-by: flowprint <61750128+flowprint@users.noreply.github.com>
2024-11-21 22:27:07 +00:00
Peter Nelson 6d3adc6169
Codechange: Remove ZeroedMemoryAllocator from ScriptText. (#13108)
ScriptText is much simplified from its original design. Use member initialisation instead.
2024-11-20 22:16:14 +00:00
Peter Nelson 13da98dab8
Fix: Error message not set when unable load an old save. (#13106) 2024-11-20 18:24:07 +00:00
translators 1b6a6f1cd2 Update: Translations from eints
chinese (simplified): 4 changes by WenSimEHRP
danish: 19 changes by bscargo
2024-11-20 04:46:40 +00:00
Peter Nelson b730f8783e
Fix d450d4743: Division by zero when larger_towns is set to 0. (#13104)
Universe ended.
2024-11-20 00:09:02 +00:00
Peter Nelson 9b6b6d50c3
Fix: Network clients incorrectly truncated all strings to NETWORK_COMPANY_NAME_LENGTH. (#13102)
This should no longer be necessary since we used std::strings.
2024-11-19 23:44:54 +00:00
SamuXarick 85e9f5745a
Codefix: Replace magic number in Kdtree (#13098) 2024-11-19 20:34:25 +00:00
Peter Nelson 6c09dcdd66
Codechange: Use reference for non-optional StationList parameter. (#13092) 2024-11-19 20:33:32 +00:00
Peter Nelson 640a270ed6
Codefix: Use correct type for IndustryType in several industry functions. (#13096) 2024-11-19 20:32:06 +00:00
Peter Nelson fcac5479f1
Codechange: Use std::visit for SetupCargoForClimate. (#13103) 2024-11-19 20:30:16 +00:00
Peter Nelson fc8685d618
Codechange: Use functor for Kdtree's XYFunc. (#13074)
Kdtree uses a function pointer and incorrectly calls it a functor. The function pointer needs to be passed on instantiaton.

Instead, use an actual functor. This simplifies instantiation.
2024-11-19 20:29:56 +00:00
Koen Bussemaker 369ea29e1e Codechange: Remove redundant checks in FindClosestTrainDepot 2024-11-19 20:42:43 +01:00
Peter Nelson f9b5f78b8a Codechange: Use std::visit for GetActiveCargoLabel. 2024-11-19 18:27:19 +00:00
Peter Nelson 25c5a64d39
Codechange: Use std::visit instead of std::get_if for string parameters. (#13100)
It's tidier and ensures all cases are handled, and doesn't use pointers.
2024-11-19 18:17:41 +00:00
SamuXarick 60ae50e016
Codechange: Make kdtree member functions const for const-correctness (#13099) 2024-11-19 12:36:56 +00:00
Michael Lutz d2496b6ec4 Add: [NewGRF] Callback for custom refit mask for engines/vehicles. 2024-11-18 22:10:38 +01:00
Michael Lutz a3ee05737f Add: [NewGRF] Vehicle prop that allows refittability based on cargo class intersection. 2024-11-18 22:10:38 +01:00
Peter Nelson c39810ff6a Codechange: Replace path cache queues with vectors.
Ship and RoadVehicle path caches use a std::deque, which is quite memory hungry, especially for RoadVehicle which has two.
std::deque was used to be able to push/pop from either end.

Change to use a single std::vector each, which is now push/popped from the back.
2024-11-18 08:59:41 +00:00
Peter Nelson d4f8453c22 Codefix: Clear and reserve storage when loading vectors from savegames. 2024-11-18 08:59:41 +00:00
translators b8f3d0dd68 Update: Translations from eints
norwegian (bokmal): 4 changes by eriksorngard
2024-11-18 04:49:46 +00:00
Peter Nelson d903806e59
Codechange: Add VectorSaveLoadHandler to simplify handlers for vectors. (#13093)
This reduces the duplication needed for each saved complex vector.
2024-11-17 23:46:32 +00:00
translators a6c526cfa0 Update: Translations from eints
bulgarian: 4 changes by Alexandar83
2024-11-17 04:46:16 +00:00
Peter Nelson 04b6dfae48
Cleanup: Remove now-unneeded includes from yapf. (#13088) 2024-11-16 23:23:06 +00:00
Peter Nelson ec1dc434ac
Codechange: Shuffle CommandCost members to reduce size. (#13087)
Prefer member initialisation as well.
2024-11-16 21:49:49 +00:00
Jonathan G Rennison 71ea58c6de
Codechange: Remove unused CYapfDestinationTileT (#13086) 2024-11-16 16:12:18 +00:00
Peter Nelson 57ac1cbe0c
Fix: Don't allow right-click to close world generation progress window. (#13084) 2024-11-16 13:54:47 +00:00
translators 8c395ed67c Update: Translations from eints
vietnamese: 4 changes by KhoiCanDev
2024-11-16 04:48:13 +00:00
Peter Nelson 14e2839087
Codechange: Let's use this new emplace_back() thing. (#13081) 2024-11-15 20:28:17 +00:00
Peter Nelson 98c8445519
Codechange: Limit house default cargo label lists to original slot counts. (#13079)
Same as for IndustrySpec and IndustryTileSpec.
2024-11-15 08:07:02 +00:00
translators d6c2f9edf1 Update: Translations from eints
polish: 5 changes by pAter-exe
2024-11-15 04:48:47 +00:00
Peter Nelson 61aff3fa49
Codechange: Limit industry default cargo label lists to original slot counts. (#13072)
IndustrySpec and IndustryTileSpec cargo label lists are only used for original industries. Original industries can only have up to 2 inputs and 3 outputs. Therefore having space for 16 input/outputs slots is unnecessary

This saves 216 bytes per industry type, and 164 bytes per industry tile type.
2024-11-14 19:05:18 +00:00