diff options
author | kraxel <kraxel> | 2006-08-13 18:28:49 +0000 |
---|---|---|
committer | kraxel <kraxel> | 2006-08-13 18:28:49 +0000 |
commit | c183d2c562148a5418849d3222a2c940f3f1102a (patch) | |
tree | 0de2e66516d4f5b19b8c0eee17fdf9e6272c2c48 | |
parent | 3e07a22545ccf71b2bdd755b9f308ae52eac334c (diff) | |
download | fbida-c183d2c562148a5418849d3222a2c940f3f1102a.tar.gz |
blend cmd line option
-rw-r--r-- | fbi.c | 9 | ||||
-rw-r--r-- | fbiconfig.c | 5 | ||||
-rw-r--r-- | fbiconfig.h | 2 |
3 files changed, 12 insertions, 4 deletions
@@ -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 @@ -117,6 +117,11 @@ struct cfg_cmdline fbi_cfg[] = { .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", .option = { O_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) |