summaryrefslogtreecommitdiff
path: root/src/lib/evas/canvas/evas_canvas3d_light.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/evas/canvas/evas_canvas3d_light.c')
-rw-r--r--src/lib/evas/canvas/evas_canvas3d_light.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/src/lib/evas/canvas/evas_canvas3d_light.c b/src/lib/evas/canvas/evas_canvas3d_light.c
index 2d7facd..11e9c81 100644
--- a/src/lib/evas/canvas/evas_canvas3d_light.c
+++ b/src/lib/evas/canvas/evas_canvas3d_light.c
@@ -8,7 +8,7 @@ _light_node_change_notify(const Eina_Hash *hash EINA_UNUSED, const void *key,
8 void *data EINA_UNUSED, void *fdata) 8 void *data EINA_UNUSED, void *fdata)
9{ 9{
10 Evas_Canvas3D_Node *n = *(Evas_Canvas3D_Node **)key; 10 Evas_Canvas3D_Node *n = *(Evas_Canvas3D_Node **)key;
11 eo_do(n, evas_canvas3d_object_change(EVAS_CANVAS3D_STATE_NODE_LIGHT, (Evas_Canvas3D_Object *)fdata)); 11 evas_canvas3d_object_change(n, EVAS_CANVAS3D_STATE_NODE_LIGHT, (Evas_Canvas3D_Object *)fdata);
12 return EINA_TRUE; 12 return EINA_TRUE;
13} 13}
14 14
@@ -79,8 +79,8 @@ evas_canvas3d_light_add(Evas *e)
79EOLIAN static Eo * 79EOLIAN static Eo *
80_evas_canvas3d_light_eo_base_constructor(Eo *obj, Evas_Canvas3D_Light_Data *pd) 80_evas_canvas3d_light_eo_base_constructor(Eo *obj, Evas_Canvas3D_Light_Data *pd)
81{ 81{
82 obj = eo_do_super_ret(obj, MY_CLASS, obj, eo_constructor()); 82 obj = eo_constructor(eo_super(obj, MY_CLASS));
83 eo_do(obj, evas_canvas3d_object_type_set(EVAS_CANVAS3D_OBJECT_TYPE_LIGHT)); 83 evas_canvas3d_object_type_set(obj, EVAS_CANVAS3D_OBJECT_TYPE_LIGHT);
84 evas_color_set(&pd->ambient, 0.0, 0.0, 0.0, 1.0); 84 evas_color_set(&pd->ambient, 0.0, 0.0, 0.0, 1.0);
85 evas_color_set(&pd->diffuse, 1.0, 1.0, 1.0, 1.0); 85 evas_color_set(&pd->diffuse, 1.0, 1.0, 1.0, 1.0);
86 evas_color_set(&pd->specular, 1.0, 1.0, 1.0, 1.0); 86 evas_color_set(&pd->specular, 1.0, 1.0, 1.0, 1.0);
@@ -115,7 +115,7 @@ _evas_canvas3d_light_eo_base_destructor(Eo *obj, Evas_Canvas3D_Light_Data *pd)
115 eina_hash_free(pd->nodes); 115 eina_hash_free(pd->nodes);
116 } 116 }
117 117
118 eo_do_super(obj, MY_CLASS, eo_destructor()); 118 eo_destructor(eo_super(obj, MY_CLASS));
119} 119}
120 120
121 121
@@ -125,7 +125,7 @@ _evas_canvas3d_light_directional_set(Eo *obj, Evas_Canvas3D_Light_Data *pd, Eina
125 if (pd->directional != directional) 125 if (pd->directional != directional)
126 { 126 {
127 pd->directional = directional; 127 pd->directional = directional;
128 eo_do(obj, evas_canvas3d_object_change(EVAS_CANVAS3D_STATE_ANY, NULL)); 128 evas_canvas3d_object_change(obj, EVAS_CANVAS3D_STATE_ANY, NULL);
129 } 129 }
130} 130}
131 131
@@ -143,7 +143,7 @@ _evas_canvas3d_light_ambient_set(Eo *obj, Evas_Canvas3D_Light_Data *pd, Evas_Rea
143 pd->ambient.b = b; 143 pd->ambient.b = b;
144 pd->ambient.a = a; 144 pd->ambient.a = a;
145 145
146 eo_do(obj, evas_canvas3d_object_change(EVAS_CANVAS3D_STATE_LIGHT_AMBIENT, NULL)); 146 evas_canvas3d_object_change(obj, EVAS_CANVAS3D_STATE_LIGHT_AMBIENT, NULL);
147} 147}
148 148
149EOLIAN static void 149EOLIAN static void
@@ -163,7 +163,7 @@ _evas_canvas3d_light_diffuse_set(Eo *obj, Evas_Canvas3D_Light_Data *pd, Evas_Rea
163 pd->diffuse.b = b; 163 pd->diffuse.b = b;
164 pd->diffuse.a = a; 164 pd->diffuse.a = a;
165 165
166 eo_do(obj, evas_canvas3d_object_change(EVAS_CANVAS3D_STATE_LIGHT_DIFFUSE, NULL)); 166 evas_canvas3d_object_change(obj, EVAS_CANVAS3D_STATE_LIGHT_DIFFUSE, NULL);
167} 167}
168 168
169EOLIAN static void 169EOLIAN static void
@@ -183,7 +183,7 @@ _evas_canvas3d_light_specular_set(Eo *obj, Evas_Canvas3D_Light_Data *pd, Evas_Re
183 pd->specular.b = b; 183 pd->specular.b = b;
184 pd->specular.a = a; 184 pd->specular.a = a;
185 185
186 eo_do(obj, evas_canvas3d_object_change(EVAS_CANVAS3D_STATE_LIGHT_SPECULAR, NULL)); 186 evas_canvas3d_object_change(obj, EVAS_CANVAS3D_STATE_LIGHT_SPECULAR, NULL);
187} 187}
188 188
189EOLIAN static void 189EOLIAN static void
@@ -199,7 +199,7 @@ EOLIAN static void
199_evas_canvas3d_light_spot_exponent_set(Eo *obj, Evas_Canvas3D_Light_Data *pd, Evas_Real exponent) 199_evas_canvas3d_light_spot_exponent_set(Eo *obj, Evas_Canvas3D_Light_Data *pd, Evas_Real exponent)
200{ 200{
201 pd->spot_exp = exponent; 201 pd->spot_exp = exponent;
202 eo_do(obj, evas_canvas3d_object_change(EVAS_CANVAS3D_STATE_LIGHT_SPOT_EXP, NULL)); 202 evas_canvas3d_object_change(obj, EVAS_CANVAS3D_STATE_LIGHT_SPOT_EXP, NULL);
203} 203}
204 204
205EOLIAN static Evas_Real 205EOLIAN static Evas_Real
@@ -213,7 +213,7 @@ _evas_canvas3d_light_spot_cutoff_set(Eo *obj, Evas_Canvas3D_Light_Data *pd, Evas
213{ 213{
214 pd->spot_cutoff = cutoff; 214 pd->spot_cutoff = cutoff;
215 pd->spot_cutoff_cos = cos(cutoff * M_PI / 180.0); 215 pd->spot_cutoff_cos = cos(cutoff * M_PI / 180.0);
216 eo_do(obj, evas_canvas3d_object_change(EVAS_CANVAS3D_STATE_LIGHT_SPOT_CUTOFF, NULL)); 216 evas_canvas3d_object_change(obj, EVAS_CANVAS3D_STATE_LIGHT_SPOT_CUTOFF, NULL);
217} 217}
218 218
219EOLIAN static Evas_Real 219EOLIAN static Evas_Real
@@ -228,7 +228,7 @@ _evas_canvas3d_light_attenuation_set(Eo *obj, Evas_Canvas3D_Light_Data *pd, Evas
228 pd->atten_const = constant; 228 pd->atten_const = constant;
229 pd->atten_linear = linear; 229 pd->atten_linear = linear;
230 pd->atten_quad = quadratic; 230 pd->atten_quad = quadratic;
231 eo_do(obj, evas_canvas3d_object_change(EVAS_CANVAS3D_STATE_LIGHT_ATTENUATION, NULL)); 231 evas_canvas3d_object_change(obj, EVAS_CANVAS3D_STATE_LIGHT_ATTENUATION, NULL);
232} 232}
233 233
234EOLIAN static void 234EOLIAN static void
@@ -245,7 +245,7 @@ _evas_canvas3d_light_attenuation_enable_set(Eo *obj, Evas_Canvas3D_Light_Data *p
245 if (pd->enable_attenuation != enable) 245 if (pd->enable_attenuation != enable)
246 { 246 {
247 pd->enable_attenuation = enable; 247 pd->enable_attenuation = enable;
248 eo_do(obj, evas_canvas3d_object_change(EVAS_CANVAS3D_STATE_LIGHT_ATTENUATION, NULL)); 248 evas_canvas3d_object_change(obj, EVAS_CANVAS3D_STATE_LIGHT_ATTENUATION, NULL);
249 } 249 }
250} 250}
251 251
@@ -260,7 +260,7 @@ _evas_canvas3d_light_projection_matrix_set(Eo *obj, Evas_Canvas3D_Light_Data *pd
260 const Evas_Real *matrix) 260 const Evas_Real *matrix)
261{ 261{
262 eina_matrix4_array_set(&pd->projection, matrix); 262 eina_matrix4_array_set(&pd->projection, matrix);
263 eo_do(obj, evas_canvas3d_object_change(EVAS_CANVAS3D_STATE_LIGHT_PROJECTION, NULL)); 263 evas_canvas3d_object_change(obj, EVAS_CANVAS3D_STATE_LIGHT_PROJECTION, NULL);
264} 264}
265 265
266EOLIAN static void 266EOLIAN static void
@@ -283,7 +283,7 @@ _evas_canvas3d_light_projection_perspective_set(Eo *obj, Evas_Canvas3D_Light_Dat
283 xmax = ymax * aspect; 283 xmax = ymax * aspect;
284 284
285 evas_mat4_frustum_set(&pd->projection, -xmax, xmax, -ymax, ymax, dnear, dfar); 285 evas_mat4_frustum_set(&pd->projection, -xmax, xmax, -ymax, ymax, dnear, dfar);
286 eo_do(obj, evas_canvas3d_object_change(EVAS_CANVAS3D_STATE_LIGHT_PROJECTION, NULL)); 286 evas_canvas3d_object_change(obj, EVAS_CANVAS3D_STATE_LIGHT_PROJECTION, NULL);
287} 287}
288 288
289EOLIAN static void 289EOLIAN static void
@@ -293,7 +293,7 @@ _evas_canvas3d_light_projection_frustum_set(Eo *obj, Evas_Canvas3D_Light_Data *p
293 Evas_Real dnear, Evas_Real dfar) 293 Evas_Real dnear, Evas_Real dfar)
294{ 294{
295 evas_mat4_frustum_set(&pd->projection, left, right, bottom, top, dnear, dfar); 295 evas_mat4_frustum_set(&pd->projection, left, right, bottom, top, dnear, dfar);
296 eo_do(obj, evas_canvas3d_object_change(EVAS_CANVAS3D_STATE_LIGHT_PROJECTION, NULL)); 296 evas_canvas3d_object_change(obj, EVAS_CANVAS3D_STATE_LIGHT_PROJECTION, NULL);
297} 297}
298 298
299EOLIAN static void 299EOLIAN static void
@@ -303,7 +303,7 @@ _evas_canvas3d_light_projection_ortho_set(Eo *obj, Evas_Canvas3D_Light_Data *pd,
303 Evas_Real dnear, Evas_Real dfar) 303 Evas_Real dnear, Evas_Real dfar)
304{ 304{
305 eina_matrix4_ortho_set(&pd->projection, left, right, bottom, top, dnear, dfar); 305 eina_matrix4_ortho_set(&pd->projection, left, right, bottom, top, dnear, dfar);
306 eo_do(obj, evas_canvas3d_object_change(EVAS_CANVAS3D_STATE_LIGHT_PROJECTION, NULL)); 306 evas_canvas3d_object_change(obj, EVAS_CANVAS3D_STATE_LIGHT_PROJECTION, NULL);
307} 307}
308 308
309 309