[Tux4kids-commits] r561 - in tuxtype/branches/soc3: data/images/keyboard src

sreyas-guest at alioth.debian.org sreyas-guest at alioth.debian.org
Fri Jul 4 16:13:02 UTC 2008


Author: sreyas-guest
Date: 2008-07-04 16:13:01 +0000 (Fri, 04 Jul 2008)
New Revision: 561

Modified:
   tuxtype/branches/soc3/data/images/keyboard/keyboard.png
   tuxtype/branches/soc3/data/images/keyboard/keyboard_A00.png
   tuxtype/branches/soc3/data/images/keyboard/keyboard_A01.png
   tuxtype/branches/soc3/data/images/keyboard/keyboard_A02.png
   tuxtype/branches/soc3/data/images/keyboard/keyboard_A03.png
   tuxtype/branches/soc3/data/images/keyboard/keyboard_A04.png
   tuxtype/branches/soc3/data/images/keyboard/keyboard_A05.png
   tuxtype/branches/soc3/data/images/keyboard/keyboard_A06.png
   tuxtype/branches/soc3/data/images/keyboard/keyboard_A07.png
   tuxtype/branches/soc3/data/images/keyboard/keyboard_A08.png
   tuxtype/branches/soc3/data/images/keyboard/keyboard_A09.png
   tuxtype/branches/soc3/data/images/keyboard/keyboard_A10.png
   tuxtype/branches/soc3/data/images/keyboard/keyboard_A11.png
   tuxtype/branches/soc3/data/images/keyboard/keyboard_A12.png
   tuxtype/branches/soc3/data/images/keyboard/keyboard_A13.png
   tuxtype/branches/soc3/data/images/keyboard/keyboard_B00.png
   tuxtype/branches/soc3/data/images/keyboard/keyboard_B01.png
   tuxtype/branches/soc3/data/images/keyboard/keyboard_B02.png
   tuxtype/branches/soc3/data/images/keyboard/keyboard_B03.png
   tuxtype/branches/soc3/data/images/keyboard/keyboard_B04.png
   tuxtype/branches/soc3/data/images/keyboard/keyboard_B05.png
   tuxtype/branches/soc3/data/images/keyboard/keyboard_B06.png
   tuxtype/branches/soc3/data/images/keyboard/keyboard_B07.png
   tuxtype/branches/soc3/data/images/keyboard/keyboard_B08.png
   tuxtype/branches/soc3/data/images/keyboard/keyboard_B09.png
   tuxtype/branches/soc3/data/images/keyboard/keyboard_B10.png
   tuxtype/branches/soc3/data/images/keyboard/keyboard_B11.png
   tuxtype/branches/soc3/data/images/keyboard/keyboard_B12.png
   tuxtype/branches/soc3/data/images/keyboard/keyboard_B13.png
   tuxtype/branches/soc3/data/images/keyboard/keyboard_C00.png
   tuxtype/branches/soc3/data/images/keyboard/keyboard_C01.png
   tuxtype/branches/soc3/data/images/keyboard/keyboard_C02.png
   tuxtype/branches/soc3/data/images/keyboard/keyboard_C03.png
   tuxtype/branches/soc3/data/images/keyboard/keyboard_C04.png
   tuxtype/branches/soc3/data/images/keyboard/keyboard_C05.png
   tuxtype/branches/soc3/data/images/keyboard/keyboard_C06.png
   tuxtype/branches/soc3/data/images/keyboard/keyboard_C07.png
   tuxtype/branches/soc3/data/images/keyboard/keyboard_C08.png
   tuxtype/branches/soc3/data/images/keyboard/keyboard_C09.png
   tuxtype/branches/soc3/data/images/keyboard/keyboard_C10.png
   tuxtype/branches/soc3/data/images/keyboard/keyboard_C11.png
   tuxtype/branches/soc3/data/images/keyboard/keyboard_C12.png
   tuxtype/branches/soc3/data/images/keyboard/keyboard_D00.png
   tuxtype/branches/soc3/data/images/keyboard/keyboard_D01.png
   tuxtype/branches/soc3/data/images/keyboard/keyboard_D02.png
   tuxtype/branches/soc3/data/images/keyboard/keyboard_D03.png
   tuxtype/branches/soc3/data/images/keyboard/keyboard_D04.png
   tuxtype/branches/soc3/data/images/keyboard/keyboard_D05.png
   tuxtype/branches/soc3/data/images/keyboard/keyboard_D06.png
   tuxtype/branches/soc3/data/images/keyboard/keyboard_D07.png
   tuxtype/branches/soc3/data/images/keyboard/keyboard_D08.png
   tuxtype/branches/soc3/data/images/keyboard/keyboard_D09.png
   tuxtype/branches/soc3/data/images/keyboard/keyboard_D10.png
   tuxtype/branches/soc3/data/images/keyboard/keyboard_D11.png
   tuxtype/branches/soc3/data/images/keyboard/keyboard_D12.png
   tuxtype/branches/soc3/data/images/keyboard/keyboard_E00.png
   tuxtype/branches/soc3/data/images/keyboard/keyboard_E01.png
   tuxtype/branches/soc3/data/images/keyboard/keyboard_E02.png
   tuxtype/branches/soc3/data/images/keyboard/keyboard_E03.png
   tuxtype/branches/soc3/data/images/keyboard/keyboard_E04.png
   tuxtype/branches/soc3/data/images/keyboard/keyboard_E05.png
   tuxtype/branches/soc3/data/images/keyboard/keyboard_E06.png
   tuxtype/branches/soc3/data/images/keyboard/keyboard_E07.png
   tuxtype/branches/soc3/data/images/keyboard/keyboard_None.png
   tuxtype/branches/soc3/src/practice.c
