Commit Graph

305 Commits (jgrpp)

Author SHA1 Message Date
Jonathan G Rennison 65407210a6 VarAction2: Allow DSGA_OP_STO_NC to be used with DSGA_TYPE_EQ/NEQ 2 years ago
Jonathan G Rennison 86324e0fda Debug: Add mode to sprite dump window to show unoptimised 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 9b0a7ac85e Debug: Don't unnecessarily show numeric value of adjust operator 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 c3bc05f7b9 VarAction2: Add access to variable 1A to inline/fast path switch 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 b74873a2fb Debug: Show industry production sprite group registers/values 2 years ago
Jonathan G Rennison d9358efc3d VarAction2: Handle zero adjusts simple case in callback analyser 2 years ago
Jonathan G Rennison c38d0d0458 Debug: Show tile layout sprite group register flags/values 2 years ago
Jonathan G Rennison 862d955320 Debug: Include var 7E procedures in sprite dump output 2 years ago
Jonathan G Rennison 145536e1fd VarAction2: Detect and replace reverse subtract via temp storage 2 years ago
Jonathan G Rennison 2360b3e93e VarAction2: Detect and replace scaled reads of train/RV/ship current speed 2 years ago
Jonathan G Rennison 90a2aa57fc VarAction2: Detect and replace signed relational comparisons 2 years ago
Jonathan G Rennison 74e1a40f7c VarAction2: Remove trivially resolvable deterministic sprite groups 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 502980ba61 Support railtype-dependant GRF train speed limits with realistic braking
See: #389
2 years ago
Jonathan G Rennison a3c003546b Implement extended NewGRF variable parameter support 2 years ago
Jonathan G Rennison 812933ffd4 Debug: Show names of remapped action 2 variables in sprite group dumper 2 years ago
Jonathan G Rennison 33dc6c9688 Add NewGRF VarAction2 variable remapping infrastructure 2 years ago
Jonathan G Rennison aaf5cd1091 Debug: Fix dumping of randomised sprite groups 3 years ago
Jonathan G Rennison da282c3ecc Merge branch 'master' into jgrpp-beta
# Conflicts:
#	.github/workflows/ci-build.yml
#	CMakeLists.txt
#	src/lang/finnish.txt
#	src/lang/french.txt
#	src/lang/korean.txt
#	src/lang/norwegian_bokmal.txt
#	src/lang/russian.txt
#	src/lang/spanish.txt
#	src/misc_gui.cpp
#	src/newgrf.cpp
3 years ago
rubidium42 55a11710a6 Codechange: convert printf DEBUG statements to fmt Debug statements 3 years ago
Peter Nelson f1328db063 Codechange: Deduplicate ResolveReal() for resolvers that don't use real sprite groups.
This may change behaviour when multiple loading/loaded stages are provided, as the various copies checked in different orders, however only one result is expected in these cases anyway.
3 years ago
Jonathan G Rennison 6f10b01ba2 Debug: Add general mechanism to dump a sprite group chain 3 years ago
Jonathan G Rennison 7c706923f8 Fix a15e26f3: Leftover debugging statement 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 02a62e4c98 Cleanup: Use range iterator to evaluate DeterministicSpriteGroup.
(cherry picked from commit 6b0b1bb3de)
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 6b0b1bb3de Cleanup: Use range iterator to evaluate DeterministicSpriteGroup. 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 b7ddd486cf Merge branch 'master' into jgrpp
# Conflicts:
#	cmake/CompileFlags.cmake
#	src/aircraft_cmd.cpp
#	src/blitter/32bpp_anim.cpp
#	src/cargopacket.cpp
#	src/cheat_gui.cpp
#	src/company_cmd.cpp
#	src/company_gui.cpp
#	src/core/pool_func.hpp
#	src/date.cpp
#	src/economy.cpp
#	src/error_gui.cpp
#	src/ground_vehicle.cpp
#	src/ground_vehicle.hpp
#	src/group_gui.cpp
#	src/industry_cmd.cpp
#	src/lang/dutch.txt
#	src/lang/french.txt
#	src/lang/german.txt
#	src/linkgraph/linkgraph_gui.cpp
#	src/linkgraph/mcf.cpp
#	src/network/network_content.cpp
#	src/network/network_server.cpp
#	src/network/network_udp.cpp
#	src/newgrf_engine.cpp
#	src/newgrf_station.cpp
#	src/order_cmd.cpp
#	src/order_gui.cpp
#	src/pathfinder/follow_track.hpp
#	src/pathfinder/yapf/yapf_common.hpp
#	src/saveload/saveload.cpp
#	src/settings_gui.cpp
#	src/station_cmd.cpp
#	src/station_kdtree.h
#	src/string_func.h
#	src/table/settings.ini
#	src/tgp.cpp
#	src/timetable_cmd.cpp
#	src/timetable_gui.cpp
#	src/toolbar_gui.cpp
#	src/town_cmd.cpp
#	src/train_cmd.cpp
#	src/train_gui.cpp
#	src/tree_gui.cpp
#	src/tunnelbridge_cmd.cpp
#	src/vehicle.cpp
#	src/vehicle_gui.cpp
#	src/video/sdl2_v.cpp
#	src/video/sdl_v.cpp
#	src/video/win32_v.cpp
#	src/viewport.cpp
#	src/viewport_sprite_sorter_sse4.cpp
#	src/window.cpp
3 years ago
Charles Pigott 9b800a96ed
Codechange: Remove min/max functions in favour of STL variants (#8502) 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
Jonathan G Rennison 81a1094cc8 Merge branch 'master' into jgrpp
# Conflicts:
#	src/console_cmds.cpp
#	src/date.cpp
#	src/economy.cpp
#	src/misc.cpp
#	src/newgrf_house.cpp
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
Jonathan G Rennison cbdd9f84d8 Merge branch 'master' into jgrpp
# Conflicts:
#	src/console_gui.cpp
#	src/lang/korean.txt
#	src/video/sdl2_v.cpp
#	src/video/sdl2_v.h
#	src/window.cpp
#	src/window_gui.h
5 years ago
S. D. Cloudt 13cc8a0cee Cleanup: Removed SVN headers 5 years ago
Jonathan G Rennison 674732cd68 Merge: Codechange: Use null pointer literal instead of the NULL macro 5 years ago
Henry Wilson 7c8e7c6b6e Codechange: Use null pointer literal instead of the NULL macro 5 years ago
Jonathan G Rennison e735c1a51a Merge branch 'master' into jgrpp
# Conflicts:
#	src/aircraft_cmd.cpp
#	src/autoreplace_cmd.cpp
#	src/pathfinder/follow_track.hpp
#	src/pathfinder/yapf/yapf_rail.cpp
#	src/saveload/afterload.cpp
#	src/saveload/saveload.cpp
#	src/script/api/ai/ai_station.hpp.sq
#	src/script/api/game/game_station.hpp.sq
#	src/script/api/script_station.hpp
#	src/track_func.h
#	src/vehicle_base.h
6 years ago
frosch 18ca3e8660 Fix: [NewGRF] Make VA2 operator 11 (ror) behave well-defined when rotating by 0 bits. 6 years ago
Charles Pigott b5028efc1f Fix: Protect against a few out of bounds or uninitialised usage errors 6 years ago
Charles Pigott f5b1115039 Doc: Lots and lots of doxymentation fixes 6 years ago
Jonathan G Rennison 385a2552e9 Merge branch 'enhanced_viewport_overlay' into jgrpp 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 a537fd5d0e (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 30f73d907a (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 29dca1be3b (svn r27984) -Codechange: Make ScopeResolver constructors/destructors inlineable. Speedup sprite resolving by about 8 percent. 6 years ago
frosch 7c406f0d9d (svn r27983) -Codechange: Reduce complexity of VA2 add-div/mod adjustments 6 years ago
frosch 2a3d0cea50 (svn r27983) -Codechange: Reduce complexity of VA2 add-div/mod adjustments 6 years ago
frosch 4fc178aebd (svn r27982) -Codechange: Reduce invocations of GetGlobalVariable. Speedup sprite resolving by about 3 percent. 6 years ago
frosch aee8ffc73b (svn r27982) -Codechange: Reduce invocations of GetGlobalVariable. Speedup sprite resolving by about 3 percent. 6 years ago
Jonathan G Rennison 740e4543c3 Merge branch 'master' into jgrpp
# Conflicts:
#	src/industry_cmd.cpp
7 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 ffdcbb8f21 (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
Jonathan G Rennison d733955d33 Add road vehicle state to UpdateViewport()->GetImage() var whitelist.
Minor refactoring of var check.
8 years ago
Jonathan G Rennison 7b56097f50 Merge branch 'master' into jgrpp
# Conflicts:
#	config.lib
#	src/linkgraph/demands.cpp
#	src/linkgraph/mcf.cpp
#	src/linkgraph/refresh.cpp
#	src/linkgraph/refresh.h
#	src/smallmap_gui.cpp
8 years ago
Jonathan G Rennison 3ac94e97c8 Cache the result of GetImage() in Vehicle::UpdateViewport() where possible.
Sprite number is not cached if callback is made, or a variable access
outside a whitelist occurs.
Invalidate cached sprite number when direction or cargo changes,
or vehicle is marked dirty.
8 years ago
frosch 2782993dd7 (svn r27600) -Fix: [NewGRF] shift-and-add-divide/modulo varadjusts use signed division/modulo. 8 years ago
frosch a073b276ba (svn r27600) -Fix: [NewGRF] shift-and-add-divide/modulo varadjusts use signed division/modulo. 8 years ago
rubidium 2be4215f43 (svn r26482) -Codechange: add an include that allows us to undefine/redefine "unsafe" functions to prevent them from being used, and thus having to care about certain aspects of their return values 10 years ago
rubidium 0463dbdc9e (svn r26482) -Codechange: add an include that allows us to undefine/redefine "unsafe" functions to prevent them from being used, and thus having to care about certain aspects of their return values 10 years ago
rubidium 101b982263 (svn r26475) -Fix: potentially undefined shifts in NewGRF code 10 years ago
rubidium bbed2ff956 (svn r26475) -Fix: potentially undefined shifts in NewGRF code 10 years ago
frosch ce92faf682 (svn r26388) -Codechange: Move resolving of Action 3 into ResolverObject constructor. 10 years ago
frosch 6b61c4608f (svn r26388) -Codechange: Move resolving of Action 3 into ResolverObject constructor. 10 years ago
frosch cefdd69748 (svn r26173) -Change: [NewGRF] Reset the temporary storage registers for every sprite resolving. 11 years ago
frosch a9e8d7a361 (svn r26173) -Change: [NewGRF] Reset the temporary storage registers for every sprite resolving. 11 years ago
frosch badbd2f894 (svn r26172) -Codechange: Make SpriteGroup::Resolve aware of nested calls. 11 years ago
frosch 3eea1befa7 (svn r26172) -Codechange: Make SpriteGroup::Resolve aware of nested calls. 11 years ago
frosch 6c63c98d7f (svn r26085) -Codechange: Pass ResolverObjects as reference instead of pointer since they are never NULL. 11 years ago
frosch db894b0b3f (svn r26085) -Codechange: Pass ResolverObjects as reference instead of pointer since they are never NULL. 11 years ago
planetmaker f00d9976f9 (svn r24900) -Fix [FS#5389]: Comments with typos (most fixes supplied by Eagle_rainbow) 12 years ago
planetmaker c24374f99c (svn r24900) -Fix [FS#5389]: Comments with typos (most fixes supplied by Eagle_rainbow) 12 years ago
frosch f5131bd588 (svn r24695) -Fix/Cleanup: Remove remaining (incorrect) usages of ResolverObject::scope and count. 12 years ago
frosch b65ece1ea9 (svn r24695) -Fix/Cleanup: Remove remaining (incorrect) usages of ResolverObject::scope and count. 12 years ago
alberth 6c1ff5f772 (svn r24693) -Doc: Add some doxymentation into the newgrf code. 12 years ago
alberth 33ff55a8f1 (svn r24693) -Doc: Add some doxymentation into the newgrf code. 12 years ago
alberth 8a297ca5f1 (svn r24692) -Cleanup: Cleanup final parts of the old resolver code. 12 years ago
alberth 4c9bea2a71 (svn r24692) -Cleanup: Cleanup final parts of the old resolver code. 12 years ago
alberth 818332f3e8 (svn r24679) -Codechange: Add resolver classes for towns. 12 years ago