diff options
author | Ricardo Buring <ricardo.buring@gmail.com> | 2024-02-17 00:57:32 +0100 |
---|---|---|
committer | Ricardo Buring <ricardo.buring@gmail.com> | 2024-03-23 12:28:36 +0100 |
commit | 2ed2ccc2d8ff17b97d8ac0fd80fc0190ea47ed00 (patch) | |
tree | 0b0595cc3bf93413b4a394967ea96fde2f7cd3d3 /core/templates | |
parent | fe01776f05b1787b28b4a270d53037a3c25f4ca2 (diff) | |
download | redot-engine-2ed2ccc2d8ff17b97d8ac0fd80fc0190ea47ed00.tar.gz |
Fixed Timestep Interpolation (2D)
Adds fixed timestep interpolation to the rendering server (2D only).
Switchable on and off with a project setting (default is off).
Co-authored-by: lawnjelly <lawnjelly@gmail.com>
Diffstat (limited to 'core/templates')
-rw-r--r-- | core/templates/local_vector.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/core/templates/local_vector.h b/core/templates/local_vector.h index 6478297fd1..e0047e0782 100644 --- a/core/templates/local_vector.h +++ b/core/templates/local_vector.h @@ -104,6 +104,22 @@ public: return false; } + U erase_multiple_unordered(const T &p_val) { + U from = 0; + U occurrences = 0; + while (true) { + int64_t idx = find(p_val, from); + + if (idx == -1) { + break; + } + remove_at_unordered(idx); + from = idx; + occurrences++; + } + return occurrences; + } + void invert() { for (U i = 0; i < count / 2; i++) { SWAP(data[i], data[count - i - 1]); |