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/simulation/meson.build
Tamás Bálint Misius 0b82796ba4
Add Simulation::frameCount, save blockair/blockairh and rng state
Saving blockair/blockairh is nice because RecalculateBlockAirMaps uses the sim rng, which means the sim rng would get advanced in Simulation::Load. Also rename RecalculateBlockAirMaps to ApproximateBlockAirMaps because that's what it is, an approximation, and it's needed only if there are no block air maps in the save.

Simulation::frameCount keeps track of frames elapsed since the beginning of the simulation, zeroed at clear_sim. It overflows when it reaches the 64-bit limit, which means anything that depends on it should either handle this, or not fail catastrophically. sandcolour (the only thing that depends on it as of now) is a good example of the latter: sandcolour has a periodicity of 360 frames, which means that there is one sandcolour period that is cut short by the overflow. This is not "handled" (the period is cut short, which is detectable by users) but is not catastrophic either (it's not a big deal, and it won't ever happen unless someone hacks the save).

Also restrict saves with determinism data to 98.0.
2023-04-15 22:19:50 +02:00

30 lines
478 B
Meson

simulation_files = files(
'Air.cpp',
'Element.cpp',
'ElementClasses.cpp',
'GOLString.cpp',
'Particle.cpp',
'SaveRenderer.cpp',
'Sign.cpp',
'SimulationData.cpp',
'Simulation.cpp',
)
subdir('elements')
subdir('simtools')
subdir('gravity')
powder_files += simulation_files
render_files += simulation_files
powder_files += files(
'Editing.cpp',
'SimTool.cpp',
'ToolClasses.cpp',
'Snapshot.cpp',
'SnapshotDelta.cpp',
)
render_files += files(
'NoToolClasses.cpp',
)