[Tux4kids-commits] r1053 - tuxtype/branches/gsoc-sarah/src

Sarah Frisk fou_fou-guest at alioth.debian.org
Tue Jun 16 03:23:53 UTC 2009


Author: fou_fou-guest
Date: 2009-06-16 03:23:52 +0000 (Tue, 16 Jun 2009)
New Revision: 1053

Modified:
   tuxtype/branches/gsoc-sarah/src/titlescreen.c
Log:
Deletes words properly in word editing function.

Modified: tuxtype/branches/gsoc-sarah/src/titlescreen.c
===================================================================
--- tuxtype/branches/gsoc-sarah/src/titlescreen.c	2009-06-15 19:24:21 UTC (rev 1052)
+++ tuxtype/branches/gsoc-sarah/src/titlescreen.c	2009-06-16 03:23:52 UTC (rev 1053)
@@ -1792,16 +1792,34 @@
             len = ConvertToUTF8(temp, words_in_list[loc], FNLEN);
             titles[loc] = BlackOutline(words_in_list[loc], DEFAULT_MENU_FONT_SIZE, &white );                     
             select[loc] = BlackOutline(words_in_list[loc], DEFAULT_MENU_FONT_SIZE, &yellow);  
-          } else {
-            // we have to remove the word from the list // FIX THIS
-            int x = 0;
-            titles[loc] = titles[loc + 1];   
-            select[loc] = select[loc + 1];
-            number_of_words--;
-            if (loc == number_of_words)
-              loc--;
+          } 
+		else {
+            // we have to remove the word from the list // 
+			int x = 0;
+			number_of_words--;
+			for (x = loc; x <= number_of_words; x++)
+			{
+				if (x < number_of_words)
+				{
+					len = ConvertFromUTF8(temp, words_in_list[x + 1], FNLEN);
+					len = ConvertToUTF8(temp, words_in_list[x], FNLEN);
+					titles[x] = BlackOutline(words_in_list[x], DEFAULT_MENU_FONT_SIZE, &white );                     
+		            select[x] = BlackOutline(words_in_list[x], DEFAULT_MENU_FONT_SIZE, &yellow);				
+				}
+				else
+				{
+					titles[x] = NULL;
+					select[x] = NULL;
+				}
+			}
+			if (loc = number_of_words)
+				loc --;
+				
+			titles[loc] = BlackOutline(words_in_list[loc], DEFAULT_MENU_FONT_SIZE, &white );                     
+	        select[loc] = BlackOutline(words_in_list[loc], DEFAULT_MENU_FONT_SIZE, &yellow);	
+		
 			//handle deleation of words better, right now don't really do that
-          }
+         }
           break;
         }
 




More information about the Tux4kids-commits mailing list