diff options
author | Justin Berger <j.david.berger@gmail.com> | 2018-03-16 10:39:26 -0600 |
---|---|---|
committer | Justin Berger <j.david.berger@gmail.com> | 2018-03-16 10:39:26 -0600 |
commit | e5cc00096e7b0700c75160c62f598a8af412c082 (patch) | |
tree | ea341f6bf2af0609d888c5910a15e323cd24be73 /src/survive_process.c | |
parent | fc575131ccf05c605ba567b95851976fad7c5444 (diff) | |
download | libsurvive-e5cc00096e7b0700c75160c62f598a8af412c082.tar.gz libsurvive-e5cc00096e7b0700c75160c62f598a8af412c082.tar.bz2 |
Refactored how the persistence (now called sensor_activations) worked
Diffstat (limited to 'src/survive_process.c')
-rw-r--r-- | src/survive_process.c | 37 |
1 files changed, 19 insertions, 18 deletions
diff --git a/src/survive_process.c b/src/survive_process.c index fe6dc45..c9225e4 100644 --- a/src/survive_process.c +++ b/src/survive_process.c @@ -45,25 +45,26 @@ void survive_default_light_process( SurviveObject * so, int sensor_id, int acode void survive_default_angle_process( SurviveObject * so, int sensor_id, int acode, uint32_t timecode, FLT length, FLT angle, uint32_t lh) { SurviveContext * ctx = so->ctx; - if( ctx->calptr ) - { - survive_cal_angle( so, sensor_id, acode, timecode, length, angle, lh ); - } - if( so->PoserFn ) - { - PoserDataLight l = { - .hdr = - { - .pt = POSERDATA_LIGHT, - }, - .sensor_id = sensor_id, - .acode = acode, - .timecode = timecode, - .length = length, - .angle = angle, - .lh = lh, - }; + PoserDataLight l = { + .hdr = + { + .pt = POSERDATA_LIGHT, + }, + .sensor_id = sensor_id, + .acode = acode, + .timecode = timecode, + .length = length, + .angle = angle, + .lh = lh, + }; + + SurviveSensorActivations_add(&so->activations, &l); + + if (ctx->calptr) { + survive_cal_angle(so, sensor_id, acode, timecode, length, angle, lh); + } + if (so->PoserFn) { so->PoserFn( so, (PoserData *)&l ); } } |