Commit Graph
80 Commits
Author SHA1 Message Date
Rubidiumandrubidium42 d067bfe577 Codechange: add missing parameter/return documentation to NewGRF code 2026-02-18 18:28:46 +01:00
Peter NelsonandGitHub 0e25f9245c Codechange: use PoolID for newgrf class ids (#15228) 2026-02-18 09:11:04 +00:00
Rubidiumandrubidium42 a0b173b43c Codechange: remove @return documentation for void methods 2026-02-15 20:30:26 +01:00
Peter NelsonandGitHub 7341c4d9aa Fix #14827: Store random trigger information per-tile. (#14830) 2026-02-03 23:01:55 +00:00
Rubidiumandrubidium42 c6c06e13eb Codefix: wrong parameter names and partially missing parameters 2026-02-02 16:31:46 +01:00
Rubidiumandrubidium42 67fac86149 Codefix: remove @param documentation for parameters that don't exist anymore 2026-02-01 15:49:41 +01:00
Peter NelsonandGitHub ebdc82ad54 Fix #14921: Crash during station autorefit if station doesn't accept current cargo type. (#14924)
Add convenience helpers to correctly retrieve goods entry cargo available/totals.

Avoids having to check if cargo data is available before accessing it, which was missing for autorefit.
2025-12-15 18:06:43 +00:00
Rito12andrubidium42 859b56a066 Doc: Correct file descriptions to match coding style and doxygen. 2025-12-15 17:31:00 +01:00
Cyprian KlimaszewskiandGitHub 99f04f27de Doc: Update information for receiving a copy of GPL. (#14869) 2025-12-07 11:25:08 +00:00
Peter NelsonandGitHub 70d4182850 Fix #14631, Fix 1cb0cbcb6c: Waypoint customs spec not allocated properly on initial construction. (#14633)
Split AllocateSpecToStation/RoadStop into Allocate and Assign functions, allowing command tests to occur separately.
2025-09-21 09:32:25 +01:00
Peter NelsonandGitHub 1cb0cbcb6c Codechange: Standardise how AllocateSpecToStation/RoadStop are called. (#14525)
Replace use of negative value with std::optional and update doxygen.
2025-08-19 18:52:36 +01:00
Peter NelsonandGitHub 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
Peter NelsonandGitHub 1cd0391926 Fix #14356, ff7eb996e6: Incorrect sprite group chosen for stations and road stops. (#14359) 2025-06-14 13:38:45 +01:00
froschandfrosch 6faa667644 Codechange: Remove global GetRegister(), instead return 100+ registers directly from GetXxxCallback(). 2025-05-06 22:24:41 +02:00
froschandfrosch f59cf73b88 Codechange: Access temporary storage through ResolverObject during sprite layout preprocessing. 2025-05-06 22:24:41 +02:00
froschandfrosch 85be7a4d92 Codechange: Access temporary storage through ResolverObject during Resolve. 2025-05-06 22:24:41 +02:00
froschandfrosch 74030a63e6 Codechange: Move SpriteLayoutProcessor's operations closer to the ResolverObject. 2025-05-06 22:24:41 +02:00
froschandfrosch 8bbfbd0347 Codechange: Move spritelayout preprocessing to a separate class, which owns the heap allocations involved. 2025-05-06 18:30:42 +02:00
froschandfrosch d9c43e7fda Codechange: Make TileLayoutSpriteGroup::ProcessRegisters return a DrawTileSpriteSpan on the stack, instead of a reference to a global. 2025-05-06 18:30:42 +02:00
froschandfrosch 010b944173 Codechange: Move SpriteGroup cast from callers into Resolve. 2025-04-29 10:35:10 +02:00
froschandGitHub 30b1eb6e5f Fix: [NewGRF] The result of Action123 evaluation affected rerandomisation in a weird corner case. (#14139)
Rerandomisation does not care about the Resolve result.
But we skipped it, in case of 'invalid SpriteGroup reference'.
2025-04-28 23:24:42 +02:00
Peter NelsonandGitHub 2c4897c2cd Codechange: Use EnumBitSet for HouseZones. (#14137) 2025-04-28 20:27:43 +01:00
froschandfrosch 0f1ef96ca1 Codechange: Road stops do not use RealSpriteGroup, ResolveReal is never called. 2025-04-28 20:49:20 +02:00
froschandfrosch 41a20e512d Codechange: Use proper enum type to index sprite groups in VariableGRFFileProps. 2025-04-27 19:50:51 +02:00
froschandGitHub f62f728187 Codechange: Move usage of ResolverObjects to newgrf_xxx.cpp (#14116) 2025-04-26 20:53:50 +02:00
froschandGitHub d3ae6bc9a8 Fix: [NewGRF] For animation-triggers which do not supply a cargo-type in var18, the var18 bits should remain empty. (#14091) 2025-04-26 14:44:07 +02:00
froschandfrosch bc0eaf9ac4 Codechange: Allow passing waypoints to Trigger(Station|RoadStop)Randomisation. 2025-04-24 09:19:43 +02:00
froschandGitHub 6f056283f2 Fix: [NewGRF] For roadstop multi-tile-animation-triggers, the upper 16 bits were not the same for all tiles. (#14084) 2025-04-23 19:26:09 +02:00
froschandGitHub d7ddea4032 Codechange: Turn AnimationTrigger enums into enum classes. (#14067) 2025-04-21 20:53:31 +02:00
froschandGitHub 61a0a520f6 Codechange: Unify random trigger enums and turn them into enum classes. (#14066) 2025-04-21 20:03:34 +02:00
froschandfrosch f399b8eb29 Codechange: Unify naming of NewGRF animation callbacks. 2025-04-21 19:06:13 +02:00
froschandfrosch 264abfafe6 Codechange: Rename storage of random triggers to include the term 'random'. 2025-04-21 19:06:13 +02:00
froschandGitHub 2a62eea005 Codefix: Comment style. (#14064) 2025-04-21 17:25:09 +02:00
froschandfrosch cde350dc01 Codechange: Replace macros GENERAL_SPRITE_COLOUR and COMPANY_SPRITE_COLOUR with functions GetColourPalette and GetCompanyPalette. 2025-04-18 23:41:37 +02:00
Peter NelsonandGitHub 9f94cadd68 Codefix: GRF-local cargo id is not a CargoType. (#13888) 2025-03-25 17:12:43 +00:00
Peter NelsonandPeter 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 NelsonandPeter 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 NelsonandPeter Nelson 8f14894024 Add: NewGRF Badges. 2025-02-16 22:24:25 +00:00
Peter NelsonandGitHub ff7eb996e6 Codechange: Use variable storage for GrfProps with cargo-type groups. (#13557)
Slots are only allocated when used instead of being reserved.

Array-based GrfProps are still used when the number of options is more limited.
2025-02-14 18:30:17 +00:00
Peter NelsonandPeter Nelson 75387b9e2b Codechange: Use EnumBitSet for StationFacility. 2025-02-13 18:03:13 +00:00
Jonathan G Rennisonandrubidium42 d06b371254 Cleanup: Fix various spelling errors 2025-02-12 22:44:51 +01:00
Peter NelsonandPeter Nelson c31494a413 Codechange: Use EnumBitSet for RoadStopDrawModes. 2025-02-04 18:52:08 +00:00
Peter NelsonandPeter Nelson 17f6da413d Codechange: Use EnumBitSet for RoadStopSpecFlags. 2025-02-04 18:52:08 +00:00
Peter NelsonandPeter Nelson 40aeedeade Codechange: Use EnumBitSet for callback masks. 2025-01-31 17:08:24 +00:00
Rubidiumandrubidium42 e894a5880c Codechange: rename CargoID to CargoType and amend related variables/comments 2025-01-26 18:07:10 +01:00
Peter NelsonandGitHub 5f0e4cd646 Codechange: Make RoadStopType an enum class. (#13340) 2025-01-19 21:43:17 +00:00
Peter NelsonandGitHub 4397aa3909 Codechange: Make StationType an enum class. (#13339) 2025-01-19 20:53:08 +00:00
Peter NelsonandGitHub 810e442203 Codechange: Split GoodsEntry cargo and flows data to unique_ptr. (#13058)
This allows cargo packets and cargo flow data to be empty if not in use, which is the case for the majority of station goods entries, and data is allocated when needed.

This reduces the initial size of a Station from 9192 bytes to 2024 bytes (on 64 bit platforms), although an allocation of 120 bytes is made for each active cargo type at a station.

Based on similar changes in JGRPP.
2025-01-02 20:48:23 +00:00
Peter NelsonandPeter 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
Jonathan G RennisonandGitHub d5ff6b4156 Fix 8d62a8f0: Road stop variable 6B crashing for road stop preview in GUI (#12930) 2024-09-06 11:14:34 +01:00