Log:


Modified: tuxtype/branches/soc3/data/images/keyboard/keyboard.png
===================================================================
(Binary files differ)

Modified: tuxtype/branches/soc3/data/images/keyboard/keyboard_A00.png
===================================================================
(Binary files differ)

Modified: tuxtype/branches/soc3/data/images/keyboard/keyboard_A01.png
===================================================================
(Binary files differ)

Modified: tuxtype/branches/soc3/data/images/keyboard/keyboard_A02.png
===================================================================
(Binary files differ)

Modified: tuxtype/branches/soc3/data/images/keyboard/keyboard_A03.png
===================================================================
(Binary files differ)

Modified: tuxtype/branches/soc3/data/images/keyboard/keyboard_A04.png
===================================================================
(Binary files differ)

Modified: tuxtype/branches/soc3/data/images/keyboard/keyboard_A05.png
===================================================================
(Binary files differ)

Modified: tuxtype/branches/soc3/data/images/keyboard/keyboard_A06.png
===================================================================
(Binary files differ)

Modified: tuxtype/branches/soc3/data/images/keyboard/keyboard_A07.png
===================================================================
(Binary files differ)

Modified: tuxtype/branches/soc3/data/images/keyboard/keyboard_A08.png
===================================================================
(Binary files differ)

Modified: tuxtype/branches/soc3/data/images/keyboard/keyboard_A09.png
===================================================================
(Binary files differ)

Modified: tuxtype/branches/soc3/data/images/keyboard/keyboard_A10.png
===================================================================
(Binary files differ)

Modified: tuxtype/branches/soc3/data/images/keyboard/keyboard_A11.png
===================================================================
(Binary files differ)

Modified: tuxtype/branches/soc3/data/images/keyboard/keyboard_A12.png
===================================================================
(Binary files differ)

Modified: tuxtype/branches/soc3/data/images/keyboard/keyboard_A13.png
===================================================================
(Binary files differ)

Modified: tuxtype/branches/soc3/data/images/keyboard/keyboard_B00.png
===================================================================
(Binary files differ)

Modified: tuxtype/branches/soc3/data/images/keyboard/keyboard_B01.png
===================================================================
(Binary files differ)

