aboutsummaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorHarry Jeffery <harry@exec64.co.uk>2015-11-06 11:17:36 +0000
committerHarry Jeffery <harry@exec64.co.uk>2015-11-06 11:17:36 +0000
commitf18d3f357d22445ef58d4ec34532985c925ad408 (patch)
tree089a481cebe67af56292005b255e0aafc8415f5a /main.c
parent132af1a065389b15cd28955abef99c910ae44807 (diff)
downloadimv-f18d3f357d22445ef58d4ec34532985c925ad408.tar.gz
Quickly skip over groups of unsupported files
Diffstat (limited to 'main.c')
-rw-r--r--main.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/main.c b/main.c
index 5057432..e46617c 100644
--- a/main.c
+++ b/main.c
@@ -18,7 +18,8 @@ struct {
struct {
struct loop_item_s *first, *last, *cur;
int reload;
-} g_path = {NULL,NULL,NULL,1};
+ int dir;
+} g_path = {NULL,NULL,NULL,1,1};
void reset_view()
{
@@ -75,7 +76,11 @@ void remove_current_path()
struct loop_item_s* cur = g_path.cur;
cur->next->prev = cur->prev;
cur->prev->next = cur->next;
- g_path.cur = cur->next;
+ if(g_path.dir > 0) {
+ g_path.cur = cur->prev;
+ } else {
+ g_path.cur = cur->next;
+ }
free(cur);
}
@@ -83,12 +88,14 @@ void next_path()
{
g_path.cur = g_path.cur->prev;
g_path.reload = 1;
+ g_path.dir = 1;
}
void prev_path()
{
g_path.cur = g_path.cur->next;
g_path.reload = 1;
+ g_path.dir = -1;
}
int main(int argc, char** argv)
@@ -182,7 +189,7 @@ int main(int argc, char** argv)
break;
}
- if(g_path.reload) {
+ while(g_path.reload) {
if(img) {
SDL_DestroyTexture(img);
img = NULL;