cedric patch - as per email.


			
			
				expedite-1.1
			
			
		
Carsten Haitzler 15 years ago
parent 4eb1a715eb
commit bebdbe654b
  1. 15
      src/bin/engine_software_sdl.c
  2. 2
      src/bin/image_blend_border.c
  3. 2
      src/bin/image_blend_border_recolor.c
  4. 2
      src/bin/image_blend_nearest_scaled.c
  5. 2
      src/bin/image_blend_nearest_solid_scaled.c
  6. 4
      src/bin/image_blend_occlude1.c
  7. 4
      src/bin/image_blend_occlude1_many.c
  8. 4
      src/bin/image_blend_occlude1_very_many.c
  9. 4
      src/bin/image_blend_occlude2.c
  10. 4
      src/bin/image_blend_occlude2_few.c
  11. 4
      src/bin/image_blend_occlude2_many.c
  12. 4
      src/bin/image_blend_occlude2_very_many.c
  13. 4
      src/bin/image_blend_occlude3.c
  14. 4
      src/bin/image_blend_occlude3_few.c
  15. 4
      src/bin/image_blend_occlude3_many.c
  16. 4
      src/bin/image_blend_occlude3_very_many.c
  17. 2
      src/bin/image_blend_smooth_scaled.c
  18. 2
      src/bin/image_blend_smooth_solid_scaled.c
  19. 2
      src/bin/image_blend_solid_border.c
  20. 2
      src/bin/image_blend_solid_unscaled.c
  21. 2
      src/bin/image_blend_unscaled.c
  22. 4
      src/bin/image_crossfade.c
  23. 2
      src/bin/image_data_ycbcr601pl.c
  24. 2
      src/bin/image_data_ycbcr601pl_wide_stride.c
  25. 2
      src/bin/image_quality_scale.c
  26. 27
      src/bin/main.c
  27. 1
      src/bin/main.h
  28. 24
      src/bin/ui.c

@ -1,3 +1,4 @@
#include <assert.h>
#include "main.h"
#include <SDL/SDL.h>
@ -16,11 +17,15 @@ engine_software_sdl_args(int argc, char **argv)
{
i++;
if (!strcmp(argv[i], "sdl")) ok = 1;
if (!strcmp(argv[i], "sdl-16")) ok = 2;
}
}
if (!ok) return 0;
if (ok == 1)
evas_output_method_set(evas, evas_render_method_lookup("software_sdl"));
else
evas_output_method_set(evas, evas_render_method_lookup("software_16_sdl"));
einfo = (Evas_Engine_Info_SDL *) evas_engine_info_get(evas);
@ -98,8 +103,14 @@ engine_software_sdl_loop(void)
else
evas_key_lock_on(evas, "Scroll_Lock");
break;
case SDLK_ESCAPE: evas_event_feed_key_down(evas, "Escape", "Escape", NULL, NULL, 0, NULL); break;
case SDLK_RETURN: evas_event_feed_key_down(evas, "Return", "Return", NULL, NULL, 0, NULL); break;
case SDLK_s:
case SDLK_ESCAPE:
evas_event_feed_key_down(evas, "Escape", "Escape", NULL, NULL, 0, NULL);
break;
case SDLK_KP_ENTER:
case SDLK_RETURN:
evas_event_feed_key_down(evas, "Return", "Return", NULL, NULL, 0, NULL);
break;
case SDLK_LEFT: evas_event_feed_key_down(evas, "Left", "Left", NULL, NULL, 0, NULL); break;
case SDLK_RIGHT: evas_event_feed_key_down(evas, "Right", "Right", NULL, NULL, 0, NULL); break;
case SDLK_q:

@ -25,7 +25,7 @@ static void _setup(void)
{
o = evas_object_image_add(evas);
o_images[i] = o;
evas_object_image_file_set(o, PACKAGE_DATA_DIR"/data/bar.png", NULL);
evas_object_image_file_set(o, build_path("bar.png"), NULL);
evas_object_image_border_set(o, 8, 8, 8, 8);
evas_object_show(o);
}

