[Tux4kids-commits] r600 - tuxtype/branches/soc3/src

sreyas-guest at alioth.debian.org sreyas-guest at alioth.debian.org
Sun Aug 10 12:53:01 UTC 2008


Author: sreyas-guest
Date: 2008-08-10 12:53:00 +0000 (Sun, 10 Aug 2008)
New Revision: 600

Modified:
   tuxtype/branches/soc3/src/alphabet.c
   tuxtype/branches/soc3/src/funcs.h
   tuxtype/branches/soc3/src/practice.c
Log:
GetWhiteGlyph(65) bug removed

Modified: tuxtype/branches/soc3/src/alphabet.c
===================================================================
--- tuxtype/branches/soc3/src/alphabet.c	2008-08-09 16:22:36 UTC (rev 599)
+++ tuxtype/branches/soc3/src/alphabet.c	2008-08-10 12:53:00 UTC (rev 600)
@@ -316,6 +316,13 @@
 				else
 							sprintf(buf,"keyboard/keyboard_D12.png", settings.default_data_path);			
 }
+wchar_t GetLastKey()
+{
+	if(!num_chars_used)
+		return -1;
+	else
+		return keyboard_list[num_chars_used-1].unicode_value;
+} 
 int unicode_in_key_list(wchar_t uni_char)
 {
   int i = 0;

Modified: tuxtype/branches/soc3/src/funcs.h
===================================================================
--- tuxtype/branches/soc3/src/funcs.h	2008-08-09 16:22:36 UTC (rev 599)
+++ tuxtype/branches/soc3/src/funcs.h	2008-08-10 12:53:00 UTC (rev 600)
@@ -56,6 +56,7 @@
 void GenerateKeyboard(SDL_Surface* keyboard);
 void updatekeylist(int key,char ch);
 void savekeyboard(void);
+wchar_t GetLastKey(void);
 
 //void UseAlphabet(void);
 

Modified: tuxtype/branches/soc3/src/practice.c
===================================================================
--- tuxtype/branches/soc3/src/practice.c	2008-08-09 16:22:36 UTC (rev 599)
+++ tuxtype/branches/soc3/src/practice.c	2008-08-10 12:53:00 UTC (rev 600)
@@ -97,11 +97,11 @@
   if (!wcsncmp(phrase[0], (wchar_t*)"", 1))
     wcsncpy(pphrase, phrase[0], 80);
 
-  srfc = GetWhiteGlyph(65);
+  srfc = GetWhiteGlyph(GetLastKey());
 
   if (!srfc)
   {
-    fprintf(stderr, "Phrases() - GetWhiteGlyph(65) not defined - bailing out.\n");
+    fprintf(stderr, "Phrases() - GetWhiteGlyph(GetLastKey()) not defined - bailing out.\n");
     return 0;
   }
 
@@ -787,8 +787,8 @@
   SDL_Surface* surf = NULL;
   letter_loc.x = x;
   letter_loc.y = y;
-  letter_loc.w = GetWhiteGlyph(65)->w;
-  letter_loc.h = GetWhiteGlyph(65)->h;
+  letter_loc.w = GetWhiteGlyph(GetLastKey())->w;
+  letter_loc.h = GetWhiteGlyph(GetLastKey())->h;
 
   LOG("Entering print_at()\n");
 




More information about the Tux4kids-commits mailing list