[Tux4kids-commits] r768 - tuxtype/trunk/src

dbruce-guest at alioth.debian.org dbruce-guest at alioth.debian.org
Wed Nov 26 02:49:11 UTC 2008


Author: dbruce-guest
Date: 2008-11-26 02:49:10 +0000 (Wed, 26 Nov 2008)
New Revision: 768

Modified:
   tuxtype/trunk/src/titlescreen.c
Log:
Reverted some of cleanup in titlescreen.c because I had messed up Mobin's ChooseWord()



Modified: tuxtype/trunk/src/titlescreen.c
===================================================================
--- tuxtype/trunk/src/titlescreen.c	2008-11-24 13:42:10 UTC (rev 767)
+++ tuxtype/trunk/src/titlescreen.c	2008-11-26 02:49:10 UTC (rev 768)
@@ -1918,62 +1918,72 @@
       case SDL_KEYDOWN:
         i = 1;
 
-        switch (event.key.keysym.sym)
+        if (event.key.keysym.sym == SDLK_BACKSPACE)
         {
-          case SDLK_ESCAPE:
-            settings.use_english = old_use_english;
-            strncpy(settings.theme_data_path, old_theme_path, FNLEN - 1);
-            stop = 1; 
-            break;
+          font = LoadFont(settings.theme_font_name, MENU_FONT_SIZE);
+          len = ConvertFromUTF8(temp, editWordW[loc]);
+          temp[len - 1] = temp[len];
+          len = ConvertToUTF8(temp, editWordW[loc]);
+          titles[loc] = BlackOutline(editWordW[loc], font, &white );
+          len = ConvertFromUTF8(temp, editWordY[loc]);
+          temp[len - 2] = temp[len - 1];
+          temp[len - 1] = temp[len];
+          len = ConvertToUTF8(temp, editWordY[loc]);
+          select[loc] = BlackOutline(editWordY[loc], font, &yellow);
+          TTF_CloseFont(font);
+          font = NULL;
+          break;
+        }
 
-          case SDLK_LEFT:
-          case SDLK_PAGEUP:
-            if (loc - (loc % 8) - 8 >= 0) 
-              loc = loc - (loc % 8) - 8;
-            break;
+        if (event.key.keysym.sym == SDLK_ESCAPE) 
+        {
+          settings.use_english = old_use_english;
+          strncpy(settings.theme_data_path, old_theme_path, FNLEN - 1);
+          stop = 1;
+          break; 
+        }
 
-          case SDLK_RIGHT:
-          case SDLK_PAGEDOWN:
-            if (loc - (loc % 8) + 8 < themes)
-              loc = (loc - (loc % 8) + 8);
-            break;
+        if ((event.key.keysym.sym == SDLK_LEFT)
+         || (event.key.keysym.sym == SDLK_PAGEUP))
+        {
+          if (loc - (loc % 8) - 8 >= 0)
+            loc = loc - (loc % 8) - 8;
+          break;
+        }
 
-          case SDLK_UP:
-            if (loc > 0)
-              loc--;
-            break;
+        if ((event.key.keysym.sym == SDLK_RIGHT)
+         || (event.key.keysym.sym == SDLK_PAGEDOWN))
+        {
+          if (loc - (loc % 8) + 8 < themes)
+            loc = (loc - (loc % 8) + 8);
+          break;
+        }
 
-          case SDLK_DOWN:
-            if (loc + 1 < themes)
-              loc++;
-            break;
+        if (event.key.keysym.sym == SDLK_UP)
+        {
+          if (loc > 0)
+            loc--;
+          break;
+        }
 
-          case SDLK_BACKSPACE:
-            font = LoadFont(settings.theme_font_name, MENU_FONT_SIZE);
-            len = ConvertFromUTF8(temp, editWordW[loc]);
-            temp[len - 1] = temp[len];
-            len = ConvertToUTF8(temp, editWordW[loc]);
-            titles[loc] = BlackOutline(editWordW[loc], font, &white);
-            len = ConvertFromUTF8(temp,editWordY[loc]);
-            temp[len - 2] = temp[len - 1];
-            temp[len - 1] = temp[len];
-            len = ConvertToUTF8(temp,editWordY[loc]);
-            select[loc] = BlackOutline(editWordY[loc], font, &yellow);
-            TTF_CloseFont(font);
-            font = NULL;
-            break;
+        if (event.key.keysym.sym == SDLK_DOWN)
+        {
+          if (loc + 1 < themes)
+            loc++;
+          break;
+        }
 
+        switch (event.key.keysym.sym)
+        {
+          case SDLK_CAPSLOCK:
           case SDLK_RALT:
           case SDLK_LALT:
           case SDLK_RSHIFT:
           case SDLK_LSHIFT:
           case SDLK_RCTRL:
           case SDLK_LCTRL:
-            i = 0;
+            i=0;
             break;
-
-          default:
-            break;
         }
 
         if(i)




More information about the Tux4kids-commits mailing list