Modified: tuxtype/branches/soc3/data/images/keyboard/keyboard_B02.png
===================================================================
(Binary files differ)

Modified: tuxtype/branches/soc3/data/images/keyboard/keyboard_B03.png
===================================================================
(Binary files differ)

Modified: tuxtype/branches/soc3/data/images/keyboard/keyboard_B04.png
===================================================================
(Binary files differ)

Modified: tuxtype/branches/soc3/data/images/keyboard/keyboard_B05.png
===================================================================
(Binary files differ)

Modified: tuxtype/branches/soc3/data/images/keyboard/keyboard_B06.png
===================================================================
(Binary files differ)

Modified: tuxtype/branches/soc3/data/images/keyboard/keyboard_B07.png
===================================================================
(Binary files differ)

Modified: tuxtype/branches/soc3/data/images/keyboard/keyboard_B08.png
===================================================================
(Binary files differ)

Modified: tuxtype/branches/soc3/data/images/keyboard/keyboard_B09.png
===================================================================
(Binary files differ)

Modified: tuxtype/branches/soc3/data/images/keyboard/keyboard_B10.png
===================================================================
(Binary files differ)

Modified: tuxtype/branches/soc3/data/images/keyboard/keyboard_B11.png
===================================================================
(Binary files differ)

Modified: tuxtype/branches/soc3/data/images/keyboard/keyboard_B12.png
===================================================================
(Binary files differ)

Modified: tuxtype/branches/soc3/data/images/keyboard/keyboard_B13.png
===================================================================
(Binary files differ)

Modified: tuxtype/branches/soc3/data/images/keyboard/keyboard_C00.png
===================================================================
(Binary files differ)

Modified: tuxtype/branches/soc3/data/images/keyboard/keyboard_C01.png
===================================================================
(Binary files differ)

Modified: tuxtype/branches/soc3/data/images/keyboard/keyboard_C02.png
===================================================================
(Binary files differ)

Modified: tuxtype/branches/soc3/data/images/keyboard/keyboard_C03.png
===================================================================
(Binary files differ)

Modified: tuxtype/branches/soc3/data/images/keyboard/keyboard_C04.png
===================================================================
(Binary files differ)

Modified: tuxtype/branches/soc3/data/images/keyboard/keyboard_C05.png
===================================================================
(Binary files differ)

Modified: tuxtype/branches/soc3/data/images/keyboard/keyboard_C06.png
===================================================================
(Binary files differ)

Modified: tuxtype/branches/soc3/data/images/keyboard/keyboard_C07.png
===================================================================
(Binary files differ)

Modified: tuxtype/branches/soc3/data/images/keyboard/keyboard_C08.png
===================================================================
(Binary files differ)

Modified: tuxtype/branches/soc3/data/images/keyboard/keyboard_C09.png
===================================================================
(Binary files differ)

Modified: tuxtype/branches/soc3/data/images/keyboard/keyboard_C10.png
===================================================================
(Binary files differ)

Modified: tuxtype/branches/soc3/data/images/keyboard/keyboard_C11.png
===================================================================
(Binary files differ)

Modified: tuxtype/branches/soc3/data/images/keyboard/keyboard_C12.png
===================================================================
(Binary files differ)

Modified: tuxtype/branches/soc3/data/images/keyboard/keyboard_D00.png
===================================================================
(Binary files differ)

Modified: tuxtype/branches/soc3/data/images/keyboard/keyboard_D01.png
===================================================================
(Binary files differ)

Modified: tuxtype/branches/soc3/data/images/keyboard/keyboard_D02.png
===================================================================
(Binary files differ)

Modified: tuxtype/branches/soc3/data/images/keyboard/keyboard_D03.png
===================================================================
(Binary files differ)

Modified: tuxtype/branches/soc3/data/images/keyboard/keyboard_D04.png
===================================================================
(Binary files differ)

