Commit Graph

199 Commits (9a07f14f5651244f902125b6eb8c95af398d6430)

Author SHA1 Message Date
Jonathan G Rennison 894c8d8b5e NewGRF: Shrink various flags/enum fields 2 years ago
Jonathan G Rennison 7a61b5d820 VarAction2: Cache refit capacity callback results which depend only on cargo 2 years ago
Jonathan G Rennison a9ca89d0f8 VarAction2: Move cb_result_found to a flags var in AnalyseCallbackOperation 2 years ago
Jonathan G Rennison f5f48e89dc Debug: Show all sprite groups for vehicles in debug window 2 years ago
Jonathan G Rennison cf640cc0cf Debug: Add sprite group collapsing to sprite group dump window 2 years ago
Jonathan G Rennison bbc1e28b24 VarAction2: Re-use allocated callback result sprite groups 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 263a87f5da VarAction2: Add adjust types for combined (in)equality with constant 2 years ago
Jonathan G Rennison c238bd5012 Debug: Add temp store highlighting to sprite group dump window
Add tooltip
2 years ago
Jonathan G Rennison 564d7e5029 Debug: Allow clicking to highlight group in sprite group dump window 2 years ago
Jonathan G Rennison 42e20d3d99 Industry: Determine which tiles in industry layouts are not animated
Do not set these as animated tiles for new industries
2 years ago
Jonathan G Rennison 304f88dc40 VarAction2: Fix callback result detection in AnalyseEngineCallbacks 2 years ago
Jonathan G Rennison 994dc683a2 VarAction2: Fix calculated result groups being incorrectly pruned 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 145536e1fd VarAction2: Detect and replace reverse subtract via temp storage 2 years ago
Jonathan G Rennison 90a2aa57fc VarAction2: Detect and replace signed relational comparisons 2 years ago
Jonathan G Rennison 3b5eede3fc VarAction2: Detect and replace operations which always produce 0 2 years ago
Jonathan G Rennison 08b83352bf Fix truncation of variable mapping A2VM->VPRM params wider than 8 bits
And remapped variables via variable 7B
2 years ago
Jonathan G Rennison 012d73ef34 VarAction2: Detect equality comparisons
Remove redundant equality with 0 comparison before ternary
2 years ago
Jonathan G Rennison 7283825638 VarAction2: Detect and replace ternary operator pattern 2 years ago
Jonathan G Rennison e3df522111 VarAction2: Delete provably zero adjustment operations 2 years ago
Jonathan G Rennison 502980ba61 Support railtype-dependant GRF train speed limits with realistic braking
See: #389
2 years ago
Jonathan G Rennison 33dc6c9688 Add NewGRF VarAction2 variable remapping infrastructure 2 years ago
Andreas Schmitt 29b227a3cd Fix a few compiler warnings 3 years ago
Jonathan G Rennison 97d5982cb5 Fix various compiler warnings
See: #267
3 years ago
Jonathan G Rennison 6f10b01ba2 Debug: Add general mechanism to dump a sprite group chain 3 years ago
Jonathan G Rennison 55915d8d55 Elide vehicle random trigger callbacks 3 years ago
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.
3 years ago
Peter Nelson f5722a999e Cleanup: Use std::vector in RandomSpriteGroup.
(cherry picked from commit 913d8a7f28)
3 years ago
Peter Nelson a69a1d19a9 Cleanup: Use std::vector in DeterministicSpriteGroup.
(cherry picked from commit 1aeaf39954)
3 years ago
Peter Nelson d3b9d19c5a Cleanup: Use std::vector in RealSpriteGroup.
(cherry picked from commit f785a70a2b)
3 years ago
Peter Nelson 913d8a7f28 Cleanup: Use std::vector in RandomSpriteGroup. 3 years ago
Peter Nelson 1aeaf39954 Cleanup: Use std::vector in DeterministicSpriteGroup. 3 years ago
Peter Nelson f785a70a2b Cleanup: Use std::vector in RealSpriteGroup. 3 years ago
Jonathan G Rennison 810bfd276e Add several NewGRF variables to vehicle image callback whitelist
Add vehicle flags to control cached image invalidation

