]> skyeroc.xyz Git - dgamelaunch/commitdiff
Small fixes to the watching-screen, caused by variable height screen.
authorPasi Kallinen <paxed@alt.org>
Sun, 18 Oct 2009 02:11:31 +0000 (02:11 +0000)
committerPasi Kallinen <paxed@alt.org>
Sun, 18 Oct 2009 02:11:31 +0000 (02:11 +0000)
git-svn-id: svn://katsu.triplehelix.org/dgamelaunch/trunk@474 db0b04b0-f4d1-0310-9a6d-de3e77497b0e

dgamelaunch.c

index 583032aacc650bd0ae2f6ebd4b7e70971ce6dad4..640b0b214a97e38a64bb2ef5ad65f35456ae3050 100644 (file)
@@ -408,6 +408,9 @@ inprogressmenu (int gameid)
         {
          while (offset >= len && offset >= max_height)
            offset -= max_height;
+
+         while ((offset > 0) && (offset + max_height > len))
+             offset--;
        }
 
       erase ();
@@ -479,15 +482,16 @@ inprogressmenu (int gameid)
            }
            break;
         case '>':
-          if ((offset + max_height) >= len)
-            break;
-          else
+           if ((offset + max_height) >= len) {
+               if (max_height < len) offset = (len - max_height);
+               else offset = 0;
+           } else
             offset += max_height;
           break;
 
         case '<':
           if ((offset - max_height) < 0)
-            break;
+             offset = 0;
           else
             offset -= max_height;
           break;
@@ -520,6 +524,12 @@ inprogressmenu (int gameid)
         default:
            if (strchr(selectorchars, menuchoice)) {
                int sidx = strchr(selectorchars, menuchoice) - selectorchars;
+
+               if (sidx > max_height) {
+                   selected = -1;
+                   break;
+               }
+
                if (is_nhext[sidx]) /* Cannot watch NhExt game */
                    break;