summaryrefslogtreecommitdiff
path: root/legacy
diff options
context:
space:
mode:
authorLeandro Dorileo <dorileo@profusion.mobi>2012-10-16 23:18:35 +0000
committerBruno Dilly <bdilly@profusion.mobi>2012-10-16 23:18:35 +0000
commita376a5ceeb20729b69c3885ddf168a010949565a (patch)
treeff2857218e694bc0bbb60b658395cdbdbc749d1e /legacy
parent103c9ffaa05fd0105fd69ef2c5047fc1dd9f599b (diff)
EPhysics: random fixes
This patch fixes: + the scale_get function(the soft body shape scale was not been set), + the soft body evas object deletion callback, it wasn't properly freeing the slices evas objects; + puts the soft body base evas object back to canvas; Patch by: Leandro Dorileo <dorileo@profusion.mobi> SVN revision: 78093
Diffstat (limited to 'legacy')
-rw-r--r--legacy/ephysics/src/lib/ephysics_body.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/legacy/ephysics/src/lib/ephysics_body.cpp b/legacy/ephysics/src/lib/ephysics_body.cpp
index 64bc7b0e5b..254d46f673 100644
--- a/legacy/ephysics/src/lib/ephysics_body.cpp
+++ b/legacy/ephysics/src/lib/ephysics_body.cpp
@@ -222,14 +222,18 @@ static void
222_ephysics_body_soft_body_evas_del_cb(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__) 222_ephysics_body_soft_body_evas_del_cb(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__)
223{ 223{
224 EPhysics_Body_Soft_Body_Data *soft_data; 224 EPhysics_Body_Soft_Body_Data *soft_data;
225 void *slice; 225 void *ldata;
226 EPhysics_Body_Soft_Body_Slice *slice;
226 227
227 soft_data = (EPhysics_Body_Soft_Body_Data *)evas_object_data_del(obj, 228 soft_data = (EPhysics_Body_Soft_Body_Data *)evas_object_data_del(obj,
228 SOFT_DATA); 229 SOFT_DATA);
229 230
230 evas_object_del(soft_data->base_obj); 231 EINA_LIST_FREE(soft_data->slices, ldata)
231 EINA_LIST_FREE(soft_data->slices, slice) 232 {
233 slice = (EPhysics_Body_Soft_Body_Slice *)ldata;
234 evas_object_del(slice->evas_obj);
232 free(slice); 235 free(slice);
236 }
233 237
234 free(soft_data); 238 free(soft_data);
235} 239}
@@ -908,6 +912,7 @@ _ephysics_body_geometry_set(EPhysics_Body *body, Evas_Coord x, Evas_Coord y, Eva
908 if (body->type == EPHYSICS_BODY_TYPE_SOFT) 912 if (body->type == EPHYSICS_BODY_TYPE_SOFT)
909 { 913 {
910 body->soft_body->scale(body_scale); 914 body->soft_body->scale(body_scale);
915 body->soft_body->getCollisionShape()->setLocalScaling(body_scale);
911 body->rigid_body->proceedToTransform(trans); 916 body->rigid_body->proceedToTransform(trans);
912 body->soft_body->transform(trans); 917 body->soft_body->transform(trans);
913 _ephysics_body_soft_body_constraints_rebuild(body); 918 _ephysics_body_soft_body_constraints_rebuild(body);
@@ -2182,6 +2187,7 @@ EAPI Evas_Object *
2182ephysics_body_evas_object_unset(EPhysics_Body *body) 2187ephysics_body_evas_object_unset(EPhysics_Body *body)
2183{ 2188{
2184 Evas_Object *obj, *wrapper; 2189 Evas_Object *obj, *wrapper;
2190 Evas_Coord x, y;
2185 2191
2186 if (!body) 2192 if (!body)
2187 { 2193 {
@@ -2205,6 +2211,8 @@ ephysics_body_evas_object_unset(EPhysics_Body *body)
2205 wrapper = obj; 2211 wrapper = obj;
2206 obj = _ephysics_body_soft_body_evas_base_obj_get(obj); 2212 obj = _ephysics_body_soft_body_evas_base_obj_get(obj);
2207 evas_object_del(wrapper); 2213 evas_object_del(wrapper);
2214 ephysics_body_geometry_get(body, &x, &y, NULL, NULL, NULL, NULL);
2215 evas_object_move(obj, x, y);
2208 } 2216 }
2209 2217
2210 return obj; 2218 return obj;