From c183d2c562148a5418849d3222a2c940f3f1102a Mon Sep 17 00:00:00 2001 From: kraxel Date: Sun, 13 Aug 2006 18:28:49 +0000 Subject: blend cmd line option --- fbi.c | 9 +++++---- fbiconfig.c | 5 +++++ fbiconfig.h | 2 ++ 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/fbi.c b/fbi.c index fe55a38..8c63401 100644 --- a/fbi.c +++ b/fbi.c @@ -142,8 +142,8 @@ int preserve; int read_ahead; int editable; int once; -int blending_msecs = 1000; -int perfmon = 1; +int blend_msecs; +int perfmon = 0; /* font handling */ static char *fontname = NULL; @@ -757,7 +757,7 @@ static void effect_blend(struct flist *f, struct flist *t) gettimeofday(&now, NULL); msecs = (now.tv_sec - start.tv_sec) * 1000; msecs += (now.tv_usec - start.tv_usec) / 1000; - weight = msecs * 100 / blending_msecs; + weight = msecs * 100 / blend_msecs; if (weight > 100) weight = 100; shadow_draw_image(flist_img_get(f), f->left, f->top, @@ -827,7 +827,7 @@ svga_show(struct flist *f, struct flist *prev, if (f->left + fb_var.xres > img->i.width) f->left = img->i.width - fb_var.xres; } - if (blending_msecs && prev && prev != f && + if (blend_msecs && prev && prev != f && flist_img_get(prev) && flist_img_get(f)) { effect_blend(prev, f); prev = NULL; @@ -1420,6 +1420,7 @@ main(int argc, char *argv[]) read_ahead = GET_READ_AHEAD(); max_mem_mb = GET_CACHE_MEM(); + blend_msecs = GET_BLEND_MSECS(); v_steps = GET_SCROLL(); h_steps = GET_SCROLL(); timeout = GET_TIMEOUT(); diff --git a/fbiconfig.c b/fbiconfig.c index b219d2c..fb41f08 100644 --- a/fbiconfig.c +++ b/fbiconfig.c @@ -116,6 +116,11 @@ struct cfg_cmdline fbi_cfg[] = { .option = { O_CACHE_MEM }, .needsarg = 1, .desc = "image cache size in megabytes", + },{ + .cmdline = "blend", + .option = { O_BLEND_MSECS }, + .needsarg = 1, + .desc = "image blend time in miliseconds", },{ .letter = 'T', .cmdline = "vt", diff --git a/fbiconfig.h b/fbiconfig.h index b116f72..73b3d55 100644 --- a/fbiconfig.h +++ b/fbiconfig.h @@ -24,6 +24,7 @@ #define O_READ_AHEAD O_OPTIONS, "read-ahead" #define O_CACHE_MEM O_OPTIONS, "cache-mem" +#define O_BLEND_MSECS O_OPTIONS, "blend-msecs" #define O_VT O_OPTIONS, "vt" #define O_SCROLL O_OPTIONS, "scroll" #define O_TIMEOUT O_OPTIONS, "timeout" @@ -55,6 +56,7 @@ #define GET_READ_AHEAD() cfg_get_bool(O_READ_AHEAD, 0) #define GET_CACHE_MEM() cfg_get_int(O_CACHE_MEM, 256) +#define GET_BLEND_MSECS() cfg_get_int(O_BLEND_MSECS, 0) #define GET_VT() cfg_get_int(O_VT, 0) #define GET_SCROLL() cfg_get_int(O_SCROLL, 50) #define GET_TIMEOUT() cfg_get_int(O_TIMEOUT, 0) -- cgit