Various refactorings
4 years ago
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.
4 years ago
S. D. Cloudt 13cc8a0cee Cleanup: Removed SVN headers 5 years ago
Henry Wilson 7c8e7c6b6e Codechange: Use null pointer literal instead of the NULL macro 5 years ago
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.
5 years ago
Niels Martin Hansen e66cec8f86 Add: NewGRF support for 16-in-16-out industries 6 years ago
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.
6 years ago
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. 6 years ago
frosch d9d669dcf8 (svn r27984) -Codechange: Make ScopeResolver constructors/destructors inlineable. Speedup sprite resolving by about 8 percent. 6 years ago
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.
7 years ago
frosch 6b61c4608f (svn r26388) -Codechange: Move resolving of Action 3 into ResolverObject constructor. 10 years ago
frosch b935cb8415 (svn r26387) -Cleanup (r26173): No need to manually clear registers before resolving. 10 years ago
frosch 3eea1befa7 (svn r26172) -Codechange: Make SpriteGroup::Resolve aware of nested calls. 11 years ago
frosch db894b0b3f (svn r26085) -Codechange: Pass ResolverObjects as reference instead of pointer since they are never NULL. 11 years ago
planetmaker c24374f99c (svn r24900) -Fix [FS#5389]: Comments with typos (most fixes supplied by Eagle_rainbow) 12 years ago
frosch b65ece1ea9 (svn r24695) -Fix/Cleanup: Remove remaining (incorrect) usages of ResolverObject::scope and count. 12 years ago
alberth 33ff55a8f1 (svn r24693) -Doc: Add some doxymentation into the newgrf code. 12 years ago
alberth 4c9bea2a71 (svn r24692) -Cleanup: Cleanup final parts of the old resolver code. 12 years ago
alberth 69e07c3e00 (svn r24691) -Codechange: Add resolver classes for vehicles. 12 years ago
alberth e087503fd6 (svn r24690) -Codechange: Add resolver classes for industry tiles. 12 years ago
alberth 348ef7f12c (svn r24688) -Codechange: Add resolver classes for generics. 12 years ago
alberth c83db1395b (svn r24687) -Codechange: Add resolver classes for airports. 12 years ago
alberth 82e6001451 (svn r24685) -Codechange: Add resolver classes for rail types. 12 years ago
alberth c417efc962 (svn r24684) -Codechange: Add resolver classes for stations. 12 years ago
alberth a9b8b22daf (svn r24683) -Codechange: Add resolver classes for objects. 12 years ago
alberth d7b62da87b (svn r24682) -Codechange: Add resolver classes for houses. 12 years ago
alberth 0885a2370a (svn r24681) -Codechange: Add resolver classes for cargoes. 12 years ago
alberth 35cee8315a (svn r24680) -Codechange: Add resolver classes for canals. 12 years ago
alberth b985c4c0f8 (svn r24679) -Codechange: Add resolver classes for towns. 12 years ago
alberth 438495b433 (svn r24678) -Codechange: Introduce scope resolver base class and prepare for adding derived classes. 12 years ago
rubidium e40eb8177a (svn r23735) -Codechange: remove ~50 includes from headers that weren't needed 13 years ago
frosch 1ad7239247 (svn r23138) -Feature: [NewGRF] Allow passing 32bit parameters to 60+x variables (using var 7B). Currently most useful for vehicle var 60. 13 years ago
frosch e08a227b53 (svn r23136) -Change: [NewGRF v8] Deprecate old-style callback results 0xFF??. 13 years ago
michi_cc e094d7db62 (svn r23072) -Feature: [NewGRF] House callback 0x148. 13 years ago
frosch 7f228d6909 (svn r22924) -Codechange: Enhance NewGRFSpriteLayout for drawing construction stages in spritelayouts with inconsistent number of sprites per spriteset. 13 years ago
frosch de27360549 (svn r22923) -Codechange: Move application of the construction stage into TileLayoutSpriteGroup::ProcessRegisters(). 13 years ago
frosch d10168f211 (svn r22731) -Fix: [NewGRF] The construction stage sprites were incorrectly selected in cases other than 1 or 4 sprites per set. 13 years ago
frosch f0b723ebaa (svn r22723) -Fix: Do not restrict AdvVarAct2 to 255 operations. 13 years ago
michi_cc d579af11e8 (svn r22659) -Add: [NewGRF] Support for the land slope check callback for stations. 13 years ago
frosch 8930337aae (svn r22635) -Fix: Correctly reseed random bits of industries and industry tiles. 13 years ago
frosch 8b18292a2e (svn r22634) -Codechange: Deduplicate some code. Note that zeroing 'count' is intentionally removed, it is only used together with 'scope'. 13 years ago
terkhen 0749c65d74 (svn r22564) -Codechange: Rename Get and Store persistent storage functions to GetValue and StoreValue. 13 years ago
terkhen dc6218aa49 (svn r22563) -Codechange: Use a function for storing values inside the persistent storage. 13 years ago
terkhen f1cde00372 (svn r22561) -Codechange: Remove constness from Object in ResolverObject. 13 years ago
terkhen 76cd19f846 (svn r22560) -Codechange: Remove constness from House in ResolverObject. 13 years ago
terkhen e8df5563db (svn r22559) -Codechange: Remove constness from Station in ResolverObject. 13 years ago
terkhen c98a8308cc (svn r22558) -Codechange: Remove constness from BaseStation in ResolverObject. 13 years ago
frosch a241a4ce97 (svn r22518) -Feature: [NewGRF] Advanced sprite layouts with register modifiers. 13 years ago
frosch e55f849a29 (svn r22457) -Codechange: Make the NewGRFSpriteLayout a direct member of TileLayoutSpriteGroup instead of allocating it separately. 13 years ago
frosch 7415b9cca2 (svn r22456) -Codechange: Derive NewGRFSpriteLayout from DrawTileSprites for spritelayouts allocated on the heap, and make use of constructors and destructors. 13 years ago
frosch 930d0c9702 (svn r22452) -Fix (r18708): Zero register 0x100 as specified before resolving custom station foundations. 13 years ago
smatz 756cc6cf65 (svn r22116) -Codechange: use PoolBase::Clean() at more places 14 years ago
rubidium 5d0da9492e (svn r21454) -Codechange: add support for object variable 48 14 years ago
rubidium 852bde0bad (svn r20660) -Codechange: implement (most) of action2 support for objects 14 years ago
rubidium 30f2afac9b (svn r20632) -Cleanup: remove "a few" unneeded includes, and add them to some headers 14 years ago
rubidium 9982b5fd00 (svn r20624) -Codechange: some constifying for NewGRF house 14 years ago
frosch b6cf38a912 (svn r20422) -Change [FS#3947]: Resolve tracksprites on bridges always using the southern bridgehead as tile. 14 years ago
frosch 48c5091a7c (svn r20420) -Codechange: Add TileContext enum instead of using a bool. 14 years ago
yexo 6321eb5a00 (svn r20364) -Codechange: add infrastructure for airport callbacks 14 years ago
frosch 0e5c562da4 (svn r20332) -Add: [NewGRF] AdvVarAct2 operators for SHL, SHR and SAR. 14 years ago
frosch 72ee11a7c6 (svn r20126) -Fix [FS#3883]: Make railtype Terrain Type variable aware of RAIL_GROUND_HALF_SNOW. That is, resolve the sprites for upper and lower part of the foundation independently. 14 years ago
frosch 9060a7ac00 (svn r20108) -Change: [NewGRF] Report substitute industry type in AI railstation selection callback. 14 years ago
frosch 910aade284 (svn r19744) -Add [FS#3477]: [NewGRF] Access to random bits of houses and industries from construction callbacks 17, 28 and 2F. That is: The randombits the house/industry will start with, if construction succeeds. 14 years ago
frosch 7795303227 (svn r19743) -Fix: NewGrfs could access map bits of not yet constructed industries and houses during construction callbacks. 14 years ago
frosch c049bf3f38 (svn r19497) -Fix: [NewGRF] Bytes and words get sign-extended for temporary/persistent storage. (Spotted by yexo) 14 years ago