Commit Graph

30180 Commits

Author SHA1 Message Date
Peter Nelson
2560339472 Codechange: Use EnumBitSet for Border(Flag)s. 2025-01-29 21:46:39 +00:00
Peter Nelson
473728f181 Codechange: Use EnumBitSet for ExtraEngineFlags. 2025-01-29 21:46:39 +00:00
Peter Nelson
cea62a8399 Codechange: Use EnumBitSet for AspectFlags. 2025-01-29 21:46:39 +00:00
Peter Nelson
5ef495da78 Codechange: Use EnumBitSet for GroupFlags. 2025-01-29 21:46:39 +00:00
Peter Nelson
4b573b2703 Codechange: Use EnumBitSet for ViewportStringFlags. 2025-01-29 21:46:39 +00:00
Peter Nelson
05ac1dd888 Codechange: Use EnumBitSet for TileFlags. 2025-01-29 21:46:39 +00:00
Peter Nelson
3c2706f859 Codechange: Use EnumBitSet for EngineDisplayFlags. 2025-01-29 21:46:39 +00:00
Peter Nelson
6d1f56ce6b Codechange: Allow using EnumBitSet over network commands. 2025-01-29 21:46:39 +00:00
Peter Nelson
fdb3555147 Add: EnumBitSet class to safely use enum class values as a bitset.
This maintains type-safe enum values and type-safe masks, and avoids using undefined enum values.
2025-01-29 21:46:39 +00:00
Peter Nelson
bf6293a13f
Fix: Rail/road type conversion data is not populated on new game. (#13403)
This means that the rail/road type conversion that happens if NewGRFs are changed does not work the first time for a new game, only with a savegame.
2025-01-29 21:45:16 +00:00
translators
402aaf3d11 Update: Translations from eints
persian: 32 changes by CptMcWill
2025-01-29 04:42:38 +00:00
Peter Nelson
afc0745aa2
Codechange: Specify underlying type for all enums excluding those exposed to scripts. (#13383) 2025-01-28 22:17:34 +00:00
Peter Nelson
6fda85c569 Cleanup: Remove CMake endian detection. 2025-01-28 19:37:34 +00:00
Peter Nelson
fb6781015a Codechange: Use std::endian instead of TTD_ENDIAN defines. 2025-01-28 19:37:34 +00:00
Peter Nelson
b70438b76a
Fix #13392: Signs of removed stations are no longer visible. (#13395)
Add "Ghost" option for station sign visibility.
2025-01-28 19:10:32 +00:00
Peter Nelson
77f4d776c4
Codechange: Remove ZeroedMemoryAllocator from network socket handlers. (#13377)
Prefer member default initialisation instead.
2025-01-28 19:10:00 +00:00
Rubidium
4099acb946 Codechange: replace BSWAP32/BSWAP16 with std::byteswap 2025-01-28 19:22:12 +01:00
Rubidium
2481f2e085 Codechange: introduce own std::byteswap implementation
This is only available from C++23, but the implementation is fairly trivial
and the old variants of BSWAP32/BSWAP16 were not constexpr on MSVC. This was
due to all kinds of intrinsics that were added to get better code. However,
recent compilers with reasonable optimisation settings see the naive code and
will inject the appropriate optimised code (bswap op on x86-64).

For x86-64 recent is: Clang 6+ -O1, GCC 6+ -O2, MSVC 19.34+ /O1.
2025-01-28 19:22:12 +01:00
Rubidium
37a2d97c64 Doc: [Script] some IDs were not mentioned in script_types.hpp 2025-01-28 18:57:40 +01:00
Rubidium
1543b909dd Codechange: use 'using' over 'typedef' 2025-01-28 18:57:40 +01:00
Rubidium
9a21ca31f8 Codechange: [Script] do not redefine types in the script API
Also move includes to the locations where they are actually used
2025-01-28 18:57:40 +01:00
Rubidium
45444f9666 Codechange: rename DECLARE_POSTFIX_INCREMENT to DECLARE_INCREMENT_DECREMENT_OPERATORS 2025-01-28 18:56:58 +01:00
Rubidium
0207f91b8d Codechange: use traits to add increment/decrement operators to enums when requested 2025-01-28 18:56:58 +01:00
Peter Nelson
4b2b113292
Codechange: Remove TTD_ENDIAN from Colour union. (#13396)
`TTD_ENDIAN` is used to change the order of the r,g,b,a members of `Colour` to suit the architecture.

This kind of conditional is not supported by C++/`std::endian`, so instead three separate Colour unions are defined, `ColourRGBA`, `ColourARGB` and `ColourBGRA`. The correct union is then aliased to `Colour` using `std::conditional`.
2025-01-28 17:51:04 +00:00
Rubidium
d1e001f1c8 Codechange: make script and internal NEW_STATION have the same value 2025-01-28 18:17:05 +01:00
Richard Wheeler
b32e638e94 Change: Draw company manager face jacket after collar
Change the sprite drawing order defined by the enum and table to draw the (shirt) collar first, under the jacket. Simplifies new graphics development, allowing the shirt collar sprite to be a full shirt.
2025-01-27 21:31:29 +01:00
Charles Pigott
98d5dde094
Fix #13359: [CMake] Only search for Xaudio2 on Windows (#13372) 2025-01-27 20:24:57 +00:00
Patric Stout
119470f43e
Fix: [CMake] restore CMAKE_REQUIRED_FLAGS if you change it (#13393) 2025-01-27 19:41:51 +00:00
Jonathan G Rennison
a7deb16e81 Fix #13384: Crash when remove bus/truck stop tool used on road waypoints
Or vice versa
2025-01-27 20:21:01 +01:00
Koen Bussemaker
3dc12e3d65 Change: Don't distinguish between bus and truck stops when removing them 2025-01-27 19:00:39 +01:00
Rubidium
f34e04ee48 Codechange: allow mapping enums as parameter and return type from scripts 2025-01-27 06:13:45 +01:00
translators
e39f974d7d Update: Translations from eints
chinese (simplified): 1 change by WenSimEHRP
2025-01-27 04:43:45 +00:00
Peter Nelson
9b947a37b8
Codechange: Pass GRFConfig by reference where feasible. (#13388)
In places where a GRFConfig is passed by pointer and not checked for nullptr, use a reference instead.
2025-01-26 22:41:08 +00:00
Rubidium
e894a5880c Codechange: rename CargoID to CargoType and amend related variables/comments 2025-01-26 18:07:10 +01:00
Rubidium
d05cc2ef92 Codefix: do not consider TTD/TTO engine IDs actual EngineIDs 2025-01-26 18:02:12 +01:00
Rubidium
e7e9a12817 Codefix: Engine constructor's base parameter isn't an actual EngineID 2025-01-26 18:02:12 +01:00
Rubidium
40ab4e306b Codechange: use std::vector to store SpriteCache instances in 2025-01-26 18:00:07 +01:00
Rubidium
c6fc280ff1 Codechange: use std::vector over CallocT/free 2025-01-26 17:59:56 +01:00
Rubidium
043d1ac111 Codechange: use std::vector/std::unique_ptr over new/malloc 2025-01-26 17:59:56 +01:00
Rubidium
8016cfc0ef Codechange: use std::unique_ptr over malloc 2025-01-26 17:59:56 +01:00
Rubidium
f8566c3ff1 Codechange: use std::unique_ptr over calloc 2025-01-26 17:59:56 +01:00
Peter Nelson
b7a82819de Codechange: Remove ZeroedMemoryAllocator from WindowDesc.
All members which are not intended to be changed are now const to ensure they are set
2025-01-26 16:42:05 +00:00
Peter Nelson
95df7ea483 Change: Use separate WindowDescs instead of changing static data.
When opening vehicle lists a static WindowDesc is modified to change the class depending on the vehicle type.

Theses makes for inconsistencies and preferred window state, and prevents WindowDesc members being made const.
2025-01-26 16:42:05 +00:00
Peter Nelson
6c9b3f17b7
Fix 4c8f1b0f81: First entry of station cargo filter list was broken. (#13382)
Additional indent parameter was missing.
2025-01-26 10:09:18 +00:00
translators
492a5284ea Update: Translations from eints
latvian: 8 changes by lexuslatvia
2025-01-26 04:41:56 +00:00
Peter Nelson
1e14fd6a0d Codechange: Use enum class for PaletteAnimation. 2025-01-25 21:42:21 +00:00
Peter Nelson
161b02efda Codechange: Use enum class for BlitterMode. 2025-01-25 21:42:21 +00:00
Michael Ostapenko
c4494faf10 Fix #12968, d20df82: Added back ability to create unremovable houses 2025-01-25 14:40:51 +01:00
Rubidium
5b4c5632ba Codechange: add unit test against enum over optimisation 2025-01-25 10:49:13 +01:00
translators
5839ee3be3 Update: Translations from eints
galician: 8 changes by pvillaverde
2025-01-25 04:42:46 +00:00