1
0
Fork 0
Commit Graph

23963 Commits (26db4ccf09f4615747aa92942f05cadb12edbb07)

Author SHA1 Message Date
frosch 20805ba84b Codechange: Use EncodeUtf8 and DecodeUtf8 directly, when dealing with a single character. 2025-04-03 18:43:41 +02:00
frosch f640daee4c Codechange: No need for Utf8Consume and Utf8Encode, if only ASCII characters are checked. 2025-04-03 18:43:41 +02:00
frosch f06bfc0dad Codechange: Use Utf8View to const-iterate over strings, if no particular error handling is needed. 2025-04-03 18:43:41 +02:00
frosch 22ab0244d8 Codechange: Use Utf8View in Textbuf. 2025-04-03 18:43:41 +02:00
frosch f19e75b606 Codechange: Use Utf8View in Utf8StringLength. 2025-04-03 18:43:41 +02:00
frosch 83401ad5e2 Codechange: Use Utf8View::iterator in StringIterator. 2025-04-03 18:43:41 +02:00
frosch b19e43ae99 Add: Utf8View and iterator. 2025-04-03 18:43:41 +02:00
frosch e6a0cf75a9 Codechange: Shift suffixes between _name_czech_adj and _name_czech_patmod to simplify code. 2025-04-03 13:58:07 +02:00
frosch d8333fe3d7 Codechange: Czech town names unconditionally removed the last codepoint in _name_czech_adj; already do this in the source table. 2025-04-03 13:58:07 +02:00
frosch 86bb30acbe
Codefix dccc6185: Incorrect encoding of empty parameters in ScriptText. (#13951) 2025-04-03 13:57:30 +02:00
frosch 061b5630ee
Codefix: Conversion from char to char32_t requires cast to unsigned first. (#13950) 2025-04-03 13:56:50 +02:00
stormcone ced8fd9936
Fix: Reference to the correct section of the README, if a graphics or a sound set is incomplete. (#13946) 2025-04-03 13:40:16 +02:00
Peter Nelson 33a8c1c6fc
Codechange: Use default operator<=> to compare Linkgraph Hop. (#13944) 2025-04-02 23:00:06 +01:00
John Taylor 2f36e3e3a1
Fix #13075, #13893: Reversed all x-axis labels for company related and industry production graphs in wallclock mode. (#13894) 2025-04-02 19:04:49 +02:00
Loïc Guilloux 827b03a32c
Fix: [Script] Prevent cloning of API instances (#13947) 2025-04-02 12:30:57 +02:00
Peter Nelson 2ae84f3c9e
Codechange: CargoSpec::Iterate already tests cargo validity. (#13941) 2025-04-01 18:23:26 +01:00
stormcone 8d0ba5649a
Fix 667d0137: NewGRF details view does not show the "No information available", if the NewGRF sets an empty description. (#13939) 2025-04-01 16:10:59 +02:00
stormcone f8f76eb9f3
Fix 089c7a2: SDL2 application name hint was not effective. (#13926) 2025-04-01 16:07:38 +02:00
Rubidium 3c15e0c889 Codefix: return right type to prevent casting 2025-03-31 21:44:53 +02:00
Rubidium 023bf38338 Codefix: std::string_view does not accept nullptr 2025-03-31 21:44:44 +02:00
Peter Nelson e200e9b401
Codechange: Use EnumBitSet for Linkgraph RefreshFlags. (#13930) 2025-03-31 20:33:32 +01:00
Peter Nelson 047497734b
Cleanup: Remove redundant NewGRF clean up functions. (#13927)
These functions no longer clean up manually managed memory, they simply clear GRFFile's vectors of unique_ptrs. This will happen anyway when the GRFFile is deleted.
2025-03-31 20:33:09 +01:00
Peter Nelson 6a3d17923b
Codechange: Use range filter to simplify picking a random AI. (#13897) 2025-03-31 20:32:16 +01:00
frosch dc956a758d
Fix: Draw the bevel around the music track name as inset. (#13935) 2025-03-31 18:54:02 +02:00
frosch fe50f061a9
Fix #13923: Padding in music GUI was asymmetric, so it looked different for LTR and RTL languages. (#13933) 2025-03-31 18:53:51 +02:00
frosch 6c569f36e6
Fix #13925, 667d0137: Ancient NewGRF have empty name and description, show the filename instead. (#13932) 2025-03-31 14:25:47 +02:00
translators 0055e168f0 Update: Translations from eints
chinese (traditional): 7 changes by KogentaSan
vietnamese: 1 change by KhoiCanDev
2025-03-31 04:46:08 +00:00
Loïc Guilloux dc3e8a07e6
Fix #13928, 35e58f6: BuildOilRig did not properly set airport rotation (#13929) 2025-03-30 22:33:01 +00:00
Peter Nelson 99c6e85356
Codefix: Timetable display rows are not related to OrderID. (#13909) 2025-03-30 20:25:55 +01:00
Michael Lutz 68ff7e5209 Fix #13921, d95422561b: [Win32] Don't try close an already closed event handle during destruction. 2025-03-30 19:01:45 +02:00
Michael Lutz 56af0b29f5 Fix #13921, a908c7bed0: Don't reject MIDI files with a valid file magic value. 2025-03-30 19:01:45 +02:00
translators cc18f586f9 Update: Translations from eints
chinese (traditional): 1 change by KogentaSan
vietnamese: 11 changes by KhoiCanDev
chinese (simplified): 10 changes by WenSimEHRP
french: 2 changes by ottdfevr
2025-03-29 04:46:36 +00:00
Peter Nelson 319caef58f
Fix #13912: Multitile buildings break apart in house picker. (#13914)
As this is drawing sprites, use sprite-based scaling instead of interface-based scaling.
2025-03-28 20:30:52 +00:00
Peter Nelson 0829604b4f
Fix #13908: Require double click on order to change stop location. (#13913) 2025-03-28 20:23:18 +00:00
Peter Nelson e49150f9ca
Fix #13910: Invalidate content of house picker window if language is changed. (#13911) 2025-03-28 19:57:43 +00:00
Peter Nelson a361841848
Codechange: Store GameStrings as shared_ptr. (#13905)
Uses shared_ptr/weak_ptr as LanguageScanner needs access without ownership.
2025-03-28 17:44:43 +00:00
Peter Nelson d95422561b Codechange: Use unique_ptr to manage drivers. 2025-03-28 17:44:07 +00:00
translators c3457cd4c0 Update: Translations from eints
hungarian: 3 changes by vargaviktor
ukrainian: 10 changes by imlystyi
2025-03-28 04:44:47 +00:00
Peter Nelson 529fb88325 Codechange: Use template specialisation and instantiation for BaseMedia methods.
Specialisations seem to be the correct way to specialise, rather than redefining the base template.

This removes a macro which instantiated methods individually.
2025-03-27 18:57:53 +00:00
Peter Nelson 3375dc3095 Codechange: Use traits to define BaseSet parameters. 2025-03-27 18:57:53 +00:00
Peter Nelson 6914d99778 Codechange: Split baseset type definitions into separate files. 2025-03-27 18:57:53 +00:00
Peter Nelson 9feaa6b7bc
Codechange: Use vector/unique_ptr to manage network game information. (#13902)
Replaces linked list with manual memory management.
2025-03-27 18:48:41 +00:00
Peter Nelson 0b3619ea35
Codechange: Use unique_ptr to manage blitters. (#13904) 2025-03-27 08:38:58 +00:00
translators 65cabf4c87 Update: Translations from eints
ukrainian: 39 changes by imlystyi
2025-03-27 04:46:01 +00:00
Loïc Guilloux 6bf405eb18
Codechange: Remove Game::GetGameInstance() (duplicate of Game::GetInstance()) (#13901) 2025-03-26 22:41:41 +00:00
Peter Nelson ff08a22aa4
Codechange: Simplify AI/GameConfig::GetConfig. (#13900)
Reorganise these methods to reduce nesting and remove a raw pointer to a unique_ptr.
2025-03-26 21:53:05 +00:00
Peter Nelson 325f7f9767
Codechange: Use EnumBitSet for GoodsEntry status. (#13899) 2025-03-26 21:22:33 +00:00
Peter Nelson 5331389765
Codechange: Pass NewsItem by reference. (#13898) 2025-03-26 18:56:33 +00:00
Peter Nelson 422ff9dbd8 Codechange: Use std::unique_ptr for ai/game config. 2025-03-26 10:54:11 +00:00
Peter Nelson 7f3820fa7e Codechange: Load check data is only interested in landscape and starting_year. 2025-03-26 10:54:11 +00:00
translators df750d44fd Update: Translations from eints
latvian: 53 changes by lexuslatvia
2025-03-26 04:44:20 +00:00
Björn Wärmedal d009bfc47b
Codechange: Add vehicle owner to crash event (#13878)
Co-authored-by: Björn Wärmedal <bjorn.warmedal@lumera.com>
2025-03-25 22:53:44 +01:00
Peter Nelson fb008436b8
Codechange: Use std::unique_ptr for script info/library instances. (#13892) 2025-03-25 21:07:02 +00:00
Peter Nelson 47d078c033 Codechange: Use EnumBitSet for RailTypes. 2025-03-25 20:15:48 +00:00
Peter Nelson 732109e444 Codechange: Use EnumBitSet for RoadTypes. 2025-03-25 20:15:48 +00:00
Peter Nelson 819e097d6e Codechange: Use separate RoadTypes mask to list road or tram roadtypes.
This simplifies logic reduces ambiguity.
2025-03-25 20:15:48 +00:00
frosch c105adcd96
Codechange: Encode case/gender/plural choice lists without null termination, only length prefix. (#13876) 2025-03-25 20:32:40 +01:00
frosch 25005cff16
Codefix: std::string_view::data() is not necessarily null terminated. (#13891) 2025-03-25 20:32:19 +01:00
Peter Nelson 93016b9a92
Fix #13842: Close industry production graph if industry is removed. (#13890) 2025-03-25 17:58:59 +00:00
Peter Nelson 9f94cadd68
Codefix: GRF-local cargo id is not a CargoType. (#13888) 2025-03-25 17:12:43 +00:00
Peter Nelson adb20f99ea
Fix: Autoreplace rail/road list only listed buildable types. (#13887)
Instead list all possible types which includes hidden types compatible with buildable types.
2025-03-25 08:22:30 +00:00
translators 1fb4c44bc7 Update: Translations from eints
chinese (traditional): 20 changes by KogentaSan
hungarian: 61 changes by vargaviktor
2025-03-25 04:47:17 +00:00
Peter Nelson 79ef4e98fe
Codechange: Use std::swap() instead of Swap() (#13883) 2025-03-24 23:47:34 +00:00
Peter Nelson 8a53ccf8f1
Fix: Not enough parameters supplied for Autoreplace window caption. (#13886) 2025-03-24 23:01:04 +00:00
frosch 488cda728d Codechange: Use std::string and std::string_view instead of C strings. 2025-03-24 23:10:13 +01:00
frosch d7768f5f51 Codechange: Use more specific integer types than 'int'. 2025-03-24 23:10:13 +01:00
frosch b10433715d Codechange: Turn out parameters into return values. 2025-03-24 23:10:13 +01:00
frosch 77af1c89c8 Codechange: Split _show_todos into individual bool flags. 2025-03-24 23:10:13 +01:00
frosch f8292a8d11 Codechange: Remove unused/obscure strgen feature for relative offsets in plural/gender choice lists. 2025-03-24 23:10:13 +01:00
frosch 4fc0900865 Codechange: Reorder functions in strgen and reduce external symbols. 2025-03-24 23:10:13 +01:00
Peter Nelson b96b26ef15
Codechange: Rename short CargoType parameters `cargo`. (#13848)
Rename CargoType variables and parameters using short or meaningless names.
2025-03-24 18:18:21 +00:00
Loïc Guilloux bdea29c414
Fix #13875: [Script] be less strict about empty constructor format for doxygen (#13882) 2025-03-24 13:38:10 +01:00
translators 997f8abaec Update: Translations from eints
chinese (traditional): 23 changes by KogentaSan
2025-03-24 04:46:50 +00:00
Peter Nelson fc7b6c6cbb
Codechange: Use .fill() to clear an array instead of assigning a new array. (#13880)
Avoids allocating a temporary on the stack.
2025-03-23 22:09:45 +00:00
frosch ca801d55d5
Fix: [NewGRF] Display an error, if NewGRF reference out-of-bounds string parameters in gender/plural choices. (#13881) 2025-03-23 20:43:12 +01:00
Peter Nelson 42eb513897
Codechange: Make use of emplace_back's return value. (#13879) 2025-03-23 18:34:04 +00:00
frosch 5aa4ad5135
Codechange: Pass unformatted strings from GetStringPtr as std::string_view. (#13871) 2025-03-23 19:23:31 +01:00
Peter Nelson 234c9fb3bd Codechange: Use EnumBitSet for SpriteFlags. 2025-03-23 18:01:02 +00:00
Peter Nelson 5abe7c1386 Codechange: Use default initialisation for 32bpp_sse2's SpriteData.
Avoids using memset.
2025-03-23 18:01:02 +00:00
Peter Nelson 828e808444 Codechange: Split NewGRF loader into separate Action handlers. 2025-03-23 16:59:36 +00:00
Peter Nelson 0b7fa11a5b Codechange: Move NewGRF string mapping to own file. 2025-03-23 16:59:36 +00:00
Peter Nelson 2cb389946d Codechange: Move GrfProcessingState to separate file.
Allows reuse by other files.
2025-03-23 16:59:36 +00:00
Peter Nelson fe9dfa2b08 Codechange: Move NewGRF ByteReader to own file. 2025-03-23 16:59:36 +00:00
frosch 84f785b06b
Codechange: Pass GRF name as std::string to UpdateNewGRFScanStatus. (#13870) 2025-03-23 16:58:43 +01:00
Peter Nelson 8b4114d709
Fix #13849: Settings in old saves could be overridden by defaults. (#13874)
Resolved by resetting settings to default values before the OPTS and PATS chunks are loaded.
2025-03-23 15:55:55 +00:00
Peter Nelson 21d2a94809
Codechange: Use EnumBitSet for GrfMiscBits. (#13873) 2025-03-22 21:07:59 +00:00
frosch af49320637
Fix: [NewGRF] Plurals and genders did not work in strings with cases. (#13853) 2025-03-22 21:41:27 +01:00
frosch d4ae0f70da
Codechange: StringFilter now uses std::string_view entirely (#13869) 2025-03-22 20:35:31 +01:00
frosch 667d013726
Codechange: Return name, description and URL as std::string from GRFConfig. (#13868) 2025-03-22 20:30:40 +01:00
John Taylor ae2d7947d7 Fix #13562: Removed cost estimation message from money cheat 2025-03-22 20:28:55 +01:00
Jonathan G Rennison be79099a6f
Codechange: Use a std::span as input for GfxFillPolygon (#13866)
Instead of a std::vector const reference.
2025-03-22 15:16:14 +00:00
frosch 5764eaaacf
Fix: [NewGRF] Plurals and genders did not work in NewGRF substrings, and cases in substrings could mess up cases in the parent string. (#13852) 2025-03-22 13:40:43 +01:00
translators 7abca5bb25 Update: Translations from eints
hungarian: 77 changes by vargaviktor
2025-03-22 04:46:31 +00:00
Peter Nelson e47082bf7b
Codefix: Don't look up NewGRF Action 6-modified data twice. (#13863) 2025-03-21 18:13:31 +00:00
frosch a4f3ddae5f
Fix: [NewGRF] String parameter stack and case selection were not processed for control code 0x81. (#13851) 2025-03-21 18:13:08 +01:00
Peter Nelson a4f9977d18
Codechange: Don't reimplement DistanceManhattan. (#13850) 2025-03-21 17:06:39 +00:00
Peter Nelson 6297b49a00 Codechange: Remove table/strings include from header files.
This was accidentally providing coverage to basically all source files...
2025-03-21 12:53:40 +00:00
Peter Nelson 3503082f19 Codechange: Move template class implementation includes.
These are now placed at the bottom of the including files include list.
2025-03-21 12:53:40 +00:00
Peter Nelson 2909a14374 Codechange: Include table/strings.h in files that use StringIDs.
Be consistent with how and where the file is incldued.
2025-03-21 12:53:40 +00:00
Peter Nelson edb101d12f Codechange: Use free function get BaseSet list label.
This avoids using StringIDs in a header file.
2025-03-21 12:53:40 +00:00
Peter Nelson 762e2f76a3 Codechange: Avoid STR_NULL in header file. 2025-03-21 12:53:40 +00:00
Peter Nelson 4ffbf97770 Codechange: Move RawText::GetEncodedText() out of header.
This allows it to use StringID without polluting includes.
2025-03-21 12:53:40 +00:00
frosch 3b178bf58d Fix: NewGRF string interpolation did not process all string parameters, if certain string control codes were present.
String control codes with inline data may contain null characters, in particular plural/gender/case choice lists.
2025-03-21 11:03:24 +01:00
frosch 5d291317e7 Codechange: Two very different functions were named RemapNewGRFStringControlCode. 2025-03-21 11:03:24 +01:00
translators a678bb263d Update: Translations from eints
hungarian: 32 changes by vargaviktor
2025-03-21 04:45:21 +00:00
Peter Nelson 89948b941b
Codechange: Use emplace_back instead of push_back. (#13855) 2025-03-20 17:39:10 +00:00
Peter Nelson b98a7ff303
Fix f214c81e97: Signed overflow in collision test on large map when road vehicles are at just the right coordinates. (#13847)
If road vehicles are -32768 subtiles apart, the distance check will break.
2025-03-18 22:53:01 +00:00
Richard Wheeler 4ba69765be
Update: Developer credits (#13846)
<3
2025-03-18 20:57:25 +00:00
Rubidium a908c7bed0 Codechange: remove uses of MemCmpT (and MemMoveT) 2025-03-18 21:18:37 +01:00
Loïc Guilloux e55f54ce08
Fix #13843, 015c081c: Don't discard GetString() result (#13844) 2025-03-18 17:15:40 +00:00
Peter Nelson 17f7d0950e
Fix #13838: Formatted error message of sub-errors may be lost. (#13840) 2025-03-18 08:39:40 +00:00
Peter Nelson 5255aabe4d
Fix #13839: Incorrect colour of first company legend in smallmap window. (#13841)
Use the proper command to set the initial company colour.
2025-03-17 20:28:02 +00:00
translators ff275b805b Update: Translations from eints
welsh: 144 changes by Ansbaradigeidfran
catalan: 6 changes by J0anJosep
2025-03-17 04:46:50 +00:00
Rubidium 5ea5855677 Codechange: use std::move over copying where applicable 2025-03-16 17:33:06 +01:00
Rubidium f214c81e97 Codechange: simplify some complicated logic 2025-03-16 15:12:02 +01:00
Rubidium d6a1a0b058 Codechange: simplify logic and prevent invalid bit 2025-03-16 14:14:21 +01:00
Rubidium b4e5b12047 Codechange: remove unneeded locking from SmallStack 2025-03-16 14:13:51 +01:00
Rubidium ec647975ad Cleanup: remove ancient FIXME comments 2025-03-16 05:42:29 +01:00
Rubidium 2b9c94f55a Fix: don't show owner of non-existent road 2025-03-16 05:42:29 +01:00
Peter Nelson 3b004c57bc
Codechange: Use EnumBitSet for AdminUpdateFrequency. (#13819) 2025-03-15 21:18:20 +00:00
Koen Bussemaker 8d4639e525 Fix: Error message window timeout doesn't match setting 2025-03-15 22:08:19 +01:00
Rubidium ccca7fc2b4 Codechange: remove unused INVALID_TRACK_BIT 2025-03-15 22:03:17 +01:00
enveeed b0cc56a8b5
Fix: NewGRF vehicles display loading sprites when not actually loading or unloading (#13554) 2025-03-15 16:58:47 -04:00
rubidium42 2fed4b0059
Codechange: simplify code (#13822) 2025-03-15 21:49:07 +01:00
Rubidium c13226cdf8 Codefix: do not leave pointers to stack allocations in globals 2025-03-15 21:46:43 +01:00
Rubidium dae788e2e3 Codefix: do not trust allocation sizes coming from a file 2025-03-15 21:44:40 +01:00
Rubidium f794ee028b Codefix: potential division by zero in midi reader 2025-03-15 21:44:18 +01:00
Rubidium 6d0ba270d2 Codefix: do not use an invalid iterator 2025-03-15 21:43:56 +01:00
Rubidium 24f79d2ab7 Codefix: wrong type for choice list mapping 2025-03-15 21:43:18 +01:00
Rubidium cf96a97e95 Codefix: remove unneeded looping logic 2025-03-15 21:42:28 +01:00
Peter Nelson 62b8b93476 Codechange: Add default initialisation for Rect to remove MemSetT. 2025-03-15 20:09:38 +00:00
Peter Nelson c905472650 Codechange: Use std::array for vehicle sorting/grouping options to remove MemSetT. 2025-03-15 20:09:38 +00:00
Peter Nelson 653e886d26 Codechange: Use std::array in OpenGLSprite to remove MemSetT. 2025-03-15 20:09:38 +00:00
Peter Nelson a87b804386
Fix #13760: Store encoded error message inside CommandCost. (#13764)
Encoded error message was previously static to avoid memmory allocation, however this causes complications.
2025-03-15 20:09:11 +00:00
frosch 0cd87bc8c1
Fix: Don't add chars with unspecified signedness to pointers. (#13828) 2025-03-15 18:48:26 +01:00
frosch 4f63340f8d
Codechange: Replace a raw pointer with std::optional. (#13809) 2025-03-15 16:52:12 +01:00
SamuXarick f6b0f7848b
Add: [Script] Newer Cargo Classes (#13779) 2025-03-15 16:51:56 +01:00
Loïc Guilloux c5ec8fb05f
Fix #13814, 2824e790: A Set() became Reset() preventing initial sorting of lists (#13816) 2025-03-14 21:15:42 +01:00
Rubidium ac2087a3eb Codefix: remove some logically dead code 2025-03-14 16:26:21 +01:00
frosch dbea968f4f
Codefix 20e57a02a28: String parameters were off by one. (#13810) 2025-03-14 15:22:30 +01:00
Peter Nelson bd5d47836d
Codechange: Use EnumBitSet for EdgeUpdateMode. (#13808) 2025-03-14 09:01:10 +00:00
translators 8191f39649 Update: Translations from eints
chinese (traditional): 11 changes by KogentaSan
spanish (mexican): 5 changes by absay
2025-03-14 04:43:31 +00:00
Charles Pigott bcabc3b780
Codechange: Upgrade fmt to 11.1.4 (#13807) 2025-03-13 21:52:47 +00:00
Rubidium 18e1440947 Codefix: move or pass by reference instead of copy 2025-03-13 21:16:16 +01:00
Rubidium 754311a779 Codechange: use std::move when appropriate 2025-03-13 13:00:24 +01:00
SamuXarick 05ce0828c0
Change: Use max of calculated and minimal heights in ScriptLeagueWindow (#13720) 2025-03-13 08:39:26 +00:00
Peter Nelson 8b39b23d2b
Codechange: Use EnumBitSet for VehicleFlags. (#13793) 2025-03-13 08:38:54 +00:00
Björn Wärmedal dc343ca141
Fix: GenerateCompanyName sends incorrect renaming event (#13794) 2025-03-13 08:24:35 +00:00
translators 70c2a666bc Update: Translations from eints
spanish (mexican): 7 changes by absay
czech: 39 changes by adamek0202
2025-03-13 04:45:10 +00:00
Rubidium 2b88f58384 Codefix: add move operators to SQObjectPtr 2025-03-12 22:05:02 +01:00