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. |
||
---|---|---|
.. | ||
bson | ||
bzip2 | ||
client | ||
common | ||
debug | ||
graphics | ||
gui | ||
lua | ||
prefs | ||
resampler | ||
simulation | ||
tasks | ||
Activity.h | ||
Config.template.h | ||
Controller.h | ||
Format.cpp | ||
Format.h | ||
FpsLimit.h | ||
meson.build | ||
Misc.cpp | ||
Misc.h | ||
PowderToy.cpp | ||
PowderToyFontEditor.cpp | ||
PowderToyRenderer.cpp | ||
PowderToySDL.cpp | ||
PowderToySDL.h | ||
PowderToySDLCommon.cpp | ||
PowderToySDLEmscripten.cpp | ||
Probability.cpp | ||
Probability.h | ||
SDLCompat.cpp | ||
SimulationConfig.h | ||
VcsTag.template.h | ||
WindowIcon.cpp | ||
WindowIcon.h | ||
X86KillDenormals.cpp | ||
X86KillDenormals.h |