edje: warn if loading a edj with physics
authorBruno Dilly <bdilly@profusion.mobi>
Fri, 7 Dec 2012 16:42:42 +0000 (16:42 +0000)
committerBruno Dilly <bdilly@profusion.mobi>
Fri, 7 Dec 2012 16:42:42 +0000 (16:42 +0000)
If a edj using physics is loaded for edje compiled with
physics disabled, it should warn the user.

SVN revision: 80472

legacy/edje/src/lib/edje_data.c
legacy/edje/src/lib/edje_load.c
legacy/edje/src/lib/edje_private.h

index 10e7cab..62a718c 100644 (file)
@@ -945,9 +945,7 @@ _edje_edd_init(void)
    EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_collection, Edje_Part_Collection, "lua_script_only", lua_script_only, EET_T_UCHAR);
    EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_collection, Edje_Part_Collection, "prop.orientation", prop.orientation, EET_T_INT);
    EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_collection, Edje_Part_Collection, "broadcast_signal", broadcast_signal, EET_T_UCHAR);
-#ifdef HAVE_EPHYSICS
    EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_collection, Edje_Part_Collection, "physics_enabled", physics_enabled, EET_T_UCHAR);
-#endif
 }
 
 EAPI void
index ececce6..b785d96 100644 (file)
@@ -450,9 +450,8 @@ _edje_object_file_set_internal(Evas_Object *obj, const char *file, const char *g
          {
             unsigned int i;
 
-#ifdef HAVE_EPHYSICS
-            /* create physics world */
              if (ed->collection->physics_enabled)
+#ifdef HAVE_EPHYSICS
                {
                   ephysics_init();
                   ed->world = ephysics_world_new();
@@ -460,6 +459,8 @@ _edje_object_file_set_internal(Evas_Object *obj, const char *file, const char *g
                      ed->world, EPHYSICS_CALLBACK_WORLD_UPDATE,
                      _edje_physics_world_update_cb, ed);
                }
+#else
+               ERR("Edje compiled without support to physics.");
 #endif
 
             /* colorclass stuff */
index 0ba7803..806ad5a 100644 (file)
@@ -834,9 +834,7 @@ struct _Edje_Part_Collection
 
    unsigned char    broadcast_signal;
 
-#ifdef HAVE_EPHYSICS
    unsigned char    physics_enabled; /* will be 1 if a body is declared */
-#endif
 
    unsigned char    checked : 1;
 };