Modified: tuxtype/branches/soc3/data/images/keyboard/keyboard_D05.png
===================================================================
(Binary files differ)

Modified: tuxtype/branches/soc3/data/images/keyboard/keyboard_D06.png
===================================================================
(Binary files differ)

Modified: tuxtype/branches/soc3/data/images/keyboard/keyboard_D07.png
===================================================================
(Binary files differ)

Modified: tuxtype/branches/soc3/data/images/keyboard/keyboard_D08.png
===================================================================
(Binary files differ)

Modified: tuxtype/branches/soc3/data/images/keyboard/keyboard_D09.png
===================================================================
(Binary files differ)

Modified: tuxtype/branches/soc3/data/images/keyboard/keyboard_D10.png
===================================================================
(Binary files differ)

Modified: tuxtype/branches/soc3/data/images/keyboard/keyboard_D11.png
===================================================================
(Binary files differ)

Modified: tuxtype/branches/soc3/data/images/keyboard/keyboard_D12.png
===================================================================
(Binary files differ)

Modified: tuxtype/branches/soc3/data/images/keyboard/keyboard_E00.png
===================================================================
(Binary files differ)

Modified: tuxtype/branches/soc3/data/images/keyboard/keyboard_E01.png
===================================================================
(Binary files differ)

Modified: tuxtype/branches/soc3/data/images/keyboard/keyboard_E02.png
===================================================================
(Binary files differ)

Modified: tuxtype/branches/soc3/data/images/keyboard/keyboard_E03.png
===================================================================
(Binary files differ)

Modified: tuxtype/branches/soc3/data/images/keyboard/keyboard_E04.png
===================================================================
(Binary files differ)

Modified: tuxtype/branches/soc3/data/images/keyboard/keyboard_E05.png
===================================================================
(Binary files differ)

Modified: tuxtype/branches/soc3/data/images/keyboard/keyboard_E06.png
===================================================================
(Binary files differ)

Modified: tuxtype/branches/soc3/data/images/keyboard/keyboard_E07.png
===================================================================
(Binary files differ)

Modified: tuxtype/branches/soc3/data/images/keyboard/keyboard_None.png
===================================================================
(Binary files differ)

Modified: tuxtype/branches/soc3/src/practice.c
===================================================================
--- tuxtype/branches/soc3/src/practice.c	2008-07-03 06:37:07 UTC (rev 560)
+++ tuxtype/branches/soc3/src/practice.c	2008-07-04 16:13:01 UTC (rev 561)
@@ -8,6 +8,9 @@
 
 Revised extensively: 2007
 David Bruce <dbruce at tampabay.rr.com>
+Revised extensively: 2008
+Sreyas K <dbruce at tampabay.rr.com>
+
 ***************************************************************************/
 
 /***************************************************************************
@@ -23,12 +26,10 @@
 #include "funcs.h"
 
 static SDL_Surface* bg = NULL;
-static SDL_Surface* hands = NULL; 
 static SDL_Surface* keyboard = NULL;
 static SDL_Surface* keypress1 = NULL;
 static SDL_Surface* keypress2 = NULL;
-static SDL_Surface* hand[11] = {NULL};
-static SDL_Rect hand_loc, letter_loc,keyboard_loc;
+static SDL_Rect letter_loc,keyboard_loc;
 static TTF_Font* font = NULL;
 static wchar_t phrase[255][FNLEN];
 
@@ -85,7 +86,6 @@
   }
 
   SDL_BlitSurface(bg, NULL, screen, NULL);
-  SDL_BlitSurface(hands, NULL, screen, &hand_loc);
   SDL_BlitSurface(keyboard, NULL, screen, &keyboard_loc);
   SDL_Flip(screen);
 
@@ -137,7 +137,6 @@
     {
       case 0:
         start = SDL_GetTicks();
-        SDL_BlitSurface(hands, NULL, screen, &hand_loc);
         SDL_BlitSurface(keyboard, NULL, screen, &keyboard_loc);
         state = 1;
         break;
@@ -152,10 +151,16 @@
           int fing = GetFinger(key);
           keypress1= GetKeypress1(key);
           keypress2= GetKeypress2(key);
-          /*if (!keypress1)
-          if((!keypress2)*/      
-          if (fing >= 0) 
-            SDL_BlitSurface(hand[fing], NULL, screen, &hand_loc);
+          if (!keypress1)
+          {
+				fprintf(stderr, "Phrases() - GetKeypress1 failed, returning.\n");
+				return 0;
+          }
+          if(!keypress2)
+          {
+				fprintf(stderr, "Phrases() - GetKeypress2 failed, returning.\n");
+				return 0;
+          }      
           SDL_BlitSurface(keypress1, NULL, screen, &keyboard_loc);
           SDL_BlitSurface(keypress2, NULL, screen, &keyboard_loc);
           SDL_FreeSurface(keypress1);
