updated URL of forum and table in readme file
[neverball] / share / gui.c
index 3960d5a..ce284bd 100644 (file)
@@ -226,8 +226,8 @@ void gui_init(void)
     if (TTF_Init() == 0)
     {
         int s0 = s / 26;
-        int s1 = s / 12;
-        int s2 = s /  6;
+        int s1 = s / 13;
+        int s2 = s /  7;
         int m;
 
         /* Make sure text size doesn't exceed the maximum texture size. */
@@ -982,7 +982,7 @@ void gui_layout(int id, int xd, int yd)
 
     /* Hilite the widget under the cursor, if any. */
 
-    gui_point(id, -1, -1);
+    /* gui_point(id, -1, -1); */
 }
 
 int gui_search(int id, int x, int y)
@@ -1168,7 +1168,7 @@ static void gui_paint_count(int id)
                  widget[id].scale,
                  widget[id].scale);
 
-        if (widget[id].value)
+        if (widget[id].value > 0)
         {
             /* Translate left by half the total width of the rendered value. */
 
@@ -1186,7 +1186,7 @@ static void gui_paint_count(int id)
                 glTranslatef((GLfloat) -digit_w[i][j % 10], 0.0f, 0.0f);
             }
         }
-        else
+        else if (widget[id].value == 0)
         {
             /* If the value is zero, just display a zero in place. */
 
@@ -1210,6 +1210,9 @@ static void gui_paint_clock(int id)
     GLfloat dx_large = (GLfloat) digit_w[i][0];
     GLfloat dx_small = (GLfloat) digit_w[i][0] * 0.75f;
 
+    if (widget[id].value < 0)
+        return;
+
     glPushMatrix();
     {
         glColor4fv(gui_wht);
@@ -1430,6 +1433,11 @@ int gui_point(int id, int x, int y)
         return active = jd;
 }
 
+void gui_focus(int i)
+{
+    active = i;
+}
+
 int gui_click(void)
 {
     return active;