Changeset View
Changeset View
Standalone View
Standalone View
src/examples/ephysics/ephysics_logo.c
Show All 19 Lines | |||||
20 | #define LAYER_SHADOW (10) | 20 | #define LAYER_SHADOW (10) | ||
21 | #define LAYER_LETTER (20) | 21 | #define LAYER_LETTER (20) | ||
22 | 22 | | |||
23 | #define CENTER(total, item) (((total) - (item)) / 2) | 23 | #define CENTER(total, item) (((total) - (item)) / 2) | ||
24 | #define LIMIT(val, op, ref) (((val) op (ref)) ? (val) : (ref)); | 24 | #define LIMIT(val, op, ref) (((val) op (ref)) ? (val) : (ref)); | ||
25 | #define PROP_GET(pos, min, max) (((min) + ((max) - (min)) * (pos)) / (max)) | 25 | #define PROP_GET(pos, min, max) (((min) + ((max) - (min)) * (pos)) / (max)) | ||
26 | 26 | | |||
27 | static void | 27 | static void | ||
28 | _update_box_cb(void *data __UNUSED__, EPhysics_Body *body, void *event_info) | 28 | _update_box_cb(void *data EINA_UNUSED, EPhysics_Body *body, void *event_info) | ||
29 | { | 29 | { | ||
30 | Evas_Object *image = event_info; | 30 | Evas_Object *image = event_info; | ||
31 | Evas_Object *shadow = evas_object_data_get(image, "shadow"); | 31 | Evas_Object *shadow = evas_object_data_get(image, "shadow"); | ||
32 | Evas_Object *light = evas_object_data_get(image, "light"); | 32 | Evas_Object *light = evas_object_data_get(image, "light"); | ||
33 | int x, y, w, h, floor_distance, alpha = 0; | 33 | int x, y, w, h, floor_distance, alpha = 0; | ||
34 | 34 | | |||
35 | /* modify the evas object according to the body */ | 35 | /* modify the evas object according to the body */ | ||
36 | ephysics_body_evas_object_update(body); | 36 | ephysics_body_evas_object_update(body); | ||
Show All 30 Lines | |||||
67 | /* it's lighter with bigger y */ | 67 | /* it's lighter with bigger y */ | ||
68 | alpha = (y <= 0) ? 0 : y * 255 / floor_distance; | 68 | alpha = (y <= 0) ? 0 : y * 255 / floor_distance; | ||
69 | /* and with bigger x */ | 69 | /* and with bigger x */ | ||
70 | alpha = alpha * (x - OFFSET_X + 80) / (WIDTH - OFFSET_X); | 70 | alpha = alpha * (x - OFFSET_X + 80) / (WIDTH - OFFSET_X); | ||
71 | evas_object_color_set(light, alpha, alpha, alpha, alpha); | 71 | evas_object_color_set(light, alpha, alpha, alpha, alpha); | ||
72 | } | 72 | } | ||
73 | 73 | | |||
74 | static void | 74 | static void | ||
75 | _update_circle_cb(void *data __UNUSED__, EPhysics_Body *body, void *event_info) | 75 | _update_circle_cb(void *data EINA_UNUSED, EPhysics_Body *body, void *event_info) | ||
76 | { | 76 | { | ||
77 | Evas_Object *image = event_info; | 77 | Evas_Object *image = event_info; | ||
78 | Evas_Object *shadow = evas_object_data_get(image, "shadow"); | 78 | Evas_Object *shadow = evas_object_data_get(image, "shadow"); | ||
79 | Evas_Object *light = evas_object_data_get(image, "light"); | 79 | Evas_Object *light = evas_object_data_get(image, "light"); | ||
80 | int x, y, w, h, sh_w, sh_h, alpha = 0; | 80 | int x, y, w, h, sh_w, sh_h, alpha = 0; | ||
81 | const Evas_Map *map; | 81 | const Evas_Map *map; | ||
82 | 82 | | |||
83 | /* modify the evas object according to the body */ | 83 | /* modify the evas object according to the body */ | ||
▲ Show 20 Lines • Show All 86 Lines • ▼ Show 20 Line(s) | 166 | { | |||
170 | 170 | | |||
171 | ephysics_body_event_callback_add | 171 | ephysics_body_event_callback_add | ||
172 | (body, EPHYSICS_CALLBACK_BODY_UPDATE, _update_circle_cb, NULL); | 172 | (body, EPHYSICS_CALLBACK_BODY_UPDATE, _update_circle_cb, NULL); | ||
173 | 173 | | |||
174 | return body; | 174 | return body; | ||
175 | } | 175 | } | ||
176 | 176 | | |||
177 | EAPI_MAIN int | 177 | EAPI_MAIN int | ||
178 | elm_main(int argc __UNUSED__, char **argv __UNUSED__) | 178 | elm_main(int argc EINA_UNUSED, char **argv EINA_UNUSED) | ||
179 | { | 179 | { | ||
180 | Evas_Object *win, *bg, *image, *light, *shadow; | 180 | Evas_Object *win, *bg, *image, *light, *shadow; | ||
181 | EPhysics_Body *ground_body, *letter_body; | 181 | EPhysics_Body *ground_body, *letter_body; | ||
182 | EPhysics_World *world; | 182 | EPhysics_World *world; | ||
183 | unsigned int i = 0; | 183 | unsigned int i = 0; | ||
184 | int x, w, h, sh_w; | 184 | int x, w, h, sh_w; | ||
185 | Evas *evas; | 185 | Evas *evas; | ||
186 | 186 | | |||
▲ Show 20 Lines • Show All 94 Lines • Show Last 20 Lines |