Peter Nelson
4d40966303
Codechange: Use FlatSet to store and test alternate rail/road types.
2025-10-04 18:16:45 +01:00
Peter Nelson
8a8ebabb9d
Change: Provide road and rail overlay sprites for bridge decks. ( #14557 )
...
This allows bridges designed primarily with NewGRF railtypes and roadtypes to be at least somewhat compatible with built-in rail and road.
2025-09-29 22:08:16 +01:00
Peter Nelson
5ed8f1203b
Codechange: Cleanup unnecessary includes of spritecache.h ( #14678 )
2025-09-28 17:09:57 +00:00
Peter Nelson
41837d093b
Change: Record and show multiple errors for each NewGRF. ( #14658 )
2025-09-26 19:00:45 +01:00
Peter Nelson
42c9f84d74
Fix 3ac1a2f1e4: Game crash due to invalid vehicle type information. ( #14628 )
...
Use std::variant instead of union for vehicle info.
RailVehicleInfo is now non-POD so using in a union causes undefined behaviour.
2025-09-24 22:44:41 +01:00
Michael Lutz
1779da51c2
Add: [NewGRF] Train property to set multiple track types for an engine.
2025-09-14 17:11:26 +02:00
Michael Lutz
3ac1a2f1e4
Codechange: Store the rail type of rail engines as a RailTypes bitmask.
2025-09-14 17:11:26 +02:00
Michael Lutz
0715903b24
Codechange: Use an enum for vehicle acceleration model.
2025-09-14 17:11:26 +02:00
Peter Nelson
d095526406
Codechange: Range-check rail/road/tram maps by size instead of constant. ( #14602 )
...
* Compare against the size of the array instead of the constant used to define the array.
* `type_map` alias now uses auto to avoid defining the type each time.
* `_cur_gps.grffile->railtype_map` is now aliased to `type_map` to simplify and standardise.
2025-09-11 12:31:34 +01:00
Peter Nelson
960b840291
Fix 6d6e64b1f0: Road stop properties 0x13/0x14 were not skipped properly. ( #14567 )
...
These properties where changed to be variable length for consistency, but ignoring them treated them as fixed length.
2025-09-01 18:52:55 +01:00
Rubidium
7c0f69a8fe
Codefix: typos in comments and strings
2025-08-31 10:30:37 +02:00
Peter Nelson
6d6e64b1f0
Add: [NewGRF] Bridge pillar exclusion information for stations and roadstops.
...
NewGRF stations and roadstops can now specify bridge pillar and minimum height information for their tiles.
2025-08-20 21:40:41 +01:00
Peter Nelson
48b42492bc
Add: [NewGRF] Add extra information to bridges about pillars.
...
Bridges can now include information about pillars and blocked edges for each bridge piece.
This data is set for default bridges, and NewGRFs can provide their own pillar information.
2025-08-15 23:20:18 +01:00
Peter Nelson
439723b718
Codechange: Use handler structs for NewGRF action map sprite groups. ( #14489 )
...
Reduces code duplication for mapping sprite groups across GRF features.
2025-08-05 20:14:30 +01:00
Peter Nelson
13759e9f23
Fix: Display GRFID in correct hex format. ( #14478 )
2025-07-25 08:41:48 +01:00
Peter Nelson
921d83c324
Codechange: Unify structures with sprite sub-tile bounds and simplify bounding boxes. ( #14424 )
...
Lots of different structs contain variations on sub-tile bounds with different naming. Unify into a single struct that can be inherited and passed directly to AddSortableSpriteToDraw.
At the same time, offsets now work more logically: sub-tile bounds now specify the bounding box, and an offset can be applied to the sprite.
2025-07-22 00:02:00 +01:00
Peter Nelson
8e2df7809b
Codechange: Add distinct type to hold pixel drawing colour. ( #14457 )
...
This is used for individual pixels as well as line drawing.
2025-07-20 22:57:55 +01:00
Peter Nelson
b2de1ff66f
Fix #14433 : Broken road stop drawing due to incorrect modes conversion. ( #14434 )
...
The mask was treated as a single RoadStopDrawMode instead of a RoadStopDrawModes bitset.
2025-07-14 17:25:53 +01:00
Jonathan G Rennison
63f1c2aa3a
Codechange: Use TypedIndexContainer for typed index containers
...
Instead of ReferenceThroughBaseContainer
2025-06-12 18:50:49 +01:00
Peter Nelson
7c9393e822
Codechange: Remove terminator from airport tile lists. ( #14306 )
2025-05-27 20:23:59 +01:00
Peter Nelson
0aacd7acb3
Codechange: Use GrfSpecFeature type instead of uint8_t. ( #14253 )
2025-05-12 08:44:39 +01:00
frosch
84bc78fd8f
Add: [NewGRF] Special value 0x7FFE for VarAction2 results specifying 'return calculated result'.
2025-05-09 12:38:58 +02:00
frosch
9d32087236
Add: [NewGRF] Special value 0x7FFF for Action2 references specifying explicit 'callback/sprite-resolving failed'.
2025-05-09 12:38:58 +02:00
Rubidium
6caa08098c
Codechange: remove char* StringConsumer
2025-05-04 15:32:52 +02:00
frosch
74a275f37b
Add: [NewGRF] Add purchase list Action3 CID for houses, industries, industry tiles, airports and airport tiles. ( #14121 )
2025-05-03 17:50:20 +02:00
Rubidium
af25eecc15
Codechange: use const for std::string_view where appropriate
2025-04-29 10:15:18 +02:00
Rubidium
49ef3eee13
Codechange: replace char* with std::string_view
2025-04-27 20:08:02 +02:00
frosch
e1859df1c0
Codechange: Use enums as keys for the spritegroups in FixedGRFFileProps.
2025-04-27 19:50:51 +02:00
frosch
05504ec463
Codechange: Use SingleGRFFileProps, if the feature has no spritegroup keys.
2025-04-27 19:50:51 +02:00
frosch
41a20e512d
Codechange: Use proper enum type to index sprite groups in VariableGRFFileProps.
2025-04-27 19:50:51 +02:00
frosch
893aa0fb91
Codechange: Add an explicit enum member for the default spritegroup of badges.
2025-04-27 19:50:51 +02:00
Peter Nelson
7bbf380931
Fix #14125 , 828e808444: NewGRF sounds were not loaded. ( #14130 )
...
NewGRF Action 11 should be handled in both INIT and ACTIVATION stages for sounds to be loaded.
Additionally the Action 0 feature test failed due to offsets involved.
2025-04-27 15:20:38 +00:00
frosch
d7ddea4032
Codechange: Turn AnimationTrigger enums into enum classes. ( #14067 )
2025-04-21 20:53:31 +02:00
frosch
cb113cfed0
Codefix: Add missing header includes.
2025-04-20 22:06:18 +02:00
frosch
b862d4937f
Codechange: Turn custom vehicle spritenums into enum, and use them consistently. ( #14022 )
2025-04-18 15:19:28 +02:00
Peter Nelson
2c59838acb
Codechange: (re)set multiple bitset flags in one call. ( #14017 )
2025-04-18 14:07:57 +01:00
frosch
03ed59a004
Codechange: Turn AnimationStatus into an enum class.
2025-04-15 20:42:44 +02:00
frosch
96eee0e8e4
Codechange: Base ByteReader on StringConsumer.
2025-04-13 21:59:10 +02:00
frosch
1cfad1474a
Codechange: Rename _cur to _cur_gps.
2025-04-11 22:11:28 +02:00
Peter Nelson
786893a844
Fix: NewGRF Global variables 0D, 0E and 1E refer to wrong GRFFile. ( #13986 )
...
These variables used GrfProcessingState, which is only valid while loading GRFs, after which they always point to the last loaded GRFFile.
2025-04-11 19:53:05 +02:00
Peter Nelson
f57065dd41
Codefix: Avoid using override keyword as variable names.
...
Rename variables named `override`.
2025-04-09 22:02:35 +01:00
Peter Nelson
91ab7f10cd
Codefix: Avoid using override keyword as member name.
...
Rename `GRFFileProps` `override` member to `override_id`.
2025-04-09 22:02:35 +01:00
frosch
20805ba84b
Codechange: Use EncodeUtf8 and DecodeUtf8 directly, when dealing with a single character.
2025-04-03 18:43:41 +02: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
frosch
25005cff16
Codefix: std::string_view::data() is not necessarily null terminated. ( #13891 )
2025-03-25 20:32:19 +01:00
frosch
488cda728d
Codechange: Use std::string and std::string_view instead of C strings.
2025-03-24 23:10:13 +01: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