This repository has been archived on 2025-03-20. You can view files and clone it, but cannot push or open issues or pull requests.
The-Powder-Toy/src
Tamás Bálint Misius c75451b34c
Fix pasting sometimes getting interrupted by the particle limit
More precisely, fix reaching the particle limit while pasting onto a sim with no stacking, which shouldn't be possible at all, because pasting removes stacking at any position that has particles, and if the sim doesn't already have stacking, in the worst case we should end up filling the screen, which would use exactly as many particles as the limit allows.

The problem was that the removal of stacking happened after all particles were done being pasted, which meant that the particle limit could be reached halfway into the process. The solution is to remove on demand the particles wherever we're pasting one.

This works because assuming there is no stacking in the sim (this is the only case we care about) and that pmap is up to date (it is, we call RecalcFreeParticles early), then a spot that is being pasted over is either free (and therefore there are also slots free in Simulation::parts) or has exactly one particle, which we remove before creating the one we're pasting.
2023-12-15 22:36:37 +01:00
..
bson Remove a few outdated windows-only preprocessor hacks 2023-10-15 12:04:22 +02:00
bzip2 Preprocessor purge round 19: Split and minimize usage of Config.h 2023-01-27 09:27:32 +01:00
client Mark saves as being from the next version in dev builds 2023-12-15 18:58:37 +01:00
common Handle return value from signal in the External clipboard driver 2023-12-15 18:26:02 +01:00
debug Sort out constness of Simulation::PlanMove 2023-12-08 22:40:46 +01:00
graphics Sort out constness of Simulation and Renderer in graphics functions 2023-12-09 16:37:45 +01:00
gui Complain when pasting save data with missing elements 2023-12-15 19:06:19 +01:00
lua Prevent Lua callbacks from being called from secondary SaveRenderers 2023-12-09 16:37:50 +01:00
prefs Some native clipboard support for some platforms 2023-12-13 21:49:35 +01:00
resampler Remove a few outdated windows-only preprocessor hacks 2023-10-15 12:04:22 +02:00
simulation Fix pasting sometimes getting interrupted by the particle limit 2023-12-15 22:36:37 +01:00
tasks Use a proper ProgressBar in UpdateActivity 2023-10-25 22:20:13 +02:00
Activity.h Preprocessor purge round 19: Split and minimize usage of Config.h 2023-01-27 09:27:32 +01:00
Config.template.h Remove snapshot_id 2023-10-19 12:51:11 +02:00
Controller.h Preprocessor purge round 2: #pragma once 2023-01-27 09:26:38 +01:00
Format.cpp Refactor PNG and working with alpha 2023-04-05 21:30:24 +02:00
Format.h Refactor PNG and working with alpha 2023-04-05 21:30:24 +02:00
FpsLimit.h Emscripten: Add "vsync" FPS limit mode 2023-08-22 00:26:32 +02:00
meson.build Some native clipboard support for some platforms 2023-12-13 21:49:35 +01:00
Misc.cpp Remove a few outdated windows-only preprocessor hacks 2023-10-15 12:04:22 +02:00
Misc.h Prevent almost all HTTP requests from blocking 2023-06-10 19:19:53 +02:00
PowderToy.cpp Enable basic rendering of custom elements in secondary Renderers 2023-12-08 22:40:44 +01:00
PowderToyFontEditor.cpp Clean up window creation somewhat 2023-10-05 19:47:29 +02:00
PowderToyRenderer.cpp Enable basic rendering of custom elements in secondary Renderers 2023-12-08 22:40:44 +01:00
PowderToySDL.cpp Some native clipboard support for some platforms 2023-12-13 21:49:35 +01:00
PowderToySDL.h Clean up window creation somewhat 2023-10-05 19:47:29 +02:00
PowderToySDLCommon.cpp Emscripten: Disable hopefully all ways to quit 2023-08-22 00:26:33 +02:00
PowderToySDLEmscripten.cpp Emscripten: Add Platform::MarkPresentable 2023-08-23 00:42:34 +02:00
Probability.cpp Preprocessor purge round 19: Split and minimize usage of Config.h 2023-01-27 09:27:32 +01:00
Probability.h Preprocessor purge round 19: Split and minimize usage of Config.h 2023-01-27 09:27:32 +01:00
SDLCompat.cpp fix windows / renderer compile (renderer requires sdl for now) 2018-05-25 21:19:44 -04:00
SimulationConfig.h Move Simulation::platent to Element::LatentHeat 2023-12-08 23:36:34 +01:00
VcsTag.template.h Add tpt.version.vcstag 2023-09-05 20:20:00 +02:00
WindowIcon.cpp Refactor PNG and working with alpha 2023-04-05 21:30:24 +02:00
WindowIcon.h Move platform-specific code out of entrypoint TUs 2023-01-27 09:26:41 +01:00
X86KillDenormals.cpp Preprocessor purge round 13: X86 2023-01-27 09:26:40 +01:00
X86KillDenormals.h Preprocessor purge round 13: X86 2023-01-27 09:26:40 +01:00