@ -25,7 +25,7 @@ static void _setup(void)
{
o = evas_object_image_add(evas);
o_images[i] = o;
evas_object_image_file_set(o, PACKAGE_DATA_DIR"/data/pan.png", NULL);
evas_object_image_file_set(o, build_path("pan.png"), NULL);
evas_object_color_set(o, 64, 64, 64, 255);
evas_object_image_border_set(o, 3, 3, 3, 3);
evas_object_show(o);

@ -25,7 +25,7 @@ static void _setup(void)
{
o = evas_object_image_add(evas);
o_images[i] = o;
evas_object_image_file_set(o, PACKAGE_DATA_DIR"/data/logo.png", NULL);
evas_object_image_file_set(o, build_path("logo.png"), NULL);
evas_object_image_smooth_scale_set(o, 0);
evas_object_show(o);
}

@ -25,7 +25,7 @@ static void _setup(void)
{
o = evas_object_image_add(evas);
o_images[i] = o;
evas_object_image_file_set(o, PACKAGE_DATA_DIR"/data/image.png", NULL);
evas_object_image_file_set(o, build_path("image.png"), NULL);
evas_object_image_smooth_scale_set(o, 0);
evas_object_show(o);
}

@ -27,12 +27,12 @@ static void _setup(void)
o = evas_object_image_add(evas);
o_images[i] = o;
if (i < (OBNUM / 2))
evas_object_image_file_set(o, PACKAGE_DATA_DIR"/data/logo.png", NULL);
evas_object_image_file_set(o, build_path("logo.png"), NULL);
else
{
Evas_Coord x, y;
evas_object_image_file_set(o, PACKAGE_DATA_DIR"/data/image.png", NULL);
evas_object_image_file_set(o, build_path("image.png"), NULL);
x = (win_w / 4) + (((rnd() & 0xff) * ((win_w / 2) - 120)) >> 8);
y = (win_h / 4) + (((rnd() & 0xff) * ((win_h / 2) - 120)) >> 8);
evas_object_move(o, x, y);

@ -30,12 +30,12 @@ static void _setup(void)
o = evas_object_image_add(evas);
o_images[i] = o;
if (i < (OBNUM / 2))
evas_object_image_file_set(o, PACKAGE_DATA_DIR"/data/logo.png", NULL);
evas_object_image_file_set(o, build_path("logo.png"), NULL);
else
{
Evas_Coord x, y;
evas_object_image_file_set(o, PACKAGE_DATA_DIR"/data/image.png", NULL);
evas_object_image_file_set(o, build_path("image.png"), NULL);
x = (win_w / 4) + (((rnd() & 0xff) * ((win_w / 2) - 120)) >> 8);
y = (win_h / 4) + (((rnd() & 0xff) * ((win_h / 2) - 120)) >> 8);
evas_object_move(o, x, y);

@ -30,12 +30,12 @@ static void _setup(void)
o = evas_object_image_add(evas);
o_images[i] = o;
if (i < (OBNUM / 2))
evas_object_image_file_set(o, PACKAGE_DATA_DIR"/data/logo.png", NULL);
evas_object_image_file_set(o, build_path("logo.png"), NULL);
else
{
Evas_Coord x, y;
evas_object_image_file_set(o, PACKAGE_DATA_DIR"/data/image.png", NULL);
evas_object_image_file_set(o, build_path("image.png"), NULL);
x = (win_w / 4) + (((rnd() & 0xff) * ((win_w / 2) - 120)) >> 8);
y = (win_h / 4) + (((rnd() & 0xff) * ((win_h / 2) - 120)) >> 8);
evas_object_move(o, x, y);

@ -27,12 +27,12 @@ static void _setup(void)
o = evas_object_image_add(evas);
o_images[i] = o;
if (i & 0x1)
evas_object_image_file_set(o, PACKAGE_DATA_DIR"/data/logo.png", NULL);
evas_object_image_file_set(o, build_path("logo.png"), NULL);
else
{
Evas_Coord x, y;
evas_object_image_file_set(o, PACKAGE_DATA_DIR"/data/image.png", NULL);
evas_object_image_file_set(o, build_path("image.png"), NULL);
x = (win_w / 4) + (((rnd() & 0xff) * ((win_w / 2) - 120)) >> 8);
y = (win_h / 4) + (((rnd() & 0xff) * ((win_h / 2) - 120)) >> 8);
evas_object_move(o, x, y);

@ -30,12 +30,12 @@ static void _setup(void)
o = evas_object_image_add(evas);
o_images[i] = o;
if (i & 0x1)
evas_object_image_file_set(o, PACKAGE_DATA_DIR"/data/logo.png", NULL);
evas_object_image_file_set(o, build_path("logo.png"), NULL);
else
{
Evas_Coord x, y;
evas_object_image_file_set(o, PACKAGE_DATA_DIR"/data/image.png", NULL);
evas_object_image_file_set(o, build_path("image.png"), NULL);
x = (win_w / 4) + (((rnd() & 0xff) * ((win_w / 2) - 120)) >> 8);
y = (win_h / 4) + (((rnd() & 0xff) * ((win_h / 2) - 120)) >> 8);
evas_object_move(o, x, y);

@ -30,12 +30,12 @@ static void _setup(void)
o = evas_object_image_add(evas);
o_images[i] = o;
if (i & 0x1)
evas_object_image_file_set(o, PACKAGE_DATA_DIR"/data/logo.png", NULL);
evas_object_image_file_set(o, build_path("logo.png"), NULL);
else
{
Evas_Coord x, y;
evas_object_image_file_set(o, PACKAGE_DATA_DIR"/data/image.png", NULL);
evas_object_image_file_set(o, build_path("image.png"), NULL);
x = (win_w / 4) + (((rnd() & 0xff) * ((win_w / 2) - 120)) >> 8);
y = (win_h / 4) + (((rnd() & 0xff) * ((win_h / 2) - 120)) >> 8);
evas_object_move(o, x, y);

@ -30,12 +30,12 @@ static void _setup(void)
o = evas_object_image_add(evas);
o_images[i] = o;
if (i & 0x1)
evas_object_image_file_set(o, PACKAGE_DATA_DIR"/data/logo.png", NULL);
evas_object_image_file_set(o, build_path("logo.png"), NULL);
else
{
Evas_Coord x, y;
evas_object_image_file_set(o, PACKAGE_DATA_DIR"/data/image.png", NULL);
evas_object_image_file_set(o, build_path("image.png"), NULL);
x = (win_w / 4) + (((rnd() & 0xff) * ((win_w / 2) - 120)) >> 8);
y = (win_h / 4) + (((rnd() & 0xff) * ((win_h / 2) - 120)) >> 8);
evas_object_move(o, x, y);

@ -27,12 +27,12 @@ static void _setup(void)
o = evas_object_image_add(evas);
o_images[i] = o;
if (i > (OBNUM / 2))
evas_object_image_file_set(o, PACKAGE_DATA_DIR"/data/logo.png", NULL);
evas_object_image_file_set(o, build_path("logo.png"), NULL);
else
{
Evas_Coord x, y;
evas_object_image_file_set(o, PACKAGE_DATA_DIR"/data/image.png", NULL);
evas_object_image_file_set(o, build_path("image.png"), NULL);
x = (win_w / 4) + (((rnd() & 0xff) * ((win_w / 2) - 120)) >> 8);
y = (win_h / 4) + (((rnd() & 0xff) * ((win_h / 2) - 120)) >> 8);
evas_object_move(o, x, y);

@ -30,12 +30,12 @@ static void _setup(void)
o = evas_object_image_add(evas);
o_images[i] = o;
if (i > (OBNUM / 2))
evas_object_image_file_set(o, PACKAGE_DATA_DIR"/data/logo.png", NULL);
evas_object_image_file_set(o, build_path("logo.png"), NULL);
else
{
Evas_Coord x, y;
evas_object_image_file_set(o, PACKAGE_DATA_DIR"/data/image.png", NULL);
evas_object_image_file_set(o, build_path("image.png"), NULL);
x = (win_w / 4) + (((rnd() & 0xff) * ((win_w / 2) - 120)) >> 8);
y = (win_h / 4) + (((rnd() & 0xff) * ((win_h / 2) - 120)) >> 8);
evas_object_move(o, x, y);

@ -30,12 +30,12 @@ static void _setup(void)
o = evas_object_image_add(evas);
o_images[i] = o;
if (i > (OBNUM / 2))
evas_object_image_file_set(o, PACKAGE_DATA_DIR"/data/logo.png", NULL);
evas_object_image_file_set(o, build_path("logo.png"), NULL);
else
{
Evas_Coord x, y;
evas_object_image_file_set(o, PACKAGE_DATA_DIR"/data/image.png", NULL);
evas_object_image_file_set(o, build_path("image.png"), NULL);
x = (win_w / 4) + (((rnd() & 0xff) * ((win_w / 2) - 120)) >> 8);
y = (win_h / 4) + (((rnd() & 0xff) * ((win_h / 2) - 120)) >> 8);
evas_object_move(o, x, y);

@ -30,12 +30,12 @@ static void _setup(void)
o = evas_object_image_add(evas);
o_images[i] = o;
if (i > (OBNUM / 2))
evas_object_image_file_set(o, PACKAGE_DATA_DIR"/data/logo.png", NULL);
evas_object_image_file_set(o, build_path("logo.png"), NULL);
else
{
Evas_Coord x, y;
evas_object_image_file_set(o, PACKAGE_DATA_DIR"/data/image.png", NULL);
evas_object_image_file_set(o, build_path("image.png"), NULL);
x = (win_w / 4) + (((rnd() & 0xff) * ((win_w / 2) - 120)) >> 8);
y = (win_h / 4) + (((rnd() & 0xff) * ((win_h / 2) - 120)) >> 8);
evas_object_move(o, x, y);

@ -25,7 +25,7 @@ static void _setup(void)
{
o = evas_object_image_add(evas);
o_images[i] = o;
evas_object_image_file_set(o, PACKAGE_DATA_DIR"/data/logo.png", NULL);
evas_object_image_file_set(o, build_path("logo.png"), NULL);
evas_object_image_smooth_scale_set(o, 1);
evas_object_show(o);
}

@ -25,7 +25,7 @@ static void _setup(void)
{
o = evas_object_image_add(evas);
o_images[i] = o;
evas_object_image_file_set(o, PACKAGE_DATA_DIR"/data/image.png", NULL);
evas_object_image_file_set(o, build_path("image.png"), NULL);
evas_object_image_smooth_scale_set(o, 1);
evas_object_show(o);
}

@ -25,7 +25,7 @@ static void _setup(void)
{
o = evas_object_image_add(evas);
o_images[i] = o;
evas_object_image_file_set(o, PACKAGE_DATA_DIR"/data/frame.png", NULL);
evas_object_image_file_set(o, build_path("frame.png"), NULL);
evas_object_image_border_set(o, 8, 8, 8, 8);
evas_object_show(o);
}

@ -25,7 +25,7 @@ static void _setup(void)
{
o = evas_object_image_add(evas);
o_images[i] = o;
evas_object_image_file_set(o, PACKAGE_DATA_DIR"/data/image.png", NULL);
evas_object_image_file_set(o, build_path("image.png"), NULL);
evas_object_image_fill_set(o, 0, 0, 120, 160);
evas_object_resize(o, 120, 160);
evas_object_show(o);

@ -25,7 +25,7 @@ static void _setup(void)
{
o = evas_object_image_add(evas);
o_images[i] = o;
evas_object_image_file_set(o, PACKAGE_DATA_DIR"/data/logo.png", NULL);
evas_object_image_file_set(o, build_path("logo.png"), NULL);
evas_object_image_fill_set(o, 0, 0, 120, 160);
evas_object_resize(o, 120, 160);
evas_object_show(o);

@ -24,14 +24,14 @@ static void _setup(void)
o = evas_object_image_add(evas);
o_images[0] = o;
evas_object_image_file_set(o, PACKAGE_DATA_DIR"/data/im1.png", NULL);
evas_object_image_file_set(o, build_path("im1.png"), NULL);
evas_object_image_fill_set(o, 0, 0, 720, 420);
evas_object_resize(o, 720, 420);
evas_object_show(o);
o = evas_object_image_add(evas);
o_images[1] = o;
evas_object_image_file_set(o, PACKAGE_DATA_DIR"/data/im2.png", NULL);
evas_object_image_file_set(o, build_path("im2.png"), NULL);
evas_object_image_fill_set(o, 0, 0, 720, 420);
evas_object_resize(o, 720, 420);
evas_object_show(o);

@ -38,7 +38,7 @@ static void _setup(void)
yp = malloc(640 * 480);
up = malloc(320 * 240);
vp = malloc(320 * 240);
f = fopen(PACKAGE_DATA_DIR"/data/tp.yuv", "rb");
f = fopen(build_path("tp.yuv"), "rb");
if (f)
{
fread(yp, 640 * 480, 1, f);

@ -38,7 +38,7 @@ static void _setup(void)
yp = malloc(640 * 480);
up = malloc(320 * 240);
vp = malloc(320 * 240);
f = fopen(PACKAGE_DATA_DIR"/data/tp.yuv", "rb");
f = fopen(build_path("tp.yuv"), "rb");
if (f)
{
fread(yp, 640 * 480, 1, f);

@ -26,7 +26,7 @@ static void _setup(void)
{
o = evas_object_image_add(evas);
o_images[i] = o;
evas_object_image_file_set(o, PACKAGE_DATA_DIR"/data/tp.png", NULL);
evas_object_image_file_set(o, build_path("tp.png"), NULL);
evas_object_image_fill_set(o, 0, 0, 640, 480);
evas_object_resize(o, 640, 480);
evas_object_show(o);

@ -1075,9 +1075,36 @@ get_time(void)
}
#endif
const char *
build_path(const char *filename)
{
static char path[4096];
static char buffer[4096];
static int init = 0;
if (!init)
{
char *prefix;
prefix = getenv("EXPEDITE_DATA_DIR");
if (!prefix)
strcpy(path, PACKAGE_DATA_DIR"/data/");
else
snprintf(path, 4096, "%s/", prefix);
init = 1;
}
snprintf(buffer, 4096, "%s%s", path, filename);
return buffer;
}
int
engine_abort(void)
{
fprintf(stderr, "go: %i\n", go);
go = 0;
return go;
}

@ -55,6 +55,7 @@ extern int win_w, win_h;
void srnd(void);
unsigned int rnd(void);
double get_time(void);
const char *build_path(const char *filename);
void engine_loop(void);
int engine_abort(void);

@ -208,13 +208,11 @@ _ui_mouse_move(void *data, Evas *e, Evas_Object *obj, void *event_info)
static void
_ui_menu_item_add(char *icon, char *text, void (*func) (void))
{
char buf[4096];
Menu_Item *mi;
mi = malloc(sizeof(Menu_Item));
snprintf(buf, 4096, "%s%s", data_dir, icon);
mi->o_icon = evas_object_image_add(evas);
evas_object_image_file_set(mi->o_icon, buf, NULL);
evas_object_image_file_set(mi->o_icon, build_path(icon), NULL);
evas_object_resize(mi->o_icon, 32, 32);
evas_object_image_fill_set(mi->o_icon, 0, 0, 32, 32);
mi->icon = strdup(icon);
@ -227,16 +225,8 @@ _ui_menu_item_add(char *icon, char *text, void (*func) (void))
static void
_ui_setup(void)
{
char buf[4096];
Evas_Object *o;
Evas_Coord x, y, w, h;
char *prefix;
prefix = getenv("EXPEDITE_DATA_DIR");
if (!prefix)
strcpy(data_dir, PACKAGE_DATA_DIR"/data/");
else
snprintf(data_dir, 4096, "%s/", prefix);
o = evas_object_rectangle_add(evas);
evas_object_move(o, 0, 0);
@ -299,8 +289,7 @@ _ui_setup(void)
o = evas_object_image_add(evas);
evas_object_move(o, (win_w - 120) / 2, ((win_h - 160) / 2));
snprintf(buf, 4096, "%s%s", data_dir, "logo.png");
evas_object_image_file_set(o, buf, NULL);
evas_object_image_file_set(o, build_path("logo.png"), NULL);
evas_object_image_fill_set(o, 0, 0, 120, 160);
evas_object_resize(o, 120, 160);
evas_object_layer_set(o, -98);
@ -317,16 +306,14 @@ _ui_setup(void)
o = evas_object_image_add(evas);
evas_object_move(o, 0, 0);
snprintf(buf, 4096, "%s%s", data_dir, "icon_sel.png");
evas_object_image_file_set(o, buf, NULL);
evas_object_image_file_set(o, build_path("icon_sel.png"), NULL);
evas_object_resize(o, 56, 56);
evas_object_image_fill_set(o, 0, 0, 56, 56);
o_menu_icon_sel = o;
o = evas_object_image_add(evas);
evas_object_move(o, 0, 0);
snprintf(buf, 4096, "%s%s", data_dir, "text_sel.png");
evas_object_image_file_set(o, buf, NULL);
evas_object_image_file_set(o, build_path("text_sel.png"), NULL);
evas_object_resize(o, 96, 32);
evas_object_image_fill_set(o, 0, 0, 96, 32);
evas_object_image_border_set(o, 8, 8, 8, 8);
@ -334,8 +321,7 @@ _ui_setup(void)
o = evas_object_image_add(evas);
evas_object_move(o, 0, 0);
snprintf(buf, 4096, "%s%s", data_dir, "icon_sel2.png");
evas_object_image_file_set(o, buf, NULL);
evas_object_image_file_set(o, build_path("icon_sel2.png"), NULL);
evas_object_resize(o, 56, 41);
evas_object_image_fill_set(o, 0, 0, 56, 41);
o_menu_icon_sel2 = o;

Loading…
Cancel
Save