summaryrefslogtreecommitdiff
path: root/legacy/ephysics/src/lib/ephysics_main.cpp
diff options
context:
space:
mode:
authorBruno Dilly <bdilly@profusion.mobi>2012-07-05 22:53:28 +0000
committerBruno Dilly <bdilly@profusion.mobi>2012-07-05 22:53:28 +0000
commit6208fcfaf3b6113e1f07a93c19c7f7521bedae4c (patch)
tree57e75550c9f0d63ba150be07238e64c8a30a7872 /legacy/ephysics/src/lib/ephysics_main.cpp
parent9b1d6ecb873391a195dff7395674fe60d280c49c (diff)
EPhysics: properly initializes library
It wasn't initializing required libs. SVN revision: 73384
Diffstat (limited to 'legacy/ephysics/src/lib/ephysics_main.cpp')
-rw-r--r--legacy/ephysics/src/lib/ephysics_main.cpp37
1 files changed, 31 insertions, 6 deletions
diff --git a/legacy/ephysics/src/lib/ephysics_main.cpp b/legacy/ephysics/src/lib/ephysics_main.cpp
index 35680b378f..09ad9ce60a 100644
--- a/legacy/ephysics/src/lib/ephysics_main.cpp
+++ b/legacy/ephysics/src/lib/ephysics_main.cpp
@@ -2,6 +2,9 @@
2# include <config.h> 2# include <config.h>
3#endif 3#endif
4 4
5#include "Ecore.h"
6#include "Eina.h"
7
5#include "ephysics_private.h" 8#include "ephysics_private.h"
6 9
7#ifdef __cplusplus 10#ifdef __cplusplus
@@ -17,24 +20,43 @@ ephysics_init()
17 if (++_ephysics_init_count != 1) 20 if (++_ephysics_init_count != 1)
18 return _ephysics_init_count; 21 return _ephysics_init_count;
19 22
23 if (!eina_init())
24 {
25 EINA_LOG_CRIT("Couldn't init eina");
26 return --_ephysics_init_count;
27 }
28
29 if (!ecore_init())
30 {
31 EINA_LOG_CRIT("Couldn't init ecore");
32 goto no_ecore;
33 }
34
20 _ephysics_log_dom = eina_log_domain_register("ephysics", EPHYSICS_LOG_COLOR); 35 _ephysics_log_dom = eina_log_domain_register("ephysics", EPHYSICS_LOG_COLOR);
21 if (_ephysics_log_dom < 0) 36 if (_ephysics_log_dom < 0)
22 { 37 {
23 EINA_LOG_ERR("Couldn't create a log domain for ephysics"); 38 EINA_LOG_CRIT("Couldn't create a log domain for ephysics");
24 return --_ephysics_init_count; 39 goto no_log;
25 } 40 }
26 41
27 if (!ephysics_world_init()) 42 if (!ephysics_world_init())
28 { 43 {
29 ERR("Couldn't initialize worlds"); 44 ERR("Couldn't initialize worlds");
30 eina_log_domain_unregister(_ephysics_log_dom); 45 goto no_world;
31 _ephysics_log_dom = -1;
32 return --_ephysics_init_count;
33 } 46 }
34 47
35 INF("EPhysics initialized"); 48 INF("EPhysics initialized");
36 49
37 return _ephysics_init_count; 50 return _ephysics_init_count;
51
52no_world:
53 eina_log_domain_unregister(_ephysics_log_dom);
54 _ephysics_log_dom = -1;
55no_log:
56 ecore_shutdown();
57no_ecore:
58 eina_shutdown();
59 return --_ephysics_init_count;
38} 60}
39 61
40EAPI int 62EAPI int
@@ -50,6 +72,9 @@ ephysics_shutdown()
50 eina_log_domain_unregister(_ephysics_log_dom); 72 eina_log_domain_unregister(_ephysics_log_dom);
51 _ephysics_log_dom = -1; 73 _ephysics_log_dom = -1;
52 74
75 ecore_shutdown();
76 eina_shutdown();
77
53 return _ephysics_init_count; 78 return _ephysics_init_count;
54} 79}
55 80