From: Enlightenment C. <no...@cv...> - 2007-11-13 06:00:36
|
Enlightenment CVS committal Author : raster Project : e17 Module : apps/expedite Dir : e17/apps/expedite/src/bin Modified Files: engine_software_sdl.c image_blend_border.c image_blend_border_recolor.c image_blend_nearest_scaled.c image_blend_nearest_solid_scaled.c image_blend_occlude1.c image_blend_occlude1_many.c image_blend_occlude1_very_many.c image_blend_occlude2.c image_blend_occlude2_few.c image_blend_occlude2_many.c image_blend_occlude2_very_many.c image_blend_occlude3.c image_blend_occlude3_few.c image_blend_occlude3_many.c image_blend_occlude3_very_many.c image_blend_smooth_scaled.c image_blend_smooth_solid_scaled.c image_blend_solid_border.c image_blend_solid_unscaled.c image_blend_unscaled.c image_crossfade.c image_data_ycbcr601pl.c image_data_ycbcr601pl_wide_stride.c image_quality_scale.c main.c main.h ui.c Log Message: cedric patch - as per email. =================================================================== RCS file: /cvs/e/e17/apps/expedite/src/bin/engine_software_sdl.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -3 -r1.2 -r1.3 --- engine_software_sdl.c 10 Nov 2007 12:17:07 -0000 1.2 +++ engine_software_sdl.c 13 Nov 2007 06:00:33 -0000 1.3 @@ -1,3 +1,4 @@ +#include <assert.h> #include "main.h" #include <SDL/SDL.h> @@ -16,11 +17,15 @@ { 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 @@ 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: =================================================================== RCS file: /cvs/e/e17/apps/expedite/src/bin/image_blend_border.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- image_blend_border.c 11 Apr 2007 11:58:32 -0000 1.1 +++ image_blend_border.c 13 Nov 2007 06:00:33 -0000 1.2 @@ -25,7 +25,7 @@ { 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); } =================================================================== RCS file: /cvs/e/e17/apps/expedite/src/bin/image_blend_border_recolor.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- image_blend_border_recolor.c 11 Apr 2007 11:58:32 -0000 1.1 +++ image_blend_border_recolor.c 13 Nov 2007 06:00:33 -0000 1.2 @@ -25,7 +25,7 @@ { 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); =================================================================== RCS file: /cvs/e/e17/apps/expedite/src/bin/image_blend_nearest_scaled.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- image_blend_nearest_scaled.c 11 Apr 2007 11:58:32 -0000 1.1 +++ image_blend_nearest_scaled.c 13 Nov 2007 06:00:33 -0000 1.2 @@ -25,7 +25,7 @@ { 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); } =================================================================== RCS file: /cvs/e/e17/apps/expedite/src/bin/image_blend_nearest_solid_scaled.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- image_blend_nearest_solid_scaled.c 11 Apr 2007 11:58:32 -0000 1.1 +++ image_blend_nearest_solid_scaled.c 13 Nov 2007 06:00:33 -0000 1.2 @@ -25,7 +25,7 @@ { 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); } =================================================================== RCS file: /cvs/e/e17/apps/expedite/src/bin/image_blend_occlude1.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -3 -r1.2 -r1.3 --- image_blend_occlude1.c 17 Oct 2007 11:55:47 -0000 1.2 +++ image_blend_occlude1.c 13 Nov 2007 06:00:33 -0000 1.3 @@ -27,12 +27,12 @@ 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); =================================================================== RCS file: /cvs/e/e17/apps/expedite/src/bin/image_blend_occlude1_many.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -3 -r1.2 -r1.3 --- image_blend_occlude1_many.c 17 Oct 2007 11:55:47 -0000 1.2 +++ image_blend_occlude1_many.c 13 Nov 2007 06:00:33 -0000 1.3 @@ -30,12 +30,12 @@ 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); =================================================================== RCS file: /cvs/e/e17/apps/expedite/src/bin/image_blend_occlude1_very_many.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -3 -r1.2 -r1.3 --- image_blend_occlude1_very_many.c 17 Oct 2007 11:55:47 -0000 1.2 +++ image_blend_occlude1_very_many.c 13 Nov 2007 06:00:33 -0000 1.3 @@ -30,12 +30,12 @@ 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); =================================================================== RCS file: /cvs/e/e17/apps/expedite/src/bin/image_blend_occlude2.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -3 -r1.2 -r1.3 --- image_blend_occlude2.c 17 Oct 2007 11:55:47 -0000 1.2 +++ image_blend_occlude2.c 13 Nov 2007 06:00:33 -0000 1.3 @@ -27,12 +27,12 @@ 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); =================================================================== RCS file: /cvs/e/e17/apps/expedite/src/bin/image_blend_occlude2_few.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -3 -r1.2 -r1.3 --- image_blend_occlude2_few.c 17 Oct 2007 11:55:47 -0000 1.2 +++ image_blend_occlude2_few.c 13 Nov 2007 06:00:33 -0000 1.3 @@ -30,12 +30,12 @@ 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); =================================================================== RCS file: /cvs/e/e17/apps/expedite/src/bin/image_blend_occlude2_many.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -3 -r1.2 -r1.3 --- image_blend_occlude2_many.c 17 Oct 2007 11:55:47 -0000 1.2 +++ image_blend_occlude2_many.c 13 Nov 2007 06:00:33 -0000 1.3 @@ -30,12 +30,12 @@ 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); =================================================================== RCS file: /cvs/e/e17/apps/expedite/src/bin/image_blend_occlude2_very_many.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -3 -r1.2 -r1.3 --- image_blend_occlude2_very_many.c 17 Oct 2007 11:55:47 -0000 1.2 +++ image_blend_occlude2_very_many.c 13 Nov 2007 06:00:33 -0000 1.3 @@ -30,12 +30,12 @@ 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); =================================================================== RCS file: /cvs/e/e17/apps/expedite/src/bin/image_blend_occlude3.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -3 -r1.2 -r1.3 --- image_blend_occlude3.c 17 Oct 2007 11:55:47 -0000 1.2 +++ image_blend_occlude3.c 13 Nov 2007 06:00:33 -0000 1.3 @@ -27,12 +27,12 @@ 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); =================================================================== RCS file: /cvs/e/e17/apps/expedite/src/bin/image_blend_occlude3_few.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -3 -r1.2 -r1.3 --- image_blend_occlude3_few.c 17 Oct 2007 11:55:47 -0000 1.2 +++ image_blend_occlude3_few.c 13 Nov 2007 06:00:33 -0000 1.3 @@ -30,12 +30,12 @@ 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); =================================================================== RCS file: /cvs/e/e17/apps/expedite/src/bin/image_blend_occlude3_many.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -3 -r1.2 -r1.3 --- image_blend_occlude3_many.c 17 Oct 2007 11:55:47 -0000 1.2 +++ image_blend_occlude3_many.c 13 Nov 2007 06:00:33 -0000 1.3 @@ -30,12 +30,12 @@ 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); =================================================================== RCS file: /cvs/e/e17/apps/expedite/src/bin/image_blend_occlude3_very_many.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -3 -r1.2 -r1.3 --- image_blend_occlude3_very_many.c 17 Oct 2007 11:55:47 -0000 1.2 +++ image_blend_occlude3_very_many.c 13 Nov 2007 06:00:33 -0000 1.3 @@ -30,12 +30,12 @@ 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); =================================================================== RCS file: /cvs/e/e17/apps/expedite/src/bin/image_blend_smooth_scaled.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- image_blend_smooth_scaled.c 11 Apr 2007 11:58:32 -0000 1.1 +++ image_blend_smooth_scaled.c 13 Nov 2007 06:00:33 -0000 1.2 @@ -25,7 +25,7 @@ { 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); } =================================================================== RCS file: /cvs/e/e17/apps/expedite/src/bin/image_blend_smooth_solid_scaled.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- image_blend_smooth_solid_scaled.c 11 Apr 2007 11:58:32 -0000 1.1 +++ image_blend_smooth_solid_scaled.c 13 Nov 2007 06:00:33 -0000 1.2 @@ -25,7 +25,7 @@ { 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); } =================================================================== RCS file: /cvs/e/e17/apps/expedite/src/bin/image_blend_solid_border.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- image_blend_solid_border.c 11 Apr 2007 11:58:32 -0000 1.1 +++ image_blend_solid_border.c 13 Nov 2007 06:00:33 -0000 1.2 @@ -25,7 +25,7 @@ { 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); } =================================================================== RCS file: /cvs/e/e17/apps/expedite/src/bin/image_blend_solid_unscaled.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- image_blend_solid_unscaled.c 11 Apr 2007 11:58:32 -0000 1.1 +++ image_blend_solid_unscaled.c 13 Nov 2007 06:00:33 -0000 1.2 @@ -25,7 +25,7 @@ { 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); =================================================================== RCS file: /cvs/e/e17/apps/expedite/src/bin/image_blend_unscaled.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- image_blend_unscaled.c 11 Apr 2007 11:58:32 -0000 1.1 +++ image_blend_unscaled.c 13 Nov 2007 06:00:33 -0000 1.2 @@ -25,7 +25,7 @@ { 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); =================================================================== RCS file: /cvs/e/e17/apps/expedite/src/bin/image_crossfade.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -3 -r1.3 -r1.4 --- image_crossfade.c 17 Oct 2007 11:55:47 -0000 1.3 +++ image_crossfade.c 13 Nov 2007 06:00:33 -0000 1.4 @@ -24,14 +24,14 @@ 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); =================================================================== RCS file: /cvs/e/e17/apps/expedite/src/bin/image_data_ycbcr601pl.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -3 -r1.2 -r1.3 --- image_data_ycbcr601pl.c 11 Apr 2007 12:36:32 -0000 1.2 +++ image_data_ycbcr601pl.c 13 Nov 2007 06:00:33 -0000 1.3 @@ -38,7 +38,7 @@ 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); =================================================================== RCS file: /cvs/e/e17/apps/expedite/src/bin/image_data_ycbcr601pl_wide_stride.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -3 -r1.2 -r1.3 --- image_data_ycbcr601pl_wide_stride.c 17 Oct 2007 11:55:47 -0000 1.2 +++ image_data_ycbcr601pl_wide_stride.c 13 Nov 2007 06:00:33 -0000 1.3 @@ -38,7 +38,7 @@ 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); =================================================================== RCS file: /cvs/e/e17/apps/expedite/src/bin/image_quality_scale.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- image_quality_scale.c 11 Apr 2007 11:58:32 -0000 1.1 +++ image_quality_scale.c 13 Nov 2007 06:00:33 -0000 1.2 @@ -26,7 +26,7 @@ { 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); =================================================================== RCS file: /cvs/e/e17/apps/expedite/src/bin/main.c,v retrieving revision 1.16 retrieving revision 1.17 diff -u -3 -r1.16 -r1.17 --- main.c 10 Nov 2007 23:23:08 -0000 1.16 +++ main.c 13 Nov 2007 06:00:33 -0000 1.17 @@ -1075,9 +1075,36 @@ } #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; } =================================================================== RCS file: /cvs/e/e17/apps/expedite/src/bin/main.h,v retrieving revision 1.9 retrieving revision 1.10 diff -u -3 -r1.9 -r1.10 --- main.h 10 Nov 2007 23:23:08 -0000 1.9 +++ main.h 13 Nov 2007 06:00:33 -0000 1.10 @@ -55,6 +55,7 @@ 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); =================================================================== RCS file: /cvs/e/e17/apps/expedite/src/bin/ui.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -3 -r1.6 -r1.7 --- ui.c 8 Nov 2007 21:00:35 -0000 1.6 +++ ui.c 13 Nov 2007 06:00:33 -0000 1.7 @@ -208,13 +208,11 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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; |