Fixed some casts.

This commit is contained in:
Savio Sena 2014-09-24 04:13:41 -03:00
parent a67e3ea4b9
commit d810de418e
19 changed files with 98 additions and 116 deletions

View File

@ -61,7 +61,7 @@ static void _loop(double t, int f)
(*itr).position_set(x, y);
(*itr).evas::object::size_set(w, h);
(*itr).fill_set(0, 0, w, h);
data = (*itr).data_get(1);
data = static_cast<unsigned int*>((*itr).data_get(1));
st = (*itr).stride_get(); // XXX
st = st >> 2;
p = data;

View File

@ -49,11 +49,9 @@ static void _cleanup(void)
/* loop - do things */
static void _loop(double t, int f)
{
int st;
auto itr = images.begin();
for (i = 0; i < 1; i++, ++itr)
for (int i = 0; i < 1; i++, ++itr)
{
unsigned int *data, *p;
int a, r, g, b;
Evas_Coord w = 640;
Evas_Coord h = 480;
@ -62,10 +60,10 @@ static void _loop(double t, int f)
(*itr).evas::object::position_set(x, y);
(*itr).evas::object::size_set(w, h);
(*itr).fill_set(0, 0, w, h);
data = (*itr).data_get(1);
st = evas_obj_image_stride_get();
unsigned int *data = static_cast<unsigned int*>((*itr).data_get(1));
int st = evas_obj_image_stride_get();
st = st >> 2;
p = data;
unsigned int *p = data;
for (y = 0; y < h; y++)
{
for (x = 0; x < w; x++)

View File

@ -37,9 +37,9 @@ static void _setup(void)
o.fill_set(0, 0, 640, 480);
o.evas::object::size_set(640, 480);
o.visibility_set(true);
yp = malloc(640 * 480);
up = malloc(320 * 240);
vp = malloc(320 * 240);
yp = static_cast<unsigned char*>(malloc(640 * 480));
up = static_cast<unsigned char*>(malloc(320 * 240));
vp = static_cast<unsigned char*>(malloc(320 * 240));
FILE *f = fopen(build_path("tp.yuv"), "rb");
if (f)
{
@ -48,7 +48,7 @@ static void _setup(void)
fread(vp, 320 * 240, 1, f);
fclose(f);
}
unsigned char **data = evas_object_image_data_get(images[i], 1);
unsigned char **data = static_cast<unsigned char**>(o.data_get(1));
unsigned char **lp = data;
for (int y = 0; y < 480; y++)
{

View File

@ -38,9 +38,9 @@ static void _setup(void)
o.evas::object::size_set(640, 480);
o.smooth_scale_set(0);
o.visibility_set(true);
yp = malloc(640 * 480);
up = malloc(320 * 240);
vp = malloc(320 * 240);
yp = static_cast<unsigned char*>(malloc(640 * 480));
up = static_cast<unsigned char*>(malloc(320 * 240));
vp = static_cast<unsigned char*>(malloc(320 * 240));
FILE *f = fopen(build_path("tp.yuv"), "rb");
if (f)
{
@ -49,7 +49,7 @@ static void _setup(void)
fread(vp, 320 * 240, 1, f);
fclose(f);
}
unsigned char **data = o.data_get(1); // XXX
unsigned char **data = static_cast<unsigned char**>(o.data_get(1)); // XXX
unsigned char **lp = data;
for (int y = 0; y < 480; y++)
{

View File

@ -25,26 +25,22 @@ static unsigned char *yp = NULL, *up = NULL, *vp = NULL;
/* setup */
static void _setup(void)
{
int i, y;
FILE *f;
unsigned char **data, **lp;
evas::canvas canvas(::eo_ref(G_evas));
for (i = 0; i < 1; i++)
for (int i = 0; i < 1; i++)
{
evas::image o(efl::eo::parent = canvas);
images.push_back(o);
eo_do(o,
evas_obj_image_content_hint_set(EVAS_IMAGE_CONTENT_HINT_DYNAMIC),
evas_obj_image_colorspace_set(EVAS_COLORSPACE_YCBCR422P601_PL),
evas_obj_image_size_set(640, 480),
evas_obj_image_alpha_set(0),
evas_obj_image_fill_set(0, 0, 640, 480),
evas_obj_size_set(640, 480),
evas_obj_visibility_set(EINA_TRUE));
yp = malloc(640 * 480);
up = malloc(320 * 240);
vp = malloc(320 * 240);
f = fopen(build_path("tp.yuv"), "rb");
o.content_hint_set(EVAS_IMAGE_CONTENT_HINT_DYNAMIC);
o.colorspace_set(EVAS_COLORSPACE_YCBCR422P601_PL);
o.size_set(640, 480);
o.alpha_set(0);
o.fill_set(0, 0, 640, 480);
o.evas::object::size_set(640, 480);
o.evas::object::visibility_set(true);
yp = static_cast<unsigned char*>(malloc(640 * 480));
up = static_cast<unsigned char*>(malloc(320 * 240));
vp = static_cast<unsigned char*>(malloc(320 * 240));
FILE *f = fopen(build_path("tp.yuv"), "rb");
if (f)
{
fread(yp, 640 * 480, 1, f);
@ -52,24 +48,24 @@ static void _setup(void)
fread(vp, 320 * 240, 1, f);
fclose(f);
}
data = evas_object_image_data_get(images[i], 1);
lp = data;
for (y = 0; y < 480; y++)
unsigned char **data = static_cast<unsigned char**>(o.data_get(1));
unsigned char **lp = data;
for (int y = 0; y < 480; y++)
{
*lp = yp + (y * 640);
lp++;
}
for (y = 0; y < 240; y++)
for (int y = 0; y < 240; y++)
{
*lp = up + (y * 320);
lp++;
}
for (y = 0; y < 240; y++)
for (int y = 0; y < 240; y++)
{
*lp = vp + (y * 320);
lp++;
}
eo_do(images[i], evas_obj_image_data_set(data));
o.data_set(data);
}
done = 0;
}
@ -77,7 +73,7 @@ static void _setup(void)
/* cleanup */
static void _cleanup(void)
{
for (int i = 0; i < 1; i++) eo_del(images[i]);
images.clear();
free(yp);
free(up);
free(vp);

View File

@ -25,7 +25,6 @@ static unsigned char *yp = NULL, *up = NULL, *vp = NULL;
/* setup */
static void _setup(void)
{
unsigned char **data, **lp;
evas::canvas canvas(::eo_ref(G_evas));
for (int i = 0; i < 1; i++)
{
@ -38,9 +37,9 @@ static void _setup(void)
o.fill_set(0, 0, 640, 480);
o.evas::object::size_set(640, 480);
o.evas::object::visibility_set(true);
yp = malloc(640 * 480);
up = malloc(320 * 240);
vp = malloc(320 * 240);
yp = static_cast<unsigned char*>(malloc(640 * 480));
up = static_cast<unsigned char*>(malloc(320 * 240));
vp = static_cast<unsigned char*>(malloc(320 * 240));
FILE *f = fopen(build_path("tp.yuv"), "rb");
if (f)
{
@ -49,10 +48,10 @@ static void _setup(void)
fread(vp, 320 * 240, 1, f);
fclose(f);
}
data = o.data_get(1);
unsigned char **data = static_cast<unsigned char**>(o.data_get(1));
if (data)
{
lp = data;
unsigned char **lp = data;
for (int y = 0; y < 480; y++)
{
*lp = yp + (y * 640);
@ -105,7 +104,7 @@ static void _loop(double t, int f)
w &= ~0x1;
(*itr).size_set(w, 480);
unsigned char **data = (*itr).data_get(1);
unsigned char **data = static_cast<unsigned char*>((*itr).data_get(1));
if (data)
{
unsigned char **lp = data;

View File

@ -52,7 +52,7 @@ _cube_new(Evas_Coord w, Evas_Coord h, Evas_Coord d)
w -= (w / 2);
h -= (h / 2);
d -= (d / 2);
c = calloc(1, sizeof(Cube));
c = static_cast<Cube*>(calloc(1, sizeof(Cube)));
for (int i = 0; i < 6; i++)
{
Evas_Object *o;

View File

@ -52,7 +52,7 @@ _cube_new(Evas_Coord w, Evas_Coord h, Evas_Coord d)
w -= (w / 2);
h -= (h / 2);
d -= (d / 2);
c = calloc(1, sizeof(Cube));
c = static_cast<Cube*>(calloc(1, sizeof(Cube)));
for (int i = 0; i < 6; i++)
{
Evas_Object *o;

View File

@ -52,7 +52,7 @@ _cube_new(Evas_Coord w, Evas_Coord h, Evas_Coord d)
w -= (w / 2);
h -= (h / 2);
d -= (d / 2);
c = calloc(1, sizeof(Cube));
c = static_cast<Cube*>(calloc(1, sizeof(Cube)));
for (int i = 0; i < 6; i++)
{
Evas_Object *o;

View File

@ -52,10 +52,10 @@ _cube_new(Evas_Coord w, Evas_Coord h, Evas_Coord d)
w -= (w / 2);
h -= (h / 2);
d -= (d / 2);
c = calloc(1, sizeof(Cube));
c = static_cast<Cube*>(calloc(1, sizeof(Cube)));
for (int i = 0; i < 6; i++)
{
Evas_Object *o;
Evas_Object *o; // XXX
char buf[256];
o = eo_add(EVAS_IMAGE_CLASS, G_evas);
c->side[i].o = o;

View File

@ -29,12 +29,11 @@ static void _setup(void)
{
evas::image o(efl::eo::parent = canvas);
images.push_back(o);
eo_do(o,
efl_file_set(build_path("logo.png"), NULL),
evas_obj_image_fill_set(0, 0, 120, 160),
evas_obj_size_set(120, 160),
efl_image_smooth_scale_set(0),
evas_obj_visibility_set(EINA_TRUE));
o.file_set(build_path("logo.png"), "");
o.fill_set(0, 0, 120, 160);
o.evas::object::size_set(120, 160);
o.smooth_scale_set(0);
o.visibility_set(true);
}
done = 0;
}
@ -42,7 +41,7 @@ static void _setup(void)
/* cleanup */
static void _cleanup(void)
{
for (int i = 0; i < (OBNUM / 2); i++) eo_del(images[i]);
images.clear();
}
/* loop - do things */

View File

@ -42,7 +42,7 @@ static void _setup(void)
/* cleanup */
static void _cleanup(void)
{
for (int i = 0; i < (OBNUM / 2); i++) eo_del(images[i]);
images.clear();
}
/* loop - do things */

View File

@ -41,7 +41,7 @@ static void _setup(void)
/* cleanup */
static void _cleanup(void)
{
for (int i = 0; i < (OBNUM / 2); i++) eo_del(images[i]);
images.clear();
}
/* loop - do things */

View File

@ -42,7 +42,7 @@ static void _setup(void)
/* cleanup */
static void _cleanup(void)
{
for (int i = 0; i < (OBNUM / 2); i++) eo_del(images[i]);
images.clear();
}
/* loop - do things */

View File

@ -41,7 +41,7 @@ static void _setup(void)
/* cleanup */
static void _cleanup(void)
{
for (int i = 0; i < (OBNUM / 2); i++) eo_del(images[i]);
images.clear();
}
/* loop - do things */

View File

@ -29,12 +29,11 @@ static void _setup(void)
{
evas::image o(efl::eo::parent = canvas);
images.push_back(o);
eo_do(o,
efl_file_set(build_path("image.png"), NULL),
evas_obj_image_fill_set(0, 0, 120, 160),
evas_obj_size_set(120, 160),
efl_image_smooth_scale_set(0),
evas_obj_visibility_set(EINA_TRUE));
o.file_set(build_path("image.png"), "");
o.fill_set(0, 0, 120, 160);
o.evas::object::size_set(120, 160);
o.smooth_scale_set(0);
o.visibility_set(true);
}
done = 0;
}
@ -42,32 +41,30 @@ static void _setup(void)
/* cleanup */
static void _cleanup(void)
{
for (int i = 0; i < (OBNUM / 2); i++) eo_del(images[i]);
images.clear();
}
/* loop - do things */
static void _loop(double t, int f)
{
static Evas_Map *m = NULL;
Evas_Coord x, y, w, h;
if (!m) m = evas_map_new(4);
evas_map_smooth_set(m, 0);
for (int i = 0; i < (OBNUM / 2); i++)
auto itr = images.begin();
for (int i = 0; i < (OBNUM / 2); i++, ++itr)
{
w = 120;
h = 160;
x = (win_w / 2) - (w / 2);
Evas_Coord w = 120;
Evas_Coord h = 160;
Evas_Coord x = (win_w / 2) - (w / 2);
x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w / 2);
y = (win_h / 2) - (h / 2);
Evas_Coord y = (win_h / 2) - (h / 2);
y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (h / 2);
evas_map_util_points_populate_from_geometry(m, x, y, w, h, 0);
evas_map_util_rotate(m, f, x + (w / 2), y + (h / 2));
eo_do(images[i],
evas_obj_map_enable_set(1),
evas_obj_map_set(m));
(*itr).map_enable_set(1);
(*itr).map_set(m));
}
FPS_STD(NAME);
}

View File

@ -29,11 +29,10 @@ static void _setup(void)
{
evas::image o(efl::eo::parent = canvas);
images.push_back(o);
eo_do(o,
efl_file_set(build_path("image.png"), NULL),
evas_obj_image_fill_set(0, 0, 120, 160),
evas_obj_size_set(120, 160),
evas_obj_visibility_set(EINA_TRUE));
o.file_set(build_path("image.png"), "");
o.fill_set(0, 0, 120, 160);
o.evas::object::size_set(120, 160);
o.evas::object::visibility_set(EINA_TRUE);
}
done = 0;
}
@ -41,31 +40,29 @@ static void _setup(void)
/* cleanup */
static void _cleanup(void)
{
for (int i = 0; i < (OBNUM / 2); i++) eo_del(images[i]);
images.clear();
}
/* loop - do things */
static void _loop(double t, int f)
{
static Evas_Map *m = NULL;
Evas_Coord x, y, w, h;
if (!m) m = evas_map_new(4);
for (int i = 0; i < (OBNUM / 2); i++)
auto itr = images.begin();
for (int i = 0; i < (OBNUM / 2); i++, ++itr)
{
w = 120;
h = 160;
x = (win_w / 2) - (w / 2);
Evas_Coord w = 120;
Evas_Coord h = 160;
Evas_Coord x = (win_w / 2) - (w / 2);
x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w / 2);
y = (win_h / 2) - (h / 2);
Evas_Coord y = (win_h / 2) - (h / 2);
y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (h / 2);
evas_map_util_points_populate_from_geometry(m, x, y, w, h, 0);
evas_map_util_rotate(m, f, x + (w / 2), y + (h / 2));
eo_do(images[i],
evas_obj_map_enable_set(1),
evas_obj_map_set(m));
(*itr).map_enable_set(1);
(*itr).map_set(m);
}
FPS_STD(NAME);
}

View File

@ -29,10 +29,10 @@ static void _setup(void)
{
evas::image o(efl::eo::parent = canvas);
images.push_back(o);
eo_do(o, efl_file_set(build_path("tp.png"), NULL),
evas_obj_image_fill_set(0, 0, 640, 480),
evas_obj_size_set(640, 480),
evas_obj_visibility_set(EINA_TRUE));
o.file_set(build_path("tp.png"), "");
o.fill_set(0, 0, 640, 480);
o.evas::object::size_set(640, 480);
o.visibility_set(true);
}
done = 0;
}
@ -40,24 +40,24 @@ static void _setup(void)
/* cleanup */
static void _cleanup(void)
{
for (int i = 0; i < 1; i++) eo_del(images[i]);
images.clear();
}
/* loop - do things */
static void _loop(double t, int f)
{
Evas_Coord x, y, w, h;
for (int i = 0; i < 1; i++)
auto itr = images.begin();
for (int i = 0; i < 1; i++, ++itr)
{
w = 640;
h = 480;
w *= (f / 100.0) * 4.0;
h *= (f / 100.0) * 4.0;
x = (win_w / 2) - (w / 2);
y = (win_h / 2) - (h / 2);
eo_do(images[i], evas_obj_position_set(x, y),
evas_obj_size_set(w, h),
evas_obj_image_fill_set(0, 0, w, h));
Evas_Coord w = 640;
Evas_Coord h = 480;
Evas_Coord w *= (f / 100.0) * 4.0;
Evas_Coord h *= (f / 100.0) * 4.0;
Evas_Coord x = (win_w / 2) - (w / 2);
Evas_Coord y = (win_h / 2) - (h / 2);
(*itr).position_set(x, y);
(*itr).msize_set(w, h);
(*itr).fill_set(0, 0, w, h);
}
FPS_STD(NAME);
}

View File

@ -66,12 +66,8 @@ static void _setup(void)
/* cleanup */
static void _cleanup(void)
{
int i;
for (i = 0; i < NUM; i++)
{
eo_del(images[i]);
eo_del(o_texts[i]);
}
images.clear();
texts.clear();
}
static void _key(char *key)
{