@@ -172,7 +177,6 @@
         break;
 
       case 3:
-       SDL_BlitSurface(hands, NULL, screen, &hand_loc);
        state = 12;
        break;  
 
@@ -182,8 +186,16 @@
           int fing = GetFinger(key);
           keypress1= GetKeypress1(key);
           keypress2= GetKeypress2(key);
-          if (fing >= 0) 
-            SDL_BlitSurface(hand[fing], NULL, screen, &hand_loc);
+                    if (!keypress1)
+          {
+				fprintf(stderr, "Phrases() - GetKeypress1 failed, returning.\n");
+				return 0;
+          }
+          if(!keypress2)
+          {
+				fprintf(stderr, "Phrases() - GetKeypress2 failed, returning.\n");
+				return 0;
+          }      
           SDL_BlitSurface(keypress1, NULL, screen, &keyboard_loc);
           SDL_BlitSurface(keypress2, NULL, screen, &keyboard_loc);
           SDL_FreeSurface(keypress1);
@@ -313,23 +325,13 @@
   LOG("Loading practice media\n");
 
 
-  hands = LoadImage("hands/hands.png", IMG_ALPHA);
-	keyboard = LoadImage("keyboard/keyboard.png", IMG_ALPHA);
+  keyboard = LoadImage("keyboard/keyboard.png", IMG_ALPHA);
   bg = LoadImage("main_bkg.png", IMG_ALPHA);
   wrong = LoadSound("tock.wav");
   font = LoadFont(settings.theme_font_name, 30);
 
-  for (i = 0; i < 10; i++)
-  {
-    sprintf(fn, "hands/%d.png", i);
-    hand[i] = LoadImage(fn, IMG_ALPHA);
-    if (!hand[i])
-      load_failed = 1;
-  }
-
   /* Get out if anything failed to load: */
   if (load_failed
-    ||!hands
     ||!bg
     ||!wrong
     ||!font)
@@ -339,12 +341,7 @@
     return 0;
   }
 
-  /* Should be safe from here on out: */
-  hand_loc.x = (screen->w/2) - (hand[0]->w/2);
-  hand_loc.y = screen->h - (hand[0]->h);
-  hand_loc.w = (hand[0]->w);
-  hand_loc.h = (hand[0]->h);
-
+  
 	/********Position of keyboard image*/
   keyboard_loc.x = screen->w/2 -keyboard->w/2; 
   keyboard_loc.y = screen->h/2;
@@ -367,18 +364,9 @@
 	int i;
 	SDL_FreeSurface(bg);
         bg = NULL;
-	SDL_FreeSurface(hands);
-        hands = NULL;
-   SDL_FreeSurface(keyboard);
+	SDL_FreeSurface(keyboard);
         keyboard = NULL;
 	//TTF_CloseFont(font);
-
-	for (i=0; i<10; i++) 
-        {
-          SDL_FreeSurface(hand[i]);
-          hand[i] = NULL;
-        }
-
 	Mix_FreeChunk(wrong);
 	wrong = NULL;
 }




More information about the Tux4kids-commits mailing list