forked from enlightenment/efl
EPhysics: fix bug when changing head of worlds list
Animator callback was working with a not updated list pointer. SVN revision: 75510
This commit is contained in:
parent
dde0746fcb
commit
89eaea1c65
|
@ -233,16 +233,15 @@ _ephysics_world_free(EPhysics_World *world)
|
||||||
}
|
}
|
||||||
|
|
||||||
static Eina_Bool
|
static Eina_Bool
|
||||||
_simulate_worlds(void *data)
|
_simulate_worlds(void *data __UNUSED__)
|
||||||
{
|
{
|
||||||
Eina_Inlist *lworlds = (Eina_Inlist *) data;
|
|
||||||
EPhysics_World *world;
|
EPhysics_World *world;
|
||||||
double time_now;
|
double time_now;
|
||||||
void *wrld, *bd;
|
void *wrld, *bd;
|
||||||
|
|
||||||
ephysics_init();
|
ephysics_init();
|
||||||
_worlds_walking++;
|
_worlds_walking++;
|
||||||
EINA_INLIST_FOREACH(lworlds, world)
|
EINA_INLIST_FOREACH(_worlds, world)
|
||||||
{
|
{
|
||||||
double time_now, delta;
|
double time_now, delta;
|
||||||
EPhysics_Body *body;
|
EPhysics_Body *body;
|
||||||
|
@ -505,7 +504,7 @@ ephysics_world_new(void)
|
||||||
world->last_update = ecore_time_get();
|
world->last_update = ecore_time_get();
|
||||||
_worlds_running++;
|
_worlds_running++;
|
||||||
if (!_anim_simulate)
|
if (!_anim_simulate)
|
||||||
_anim_simulate = ecore_animator_add(_simulate_worlds, _worlds);
|
_anim_simulate = ecore_animator_add(_simulate_worlds, NULL);
|
||||||
|
|
||||||
INF("World %p added.", world);
|
INF("World %p added.", world);
|
||||||
return world;
|
return world;
|
||||||
|
@ -632,7 +631,7 @@ ephysics_world_running_set(EPhysics_World *world, Eina_Bool running)
|
||||||
if (_anim_simulate)
|
if (_anim_simulate)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
_anim_simulate = ecore_animator_add(_simulate_worlds, _worlds);
|
_anim_simulate = ecore_animator_add(_simulate_worlds, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI Eina_Bool
|
EAPI Eina_Bool
|
||||||
|
|
Loading…
Reference in New Issue