From e5cc00096e7b0700c75160c62f598a8af412c082 Mon Sep 17 00:00:00 2001 From: Justin Berger Date: Fri, 16 Mar 2018 10:39:26 -0600 Subject: Refactored how the persistence (now called sensor_activations) worked --- src/survive_process.c | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) (limited to 'src/survive_process.c') 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 ); } } -- cgit v1.2.3