frosch
6faa667644
Codechange: Remove global GetRegister(), instead return 100+ registers directly from GetXxxCallback().
2025-05-06 22:24:41 +02:00
frosch
f59cf73b88
Codechange: Access temporary storage through ResolverObject during sprite layout preprocessing.
2025-05-06 22:24:41 +02:00
frosch
85be7a4d92
Codechange: Access temporary storage through ResolverObject during Resolve.
2025-05-06 22:24:41 +02:00
frosch
74030a63e6
Codechange: Move SpriteLayoutProcessor's operations closer to the ResolverObject.
2025-05-06 22:24:41 +02:00
frosch
8bbfbd0347
Codechange: Move spritelayout preprocessing to a separate class, which owns the heap allocations involved.
2025-05-06 18:30:42 +02:00
frosch
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
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
frosch
010b944173
Codechange: Move SpriteGroup cast from callers into Resolve.
2025-04-29 10:35:10 +02:00
frosch
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 Nelson
2c4897c2cd
Codechange: Use EnumBitSet for HouseZones. ( #14137 )
2025-04-28 20:27:43 +01:00
frosch
b7e7f08f78
Codechange: Simplify usage of GRFFileProps by adding some common helper methods.
2025-04-28 13:44:46 +02:00
frosch
f62f728187
Codechange: Move usage of ResolverObjects to newgrf_xxx.cpp ( #14116 )
2025-04-26 20:53:50 +02:00
frosch
398524e49a
Add: [NewGRF] Provide random bits in var10 of house callback 1C 'construction stage changed'. ( #14095 )
2025-04-26 15:58:44 +02:00
frosch
0d9074769d
Change: [NewGRF] Animation-trigger 'construction stage changed' of houses and industries now also triggers at construction start. ( #14089 )
2025-04-26 14:42:49 +02:00
frosch
61a0a520f6
Codechange: Unify random trigger enums and turn them into enum classes. ( #14066 )
2025-04-21 20:03:34 +02:00
frosch
f399b8eb29
Codechange: Unify naming of NewGRF animation callbacks.
2025-04-21 19:06:13 +02:00
frosch
264abfafe6
Codechange: Rename storage of random triggers to include the term 'random'.
2025-04-21 19:06:13 +02:00
frosch
39220a5feb
Codechange: Unify naming of NewGRF random trigger functions.
2025-04-21 19:06:13 +02:00
frosch
368d131fb7
Codechange: Use 'construction stage' consistently, instead of 'construction state'.
2025-04-21 19:06:13 +02:00
frosch
b956af631e
Codechange: Replace CircularTileSearch with SpiralTileSequence.
2025-04-20 12:50:45 +02:00
frosch
cde350dc01
Codechange: Replace macros GENERAL_SPRITE_COLOUR and COMPANY_SPRITE_COLOUR with functions GetColourPalette and GetCompanyPalette.
2025-04-18 23:41:37 +02:00
frosch
5aed046d11
Fix: [NewGRF] Strange things happened, when using the synchronised tile loop animation trigger for houses. ( #14011 )
2025-04-17 12:15:49 +02:00
Peter Nelson
325f7f9767
Codechange: Use EnumBitSet for GoodsEntry status. ( #13899 )
2025-03-26 21:22:33 +00:00
Peter Nelson
8f14894024
Add: NewGRF Badges.
2025-02-16 22:24:25 +00:00
Peter Nelson
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
Jonathan G Rennison
d06b371254
Cleanup: Fix various spelling errors
2025-02-12 22:44:51 +01:00
Tyler Trahan
521b860394
Feature: Prevent towns from upgrading individually-placed houses ( #13270 )
2025-02-09 20:37:06 +00:00
Peter Nelson
95bd53ddf1
Codechange: Use EnumBitSet for BuildingFlags.
2025-02-01 14:16:25 +00:00
Peter Nelson
113205c540
Codechange: Use EnumBitSet for HouseExtraFlags.
2025-02-01 14:16:25 +00:00
Peter Nelson
40aeedeade
Codechange: Use EnumBitSet for callback masks.
2025-01-31 17:08:24 +00:00
Rubidium
e894a5880c
Codechange: rename CargoID to CargoType and amend related variables/comments
2025-01-26 18:07:10 +01: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
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
6c09dcdd66
Codechange: Use reference for non-optional StationList parameter. ( #13092 )
2024-11-19 20:33:32 +00:00
Peter Nelson
e60c5f30a3
Fix ddf1510a23: House animation random data flag ignored. ( #12963 )
...
In the refactor to unified tile animation code, the test for `CALLBACK_1A_RANDOM_BITS` incorrectly got changed to a `HasBit()` test preventing it from working.
Use `HasFlag()` instead.
2024-09-23 17:18:28 +00:00
Loïc Guilloux
29ce013eda
Codechange: Pass avail(able) as reference instead of pointer since they are never nullptr ( #12696 )
2024-05-18 17:04:16 +02:00
Peter Nelson
ed67aedabf
Feature: Allow manually placing town buildings in scenario editor.
...
House picker is accessed from the Landscaping toolbar as there is no town toolbar.
Once placed these houses behave like any other and can be removed by players and towns.
Uses the unified picker system, so also supports used/saved favourites. As town building don't have class labels, town zones are use to imitate them.
2024-05-14 21:11:48 +01:00
Peter Nelson
b731ab0632
Change: Allow sprite resolver to evaluate non-existent houses.
...
This could previous be done but only with a town and tile in mind, but for drawing in the UI, neither of those exist yet.
2024-05-14 21:11:48 +01:00
Peter Nelson
e16b982b6a
Codechange: Use iteration when dealing with all HouseSpecs.
2024-03-28 23:23:00 +01:00
Peter Nelson
3e83dcedfd
Codechange: Allocate houses dynamically instead of from a fixed array.
...
This uses vectors for HouseSpecs and global/town building counts.
2024-03-28 23:23:00 +01:00
Patric Stout
a3cfd23cf9
Codechange: rename byte to uint8_t ( #12308 )
2024-03-16 23:59:32 +01:00
Rubidium
27eadc13ec
Codechange: rename TILE_ADD(XY) to TileAdd(XY)
2024-03-10 15:50:24 +01:00
Peter Nelson
c0ab436077
Codechange: Store Colours in Colours type. ( #11625 )
...
This reduces casts, some magic numbers, and introduces a bit of type-safety.
2024-01-21 13:23:04 +00:00
Peter Nelson
ab535c0a86
Codechange: Add base() method to StrongType to allow access to the base type without casting. ( #11445 )
...
This removes the ability to explicitly cast to the base type, but the requirement
to use .base() means the conversion is still explicit.
2023-11-06 20:29:35 +00:00
frosch
b6c8f301be
Codechange: Silence warnings about intentionally unused parameters.
2023-09-19 22:49:59 +02:00
PeterN
6643c010bd
Fix: NewGRF house class mappings were not reset between games. ( #11279 )
2023-09-10 18:55:37 +01:00
Patric Stout
299570b2c1
Codechange: make TimerGameCalendar Date and Year types strongly typed ( #10761 )
2023-08-12 18:14:21 +00:00
Rubidium
eaae0bb5e7
Codechange: automatic adding of _t to (u)int types, and WChar to char32_t
...
for i in `find src -type f|grep -v 3rdparty/fmt|grep -v 3rdparty/catch2|grep -v 3rdparty/opengl|grep -v stdafx.h`; do sed 's/uint16& /uint16 \&/g;s/int8\([ >*),;[]\)/int8_t\1/g;s/int16\([ >*),;[]\)/int16_t\1/g;s/int32\([ >*),;[]\)/int32_t\1/g;s/int64\([ >*),;[]\)/int64_t\1/g;s/ uint32(/ uint32_t(/g;s/_uint8_t/_uint8/;s/Uint8_t/Uint8/;s/ft_int64_t/ft_int64/g;s/uint64$/uint64_t/;s/WChar/char32_t/g;s/char32_t char32_t/char32_t WChar/' -i $i; done
2023-07-19 19:30:14 +02:00
Peter Nelson
76516d7f70
Codechange: Use IsValidCargoID/IsValidCargoType.
...
IsValidCargoType() is used only for unmapped IDs.
2023-05-22 20:43:40 +01:00
Rubidium
fb856e16c1
Codechange: replace some min/clamp constructs to ClampTo
2023-05-06 21:26:13 +02:00