From eaa269b6cb486f83229cb0d3dc5f7e03d1c485bb Mon Sep 17 00:00:00 2001 From: Bert Münnich Date: Thu, 25 Sep 2014 20:57:24 +0200 Subject: Revised thumbnail loading... - Only load the thumbnails that are currently visible in the window - Unload thumbnails that are leaving the visible area - Much less memory needed, but scrolling is now slower - This also unintentionally fixes issue #86 --- thumbs.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'thumbs.h') diff --git a/thumbs.h b/thumbs.h index d2a6b83..88ea7c2 100644 --- a/thumbs.h +++ b/thumbs.h @@ -31,16 +31,15 @@ typedef struct { int h; int x; int y; - bool loaded; } thumb_t; typedef struct { const fileinfo_t *files; thumb_t *thumbs; - int cap; int cnt; int loadnext; - int first; + int first, end; + int r_first, r_end; int *sel; win_t *win; @@ -58,6 +57,7 @@ void tns_init(tns_t*, const fileinfo_t*, int, int*, win_t*); void tns_free(tns_t*); bool tns_load(tns_t*, int, bool); +void tns_unload(tns_t*, int); void tns_render(tns_t*); void tns_mark(tns_t*, int, bool); -- cgit v1.2.3-54-g00ecf