Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacques Lucke <jacques@blender.org>2020-08-07 19:24:59 +0300
committerJacques Lucke <jacques@blender.org>2020-08-07 19:42:21 +0300
commitc50e5fcc344d00b03eb4a3141b5b45944c3570fd (patch)
treef683ae1a1f38551d160a5be2ee86561d51faca26 /source/blender/blenkernel/intern/simulation.cc
parent28b10224346a9a2e55267f98357991a841eeda5b (diff)
Cleanup: use C++ style casts in various places
Diffstat (limited to 'source/blender/blenkernel/intern/simulation.cc')
-rw-r--r--source/blender/blenkernel/intern/simulation.cc9
1 files changed, 3 insertions, 6 deletions
diff --git a/source/blender/blenkernel/intern/simulation.cc b/source/blender/blenkernel/intern/simulation.cc
index c0fc8fcb464..6b03721cab8 100644
--- a/source/blender/blenkernel/intern/simulation.cc
+++ b/source/blender/blenkernel/intern/simulation.cc
@@ -295,21 +295,20 @@ using StateTypeMap = blender::Map<std::string, std::unique_ptr<SimulationStateTy
template<typename T>
static void add_state_type(StateTypeMap &map,
- const char *name,
void (*init)(T *state),
void (*reset)(T *state),
void (*remove)(T *state),
void (*copy)(const T *src, T *dst))
{
SimulationStateType state_type{
- name,
- (int)sizeof(T),
+ BKE_simulation_get_state_type_name<T>(),
+ static_cast<int>(sizeof(T)),
(StateInitFunction)init,
(StateResetFunction)reset,
(StateRemoveFunction)remove,
(StateCopyFunction)copy,
};
- map.add_new(name, std::make_unique<SimulationStateType>(state_type));
+ map.add_new(state_type.name, std::make_unique<SimulationStateType>(state_type));
}
static StateTypeMap init_state_types()
@@ -317,7 +316,6 @@ static StateTypeMap init_state_types()
StateTypeMap map;
add_state_type<ParticleSimulationState>(
map,
- SIM_TYPE_NAME_PARTICLE_SIMULATION,
[](ParticleSimulationState *state) { CustomData_reset(&state->attributes); },
[](ParticleSimulationState *state) {
CustomData_free(&state->attributes, state->tot_particles);
@@ -337,7 +335,6 @@ static StateTypeMap init_state_types()
add_state_type<ParticleMeshEmitterSimulationState>(
map,
- SIM_TYPE_NAME_PARTICLE_MESH_EMITTER,
[](ParticleMeshEmitterSimulationState *UNUSED(state)) {},
[](ParticleMeshEmitterSimulationState *state) { state->last_birth_time = 0.0f; },
[](ParticleMeshEmitterSimulationState *UNUSED(state)) {},