diff options
author | David Walter Seikel | 2016-03-13 19:59:59 +1000 |
---|---|---|
committer | David Walter Seikel | 2016-03-13 19:59:59 +1000 |
commit | bb128645efa19772a5c1a039df9c46213feb4426 (patch) | |
tree | 87bb9931b4effd3dc1db4ee607d69367cc19a9c6 /src/extantz | |
parent | Introducing Rough Hir, the new default avatar. At least, when we get avatars. (diff) | |
download | SledjHamr-bb128645efa19772a5c1a039df9c46213feb4426.zip SledjHamr-bb128645efa19772a5c1a039df9c46213feb4426.tar.gz SledjHamr-bb128645efa19772a5c1a039df9c46213feb4426.tar.bz2 SledjHamr-bb128645efa19772a5c1a039df9c46213feb4426.tar.xz |
Update to new eo_* syntax.
Diffstat (limited to '')
-rw-r--r-- | src/extantz/camera.c | 35 | ||||
-rw-r--r-- | src/extantz/ephysics_demo.c | 16 | ||||
-rw-r--r-- | src/extantz/extantz.c | 12 | ||||
-rw-r--r-- | src/extantz/extantz.h | 3 | ||||
-rw-r--r-- | src/extantz/files.c | 76 | ||||
-rw-r--r-- | src/extantz/scenri.c | 223 | ||||
-rw-r--r-- | src/extantz/woMan.c | 10 |
7 files changed, 182 insertions, 193 deletions
diff --git a/src/extantz/camera.c b/src/extantz/camera.c index ba960d4..bbf8b01 100644 --- a/src/extantz/camera.c +++ b/src/extantz/camera.c | |||
@@ -28,22 +28,26 @@ Eina_Bool animateCamera(Scene_Data *scene) | |||
28 | { | 28 | { |
29 | Eina_Quaternion rotate, orient, result, move; | 29 | Eina_Quaternion rotate, orient, result, move; |
30 | Evas_Real x, y, z; | 30 | Evas_Real x, y, z; |
31 | Eo *n = scene->avatar_node; | ||
31 | 32 | ||
32 | eo_do(scene->camera_node, evas_canvas3d_node_orientation_get(EVAS_CANVAS3D_SPACE_PARENT, &orient.x, &orient.y, &orient.z, &orient.w)); | ||
33 | euler_to_quaternion(&rotate, DEGREE_TO_RADIAN(scene->move->r), DEGREE_TO_RADIAN(scene->move->s), DEGREE_TO_RADIAN(scene->move->p)); | 33 | euler_to_quaternion(&rotate, DEGREE_TO_RADIAN(scene->move->r), DEGREE_TO_RADIAN(scene->move->s), DEGREE_TO_RADIAN(scene->move->p)); |
34 | eina_quaternion_mul(&result, &orient, &rotate); | 34 | eina_quaternion_mul(&result, &orient, &rotate); |
35 | eina_quaternion_normalized(&result, &result); | 35 | eina_quaternion_normalized(&result, &result); |
36 | eo_do(scene->camera_node, evas_canvas3d_node_orientation_set(result.x, result.y, result.z, result.w)); | 36 | if (n) |
37 | { | ||
38 | evas_canvas3d_node_orientation_get(n, EVAS_CANVAS3D_SPACE_PARENT, &orient.x, &orient.y, &orient.z, &orient.w); | ||
39 | evas_canvas3d_node_orientation_set(n, result.x, result.y, result.z, result.w); | ||
37 | 40 | ||
38 | eina_quaternion_set(&move, scene->move->x, scene->move->y, scene->move->z, 0); | 41 | eina_quaternion_set(&move, scene->move->x, scene->move->y, scene->move->z, 0); |
39 | eo_do(scene->camera_node, evas_canvas3d_node_position_get(EVAS_CANVAS3D_SPACE_PARENT, &x, &y, &z)); | ||
40 | eina_quaternion_mul(&rotate, &result, &move); | 42 | eina_quaternion_mul(&rotate, &result, &move); |
41 | eina_quaternion_conjugate(&result, &result); | 43 | eina_quaternion_conjugate(&result, &result); |
42 | eina_quaternion_mul(&move, &rotate, &result); | 44 | eina_quaternion_mul(&move, &rotate, &result); |
43 | x += move.x; | 45 | x += move.x; |
44 | y += move.y; | 46 | y += move.y; |
45 | z += move.z; | 47 | z += move.z; |
46 | eo_do(scene->camera_node, evas_canvas3d_node_position_set(x, y, z)); | 48 | evas_canvas3d_node_position_get(n, EVAS_CANVAS3D_SPACE_PARENT, &x, &y, &z); |
49 | evas_canvas3d_node_position_set(n, x, y, z); | ||
50 | } | ||
47 | 51 | ||
48 | return EINA_TRUE; | 52 | return EINA_TRUE; |
49 | } | 53 | } |
@@ -204,19 +208,20 @@ Eo *cameraAdd(Evas *evas, Scene_Data *scene, Evas_Object *image) | |||
204 | Eo *camera; | 208 | Eo *camera; |
205 | 209 | ||
206 | camera = eo_add(EVAS_CANVAS3D_CAMERA_CLASS, evas, | 210 | camera = eo_add(EVAS_CANVAS3D_CAMERA_CLASS, evas, |
207 | evas_canvas3d_camera_projection_perspective_set(90.0, 1.0, 1.0, 1024.0) | 211 | evas_canvas3d_camera_projection_perspective_set(eoid, 90.0, 1.0, 1.0, 1024.0) |
208 | ); | 212 | ); |
209 | 213 | ||
210 | result = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(EVAS_CANVAS3D_NODE_TYPE_CAMERA), | 214 | result = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, |
211 | evas_canvas3d_node_camera_set(camera), | 215 | evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_CAMERA), |
212 | evas_canvas3d_node_position_set(0.0, 4.0, 8.0), | 216 | evas_canvas3d_node_camera_set(eoid, camera), |
213 | // evas_canvas3d_node_look_at_set(EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 20.0, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 1.0, 0.0), | 217 | evas_canvas3d_node_position_set(eoid, 0.0, 4.0, 8.0), |
214 | evas_canvas3d_node_orientation_set(0.0, 0.0, 0.0, 1.0) | 218 | // evas_canvas3d_node_look_at_set(eoid, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 20.0, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 1.0, 0.0), |
215 | ); | 219 | evas_canvas3d_node_orientation_set(eoid, 0.0, 0.0, 0.0, 1.0) |
220 | ); | ||
216 | // eo_unref(camera); | 221 | // eo_unref(camera); |
217 | 222 | ||
218 | eo_do(scene->root_node, evas_canvas3d_node_member_add(result)); | 223 | evas_canvas3d_node_member_add(scene->root_node, result); |
219 | eo_do(scene->scene, evas_canvas3d_scene_camera_node_set(result)); | 224 | evas_canvas3d_scene_camera_node_set(scene->scene, result); |
220 | 225 | ||
221 | scene->move = calloc(1, sizeof(cameraMove)); | 226 | scene->move = calloc(1, sizeof(cameraMove)); |
222 | // In this code, we are making our own camera, so grab it's input when we are focused. | 227 | // In this code, we are making our own camera, so grab it's input when we are focused. |
diff --git a/src/extantz/ephysics_demo.c b/src/extantz/ephysics_demo.c index 2ff589b..e8ca8e2 100644 --- a/src/extantz/ephysics_demo.c +++ b/src/extantz/ephysics_demo.c | |||
@@ -33,10 +33,10 @@ EPhysics_World *ephysicsAdd(globals *ourGlobals) | |||
33 | 33 | ||
34 | sprintf(buf, "%s/%s.edj", prefix_data_get(), EPHYSICS_TEST_THEME); | 34 | sprintf(buf, "%s/%s.edj", prefix_data_get(), EPHYSICS_TEST_THEME); |
35 | box1 = eo_add(ELM_IMAGE_CLASS, ourGlobals->win, | 35 | box1 = eo_add(ELM_IMAGE_CLASS, ourGlobals->win, |
36 | efl_file_set(buf, "blue-cube"), | 36 | efl_file_set(eoid, buf, "blue-cube"), |
37 | efl_gfx_size_set(70, 70), | 37 | efl_gfx_size_set(eoid, 70, 70), |
38 | efl_gfx_position_set(ourGlobals->win_w / 2 - 80, ourGlobals->win_h - 200), | 38 | efl_gfx_position_set(eoid, ourGlobals->win_w / 2 - 80, ourGlobals->win_h - 200), |
39 | efl_gfx_visible_set(EINA_TRUE) | 39 | efl_gfx_visible_set(eoid, EINA_TRUE) |
40 | ); | 40 | ); |
41 | 41 | ||
42 | box_body1 = ephysics_body_box_add(world); | 42 | box_body1 = ephysics_body_box_add(world); |
@@ -50,10 +50,10 @@ EPhysics_World *ephysicsAdd(globals *ourGlobals) | |||
50 | 50 | ||
51 | sprintf(buf, "%s/%s.edj", prefix_data_get(), EPHYSICS_TEST_THEME); | 51 | sprintf(buf, "%s/%s.edj", prefix_data_get(), EPHYSICS_TEST_THEME); |
52 | box2 = eo_add(ELM_IMAGE_CLASS, ourGlobals->win, | 52 | box2 = eo_add(ELM_IMAGE_CLASS, ourGlobals->win, |
53 | efl_file_set(buf, "purple-cube"), | 53 | efl_file_set(eoid, buf, "purple-cube"), |
54 | efl_gfx_size_set(70, 70), | 54 | efl_gfx_size_set(eoid, 70, 70), |
55 | efl_gfx_position_set(ourGlobals->win_w / 2 + 10, ourGlobals->win_h - 200), | 55 | efl_gfx_position_set(eoid, ourGlobals->win_w / 2 + 10, ourGlobals->win_h - 200), |
56 | efl_gfx_visible_set(EINA_TRUE) | 56 | efl_gfx_visible_set(eoid, EINA_TRUE) |
57 | ); | 57 | ); |
58 | 58 | ||
59 | box_body2 = ephysics_body_box_add(world); | 59 | box_body2 = ephysics_body_box_add(world); |
diff --git a/src/extantz/extantz.c b/src/extantz/extantz.c index ed78b24..b5f272e 100644 --- a/src/extantz/extantz.c +++ b/src/extantz/extantz.c | |||
@@ -228,11 +228,13 @@ static void _on_resize(void *data, Evas *evas EINA_UNUSED, Evas_Object *obj EINA | |||
228 | GLData *gld = &ourGlobals->gld; | 228 | GLData *gld = &ourGlobals->gld; |
229 | Evas_Coord h; | 229 | Evas_Coord h; |
230 | 230 | ||
231 | eo_do(ourGlobals->win, efl_gfx_size_get(&ourGlobals->win_w, &ourGlobals->win_h)); | 231 | efl_gfx_size_get(ourGlobals->win, &ourGlobals->win_w, &ourGlobals->win_h); |
232 | eo_do(ourGlobals->tb, | 232 | evas_obj_size_hint_min_get(ourGlobals->win, NULL, &h); |
233 | evas_obj_size_hint_min_get(NULL, &h), | 233 | |
234 | efl_gfx_size_set(ourGlobals->win_w, h) | 234 | if (10 > h) |
235 | ); | 235 | h = ourGlobals->win_h; |
236 | |||
237 | efl_gfx_size_set(ourGlobals->win, ourGlobals->win_w, h); | ||
236 | // Stop internal windows going under the toolbar. | 238 | // Stop internal windows going under the toolbar. |
237 | evas_object_resize(ourGlobals->mainWindow->layout, ourGlobals->win_w, h); | 239 | evas_object_resize(ourGlobals->mainWindow->layout, ourGlobals->win_w, h); |
238 | #if USE_EPHYSICS | 240 | #if USE_EPHYSICS |
diff --git a/src/extantz/extantz.h b/src/extantz/extantz.h index 1f62496..ea22879 100644 --- a/src/extantz/extantz.h +++ b/src/extantz/extantz.h | |||
@@ -138,11 +138,12 @@ typedef struct | |||
138 | typedef struct _Scene_Data | 138 | typedef struct _Scene_Data |
139 | { | 139 | { |
140 | Evas *evas; | 140 | Evas *evas; |
141 | Evas_Object *image; // Our Elm image. | 141 | Evas_Object *image, *image_e; // Our Elm image, and it's Evas image. |
142 | Eo *scene; | 142 | Eo *scene; |
143 | Eo *root_node; | 143 | Eo *root_node; |
144 | Eo *camera_node; | 144 | Eo *camera_node; |
145 | Eo *light_node; | 145 | Eo *light_node; |
146 | Eo *avatar_node; | ||
146 | 147 | ||
147 | Eo *light; | 148 | Eo *light; |
148 | 149 | ||
diff --git a/src/extantz/files.c b/src/extantz/files.c index 535e250..216e696 100644 --- a/src/extantz/files.c +++ b/src/extantz/files.c | |||
@@ -153,11 +153,9 @@ winFang *filesAdd(globals *ourGlobals, char *path, Eina_Bool multi, Eina_Bool sa | |||
153 | wid->data = ourGlobals; | 153 | wid->data = ourGlobals; |
154 | wid->on_del = _on_fs_del; | 154 | wid->on_del = _on_fs_del; |
155 | me->data = fs; | 155 | me->data = fs; |
156 | eo_do(fs, | 156 | elm_obj_fileselector_buttons_ok_cancel_set(fs, EINA_FALSE); |
157 | elm_obj_fileselector_buttons_ok_cancel_set(EINA_FALSE), | 157 | elm_interface_fileselector_expandable_set(fs, EINA_TRUE); |
158 | elm_interface_fileselector_expandable_set(EINA_TRUE), | 158 | elm_interface_fileselector_folder_only_set(fs, EINA_FALSE); |
159 | elm_interface_fileselector_folder_only_set(EINA_FALSE) | ||
160 | ); | ||
161 | 159 | ||
162 | elm_fileselector_path_set(fs, path); | 160 | elm_fileselector_path_set(fs, path); |
163 | elm_fileselector_is_save_set(fs, save); | 161 | elm_fileselector_is_save_set(fs, save); |
@@ -177,36 +175,36 @@ winFang *filesAdd(globals *ourGlobals, char *path, Eina_Bool multi, Eina_Bool sa | |||
177 | evas_object_smart_callback_add(fs, "activated", my_fileselector_activated, me); | 175 | evas_object_smart_callback_add(fs, "activated", my_fileselector_activated, me); |
178 | 176 | ||
179 | hbox = eo_add(ELM_BOX_CLASS, me->win, | 177 | hbox = eo_add(ELM_BOX_CLASS, me->win, |
180 | elm_obj_box_homogeneous_set(EINA_FALSE), | 178 | elm_obj_box_homogeneous_set(eoid, EINA_FALSE), |
181 | elm_obj_box_horizontal_set(EINA_TRUE), | 179 | elm_obj_box_horizontal_set(eoid, EINA_TRUE), |
182 | evas_obj_size_hint_align_set(EVAS_HINT_FILL, EVAS_HINT_FILL) | 180 | evas_obj_size_hint_align_set(eoid, EVAS_HINT_FILL, EVAS_HINT_FILL) |
183 | ); | 181 | ); |
184 | 182 | ||
185 | hoversel = eo_add(ELM_HOVERSEL_CLASS, hbox, | 183 | hoversel = eo_add(ELM_HOVERSEL_CLASS, hbox, |
186 | elm_obj_hoversel_hover_parent_set(me->win), | 184 | elm_obj_hoversel_hover_parent_set(eoid, me->win), |
187 | eo_key_data_set("fileselector", fs), | 185 | eo_key_data_set(eoid, "fileselector", fs), |
188 | elm_obj_hoversel_item_add("name(asc)", NULL, ELM_ICON_NONE, _sort_selected_cb, (const void *) ELM_FILESELECTOR_SORT_BY_FILENAME_ASC), | 186 | elm_obj_hoversel_item_add(eoid, "name(asc)", NULL, ELM_ICON_NONE, _sort_selected_cb, (const void *) ELM_FILESELECTOR_SORT_BY_FILENAME_ASC), |
189 | elm_obj_hoversel_item_add("name(desc)", NULL, ELM_ICON_NONE, _sort_selected_cb, (const void *) ELM_FILESELECTOR_SORT_BY_FILENAME_DESC), | 187 | elm_obj_hoversel_item_add(eoid, "name(desc)", NULL, ELM_ICON_NONE, _sort_selected_cb, (const void *) ELM_FILESELECTOR_SORT_BY_FILENAME_DESC), |
190 | elm_obj_hoversel_item_add("type(asc)", NULL, ELM_ICON_NONE, _sort_selected_cb, (const void *) ELM_FILESELECTOR_SORT_BY_TYPE_ASC), | 188 | elm_obj_hoversel_item_add(eoid, "type(asc)", NULL, ELM_ICON_NONE, _sort_selected_cb, (const void *) ELM_FILESELECTOR_SORT_BY_TYPE_ASC), |
191 | elm_obj_hoversel_item_add("type(desc)", NULL, ELM_ICON_NONE, _sort_selected_cb, (const void *) ELM_FILESELECTOR_SORT_BY_TYPE_DESC), | 189 | elm_obj_hoversel_item_add(eoid, "type(desc)", NULL, ELM_ICON_NONE, _sort_selected_cb, (const void *) ELM_FILESELECTOR_SORT_BY_TYPE_DESC), |
192 | elm_obj_hoversel_item_add("size(asc)", NULL, ELM_ICON_NONE, _sort_selected_cb, (const void *) ELM_FILESELECTOR_SORT_BY_SIZE_ASC), | 190 | elm_obj_hoversel_item_add(eoid, "size(asc)", NULL, ELM_ICON_NONE, _sort_selected_cb, (const void *) ELM_FILESELECTOR_SORT_BY_SIZE_ASC), |
193 | elm_obj_hoversel_item_add("size(desc)", NULL, ELM_ICON_NONE, _sort_selected_cb, (const void *) ELM_FILESELECTOR_SORT_BY_SIZE_DESC), | 191 | elm_obj_hoversel_item_add(eoid, "size(desc)", NULL, ELM_ICON_NONE, _sort_selected_cb, (const void *) ELM_FILESELECTOR_SORT_BY_SIZE_DESC), |
194 | elm_obj_hoversel_item_add("time(asc)", NULL, ELM_ICON_NONE, _sort_selected_cb, (const void *) ELM_FILESELECTOR_SORT_BY_MODIFIED_ASC), | 192 | elm_obj_hoversel_item_add(eoid, "time(asc)", NULL, ELM_ICON_NONE, _sort_selected_cb, (const void *) ELM_FILESELECTOR_SORT_BY_MODIFIED_ASC), |
195 | elm_obj_hoversel_item_add("time(desc)", NULL, ELM_ICON_NONE, _sort_selected_cb, (const void *) ELM_FILESELECTOR_SORT_BY_MODIFIED_DESC), | 193 | elm_obj_hoversel_item_add(eoid, "time(desc)", NULL, ELM_ICON_NONE, _sort_selected_cb, (const void *) ELM_FILESELECTOR_SORT_BY_MODIFIED_DESC), |
196 | efl_gfx_visible_set(EINA_TRUE) | 194 | efl_gfx_visible_set(eoid, EINA_TRUE) |
197 | ); | 195 | ); |
198 | elm_object_text_set(hoversel, "sorting"); | 196 | elm_object_text_set(hoversel, "sorting"); |
199 | elm_box_pack_end(hbox, hoversel); | 197 | elm_box_pack_end(hbox, hoversel); |
200 | 198 | ||
201 | hoversel = eo_add(ELM_HOVERSEL_CLASS, hbox, | 199 | hoversel = eo_add(ELM_HOVERSEL_CLASS, hbox, |
202 | elm_obj_hoversel_hover_parent_set(me->win), | 200 | elm_obj_hoversel_hover_parent_set(eoid, me->win), |
203 | eo_key_data_set("fileselector", fs), | 201 | eo_key_data_set(eoid, "fileselector", fs), |
204 | elm_obj_hoversel_item_add("tiny", NULL, ELM_ICON_NONE, _tiny_icon_clicked, fs), | 202 | elm_obj_hoversel_item_add(eoid, "tiny", NULL, ELM_ICON_NONE, _tiny_icon_clicked, fs), |
205 | elm_obj_hoversel_item_add("small", NULL, ELM_ICON_NONE, _small_icon_clicked, fs), | 203 | elm_obj_hoversel_item_add(eoid, "small", NULL, ELM_ICON_NONE, _small_icon_clicked, fs), |
206 | elm_obj_hoversel_item_add("medium", NULL, ELM_ICON_NONE, _middle_icon_clicked, fs), | 204 | elm_obj_hoversel_item_add(eoid, "medium", NULL, ELM_ICON_NONE, _middle_icon_clicked, fs), |
207 | elm_obj_hoversel_item_add("big", NULL, ELM_ICON_NONE, _big_icon_clicked, fs), | 205 | elm_obj_hoversel_item_add(eoid, "big", NULL, ELM_ICON_NONE, _big_icon_clicked, fs), |
208 | efl_gfx_visible_set(EINA_TRUE) | 206 | efl_gfx_visible_set(eoid, EINA_TRUE) |
209 | ); | 207 | ); |
210 | elm_object_text_set(hoversel, "size"); | 208 | elm_object_text_set(hoversel, "size"); |
211 | elm_box_pack_end(hbox, hoversel); | 209 | elm_box_pack_end(hbox, hoversel); |
212 | // Make sure it starts off as small, works around "hitting grid mode before hitting size not showing anything" bug. | 210 | // Make sure it starts off as small, works around "hitting grid mode before hitting size not showing anything" bug. |
@@ -214,17 +212,17 @@ winFang *filesAdd(globals *ourGlobals, char *path, Eina_Bool multi, Eina_Bool sa | |||
214 | 212 | ||
215 | 213 | ||
216 | bt = eo_add(ELM_CHECK_CLASS, hbox, | 214 | bt = eo_add(ELM_CHECK_CLASS, hbox, |
217 | elm_obj_check_state_set(elm_fileselector_hidden_visible_get(fs)), | 215 | elm_obj_check_state_set(eoid, elm_fileselector_hidden_visible_get(fs)), |
218 | efl_gfx_visible_set(EINA_TRUE) | 216 | efl_gfx_visible_set(eoid, EINA_TRUE) |
219 | ); | 217 | ); |
220 | elm_object_text_set(bt, "hidden"); | 218 | elm_object_text_set(bt, "hidden"); |
221 | evas_object_smart_callback_add(bt, "changed", _hidden_clicked, fs); | 219 | evas_object_smart_callback_add(bt, "changed", _hidden_clicked, fs); |
222 | elm_box_pack_end(hbox, bt); | 220 | elm_box_pack_end(hbox, bt); |
223 | 221 | ||
224 | rdg = rd = eo_add(ELM_RADIO_CLASS, hbox, | 222 | rdg = rd = eo_add(ELM_RADIO_CLASS, hbox, |
225 | elm_obj_radio_state_value_set(ELM_FILESELECTOR_GRID), | 223 | elm_obj_radio_state_value_set(eoid, ELM_FILESELECTOR_GRID), |
226 | efl_gfx_visible_set(EINA_TRUE) | 224 | efl_gfx_visible_set(eoid, EINA_TRUE) |
227 | ); | 225 | ); |
228 | elm_object_text_set(rd, "grid"); | 226 | elm_object_text_set(rd, "grid"); |
229 | elm_box_pack_end(hbox, rd); | 227 | elm_box_pack_end(hbox, rd); |
230 | evas_object_smart_callback_add(rd, "changed", _mode_changed_cb, fs); | 228 | evas_object_smart_callback_add(rd, "changed", _mode_changed_cb, fs); |
@@ -232,23 +230,23 @@ winFang *filesAdd(globals *ourGlobals, char *path, Eina_Bool multi, Eina_Bool sa | |||
232 | _mode_changed_cb(fs, rd, NULL); | 230 | _mode_changed_cb(fs, rd, NULL); |
233 | 231 | ||
234 | rd = eo_add(ELM_RADIO_CLASS, hbox, | 232 | rd = eo_add(ELM_RADIO_CLASS, hbox, |
235 | elm_obj_radio_state_value_set(ELM_FILESELECTOR_LIST), | 233 | elm_obj_radio_state_value_set(eoid, ELM_FILESELECTOR_LIST), |
236 | efl_gfx_visible_set(EINA_TRUE) | 234 | efl_gfx_visible_set(eoid, EINA_TRUE) |
237 | ); | 235 | ); |
238 | elm_radio_group_add(rd, rdg); | 236 | elm_radio_group_add(rd, rdg); |
239 | elm_object_text_set(rd, "list"); | 237 | elm_object_text_set(rd, "list"); |
240 | elm_box_pack_end(hbox, rd); | 238 | elm_box_pack_end(hbox, rd); |
241 | evas_object_smart_callback_add(rd, "changed", _mode_changed_cb, fs); | 239 | evas_object_smart_callback_add(rd, "changed", _mode_changed_cb, fs); |
242 | 240 | ||
243 | bt = eo_add(ELM_BUTTON_CLASS, me->win, | 241 | bt = eo_add(ELM_BUTTON_CLASS, me->win, |
244 | efl_gfx_visible_set(EINA_TRUE) | 242 | efl_gfx_visible_set(eoid, EINA_TRUE) |
245 | ); | 243 | ); |
246 | elm_object_text_set(bt, "OK"); | 244 | elm_object_text_set(bt, "OK"); |
247 | evas_object_smart_callback_add(bt, "clicked", _OK_clicked, me); | 245 | evas_object_smart_callback_add(bt, "clicked", _OK_clicked, me); |
248 | elm_box_pack_end(hbox, bt); | 246 | elm_box_pack_end(hbox, bt); |
249 | 247 | ||
250 | bt = eo_add(ELM_BUTTON_CLASS, me->win, | 248 | bt = eo_add(ELM_BUTTON_CLASS, me->win, |
251 | efl_gfx_visible_set(EINA_TRUE) | 249 | efl_gfx_visible_set(eoid, EINA_TRUE) |
252 | ); | 250 | ); |
253 | elm_object_text_set(bt, "CANCEL"); | 251 | elm_object_text_set(bt, "CANCEL"); |
254 | evas_object_smart_callback_add(bt, "clicked", _CANCEL_clicked, me); | 252 | evas_object_smart_callback_add(bt, "clicked", _CANCEL_clicked, me); |
diff --git a/src/extantz/scenri.c b/src/extantz/scenri.c index 4f15109..a487d47 100644 --- a/src/extantz/scenri.c +++ b/src/extantz/scenri.c | |||
@@ -100,10 +100,8 @@ static void _animateCube(ExtantzStuffs *stuffs) | |||
100 | if (frame >= 20) inc = -1; | 100 | if (frame >= 20) inc = -1; |
101 | else if (frame <= 0) inc = 1; | 101 | else if (frame <= 0) inc = 1; |
102 | 102 | ||
103 | eo_do(stuffs->mesh_node, | 103 | evas_canvas3d_node_orientation_angle_axis_set(stuffs->mesh_node, angle, 1.0, 1.0, 1.0); |
104 | evas_canvas3d_node_orientation_angle_axis_set(angle, 1.0, 1.0, 1.0), | 104 | evas_canvas3d_node_mesh_frame_set(stuffs->mesh_node, m, frame); |
105 | evas_canvas3d_node_mesh_frame_set(m, frame) | ||
106 | ); | ||
107 | } | 105 | } |
108 | 106 | ||
109 | static void _animateSphere(ExtantzStuffs *stuffs) | 107 | static void _animateSphere(ExtantzStuffs *stuffs) |
@@ -112,9 +110,7 @@ static void _animateSphere(ExtantzStuffs *stuffs) | |||
112 | 110 | ||
113 | earthAngle += 0.3; | 111 | earthAngle += 0.3; |
114 | if (earthAngle > 360.0) earthAngle -= 360.0f; | 112 | if (earthAngle > 360.0) earthAngle -= 360.0f; |
115 | eo_do(stuffs->mesh_node, | 113 | evas_canvas3d_node_orientation_angle_axis_set(stuffs->mesh_node, earthAngle, 0.0, 1.0, 0.0); |
116 | evas_canvas3d_node_orientation_angle_axis_set(earthAngle, 0.0, 1.0, 0.0) | ||
117 | ); | ||
118 | } | 114 | } |
119 | 115 | ||
120 | static void _animateSonic(ExtantzStuffs *stuffs) | 116 | static void _animateSonic(ExtantzStuffs *stuffs) |
@@ -125,9 +121,7 @@ static void _animateSonic(ExtantzStuffs *stuffs) | |||
125 | eina_accessor_data_get(stuffs->aMesh, 0, (void **) &m); | 121 | eina_accessor_data_get(stuffs->aMesh, 0, (void **) &m); |
126 | sonicFrame += 32; | 122 | sonicFrame += 32; |
127 | if (sonicFrame > 256 * 50) sonicFrame = 0; | 123 | if (sonicFrame > 256 * 50) sonicFrame = 0; |
128 | eo_do(stuffs->mesh_node, | 124 | evas_canvas3d_node_mesh_frame_set(stuffs->mesh_node, m, sonicFrame); |
129 | evas_canvas3d_node_mesh_frame_set(m, sonicFrame) | ||
130 | ); | ||
131 | } | 125 | } |
132 | 126 | ||
133 | Eina_Bool animateScene(globals *ourGlobals) | 127 | Eina_Bool animateScene(globals *ourGlobals) |
@@ -206,12 +200,12 @@ static void _on_mouse_down(void *data, Evas *e EINA_UNUSED, Evas_Object *o, void | |||
206 | obj_x = ev->canvas.x - x; | 200 | obj_x = ev->canvas.x - x; |
207 | obj_y = ev->canvas.y - y; | 201 | obj_y = ev->canvas.y - y; |
208 | 202 | ||
209 | eo_do(scene->scene, evas_canvas3d_scene_size_get(&scene_w, &scene_h)); | 203 | evas_canvas3d_scene_size_get(scene->scene, &scene_w, &scene_h); |
210 | 204 | ||
211 | scene_x = obj_x * scene_w / (Evas_Real)w; | 205 | scene_x = obj_x * scene_w / (Evas_Real)w; |
212 | scene_y = obj_y * scene_h / (Evas_Real)h; | 206 | scene_y = obj_y * scene_h / (Evas_Real)h; |
213 | 207 | ||
214 | eo_do(scene->scene, pick = evas_canvas3d_scene_pick(scene_x, scene_y, &n, &m, &s, &t)); | 208 | pick = evas_canvas3d_scene_pick(scene->scene, scene_x, scene_y, &n, &m, &s, &t); |
215 | if (pick) | 209 | if (pick) |
216 | { | 210 | { |
217 | name = evas_object_data_get(n, "Name"); | 211 | name = evas_object_data_get(n, "Name"); |
@@ -406,24 +400,21 @@ Scene_Data *scenriAdd(Evas_Object *win) | |||
406 | { | 400 | { |
407 | Scene_Data *scene; | 401 | Scene_Data *scene; |
408 | Evas_Object *evas; | 402 | Evas_Object *evas; |
409 | #if USE_ELM_IMG | ||
410 | Evas_Object *temp; | ||
411 | #endif | ||
412 | int w, h; | 403 | int w, h; |
413 | 404 | ||
414 | evas = evas_object_evas_get(win); | 405 | evas = evas_object_evas_get(win); |
415 | eo_do(win, efl_gfx_size_get(&w, &h)); | 406 | efl_gfx_size_get(win, &w, &h); |
416 | scene = calloc(1, sizeof(Scene_Data)); | 407 | scene = calloc(1, sizeof(Scene_Data)); |
417 | scene->evas = evas; | 408 | scene->evas = evas; |
418 | eina_clist_init(&(scene->stuffs)); | 409 | eina_clist_init(&(scene->stuffs)); |
419 | eina_clist_init(&(scene->loading)); | 410 | eina_clist_init(&(scene->loading)); |
420 | 411 | ||
421 | scene->root_node = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(EVAS_CANVAS3D_NODE_TYPE_NODE)); | 412 | scene->root_node = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_NODE)); |
422 | 413 | ||
423 | scene->scene = eo_add(EVAS_CANVAS3D_SCENE_CLASS, evas, | 414 | scene->scene = eo_add(EVAS_CANVAS3D_SCENE_CLASS, evas, |
424 | evas_canvas3d_scene_root_node_set(scene->root_node), | 415 | evas_canvas3d_scene_root_node_set(eoid, scene->root_node), |
425 | evas_canvas3d_scene_size_set(w, h), | 416 | evas_canvas3d_scene_size_set(eoid, w, h), |
426 | evas_canvas3d_scene_background_color_set(0.0, 0.0, 0.0, 0.0) | 417 | evas_canvas3d_scene_background_color_set(eoid, 0.0, 0.0, 0.0, 0.0) |
427 | ); | 418 | ); |
428 | 419 | ||
429 | // Add an image object for 3D scene rendering. | 420 | // Add an image object for 3D scene rendering. |
@@ -432,10 +423,10 @@ Scene_Data *scenriAdd(Evas_Object *win) | |||
432 | // Note that we can't reuse the windows background image, Evas_3D needs both images. | 423 | // Note that we can't reuse the windows background image, Evas_3D needs both images. |
433 | #if USE_ELM_IMG | 424 | #if USE_ELM_IMG |
434 | scene->image = eo_add(ELM_IMAGE_CLASS, win, | 425 | scene->image = eo_add(ELM_IMAGE_CLASS, win, |
435 | evas_obj_size_hint_weight_set(EVAS_HINT_EXPAND, EVAS_HINT_EXPAND), | 426 | evas_obj_size_hint_weight_set(eoid, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND), |
436 | elm_obj_image_fill_outside_set(EINA_TRUE), | 427 | elm_obj_image_fill_outside_set(eoid, EINA_TRUE), |
437 | efl_gfx_visible_set(EINA_TRUE), | 428 | efl_gfx_visible_set(eoid, EINA_TRUE), |
438 | temp = elm_obj_image_object_get() | 429 | scene->image_e = elm_obj_image_object_get(eoid) |
439 | ); | 430 | ); |
440 | #else | 431 | #else |
441 | scene->image = evas_object_image_filled_add(evas); | 432 | scene->image = evas_object_image_filled_add(evas); |
@@ -446,17 +437,18 @@ Scene_Data *scenriAdd(Evas_Object *win) | |||
446 | 437 | ||
447 | // Lights! | 438 | // Lights! |
448 | scene->light = eo_add(EVAS_CANVAS3D_LIGHT_CLASS, evas, | 439 | scene->light = eo_add(EVAS_CANVAS3D_LIGHT_CLASS, evas, |
449 | evas_canvas3d_light_ambient_set(1.0, 1.0, 1.0, 1.0), | 440 | evas_canvas3d_light_ambient_set(eoid, 1.0, 1.0, 1.0, 1.0), |
450 | evas_canvas3d_light_diffuse_set(1.0, 1.0, 1.0, 1.0), | 441 | evas_canvas3d_light_diffuse_set(eoid, 1.0, 1.0, 1.0, 1.0), |
451 | evas_canvas3d_light_specular_set(1.0, 1.0, 1.0, 1.0), | 442 | evas_canvas3d_light_specular_set(eoid, 1.0, 1.0, 1.0, 1.0), |
452 | evas_canvas3d_light_directional_set(EINA_TRUE) | 443 | evas_canvas3d_light_directional_set(eoid, EINA_TRUE) |
453 | ); | 444 | ); |
454 | scene->light_node = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(EVAS_CANVAS3D_NODE_TYPE_LIGHT), | 445 | scene->light_node = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, |
455 | evas_canvas3d_node_light_set(scene->light), | 446 | evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_LIGHT), |
456 | evas_canvas3d_node_position_set(1000.0, 0.0, 1000.0), | 447 | evas_canvas3d_node_light_set(eoid, scene->light), |
457 | evas_canvas3d_node_look_at_set(EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 0.0, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 1.0, 0.0) | 448 | evas_canvas3d_node_position_set(eoid, 1000.0, 0.0, 1000.0), |
449 | evas_canvas3d_node_look_at_set(eoid, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 0.0, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 1.0, 0.0) | ||
458 | ); | 450 | ); |
459 | eo_do(scene->root_node, evas_canvas3d_node_member_add(scene->light_node)); | 451 | evas_canvas3d_node_member_add(scene->root_node, scene->light_node); |
460 | 452 | ||
461 | // Cameras! | 453 | // Cameras! |
462 | scene->camera_node = cameraAdd(evas, scene, scene->image); | 454 | scene->camera_node = cameraAdd(evas, scene, scene->image); |
@@ -466,13 +458,13 @@ Scene_Data *scenriAdd(Evas_Object *win) | |||
466 | elm_object_tooltip_hide(scene->image); | 458 | elm_object_tooltip_hide(scene->image); |
467 | 459 | ||
468 | #if USE_ELM_IMG | 460 | #if USE_ELM_IMG |
469 | eo_do(temp, evas_obj_image_scene_set(scene->scene)); | 461 | evas_obj_image_scene_set(scene->image_e, scene->scene); |
470 | 462 | ||
471 | // Elm can't seem to be able to tell us WHERE an image was clicked, so use raw Evas callbacks instead. | 463 | // Elm can't seem to be able to tell us WHERE an image was clicked, so use raw Evas callbacks instead. |
472 | evas_object_event_callback_add(temp, EVAS_CALLBACK_MOUSE_MOVE, _on_mouse_move, scene); | 464 | evas_object_event_callback_add(scene->image_e, EVAS_CALLBACK_MOUSE_MOVE, _on_mouse_move, scene); |
473 | evas_object_event_callback_add(temp, EVAS_CALLBACK_MOUSE_DOWN, _on_mouse_down, scene); | 465 | evas_object_event_callback_add(scene->image_e, EVAS_CALLBACK_MOUSE_DOWN, _on_mouse_down, scene); |
474 | #else | 466 | #else |
475 | eo_do(scene->image, evas_obj_image_scene_set(scene->scene)); | 467 | evas_obj_image_scene_set(scene->image, scene->scene); |
476 | 468 | ||
477 | // Elm can't seem to be able to tell us WHERE an image was clicked, so use raw Evas callbacks instead. | 469 | // Elm can't seem to be able to tell us WHERE an image was clicked, so use raw Evas callbacks instead. |
478 | evas_object_event_callback_add(scene->image, EVAS_CALLBACK_MOUSE_MOVE, _on_mouse_move, scene); | 470 | evas_object_event_callback_add(scene->image, EVAS_CALLBACK_MOUSE_MOVE, _on_mouse_move, scene); |
@@ -594,11 +586,9 @@ static void _set_vertex_data_from_array(Evas_Canvas3D_Mesh *mesh, int frame, con | |||
594 | float *address, *out; | 586 | float *address, *out; |
595 | int stride, i, j; | 587 | int stride, i, j; |
596 | 588 | ||
597 | eo_do(mesh, | 589 | evas_canvas3d_mesh_frame_vertex_data_copy_set(mesh, frame, attr, 0, NULL); |
598 | evas_canvas3d_mesh_frame_vertex_data_copy_set(frame, attr, 0, NULL), | 590 | address = (float *)evas_canvas3d_mesh_frame_vertex_data_map(mesh, frame, attr); |
599 | address = (float *)evas_canvas3d_mesh_frame_vertex_data_map(frame, attr), | 591 | stride = evas_canvas3d_mesh_frame_vertex_stride_get(mesh, frame, attr); |
600 | stride = evas_canvas3d_mesh_frame_vertex_stride_get(frame, attr) | ||
601 | ); | ||
602 | 592 | ||
603 | if (stride == 0) stride = sizeof(float) * attr_count; | 593 | if (stride == 0) stride = sizeof(float) * attr_count; |
604 | 594 | ||
@@ -609,7 +599,7 @@ static void _set_vertex_data_from_array(Evas_Canvas3D_Mesh *mesh, int frame, con | |||
609 | out[j] = data[start + (line * i) + j]; | 599 | out[j] = data[start + (line * i) + j]; |
610 | } | 600 | } |
611 | 601 | ||
612 | eo_do(mesh, evas_canvas3d_mesh_frame_vertex_data_unmap(frame, attr)); | 602 | evas_canvas3d_mesh_frame_vertex_data_unmap(mesh, frame, attr); |
613 | } | 603 | } |
614 | 604 | ||
615 | void stuffsSetup(ExtantzStuffs *stuffs, Scene_Data *scene, int fake) | 605 | void stuffsSetup(ExtantzStuffs *stuffs, Scene_Data *scene, int fake) |
@@ -628,13 +618,13 @@ void stuffsSetup(ExtantzStuffs *stuffs, Scene_Data *scene, int fake) | |||
628 | if (1 == fake) | 618 | if (1 == fake) |
629 | { | 619 | { |
630 | t = eo_add(EVAS_CANVAS3D_TEXTURE_CLASS, scene->evas, | 620 | t = eo_add(EVAS_CANVAS3D_TEXTURE_CLASS, scene->evas, |
631 | evas_canvas3d_texture_data_set(EVAS_COLORSPACE_ARGB8888, 4, 4, &pixels0[0]) | 621 | evas_canvas3d_texture_data_set(eoid, EVAS_COLORSPACE_ARGB8888, 4, 4, &pixels0[0]) |
632 | ); | 622 | ); |
633 | eina_array_push(stuffs->textures, t); | 623 | eina_array_push(stuffs->textures, t); |
634 | 624 | ||
635 | t1 = eo_add(EVAS_CANVAS3D_TEXTURE_CLASS, scene->evas, | 625 | t1 = eo_add(EVAS_CANVAS3D_TEXTURE_CLASS, scene->evas, |
636 | evas_canvas3d_texture_data_set(EVAS_COLORSPACE_ARGB8888, 4, 4, &pixels1[0]) | 626 | evas_canvas3d_texture_data_set(eoid, EVAS_COLORSPACE_ARGB8888, 4, 4, &pixels1[0]) |
637 | ); | 627 | ); |
638 | eina_array_push(stuffs->textures, t1); | 628 | eina_array_push(stuffs->textures, t1); |
639 | } | 629 | } |
640 | 630 | ||
@@ -642,10 +632,10 @@ void stuffsSetup(ExtantzStuffs *stuffs, Scene_Data *scene, int fake) | |||
642 | { | 632 | { |
643 | snprintf(buf, sizeof(buf), "%s/%s", prefix_data_get(), m->texture); | 633 | snprintf(buf, sizeof(buf), "%s/%s", prefix_data_get(), m->texture); |
644 | ti = eo_add(EVAS_CANVAS3D_TEXTURE_CLASS, scene->evas, | 634 | ti = eo_add(EVAS_CANVAS3D_TEXTURE_CLASS, scene->evas, |
645 | evas_canvas3d_texture_file_set(buf, NULL), | 635 | evas_canvas3d_texture_file_set(eoid, buf, NULL), |
646 | evas_canvas3d_texture_filter_set(EVAS_CANVAS3D_TEXTURE_FILTER_LINEAR, EVAS_CANVAS3D_TEXTURE_FILTER_LINEAR), // Only for sphere originally. | 636 | evas_canvas3d_texture_filter_set(eoid, EVAS_CANVAS3D_TEXTURE_FILTER_LINEAR, EVAS_CANVAS3D_TEXTURE_FILTER_LINEAR), // Only for sphere originally. |
647 | evas_canvas3d_texture_filter_set(EVAS_CANVAS3D_TEXTURE_FILTER_NEAREST, EVAS_CANVAS3D_TEXTURE_FILTER_NEAREST), // Only for sonic originally. | 637 | evas_canvas3d_texture_filter_set(eoid, EVAS_CANVAS3D_TEXTURE_FILTER_NEAREST, EVAS_CANVAS3D_TEXTURE_FILTER_NEAREST), // Only for sonic originally. |
648 | evas_canvas3d_texture_wrap_set(EVAS_CANVAS3D_WRAP_MODE_REPEAT, EVAS_CANVAS3D_WRAP_MODE_REPEAT) | 638 | evas_canvas3d_texture_wrap_set(eoid, EVAS_CANVAS3D_WRAP_MODE_REPEAT, EVAS_CANVAS3D_WRAP_MODE_REPEAT) |
649 | ); | 639 | ); |
650 | eina_array_push(stuffs->textures, ti); | 640 | eina_array_push(stuffs->textures, ti); |
651 | } | 641 | } |
@@ -655,34 +645,31 @@ void stuffsSetup(ExtantzStuffs *stuffs, Scene_Data *scene, int fake) | |||
655 | { | 645 | { |
656 | eina_accessor_data_get(stuffs->aTexture, 0, (void **) &t); | 646 | eina_accessor_data_get(stuffs->aTexture, 0, (void **) &t); |
657 | mi = eo_add(EVAS_CANVAS3D_MATERIAL_CLASS, scene->evas, | 647 | mi = eo_add(EVAS_CANVAS3D_MATERIAL_CLASS, scene->evas, |
658 | evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, EINA_TRUE), | 648 | evas_canvas3d_material_enable_set(eoid, EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, EINA_TRUE), |
659 | evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, EINA_TRUE), | 649 | evas_canvas3d_material_enable_set(eoid, EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, EINA_TRUE), |
660 | evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, EINA_TRUE), | 650 | evas_canvas3d_material_enable_set(eoid, EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, EINA_TRUE), |
661 | evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_NORMAL, EINA_TRUE), | 651 | evas_canvas3d_material_enable_set(eoid, EVAS_CANVAS3D_MATERIAL_ATTRIB_NORMAL, EINA_TRUE), |
662 | 652 | evas_canvas3d_material_color_set(eoid, EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, 0.2, 0.2, 0.2, 1.0), | |
663 | evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, 0.2, 0.2, 0.2, 1.0), | 653 | evas_canvas3d_material_color_set(eoid, EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, 0.8, 0.8, 0.8, 1.0), |
664 | evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, 0.8, 0.8, 0.8, 1.0), | 654 | evas_canvas3d_material_color_set(eoid, EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, 1.0, 1.0, 1.0, 1.0), |
665 | evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, 1.0, 1.0, 1.0, 1.0), | 655 | evas_canvas3d_material_shininess_set(eoid, 100.0), |
666 | evas_canvas3d_material_shininess_set(100.0), | 656 | evas_canvas3d_material_texture_set(eoid, EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, t) |
667 | evas_canvas3d_material_texture_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, t) | ||
668 | ); | 657 | ); |
669 | eina_array_push(stuffs->materials, mi); | 658 | eina_array_push(stuffs->materials, mi); |
670 | 659 | ||
671 | eina_accessor_data_get(stuffs->aTexture, 1, (void **) &t1); | 660 | eina_accessor_data_get(stuffs->aTexture, 1, (void **) &t1); |
672 | eina_accessor_data_get(stuffs->aTexture, 2, (void **) &ti); | 661 | eina_accessor_data_get(stuffs->aTexture, 2, (void **) &ti); |
673 | mj = eo_add(EVAS_CANVAS3D_MATERIAL_CLASS, scene->evas, | 662 | mj = eo_add(EVAS_CANVAS3D_MATERIAL_CLASS, scene->evas, |
674 | evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, EINA_TRUE), | 663 | evas_canvas3d_material_enable_set(eoid, EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, EINA_TRUE), |
675 | evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, EINA_TRUE), | 664 | evas_canvas3d_material_enable_set(eoid, EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, EINA_TRUE), |
676 | evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, EINA_TRUE), | 665 | evas_canvas3d_material_enable_set(eoid, EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, EINA_TRUE), |
677 | evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_NORMAL, EINA_TRUE), | 666 | evas_canvas3d_material_enable_set(eoid, EVAS_CANVAS3D_MATERIAL_ATTRIB_NORMAL, EINA_TRUE), |
678 | 667 | evas_canvas3d_material_color_set(eoid, EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, 0.2, 0.2, 0.2, 1.0), | |
679 | evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, 0.2, 0.2, 0.2, 1.0), | 668 | evas_canvas3d_material_color_set(eoid, EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, 0.8, 0.8, 0.8, 1.0), |
680 | evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, 0.8, 0.8, 0.8, 1.0), | 669 | evas_canvas3d_material_color_set(eoid, EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, 1.0, 1.0, 1.0, 1.0), |
681 | evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, 1.0, 1.0, 1.0, 1.0), | 670 | evas_canvas3d_material_shininess_set(eoid, 100.0), |
682 | evas_canvas3d_material_shininess_set(100.0), | 671 | evas_canvas3d_material_texture_set(eoid, EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, t1), |
683 | 672 | evas_canvas3d_material_texture_set(eoid, EVAS_CANVAS3D_MATERIAL_ATTRIB_NORMAL, ti) | |
684 | evas_canvas3d_material_texture_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, t1), | ||
685 | evas_canvas3d_material_texture_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_NORMAL, ti) | ||
686 | ); | 673 | ); |
687 | eina_array_push(stuffs->materials, mj); | 674 | eina_array_push(stuffs->materials, mj); |
688 | } | 675 | } |
@@ -690,17 +677,16 @@ void stuffsSetup(ExtantzStuffs *stuffs, Scene_Data *scene, int fake) | |||
690 | { | 677 | { |
691 | eina_accessor_data_get(stuffs->aTexture, 0, (void **) &t); | 678 | eina_accessor_data_get(stuffs->aTexture, 0, (void **) &t); |
692 | mi = eo_add(EVAS_CANVAS3D_MATERIAL_CLASS, scene->evas, | 679 | mi = eo_add(EVAS_CANVAS3D_MATERIAL_CLASS, scene->evas, |
693 | evas_canvas3d_material_texture_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, t), | 680 | evas_canvas3d_material_texture_set(eoid, EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, t), |
694 | 681 | evas_canvas3d_material_enable_set(eoid, EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, EINA_TRUE), | |
695 | evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, EINA_TRUE), | 682 | evas_canvas3d_material_enable_set(eoid, EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, EINA_TRUE), |
696 | evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, EINA_TRUE), | 683 | evas_canvas3d_material_enable_set(eoid, EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, EINA_TRUE), |
697 | evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, EINA_TRUE), | 684 | evas_canvas3d_material_enable_set(eoid, EVAS_CANVAS3D_MATERIAL_ATTRIB_NORMAL, EINA_TRUE), // Not for sphere originally. |
698 | evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_NORMAL, EINA_TRUE), // Not for sphere originally. | 685 | |
699 | 686 | evas_canvas3d_material_color_set(eoid, EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, 0.01, 0.01, 0.01, 1.0), | |
700 | evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, 0.01, 0.01, 0.01, 1.0), | 687 | evas_canvas3d_material_color_set(eoid, EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, 1.0, 1.0, 1.0, 1.0), |
701 | evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, 1.0, 1.0, 1.0, 1.0), | 688 | evas_canvas3d_material_color_set(eoid, EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, 1.0, 1.0, 1.0, 1.0), |
702 | evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, 1.0, 1.0, 1.0, 1.0), | 689 | evas_canvas3d_material_shininess_set(eoid, 50.0) |
703 | evas_canvas3d_material_shininess_set(50.0) | ||
704 | ); | 690 | ); |
705 | eina_array_push(stuffs->materials, mi); | 691 | eina_array_push(stuffs->materials, mi); |
706 | } | 692 | } |
@@ -715,16 +701,16 @@ void stuffsSetup(ExtantzStuffs *stuffs, Scene_Data *scene, int fake) | |||
715 | 701 | ||
716 | #if 0 | 702 | #if 0 |
717 | Eo *cube = eo_add(EVAS_CANVAS3D_PRIMITIVE_CLASS, scene->evas); | 703 | Eo *cube = eo_add(EVAS_CANVAS3D_PRIMITIVE_CLASS, scene->evas); |
718 | eo_do(cube, evas_canvas3d_primitive_form_set(EVAS_CANVAS3D_MESH_PRIMITIVE_CUBE)); | 704 | evas_canvas3d_primitive_form_set(cube, EVAS_CANVAS3D_MESH_PRIMITIVE_CUBE); |
719 | me = eo_add(EVAS_CANVAS3D_MESH_CLASS, scene->evas, | 705 | me = eo_add(EVAS_CANVAS3D_MESH_CLASS, scene->evas, |
720 | evas_canvas3d_mesh_from_primitive_set(0, cube), | 706 | evas_canvas3d_mesh_from_primitive_set(eoid, 0, cube) |
721 | ); | 707 | ); |
722 | #else | 708 | #else |
723 | // More or less copied from EFL, so I can create my own primitives. | 709 | // More or less copied from EFL, so I can create my own primitives. |
724 | me = eo_add(EVAS_CANVAS3D_MESH_CLASS, scene->evas, | 710 | me = eo_add(EVAS_CANVAS3D_MESH_CLASS, scene->evas, |
725 | evas_canvas3d_mesh_frame_add(0), | 711 | evas_canvas3d_mesh_frame_add(eoid, 0), |
726 | evas_canvas3d_mesh_vertex_count_set(24), | 712 | evas_canvas3d_mesh_vertex_count_set(eoid, 24), |
727 | evas_canvas3d_mesh_index_data_set(EVAS_CANVAS3D_INDEX_FORMAT_UNSIGNED_SHORT, 36, &cube_indices[0]) | 713 | evas_canvas3d_mesh_index_data_set(eoid, EVAS_CANVAS3D_INDEX_FORMAT_UNSIGNED_SHORT, 36, &cube_indices[0]) |
728 | ); | 714 | ); |
729 | 715 | ||
730 | _set_vertex_data_from_array(me, 0, cube_vertices, EVAS_CANVAS3D_VERTEX_ATTRIB_POSITION, 0, 3, 15, 24); | 716 | _set_vertex_data_from_array(me, 0, cube_vertices, EVAS_CANVAS3D_VERTEX_ATTRIB_POSITION, 0, 3, 15, 24); |
@@ -735,13 +721,11 @@ void stuffsSetup(ExtantzStuffs *stuffs, Scene_Data *scene, int fake) | |||
735 | 721 | ||
736 | #endif | 722 | #endif |
737 | 723 | ||
738 | eo_do(me, | 724 | evas_canvas3d_mesh_vertex_assembly_set(me, EVAS_CANVAS3D_VERTEX_ASSEMBLY_TRIANGLES); |
739 | evas_canvas3d_mesh_vertex_assembly_set(EVAS_CANVAS3D_VERTEX_ASSEMBLY_TRIANGLES), | 725 | evas_canvas3d_mesh_shade_mode_set(me, EVAS_CANVAS3D_SHADE_MODE_NORMAL_MAP); |
740 | evas_canvas3d_mesh_shade_mode_set(EVAS_CANVAS3D_SHADE_MODE_NORMAL_MAP), | 726 | evas_canvas3d_mesh_frame_material_set(me, 0, mi); |
741 | evas_canvas3d_mesh_frame_material_set(0, mi), | 727 | evas_canvas3d_mesh_frame_add(me, 20); |
742 | evas_canvas3d_mesh_frame_add(20), | 728 | evas_canvas3d_mesh_frame_material_set(me, 20, mj); |
743 | evas_canvas3d_mesh_frame_material_set(20, mj) | ||
744 | ); | ||
745 | 729 | ||
746 | eina_array_push(stuffs->mesh, me); | 730 | eina_array_push(stuffs->mesh, me); |
747 | } | 731 | } |
@@ -752,13 +736,12 @@ void stuffsSetup(ExtantzStuffs *stuffs, Scene_Data *scene, int fake) | |||
752 | eina_accessor_data_get(stuffs->aMaterial, 0, (void **) &mi); | 736 | eina_accessor_data_get(stuffs->aMaterial, 0, (void **) &mi); |
753 | 737 | ||
754 | sphere = eo_add(EVAS_CANVAS3D_PRIMITIVE_CLASS, scene->evas); | 738 | sphere = eo_add(EVAS_CANVAS3D_PRIMITIVE_CLASS, scene->evas); |
755 | eo_do(sphere, evas_canvas3d_primitive_form_set(EVAS_CANVAS3D_MESH_PRIMITIVE_SPHERE)); | 739 | evas_canvas3d_primitive_form_set(sphere, EVAS_CANVAS3D_MESH_PRIMITIVE_SPHERE); |
756 | 740 | ||
757 | me = eo_add(EVAS_CANVAS3D_MESH_CLASS, scene->evas, | 741 | me = eo_add(EVAS_CANVAS3D_MESH_CLASS, scene->evas, |
758 | evas_canvas3d_mesh_from_primitive_set(0, sphere), | 742 | evas_canvas3d_mesh_from_primitive_set(eoid, 0, sphere), |
759 | evas_canvas3d_mesh_frame_material_set(0, mi), | 743 | evas_canvas3d_mesh_frame_material_set(eoid, 0, mi), |
760 | 744 | evas_canvas3d_mesh_shade_mode_set(eoid, EVAS_CANVAS3D_SHADE_MODE_DIFFUSE) | |
761 | evas_canvas3d_mesh_shade_mode_set(EVAS_CANVAS3D_SHADE_MODE_DIFFUSE) | ||
762 | ); | 745 | ); |
763 | eina_array_push(stuffs->mesh, me); | 746 | eina_array_push(stuffs->mesh, me); |
764 | } | 747 | } |
@@ -770,15 +753,14 @@ void stuffsSetup(ExtantzStuffs *stuffs, Scene_Data *scene, int fake) | |||
770 | 753 | ||
771 | // Attempt to create a heightfield. | 754 | // Attempt to create a heightfield. |
772 | terrain = eo_add(EVAS_CANVAS3D_PRIMITIVE_CLASS, scene->evas); | 755 | terrain = eo_add(EVAS_CANVAS3D_PRIMITIVE_CLASS, scene->evas); |
773 | eo_do(terrain, evas_canvas3d_primitive_form_set(EVAS_CANVAS3D_MESH_PRIMITIVE_SURFACE), | 756 | evas_canvas3d_primitive_form_set(terrain, EVAS_CANVAS3D_MESH_PRIMITIVE_SURFACE); |
774 | evas_canvas3d_primitive_precision_set(256), | 757 | evas_canvas3d_primitive_precision_set(terrain, 256); |
775 | evas_canvas3d_primitive_tex_scale_set(1.0, 1.0), | 758 | evas_canvas3d_primitive_tex_scale_set(terrain, 1.0, 1.0); |
776 | evas_canvas3d_primitive_surface_set(_SL_RAW_terrain) | 759 | evas_canvas3d_primitive_surface_set(terrain, _SL_RAW_terrain); |
777 | ); | ||
778 | me = eo_add(EVAS_CANVAS3D_MESH_CLASS, scene->evas, | 760 | me = eo_add(EVAS_CANVAS3D_MESH_CLASS, scene->evas, |
779 | evas_canvas3d_mesh_from_primitive_set(0, terrain), | 761 | evas_canvas3d_mesh_from_primitive_set(eoid, 0, terrain), |
780 | evas_canvas3d_mesh_frame_material_set(0, mi), | 762 | evas_canvas3d_mesh_frame_material_set(eoid, 0, mi), |
781 | evas_canvas3d_mesh_shade_mode_set(EVAS_CANVAS3D_SHADE_MODE_DIFFUSE) | 763 | evas_canvas3d_mesh_shade_mode_set(eoid, EVAS_CANVAS3D_SHADE_MODE_DIFFUSE) |
782 | ); | 764 | ); |
783 | eina_array_push(stuffs->mesh, me); | 765 | eina_array_push(stuffs->mesh, me); |
784 | } | 766 | } |
@@ -787,23 +769,24 @@ void stuffsSetup(ExtantzStuffs *stuffs, Scene_Data *scene, int fake) | |||
787 | eina_accessor_data_get(stuffs->aMaterial, 0, (void **) &mi); | 769 | eina_accessor_data_get(stuffs->aMaterial, 0, (void **) &mi); |
788 | snprintf(buf, sizeof(buf), "%s/%s", prefix_data_get(), stuffs->stuffs.details.mesh->fileName); | 770 | snprintf(buf, sizeof(buf), "%s/%s", prefix_data_get(), stuffs->stuffs.details.mesh->fileName); |
789 | me = eo_add(EVAS_CANVAS3D_MESH_CLASS, scene->evas, | 771 | me = eo_add(EVAS_CANVAS3D_MESH_CLASS, scene->evas, |
790 | efl_file_set(buf, NULL), | 772 | efl_file_set(eoid, buf, NULL), |
791 | evas_canvas3d_mesh_frame_material_set(0, mi), | 773 | evas_canvas3d_mesh_frame_material_set(eoid, 0, mi), |
792 | evas_canvas3d_mesh_shade_mode_set(EVAS_CANVAS3D_SHADE_MODE_PHONG) | 774 | evas_canvas3d_mesh_shade_mode_set(eoid, EVAS_CANVAS3D_SHADE_MODE_PHONG) |
793 | ); | 775 | ); |
794 | eina_array_push(stuffs->mesh, me); | 776 | eina_array_push(stuffs->mesh, me); |
795 | } | 777 | } |
796 | 778 | ||
797 | eina_accessor_data_get(stuffs->aMesh, 0, (void **) &me); | 779 | eina_accessor_data_get(stuffs->aMesh, 0, (void **) &me); |
798 | stuffs->mesh_node = eo_add(EVAS_CANVAS3D_NODE_CLASS, scene->evas, evas_canvas3d_node_constructor(EVAS_CANVAS3D_NODE_TYPE_MESH), | 780 | stuffs->mesh_node = eo_add(EVAS_CANVAS3D_NODE_CLASS, scene->evas, |
799 | eo_key_data_set("Name", stuffs->stuffs.name), | 781 | evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_MESH), |
800 | evas_canvas3d_node_position_set(stuffs->stuffs.details.mesh->pos.x, stuffs->stuffs.details.mesh->pos.y, stuffs->stuffs.details.mesh->pos.z), | 782 | eo_key_data_set(eoid, "Name", stuffs->stuffs.name), |
801 | evas_canvas3d_node_orientation_set(stuffs->stuffs.details.mesh->rot.x, stuffs->stuffs.details.mesh->rot.y, stuffs->stuffs.details.mesh->rot.z, stuffs->stuffs.details.mesh->rot.w), | 783 | evas_canvas3d_node_position_set(eoid, stuffs->stuffs.details.mesh->pos.x, stuffs->stuffs.details.mesh->pos.y, stuffs->stuffs.details.mesh->pos.z), |
802 | evas_canvas3d_node_scale_set(stuffs->stuffs.details.mesh->size.x, stuffs->stuffs.details.mesh->size.y, stuffs->stuffs.details.mesh->size.z), | 784 | evas_canvas3d_node_orientation_set(eoid, stuffs->stuffs.details.mesh->rot.x, stuffs->stuffs.details.mesh->rot.y, stuffs->stuffs.details.mesh->rot.z, stuffs->stuffs.details.mesh->rot.w), |
803 | evas_canvas3d_node_mesh_add(me) | 785 | evas_canvas3d_node_scale_set(eoid, stuffs->stuffs.details.mesh->size.x, stuffs->stuffs.details.mesh->size.y, stuffs->stuffs.details.mesh->size.z), |
804 | ); | 786 | evas_canvas3d_node_mesh_add(eoid, me) |
787 | ); | ||
805 | 788 | ||
806 | eo_do(scene->root_node, evas_canvas3d_node_member_add(stuffs->mesh_node)); | 789 | evas_canvas3d_node_member_add(scene->root_node, stuffs->mesh_node); |
807 | eina_clist_add_head(&(scene->stuffs), &(stuffs->node)); | 790 | eina_clist_add_head(&(scene->stuffs), &(stuffs->node)); |
808 | 791 | ||
809 | if (1 == fake) | 792 | if (1 == fake) |
diff --git a/src/extantz/woMan.c b/src/extantz/woMan.c index 7ff1c28..a7bb4de 100644 --- a/src/extantz/woMan.c +++ b/src/extantz/woMan.c | |||
@@ -257,11 +257,11 @@ winFang *woMan_add(globals *ourGlobals) | |||
257 | elm_box_pack_end(me->box, nf); | 257 | elm_box_pack_end(me->box, nf); |
258 | 258 | ||
259 | bt = eo_add(ELM_BUTTON_CLASS, me->win, | 259 | bt = eo_add(ELM_BUTTON_CLASS, me->win, |
260 | // evas_obj_text_set("Login"), | 260 | // evas_obj_text_set(eoid, "Login"), |
261 | evas_obj_size_hint_align_set(EVAS_HINT_FILL, EVAS_HINT_FILL), | 261 | evas_obj_size_hint_align_set(eoid, EVAS_HINT_FILL, EVAS_HINT_FILL), |
262 | evas_obj_size_hint_weight_set(EVAS_HINT_EXPAND, 0.0), | 262 | evas_obj_size_hint_weight_set(eoid, EVAS_HINT_EXPAND, 0.0), |
263 | efl_gfx_visible_set(EINA_TRUE) | 263 | efl_gfx_visible_set(eoid, EINA_TRUE) |
264 | ); | 264 | ); |
265 | elm_object_text_set(bt, "Login"); // No eo interface for this that I can find. | 265 | elm_object_text_set(bt, "Login"); // No eo interface for this that I can find. |
266 | // evas_object_smart_callback_add(bt, "clicked", NULL, NULL); | 266 | // evas_object_smart_callback_add(bt, "clicked", NULL, NULL); |
267 | elm_box_pack_end(me->box, bt); | 267 | elm_box_pack_end(me->box, bt); |