changeset 1565:58aa34bb4f03

Fix page up/down skip amounts.
author Matti Hamalainen <ccr@tnsp.org>
date Sun, 13 May 2018 07:33:05 +0300
parents d1e2f7a22fb8
children 3b53b289df0e
files tools/64vw.c
diffstat 1 files changed, 10 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/tools/64vw.c	Sun May 13 07:32:36 2018 +0300
+++ b/tools/64vw.c	Sun May 13 07:33:05 2018 +0300
@@ -12,6 +12,9 @@
 #include <SDL.h>
 
 
+#define SET_SKIP_AMOUNT 10
+
+
 int    optVFlags = 0;
 int    optScrWidth, optScrHeight;
 int    optForcedFormat = -1;
@@ -320,21 +323,22 @@
                         if (currIndex < noptFilenames2 - 1)
                             currIndex++;
                         else
-                            currIndex = noptFilenames2;
+                            currIndex = noptFilenames2 - 1;
                         break;
 
                     case SDLK_PAGEDOWN:
-                        if (currIndex > 10)
-                            currIndex -= 10;
+                        if (currIndex > SET_SKIP_AMOUNT)
+                            currIndex -= SET_SKIP_AMOUNT;
                         else
                             currIndex = 0;
                         break;
 
                     case SDLK_PAGEUP:
-                        if (currIndex < noptFilenames2 - 10)
-                            currIndex += 10;
+                        if (currIndex < noptFilenames2 - 1 - SET_SKIP_AMOUNT)
+                            currIndex += SET_SKIP_AMOUNT;
                         else
-                            currIndex = noptFilenames2;
+                            currIndex = noptFilenames2 - 1;
+                        break;
                         break;
 
                     default: