This commit caches the last visited node in paint_arrange_structs and
in paint_arrange_structs_helper, which allows skipping iterating over
long linked lists that don't work well with modern CPU caches.
This is especially useful, if the list is walked just to be discarded in
the end.
This improves performance across the board, the busier the park, the
higher performance improvement.
I have verified this producing pixel-perfect results with ones before
this change by dumping giant screenshot on various parks in all zooms,
all rotations.
Results collected running before and after this change with `benchgfx`
command (https://github.com/OpenRCT2/OpenRCT2/pull/5655) on current
title sequence, YMMV.
**Park**|**Before**|**After**|**Delta**
:-----:|:-----:|:-----:|:-----:
Maian\_SOSDragon.sv6|2.80|2.43|-13.2%
Maian\_SOSFrosty.sv6|3.53|3.02|-14.4%
Maian\_SOSParabola.sv6|4.16|3.45|-17.1%
MrB.sv6|5.52|4.52|-18.1%
SpacekKing.sv6|8.53|6.52|-23.6%
SpacekMaple.sv6|7.18|5.75|-19.9%
SpacekMission.sv6|4.41|3.43|-22.2%
SpacekParadise.sv6|9.01|6.36|-29.4%
SpacekSwimmers.sv6|4.11|2.97|-27.7%
Stosky.sv6|3.34|2.36|-29.3%
| | |
**Average**|**5.26**|**4.08**|**-21.5%**
* Fixed a desync that would happen when having the guests list open.
* Refactored the flashing state of peeps to not affect the flags.
* Added deprecation info for SPRITE_FLAGS_PEEP_FLASHING.
* Removed unused line that used the old flag.
* Update network version
This commit expands tabs to spaces (ts=4) in all the files under src/
and test/.
Until now we had two wildly different code styles with C using tabs and
new C++ using spaces. It is painful to maintain as none of the commonly
used tools support this kind of setup and in reality is needless, as we
can simply convert all the sources to spaces and have opened PRs do the
same, where needed.
Additionally, trailing whitespace has been removed.
Paint clipping is a possible future feature to assist players building in cluttered areas of a park by controlling which map elements and sprites are rendered, providing a clearer view for construction, inspection, etc.
Only clip height is supported in this prototype.
Map elements are clipped according to the map element base height (meaning *all* scenery on that map element is currently clipped with it).
Sprites are clipped according to their z value being within the "sprite volume" of any non-clipped map element (which means below clip height + 2).
Control is only provided through the console in this prototype - use the command: set paint_clip_height _value_
To turn clipping off use the command: set paint_clip_height 255
Clip heights are limited to multiples of two to coincide with the native heights of map elements.
Command "get paint_clip_height" prints the clip height as a raw value as well as the equivalent height in ft and m as used when displaying heights in-game.
At this time only painting of the main viewport is affected. There is no change to any input control handling.
Cleaned up widget positions - looks like a proper interface now.
Remaining Issues:
- Window only displays correctly every second time it is opened;
- Clip height in Units (ft/m) is displayed without the decimal point;
- Scroll bar is not working;
- Decide how the View menu entry should work.
Paint clipping is a possible future feature to assist players building in cluttered areas of a park by controlling which map elements and sprites are rendered, providing a clearer view for construction, inspection, etc.
Only clip height is supported in this prototype.
Map elements are clipped according to the map element base height (meaning *all* scenery on that map element is currently clipped with it).
Sprites are clipped according to their z value being within the "sprite volume" of any non-clipped map element (which means below clip height + 2).
Control is only provided through the console in this prototype - use the command: set paint_clip_height _value_
To turn clipping off use the command: set paint_clip_height 255
Clip heights are limited to multiples of two to coincide with the native heights of map elements.
Command "get paint_clip_height" prints the clip height as a raw value as well as the equivalent height in ft and m as used when displaying heights in-game.
At this time only painting of the main viewport is affected. There is no change to any input control handling.