Jonathan G Rennison
1bfd96c7f2
Merge branch 'master' into jgrpp
...
# Conflicts:
# src/3rdparty/fmt/core.h
# src/command_type.h
# src/console_cmds.cpp
# src/core/overflowsafe_type.hpp
# src/landscape.cpp
# src/network/network.cpp
# src/newgrf_object.h
# src/object_cmd.cpp
# src/order_gui.cpp
# src/saveload/vehicle_sl.cpp
# src/script/api/script_industrytype.cpp
# src/script/api/script_object.hpp
# src/script/api/script_town.cpp
# src/table/object_land.h
# src/timetable_cmd.cpp
# src/tree_cmd.cpp
# src/vehicle_gui.cpp
# src/window.cpp
2 years ago
PeterN
2355882ec1
Codechange: Remove object `enabled` flag and shuffle members. ( #10358 )
...
`enabled` flag is replaced with IsEnabled() which checks if views is
non-zero.
ObjectSpec is shuffled to reduce its memory footprint.
2 years ago
Jonathan G Rennison
5b490b243d
Merge branch 'master' into jgrpp
...
# Conflicts:
# src/industry_cmd.cpp
# src/landscape.cpp
# src/object_cmd.cpp
# src/rail_cmd.cpp
# src/script/api/script_tile.cpp
# src/table/settings/difficulty_settings.ini
# src/table/settings/world_settings.ini
# src/terraform_cmd.cpp
# src/tilearea_type.h
# src/tree_cmd.cpp
# src/tree_cmd.h
# src/tree_gui.cpp
# src/water_cmd.cpp
2 years ago
PeterN
6a0d1c7c19
Fix: Link variants to parents when finalising engines. ( #10346 )
...
This ensures that definition-order of engines within the NewGRF does not matter.
2 years ago
Jonathan G Rennison
62d524eaef
Merge branch 'master' into jgrpp
...
# Conflicts:
# src/saveload/station_sl.cpp
# src/saveload/town_sl.cpp
# src/spritecache.cpp
# src/timetable_gui.cpp
2 years ago
PeterN
1b1aa682a6
Fix: Don't assume engclass 2 should be elrail. ( #10315 )
...
When disabling/enabling elrail, there is an assumption that `engclass` of 2
means the engine will run on elrail. While this holds for default engines,
NewGRFs can do other things.
To resolve this we store the intended railtype so that toggling elrail will
restore to the correct type.
2 years ago
Jonathan G Rennison
b9dad1818b
Add setting to disable NewGRF inflation flag
2 years ago
Jonathan G Rennison
64c210f770
Merge branch 'master' into jgrpp
...
# Conflicts:
# src/build_vehicle_gui.cpp
# src/engine.cpp
# src/engine_func.h
# src/group_gui.cpp
# src/lang/english.txt
# src/newgrf.cpp
# src/saveload/oldloader_sl.cpp
# src/timetable_cmd.cpp
# src/timetable_cmd.h
# src/timetable_gui.cpp
2 years ago
Jonathan G Rennison
58d841486e
Merge branch 'master' into jgrpp
...
# Conflicts:
# src/os/windows/font_win32.cpp
# src/script/api/script_object.hpp
# src/town_cmd.cpp
# src/train_cmd.cpp
# src/viewport.cpp
# src/viewport_func.h
2 years ago
Francis Herne
6caed5f15e
Add: Slope-aware and roadtype-specific one-way sprites. ( #10282 )
2 years ago
PeterN
4f26f6b8aa
Cleanup: Simplify GRFLabel linked-list with std::vector. ( #10284 )
2 years ago
Peter Nelson
3485709f53
Add: Additional vehicle flags to control variants.
2 years ago
Peter Nelson
85814b29d4
Feature: Vehicle add-ons can now group engines in purchase list.
...
Grouped engines are collapsed by default but can be expanded. This allows
similar engines to be grouped together to avoid cluttering the list.
Suggested uses for this are e.g.:
* Liveries; same stats but different paint job.
* Re-gearing; engine design is mostly the same but different stats.
... but avoiding complex hidden cargo subtype refit systems.
Grouped engines are otherwise separate, so can be independently
autoreplaced, even between variants.
2 years ago
peter1138
d7f561a400
Change: Add variant property to engines.
2 years ago
PeterN
7b5edba76c
Change: Support flipping shorter engines without NewGRF support. ( #10262 )
...
* Change: Support flipping shorter engines without NewGRF support.
* Cleanup: Remove write-only prop27_set temporary flag.
2 years ago
Jonathan G Rennison
3877bb31ef
Changing day length or date no longer changes time in minutes
...
Add offset variables for scaled date ticks.
Adjust offset when changing day length or date, such that scaled
date ticks remain the same.
Store _scaled_tick_counter and scaled date ticks offset in the savagame.
2 years ago
Jonathan G Rennison
9038c849ab
VarAction2: Use scaled tick counter for NewGRF variable 0x0A
2 years ago
Jonathan G Rennison
12b20376b3
Add new landscape flag to enable drawing rocks covered by snow
2 years ago
Jonathan G Rennison
41fb98db09
Add NewGRF global flag to allow rocky tiles in tropic desert zones
2 years ago
Jonathan G Rennison
2af2c56d19
Allow various settings to be changed in multiplayer
...
If the corresponding TTDPatch flag bit has not been observed by a NewGRF
2 years ago
Jonathan G Rennison
6459e62fff
Merge branch 'master' into jgrpp
...
# Conflicts:
# src/lang/english.txt
# src/map_type.h
# src/network/network_command.cpp
# src/object_cmd.cpp
# src/rail_cmd.cpp
# src/road_cmd.cpp
# src/road_func.h
# src/saveload/afterload.cpp
# src/saveload/saveload.h
# src/settings_gui.cpp
# src/string.cpp
# src/table/road_land.h
# src/table/settings/game_settings.ini
# src/table/settings/world_settings.ini
# src/tbtr_template_gui_main.h
# src/train_cmd.cpp
2 years ago
PeterN
f24286a1ae
Fix: Ensure 31-bit shifts are unsigned. ( #10128 )
...
Shifting a signed 32-bit integer by 31 bits is undefined behaviour.
A few more than necessary are switched to unsigned for consistentency.
2 years ago
Jonathan G Rennison
ba3bc73676
VarAction2: Fix memory leak of inlinable adjust groups
2 years ago
Jonathan G Rennison
0a9c44d1a2
Merge branch 'master' into jgrpp
...
# Conflicts:
# src/airport_gui.cpp
# src/blitter/32bpp_anim_sse4.cpp
# src/console_cmds.cpp
# src/linkgraph/linkgraph_gui.cpp
# src/newgrf_object.h
# src/road_gui.cpp
# src/widgets/road_widget.h
# src/window.cpp
2 years ago
Michael Lutz
bd357656ba
Codechange: [NewGRF] Replace magic number for default object size by a constant.
2 years ago
frosch
f4e2a462fe
Cleanup: Remove unused flag sprites.
2 years ago
Jonathan G Rennison
0818ce4ae7
Merge branch 'master' into jgrpp (SLV_U64_TICK_COUNTER)
...
# Conflicts:
# src/date.cpp
# src/date_func.h
# src/newgrf.cpp
# src/newgrf_animation_base.h
# src/saveload/gamelog_sl.cpp
# src/saveload/misc_sl.cpp
# src/saveload/saveload.h
# src/stdafx.h
2 years ago
Jonathan G Rennison
c2ede2af54
VarAction2: Allow inlining trivial procedures
2 years ago
dP
548f0496a9
Change: Make _tick_counter 64bit to avoid wrapping ( #10035 )
2 years ago
Jonathan G Rennison
3d8187261a
Debug: Include values when logging GRF base cost changes
2 years ago
Jonathan G Rennison
ece0a43146
Merge branch 'master' into jgrpp
...
# Conflicts:
# src/newgrf_station.cpp
2 years ago
frosch
e2c46fda3f
Fix: [NewGRF] Ensure that stations always have an even number of sprite layouts.
...
The drawing code has a special fallbacks for zero layouts, but fails hard for one layout.
(odd numbers >= 3 are weird, but do not fail as badly as 1)
2 years ago
Jonathan G Rennison
173f867e1a
VarAction2: Save calculated_result in shadow group struct
2 years ago
Jonathan G Rennison
14de8c7f34
VarAction2: Add quick exit case to last-level callback groups if possible
2 years ago
Jonathan G Rennison
9c18835bd0
Move ProcessDeterministicSpriteGroupRanges into newgrf.cpp
2 years ago
Jonathan G Rennison
4601a1bfc6
Move NewGRF optimiser functions into a separate file
...
Create a new header for shared definitions with newgrf.cpp
2 years ago
Jonathan G Rennison
3d59c961a6
VarAction2: Avoid group variable tracking coupling through shared procs
...
Output dependencies on a procedure shouldn't propagate into input
dependencies on unrelated call sites in different groups
2 years ago
Jonathan G Rennison
00e32162a1
VarAction2: Allow DSE to remove procedure calls
2 years ago
Jonathan G Rennison
30ecdfe140
VarAction2: Allow jumping over constant stores to special registers
...
Insert suitable store(s) after the end block
2 years ago
Jonathan G Rennison
3a8bd7a589
VarAction2: Allow jumps to skip over procedure calls if possible
2 years ago
Jonathan G Rennison
e143ab06d8
VarAction2: Track which temp stores may be overwritten by procedures
...
Instead of treating procedures as an unpredictable store
2 years ago
Jonathan G Rennison
06cc71b6c5
VarAction2: Mark suitable AND ops as jump insertion candidates
2 years ago
Jonathan G Rennison
0bddf96f7f
VarAction2: Set variable for ABS op to avoid unused read from var 0
2 years ago
Jonathan G Rennison
7af568f0f0
VarAction2: Handle case where expensive vars are only conditionally read
...
Within a JZ_LV and in prior DSGAF_SKIP_ON_ZERO op
2 years ago
Jonathan G Rennison
9a4c31b0da
VarAction2: Add last_value variants of JZ/JNZ ops
2 years ago
Jonathan G Rennison
cbc6199542
VarAction2: Add a JNZ op analogous to JZ for OR ops
2 years ago
Jonathan G Rennison
5ec802a3d4
VarAction2: Allow substituting perm store loads through temp store
2 years ago
Jonathan G Rennison
ed737e1a8f
VarAction2: Do not remove redundant adjusts when this would break var 1C
2 years ago
Jonathan G Rennison
b9c22a0b9e
VarAction2: Do not prune groups when this would break var 1C
2 years ago
Jonathan G Rennison
ae746a1af4
VarAction2: Fix tracking of whether a sprite group needs var 1C
2 years ago
Jonathan G Rennison
c19bd4473f
Add signal style flag to require realistic braking
2 years ago
Jonathan G Rennison
78ae295dfe
Add combined normal and shunt aspect signal style flag
2 years ago
Jonathan G Rennison
759b00262e
VarAction2: Allow more than one JZ to end on the same end block adjust
2 years ago
Jonathan G Rennison
9775f468e8
VarAction2: Fix jump insertion moving the end marker for another jump
2 years ago
Jonathan G Rennison
89f66236ff
VarAction2: Fix SHR/SAR mixup in check for merge with prior RST
2 years ago
Jonathan G Rennison
a311f12615
Add signals_style_lookahead_single_signal_only signal style property
2 years ago
Jonathan G Rennison
fcae909839
Add signal style flag for drawing on the opposite side
2 years ago
Jonathan G Rennison
229613b06a
VarAction2: Resolve jumps in advance to avoid needing to track nesting
2 years ago
Jonathan G Rennison
387e646439
VarAction2: Add group flag for whether to run jump insert pass
2 years ago
Jonathan G Rennison
3714fad790
VarAction2: Fix jump insertion using mul with bool as last value
2 years ago
Jonathan G Rennison
4af3022c45
VarAction2: Fix last variable read annotations being incorrect
...
This is because DSE variable substitutions/etc were applied afterwards
This broke jump insertion
2 years ago
Jonathan G Rennison
191f710c40
Add custom signal style properties to set electric/semaphore enabled types
2 years ago
Jonathan G Rennison
175c5d4d50
Add signal style flag to limit lookahead extra aspect
2 years ago
Jonathan G Rennison
bdd73a19a1
Add signal style flag for unconditional reserve through
...
Add map bits for unconditional reserve through
Adjust signal aspect/state handling
2 years ago
Jonathan G Rennison
7ae06124ae
Add signal style flag for no aspect increase behaviour (banner repeater)
2 years ago
Jonathan G Rennison
6e4c4b35e7
Initial implementation of NewGRF custom signal styles
2 years ago
Jonathan G Rennison
4acccc232a
Fix #9925 : Industry tile layout validation for layouts of only one tile
2 years ago
Jonathan G Rennison
098bb74ed2
Fix industry tile layout validation when the layout has only one tile
...
See: https://github.com/OpenTTD/OpenTTD/issues/9925
2 years ago
Jonathan G Rennison
13fcde9ea0
VarAction2: Add a JZ operation, use for ternary style mul masking
2 years ago
Jonathan G Rennison
8687b82dd8
VarAction2: Mark various object variables as expensive
2 years ago
Jonathan G Rennison
c0b1f867a3
VarAction2: Prefer tracking store content as clone of another store
2 years ago
Jonathan G Rennison
315f12f1e4
Fix spelling error in comment
2 years ago
Jonathan G Rennison
7bb0de247d
Add GRF feature: New Landscape
...
Custom graphics using actions 1/2/3.
Currently only for rock tiles
2 years ago
Jonathan G Rennison
5a02a13885
VarAction2: Add abs() detection to bool/mul adjust combining
2 years ago
Jonathan G Rennison
e554d7fdfb
VarAction2: Generalise bool/mul adjust combining
2 years ago
Jonathan G Rennison
3e56837ae6
Fix bec2bf7e: Fix (anti-)commutative store/load re-arrangements
2 years ago
Jonathan G Rennison
34cd547325
Debug: Show if action 2s have been modified by action 6 in debug window
2 years ago
Jonathan G Rennison
6214d0d20d
VarAction2: Add an ABS opcode
2 years ago
Jonathan G Rennison
7f1b3a965f
VarAction2: Allow tracking stores as (inverted) clones of previous store
2 years ago
Jonathan G Rennison
bec2bf7e85
VarAction2: Initial temp store versioning in 1st pass
2 years ago
Jonathan G Rennison
4f3058ee06
VarAction2: Improve handling of variable 7B with a previous constant
2 years ago
Jonathan G Rennison
23e6d861fc
VarAction2: Ensure that store simplification can't break var 7B
2 years ago
Jonathan G Rennison
3bddd55921
VarAction2: Add sprite group flag for if var 1C seen before proc
2 years ago
Jonathan G Rennison
16185e817e
VarAction2: Merge compatible constant operations
2 years ago
Jonathan G Rennison
0343e9d9dd
VarAction2: Replace sequences of the form: (var * flag) + (var * !flag)
2 years ago
Jonathan G Rennison
e5e984d92f
VarAction2: Replace effective SMAX/SMIN sequences in DSE pass
2 years ago
Jonathan G Rennison
0484fbf941
VarAction2: Save/restore inference when going back to previous op with side effects
2 years ago
Jonathan G Rennison
376b434d53
VarAction2: Re-order commutative skip on zero operation sequences
...
Such that less expensive variables can be tested first
2 years ago
Jonathan G Rennison
0409bd88e8
VarAction2: Simplify tracking of sprite group feature
2 years ago
Jonathan G Rennison
caebff85f5
VarAction2: Add helper functions for constant comparison adjust types
2 years ago
Jonathan G Rennison
249a20e47a
VarAction2: Add helper functions for relational comparison ops
2 years ago
Jonathan G Rennison
31e96ff5e7
VarAction2: Add helper functions for anti-commutative ops
2 years ago
Jonathan G Rennison
5db30e559e
VarAction2: Store substitutions can now handle inversions
2 years ago
Jonathan G Rennison
b95116e4fc
VarAction2: Apply XOR bool inversion conversions after DSE
2 years ago
Jonathan G Rennison
2bbfa37730
VarAction2: Replace reversed commutative/sub op via temp storage in DSE pass
2 years ago
Jonathan G Rennison
45ac1a89aa
VarAction2: Apply XOR with 1 bool logic inversion in more cases
...
Fixes case of DSE-delayed var substitutions
2 years ago
Jonathan G Rennison
1c1e6a1042
VarAction2: Prune deterministic sprite group children again after DSE
2 years ago
Jonathan G Rennison
6e398f9cec
VarAction2: DSE now takes into account DSE results from child groups
2 years ago
Jonathan G Rennison
65407210a6
VarAction2: Allow DSGA_OP_STO_NC to be used with DSGA_TYPE_EQ/NEQ
2 years ago
Jonathan G Rennison
d3dce79d73
VarAction2: Substitute single-use vars through temp storage in DSE pass
2 years ago
Jonathan G Rennison
0310692acf
VarAction2: Only substitute cheap vars through temp storage in 1st pass
2 years ago
Jonathan G Rennison
f54530b1b2
VarAction2: Add checks for vars 7B, 7C when getting previous single load
2 years ago
Jonathan G Rennison
a8c0e47dd8
VarAction2: If DSE results in a redundant load, remove it
2 years ago
Jonathan G Rennison
86324e0fda
Debug: Add mode to sprite dump window to show unoptimised
2 years ago
Jonathan G Rennison
74681f70d9
VarAction2: Replace inverted OR of bools with AND where this makes sense
2 years ago
Jonathan G Rennison
e41a5d2f63
VarAction2: Add flags to skip adjust if value is 0 or LSB set
2 years ago
Jonathan G Rennison
236cbc4e83
VarAction2: Optimise SAR same as SHR on unsigned inputs
2 years ago
Jonathan G Rennison
9d04ebcc90
VarAction2: Remove operations which always do nothing when applied to 0
2 years ago
Jonathan G Rennison
26dd84f931
VarAction2: Optimise OR followed by XOR of same constant
2 years ago
Jonathan G Rennison
3aa0ccb97b
VarAction2: Optimise OR which always produces 1
2 years ago
Jonathan G Rennison
4b7288902d
VarAction2: Consider industry tile vars 0x60 to 0x62 to be expensive
2 years ago
Jonathan G Rennison
3a5902ff77
VarAction2: Reduce cost of RecursiveDisallowDSEForProcedure
...
Fix disallowing DSE also disallowing store simplification
2 years ago
Jonathan G Rennison
c342b4219b
NewGRF: Use per-GRF text ID map in GetGRFStringID
2 years ago
Jonathan G Rennison
3ea1e27fdd
Merge branch 'master' into jgrpp
...
# Conflicts:
# src/lang/german.txt
# src/lang/korean.txt
# src/lang/spanish_MX.txt
# src/lang/traditional_chinese.txt
# src/script/api/script_airport.cpp
# src/script/api/script_rail.cpp
2 years ago
Jonathan G Rennison
f05b5163f7
Fix narrowing converison warning
2 years ago
Jonathan G Rennison
bbc1e28b24
VarAction2: Re-use allocated callback result sprite groups
2 years ago
Jonathan G Rennison
e5ef888e80
VarAction2: Add variable/constant copy store simplifification
2 years ago
Jonathan G Rennison
a93b3948b5
VarAction2: Don't change variable masks when disabling procedure DSE
2 years ago
Jonathan G Rennison
3d42e36f89
VarAction2: Avoid pessimising DSE when a procedure returns a callback result
2 years ago
Jonathan G Rennison
9e414a1eab
VarAction2: Move optimiser flags to a separate setting
2 years ago
Jonathan G Rennison
6ff8066d34
VarAction2: Ensure that a temp store var can't reference a clobbered var
2 years ago
Jonathan G Rennison
fe6ab0f19f
VarAction2: Don't track var copies through temporary storage for stations
...
Except for copies of other temporary storage vars
2 years ago
Jonathan G Rennison
db7f29b07c
VarAction2: Deduplicate loads from expensive uncached variables
...
Currently only some vehicle variables
2 years ago
Jonathan G Rennison
6a17f00a27
VarAction2: Ensure dead store elimination doesn't break variable 0x7B
2 years ago
Jonathan G Rennison
813146a78f
VarAction2: Track value inferences through temp storage in more cases
2 years ago
Jonathan G Rennison
ccef3646db
VarAction2: Set value inferences for operations with eq/neq adjust types
2 years ago
Jonathan G Rennison
04a9c73ec2
VarAction2: Combine RST, UMIN sequence to load with neq 0 adjust
2 years ago
Jonathan G Rennison
9116ca6bb0
VarAction2: Track copies of variables through temporary storage
2 years ago
Jonathan G Rennison
263a87f5da
VarAction2: Add adjust types for combined (in)equality with constant
2 years ago
Jonathan G Rennison
1e52e51ce1
VarAction2: Add bounds checks to previous adjust accesses
2 years ago
Jonathan G Rennison
c2fde53495
VarAction2: Remove redundant variable loads
2 years ago
Jonathan G Rennison
30f74c5b74
Sprite group: Add getter function for sprite groups
2 years ago
Jonathan G Rennison
d8f9641dc9
VarAction2: Remove redundant UMIN operation on already boolean values
2 years ago
Jonathan G Rennison
3c9201ebd5
VarAction2: Fix dead store elimination through randomised sprite groups
2 years ago
Jonathan G Rennison
e0581db2a1
VarAction2: Remove dead stores and redundant adjusts in more cases
2 years ago
Jonathan G Rennison
d71e38446e
Improve performance of string lookup in AddGRFString
2 years ago
Jonathan G Rennison
994dc683a2
VarAction2: Fix calculated result groups being incorrectly pruned
2 years ago
Jonathan G Rennison
b102e912b3
VarAction2: Allow temp store dead store elmination with industries
2 years ago
Jonathan G Rennison
4687a8c2a4
VarAction2: Prune group ranges for constant values
...
Add chicken bit to control pruning
2 years ago
Jonathan G Rennison
c894d5a86d
VarAction2: Add temp store dead store elimination
2 years ago
Niels Martin Hansen
5587e439a9
Fix: Industry layouts with zero regular tiles should be invalid
2 years ago
Jonathan G Rennison
a8eb52f061
VarAction2: Simplify handling of first adjustment
2 years ago
Jonathan G Rennison
a5f5be2dff
VarAction2: Detect ops on previous constants which become loads
2 years ago
Jonathan G Rennison
1fec7d6ddb
VarAction2: Detect and replace reversed commutative op via temp storage
2 years ago
Jonathan G Rennison
762cfb3df7
VarAction2: Track temp store loads with respect to stores
2 years ago
Jonathan G Rennison
6953150898
VarAction2: Move optimisation pass to separate function
...
Simplify logic slightly
2 years ago
Jonathan G Rennison
145536e1fd
VarAction2: Detect and replace reverse subtract via temp storage
2 years ago
Jonathan G Rennison
dd2e1fe956
Add chicken bit to disable varact2 optimisation
2 years ago
Jonathan G Rennison
f0a0b2e200
VarAction2: Flatten constant operations on constants in more cases
2 years ago
Jonathan G Rennison
2360b3e93e
VarAction2: Detect and replace scaled reads of train/RV/ship current speed
2 years ago