Jonathan G Rennison
45798fa533
Debug: Add scroll to sprite number to debug window
2022-06-08 01:57:10 +01:00
Jonathan G Rennison
6e398f9cec
VarAction2: DSE now takes into account DSE results from child groups
2022-06-07 23:53:32 +01:00
Jonathan G Rennison
65407210a6
VarAction2: Allow DSGA_OP_STO_NC to be used with DSGA_TYPE_EQ/NEQ
2022-06-07 22:21:51 +01:00
Jonathan G Rennison
86324e0fda
Debug: Add mode to sprite dump window to show unoptimised
2022-06-07 18:54:42 +01:00
Jonathan G Rennison
e41a5d2f63
VarAction2: Add flags to skip adjust if value is 0 or LSB set
2022-06-06 23:04:45 +01:00
Jonathan G Rennison
9d04ebcc90
VarAction2: Remove operations which always do nothing when applied to 0
2022-06-06 22:20:16 +01:00
Jonathan G Rennison
dc8465dc68
VarAction2: Shrink enum fields of DeterministicSpriteGroupAdjust
2022-06-06 21:38:12 +01:00
Jonathan G Rennison
3a5902ff77
VarAction2: Reduce cost of RecursiveDisallowDSEForProcedure
...
Fix disallowing DSE also disallowing store simplification
2022-06-06 20:09:48 +01:00
Jonathan G Rennison
894c8d8b5e
NewGRF: Shrink various flags/enum fields
2022-06-06 20:01:25 +01:00
Jonathan G Rennison
7a61b5d820
VarAction2: Cache refit capacity callback results which depend only on cargo
2022-06-06 18:34:30 +01:00
Jonathan G Rennison
a9ca89d0f8
VarAction2: Move cb_result_found to a flags var in AnalyseCallbackOperation
2022-06-06 17:44:47 +01:00
Jonathan G Rennison
f5f48e89dc
Debug: Show all sprite groups for vehicles in debug window
2022-06-06 02:07:21 +01:00
Jonathan G Rennison
cf640cc0cf
Debug: Add sprite group collapsing to sprite group dump window
2022-06-04 21:08:35 +01:00
Jonathan G Rennison
bbc1e28b24
VarAction2: Re-use allocated callback result sprite groups
2022-06-04 20:31:09 +01:00
Jonathan G Rennison
db7f29b07c
VarAction2: Deduplicate loads from expensive uncached variables
...
Currently only some vehicle variables
2022-06-03 20:14:30 +01:00
Jonathan G Rennison
263a87f5da
VarAction2: Add adjust types for combined (in)equality with constant
2022-06-03 14:17:15 +01:00
Jonathan G Rennison
c238bd5012
Debug: Add temp store highlighting to sprite group dump window
...
Add tooltip
2022-06-02 20:07:18 +01:00
Jonathan G Rennison
564d7e5029
Debug: Allow clicking to highlight group in sprite group dump window
2022-06-01 21:31:05 +01:00
Jonathan G Rennison
42e20d3d99
Industry: Determine which tiles in industry layouts are not animated
...
Do not set these as animated tiles for new industries
2022-06-01 01:13:46 +01:00
Jonathan G Rennison
304f88dc40
VarAction2: Fix callback result detection in AnalyseEngineCallbacks
2022-05-31 17:41:35 +01:00
Jonathan G Rennison
994dc683a2
VarAction2: Fix calculated result groups being incorrectly pruned
2022-05-30 17:24:26 +01:00
Jonathan G Rennison
a5f5be2dff
VarAction2: Detect ops on previous constants which become loads
2022-05-29 12:57:23 +01:00
Jonathan G Rennison
1fec7d6ddb
VarAction2: Detect and replace reversed commutative op via temp storage
2022-05-29 12:08:49 +01:00
Jonathan G Rennison
145536e1fd
VarAction2: Detect and replace reverse subtract via temp storage
2022-05-27 03:14:07 +01:00
Jonathan G Rennison
90a2aa57fc
VarAction2: Detect and replace signed relational comparisons
2022-05-25 23:58:44 +01:00
Jonathan G Rennison
3b5eede3fc
VarAction2: Detect and replace operations which always produce 0
2022-05-25 20:04:36 +01:00
Jonathan G Rennison
08b83352bf
Fix truncation of variable mapping A2VM->VPRM params wider than 8 bits
...
And remapped variables via variable 7B
2022-05-25 04:02:12 +01:00
Jonathan G Rennison
012d73ef34
VarAction2: Detect equality comparisons
...
Remove redundant equality with 0 comparison before ternary
2022-05-25 02:23:25 +01:00
Jonathan G Rennison
7283825638
VarAction2: Detect and replace ternary operator pattern
2022-05-25 01:52:22 +01:00
Jonathan G Rennison
e3df522111
VarAction2: Delete provably zero adjustment operations
2022-05-24 23:40:29 +01:00
Jonathan G Rennison
502980ba61
Support railtype-dependant GRF train speed limits with realistic braking
...
See: #389
2022-05-24 21:50:38 +01:00
Jonathan G Rennison
33dc6c9688
Add NewGRF VarAction2 variable remapping infrastructure
2022-01-24 02:01:09 +00:00
Andreas Schmitt
29b227a3cd
Fix a few compiler warnings
2021-06-23 05:45:10 +02:00
Jonathan G Rennison
97d5982cb5
Fix various compiler warnings
...
See: #267
2021-06-11 00:39:24 +01:00
Jonathan G Rennison
6f10b01ba2
Debug: Add general mechanism to dump a sprite group chain
2021-05-21 19:35:22 +01:00
Jonathan G Rennison
55915d8d55
Elide vehicle random trigger callbacks
2021-05-18 22:14:19 +01:00
Jonathan G Rennison
a15e26f369
NewGRF: Elide unmasked vehicle callbacks where possible
...
This includes:
* CBID_VEHICLE_32DAY_CALLBACK
* CBID_VEHICLE_REFIT_COST
* CBID_VEHICLE_MODIFY_PROPERTY
This is on a per-property basis
The main benefit of this is to avoid callbacks not handled by the
vehicle's current sprite group from using the full graphics chain as
the "default" branch in the callback switch.
In the case where the graphics chain is long/expensive, a lot of work
had to be done before a callback failure result was eventually returned.
2021-05-18 19:07:44 +01:00
Peter Nelson
f5722a999e
Cleanup: Use std::vector in RandomSpriteGroup.
...
(cherry picked from commit 913d8a7f28 )
2021-05-06 20:25:59 +01:00
Peter Nelson
a69a1d19a9
Cleanup: Use std::vector in DeterministicSpriteGroup.
...
(cherry picked from commit 1aeaf39954 )
2021-05-06 20:21:57 +01:00
Peter Nelson
d3b9d19c5a
Cleanup: Use std::vector in RealSpriteGroup.
...
(cherry picked from commit f785a70a2b )
2021-05-06 20:21:57 +01:00
Jonathan G Rennison
810bfd276e
Add several NewGRF variables to vehicle image callback whitelist
...
Add vehicle flags to control cached image invalidation
Various refactorings
2020-08-25 01:26:44 +01:00
Niels Martin Hansen
c8779fb311
Feature: NewGRF callback profiling ( #7868 )
...
Adds a console command newgrf_profile to collect some profiling data about NewGRF action 2 callbacks and produce a CSV file.
2020-01-26 13:45:51 +01:00
S. D. Cloudt
13cc8a0cee
Cleanup: Removed SVN headers
2019-11-10 17:59:20 +00:00
Henry Wilson
7c8e7c6b6e
Codechange: Use null pointer literal instead of the NULL macro
2019-04-10 23:22:20 +02:00
peter1138
fc5f67123a
Fix e66cec8f86: Permit loading of industry production callback with invalid cargo type.
...
It is only an error if the invalid result is actually used. This will be silently ignored at the moment.
It is still an error if a duplicate cargo type is returned.
2019-03-15 17:43:10 +00:00
Niels Martin Hansen
e66cec8f86
Add: NewGRF support for 16-in-16-out industries
2018-11-03 21:43:54 +01:00
frosch
55a503e6f2
(svn r27989) -Fix (r27985): VA2 optimisation failed in various special cases:
...
- nvar=0 is meant to return the calculated result.
- Missing references resolve to NULL and got identified with the default result.
- Missing 'break' broke overlapping cases.
- Splitting into non-overlapping cases could result in more than 256 cases.
2018-03-11 15:08:51 +00:00
frosch
07d841d0ef
(svn r27985) -Codechange: Convert VA2 switches into ones with non-overlapping ranges, sort them and resolve them using binary search. Speedup sprite resolving by about 7 percent.
2018-03-11 13:21:27 +00:00
frosch
d9d669dcf8
(svn r27984) -Codechange: Make ScopeResolver constructors/destructors inlineable. Speedup sprite resolving by about 8 percent.
2018-03-11 13:19:41 +00:00
frosch
82ae414e8d
(svn r27928) -Fix: [NewGRF] While executing random triggers, var 5F should include the new triggers.
...
-Fix: [NewGRF] Reset used random triggers only after all A123 chains have been resolved, so that all RA2 in all chains can test the shard triggers. This also includes multiple RA2 in the same A123 chain.
-Fix: [NewGRF] Industry random triggers are stored per tile, even when randomising the shared random bits of the parent industry.
2017-10-25 15:38:14 +00:00