[Tux4kids-commits] r763 - in tuxmath/trunk: . doc src

dbruce-guest at alioth.debian.org dbruce-guest at alioth.debian.org
Fri Oct 17 01:29:05 UTC 2008


Author: dbruce-guest
Date: 2008-10-17 01:29:04 +0000 (Fri, 17 Oct 2008)
New Revision: 763

Modified:
   tuxmath/trunk/configure
   tuxmath/trunk/configure.ac
   tuxmath/trunk/doc/changelog
   tuxmath/trunk/src/Makefile.am
   tuxmath/trunk/src/SDL_rotozoom.h
   tuxmath/trunk/src/credits.c
   tuxmath/trunk/src/factroids.c
   tuxmath/trunk/src/tuxmath.h
Log:
Updated credits.c to reflect Tim's role as co-lead programmer.



Modified: tuxmath/trunk/configure
===================================================================
--- tuxmath/trunk/configure	2008-10-15 14:49:35 UTC (rev 762)
+++ tuxmath/trunk/configure	2008-10-17 01:29:04 UTC (rev 763)
@@ -13992,77 +13992,13 @@
 fi
 
 
-{ echo "$as_me:$LINENO: checking for rotozoomSurface in -lSDL_gfx" >&5
-echo $ECHO_N "checking for rotozoomSurface in -lSDL_gfx... $ECHO_C" >&6; }
-if test "${ac_cv_lib_SDL_gfx_rotozoomSurface+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lSDL_gfx  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
+##dnl Check for SDL_gfx:
+##AC_CHECK_LIB([SDL_gfx],
+##	[rotozoomSurface],
+##	LIBS="$LIBS -lSDL_gfx",
+##	[AC_MSG_ERROR([SDL_gfx not found! http://www.ferzkopp.net/joomla/content/view/19/14/])]
+##)
 
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char rotozoomSurface ();
-int
-main ()
-{
-return rotozoomSurface ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
-  ac_cv_lib_SDL_gfx_rotozoomSurface=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_lib_SDL_gfx_rotozoomSurface=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_SDL_gfx_rotozoomSurface" >&5
-echo "${ECHO_T}$ac_cv_lib_SDL_gfx_rotozoomSurface" >&6; }
-if test $ac_cv_lib_SDL_gfx_rotozoomSurface = yes; then
-  LIBS="$LIBS -lSDL_gfx"
-else
-  { { echo "$as_me:$LINENO: error: SDL_gfx not found! http://www.ferzkopp.net/joomla/content/view/19/14/" >&5
-echo "$as_me: error: SDL_gfx not found! http://www.ferzkopp.net/joomla/content/view/19/14/" >&2;}
-   { (exit 1); exit 1; }; }
-
-fi
-
-
 have_sdlpango=no
 # Check whether --enable-sdlpango was given.
 if test "${enable_sdlpango+set}" = set; then

Modified: tuxmath/trunk/configure.ac
===================================================================
--- tuxmath/trunk/configure.ac	2008-10-15 14:49:35 UTC (rev 762)
+++ tuxmath/trunk/configure.ac	2008-10-17 01:29:04 UTC (rev 763)
@@ -96,12 +96,12 @@
 	[AC_MSG_ERROR([SDL_ttf not found! http://www.libsdl.org/projects/SDL_ttf])]
 )
 
-dnl Check for SDL_gfx:
-AC_CHECK_LIB([SDL_gfx],
-	[rotozoomSurface],
-	LIBS="$LIBS -lSDL_gfx",
-	[AC_MSG_ERROR([SDL_gfx not found! http://www.ferzkopp.net/joomla/content/view/19/14/])]
-)
+##dnl Check for SDL_gfx:
+##AC_CHECK_LIB([SDL_gfx],
+##	[rotozoomSurface],
+##	LIBS="$LIBS -lSDL_gfx",
+##	[AC_MSG_ERROR([SDL_gfx not found! http://www.ferzkopp.net/joomla/content/view/19/14/])]
+##)
 
 dnl sdlpango support
 have_sdlpango=no

Modified: tuxmath/trunk/doc/changelog
===================================================================
--- tuxmath/trunk/doc/changelog	2008-10-15 14:49:35 UTC (rev 762)
+++ tuxmath/trunk/doc/changelog	2008-10-17 01:29:04 UTC (rev 763)
@@ -1,3 +1,19 @@
+
+2008.Oct.16 (svn.debian.org/tux4kids - revision 763)
+	Credits: 
+          Changed Tim Holy's listing from "Additional Code" to "Lead
+          Programmer" to better acknowledge his major role over the last
+          year.
+
+        David Bruce <davidstuartbruce at gmail.com>
+
+2008.Oct.14 (svn.debian.org/tux4kids - revision 761)
+	i18n:
+          Added Irish translation courtesy of Seanán Ó Coistín <seananoc at gmail.com> 
+
+        David Bruce <davidstuartbruce at gmail.com>
+
+
 2008.Aug.15 (svn.debian.org/tux4kids - revision 627)
 	Added SDL_rotozoom to the sources, from the SDL_gfx library.
 	

Modified: tuxmath/trunk/src/Makefile.am
===================================================================
--- tuxmath/trunk/src/Makefile.am	2008-10-15 14:49:35 UTC (rev 762)
+++ tuxmath/trunk/src/Makefile.am	2008-10-17 01:29:04 UTC (rev 763)
@@ -38,6 +38,7 @@
 	fileops.c	\
 	ConvertUTF.c	\
 	SDL_extras.c	\
+	SDL_rotozoom.c	\
 	lessons.c	\
 	scandir.c	\
 	pixels.c

Modified: tuxmath/trunk/src/SDL_rotozoom.h
===================================================================
--- tuxmath/trunk/src/SDL_rotozoom.h	2008-10-15 14:49:35 UTC (rev 762)
+++ tuxmath/trunk/src/SDL_rotozoom.h	2008-10-17 01:29:04 UTC (rev 763)
@@ -48,16 +48,19 @@
 
 /* ---- Prototypes */
 
-#ifdef WIN32
-#ifdef BUILD_DLL
-#define DLLINTERFACE __declspec(dllexport)
-#else
-#define DLLINTERFACE __declspec(dllimport)
-#endif
-#else
+// #ifdef WIN32
+// #ifdef BUILD_DLL
+// #define DLLINTERFACE __declspec(dllexport)
+// #else
+// #define DLLINTERFACE __declspec(dllimport)
+// #endif
+// #else
+// #define DLLINTERFACE
+// #endif
+
+/* NOTE inactivating above declspec stuff because we are building */
+/* for our own tree                                               */
 #define DLLINTERFACE
-#endif
-
 /* 
  
  rotozoomSurface()

Modified: tuxmath/trunk/src/credits.c
===================================================================
--- tuxmath/trunk/src/credits.c	2008-10-15 14:49:35 UTC (rev 762)
+++ tuxmath/trunk/src/credits.c	2008-10-17 01:29:04 UTC (rev 763)
@@ -45,6 +45,7 @@
   "BILL KENDRICK,",
   "NEW BREED SOFTWARE",
   "DAVID BRUCE",
+  "TIM HOLY",
   "",
   "-ADDITIONAL CODE",
   "GLEN DITCHFIELD",
@@ -52,7 +53,6 @@
   "DONNY VISZNEKI",
   "YVES COMBE",
   "DAVID YODER",
-  "TIM HOLY",
   "KARL OVE HUFTHAMMER",
   "AHMED SAYED",
   "BRENDAN LUCHEN",
@@ -375,68 +375,68 @@
   quit = 0;
   scroll = 0;
   line = 0;
-
-  subscreen.x = 0;
-  subscreen.y = images[IMG_TITLE]->h;
-  subscreen.w = screen->w;
-  subscreen.h = screen->h - images[IMG_TITLE]->h;
-  quit = scroll_text(credit_text, subscreen, 2);
+
+  subscreen.x = 0;
+  subscreen.y = images[IMG_TITLE]->h;
+  subscreen.w = screen->w;
+  subscreen.h = screen->h - images[IMG_TITLE]->h;
+  quit = scroll_text(credit_text, subscreen, 2);
   
   /* Return the chosen command: */
   
   return quit;
 }
 
-int scroll_text(char* text[], SDL_Rect subscreen, int speed)
-{
-  int done = 0, quit = 0, scroll = 0, clearing = 0;
-  SDL_Event event;
-  SDL_Rect src, dest;
-  Uint32 last_time = SDL_GetTicks(), now_time;
-
-  line = 0;
-    
-  do
-    {
-      /* Handle any incoming events: */
-      while (SDL_PollEvent(&event) > 0)
-        {
-          if (event.type == SDL_QUIT)
-            {
-              /* Window close event - quit! */
-              
-              quit = 1;
-              done = 1;
-            }
-          else if (event.type == SDL_KEYDOWN)
-            {
-              if (event.key.keysym.sym == SDLK_ESCAPE)
-                {
-                  /* Escape key - quit! */
-                  done = 1;
-                }
-            }
-          else if (event.type == SDL_MOUSEBUTTONDOWN)
-            {
-              done = 1;
-            }
-        }
-
-      
-      /* Scroll: */
-
-      src = dest = subscreen;
-      src.y += speed; //amount to scroll by
-      
+int scroll_text(char* text[], SDL_Rect subscreen, int speed)
+{
+  int done = 0, quit = 0, scroll = 0, clearing = 0;
+  SDL_Event event;
+  SDL_Rect src, dest;
+  Uint32 last_time = SDL_GetTicks(), now_time;
+
+  line = 0;
+    
+  do
+    {
+      /* Handle any incoming events: */
+      while (SDL_PollEvent(&event) > 0)
+        {
+          if (event.type == SDL_QUIT)
+            {
+              /* Window close event - quit! */
+              
+              quit = 1;
+              done = 1;
+            }
+          else if (event.type == SDL_KEYDOWN)
+            {
+              if (event.key.keysym.sym == SDLK_ESCAPE)
+                {
+                  /* Escape key - quit! */
+                  done = 1;
+                }
+            }
+          else if (event.type == SDL_MOUSEBUTTONDOWN)
+            {
+              done = 1;
+            }
+        }
+
+      
+      /* Scroll: */
+
+      src = dest = subscreen;
+      src.y += speed; //amount to scroll by
+      
       SDL_BlitSurface(screen, &src, screen, &dest);
-      
-      dest.x = subscreen.x;
-      dest.y = subscreen.y + subscreen.h - speed;
-      dest.w = subscreen.w;
-      dest.h = speed;
-
-      SDL_FillRect(screen, &dest, SDL_MapRGB(screen->format, 0, 0, 0));
-      
+      
+      dest.x = subscreen.x;
+      dest.y = subscreen.y + subscreen.h - speed;
+      dest.w = subscreen.w;
+      dest.h = speed;
+
+      SDL_FillRect(screen, &dest, SDL_MapRGB(screen->format, 0, 0, 0));
+      
       ++scroll;
 
       if (clearing) //scroll/check, but don't display any more text
@@ -445,44 +445,44 @@
             done = 1;
         }
       else
-        {
-          dest.x = subscreen.x + subscreen.w / 2;
-          dest.y = subscreen.y + (subscreen.h - scroll * speed);
-          dest.w = 1;
-          dest.h = 1;
-          draw_text(text[line], dest);
-          
-
-          if (scroll * speed >= TTF_FontHeight(default_font) )
-            {
-              scroll = 0;
-              line++;
-              
-              if (text[line] == NULL) //end of text 
-                {
-                clearing = 1; //scroll to blank            
-                }            
-              else
-                tmdprintf("text[line]: %s\n", text[line]);
+        {
+          dest.x = subscreen.x + subscreen.w / 2;
+          dest.y = subscreen.y + (subscreen.h - scroll * speed);
+          dest.w = 1;
+          dest.h = 1;
+          draw_text(text[line], dest);
+          
+
+          if (scroll * speed >= TTF_FontHeight(default_font) )
+            {
+              scroll = 0;
+              line++;
+              
+              if (text[line] == NULL) //end of text 
+                {
+                clearing = 1; //scroll to blank            
+                }            
+              else
+                tmdprintf("text[line]: %s\n", text[line]);
             }
-        }
-      
-      
-      SDL_Flip(screen);
-      
-      
-      /* Pause (keep frame-rate event) */
-      
-      now_time = SDL_GetTicks();
-      if (now_time < last_time + (1000 / 20))
-        {
-          SDL_Delay(last_time + (1000 / 20) - now_time);
         }
-      last_time = SDL_GetTicks();
-    }
-  while (!done);
-  return quit;
-}
+      
+      
+      SDL_Flip(screen);
+      
+      
+      /* Pause (keep frame-rate event) */
+      
+      now_time = SDL_GetTicks();
+      if (now_time < last_time + (1000 / 20))
+        {
+          SDL_Delay(last_time + (1000 / 20) - now_time);
+        }
+      last_time = SDL_GetTicks();
+    }
+  while (!done);
+  return quit;
+}
 #if 0 //really cool effect, but not translatable. I'll leave it in in case we 
       //decide to use it e.g. only for English
 void draw_text(char * str, int offset)
@@ -567,33 +567,33 @@
 
 //FIXME it's possible that generating the surface every frame taxes 
 //slower machines. If so consider returning the surface to be used 
-//as long as it's needed.
-void draw_text(char* str, SDL_Rect dest)
-{
-  int hloffset = 0;
-  SDL_Color col;
-  SDL_Surface* surf = NULL;
-  if (!str || *str == '\0')
-    return;
+//as long as it's needed.
+void draw_text(char* str, SDL_Rect dest)
+{
+  int hloffset = 0;
+  SDL_Color col;
+  SDL_Surface* surf = NULL;
+  if (!str || *str == '\0')
+    return;
 
   tmdprintf("Entering draw_text(%s)\n", str);
-  
-  if (str[0] == '-') //highlight text
-  {
-    hloffset = 1;
-    col.r = 128;
-    col.g = 192;
-    col.b = 255 - (40);
-  }
-  else //normal color
-  {
-    col.r = 255 - (line % 256);
-    col.g = 255 / 2;
-    col.b = (line * line * 2) % 256;  
-  }
-  
-#ifndef SDL_Pango
-  surf = TTF_RenderUTF8_Blended(default_font, str+hloffset, col);
+  
+  if (str[0] == '-') //highlight text
+  {
+    hloffset = 1;
+    col.r = 128;
+    col.g = 192;
+    col.b = 255 - (40);
+  }
+  else //normal color
+  {
+    col.r = 255 - (line % 256);
+    col.g = 255 / 2;
+    col.b = (line * line * 2) % 256;  
+  }
+  
+#ifndef SDL_Pango
+  surf = TTF_RenderUTF8_Blended(default_font, str+hloffset, col);
 #else
   printf("Using Pango\n");
   
@@ -603,21 +603,21 @@
     col.b,  col.b, 0, 0,
     0,      255,   0, 0,
   };
-  
-  if( context != NULL)
-  {
-    SDLPango_SetDefaultColor(context, &colormatrix );
-    SDLPango_SetText(context, str, -1);
-    surf = SDLPango_CreateSurfaceDraw(context);
-  }
-  else {
-    surf = TTF_RenderUTF8_Blended(default_font, str+hloffset, col);
-  }
-#endif
-  
-  dest.x -= surf->w / 2; //center text
-  SDL_BlitSurface(surf, NULL, screen, &dest);
-  SDL_FreeSurface(surf);
-  tmdprintf("done\n");
-}
-#endif
+  
+  if( context != NULL)
+  {
+    SDLPango_SetDefaultColor(context, &colormatrix );
+    SDLPango_SetText(context, str, -1);
+    surf = SDLPango_CreateSurfaceDraw(context);
+  }
+  else {
+    surf = TTF_RenderUTF8_Blended(default_font, str+hloffset, col);
+  }
+#endif
+  
+  dest.x -= surf->w / 2; //center text
+  SDL_BlitSurface(surf, NULL, screen, &dest);
+  SDL_FreeSurface(surf);
+  tmdprintf("done\n");
+}
+#endif

Modified: tuxmath/trunk/src/factroids.c
===================================================================
--- tuxmath/trunk/src/factroids.c	2008-10-15 14:49:35 UTC (rev 762)
+++ tuxmath/trunk/src/factroids.c	2008-10-17 01:29:04 UTC (rev 763)
@@ -38,6 +38,7 @@
 #include "titlescreen.h"
 #include "options.h"
 #include "SDL_extras.h"
+#include "SDL_rotozoom.h"
 
 #define FPS 15                     /* 15 frames per second */
 #define MS_PER_FRAME (1000 / FPS)
@@ -183,6 +184,8 @@
 
 /*************** The Factor and Faraction Activiy game Functions ***************/
 
+/* Local function prototypes: */
+
 static int FF_init(void);
 static void FF_intro(void);
 
@@ -211,8 +214,8 @@
 static int is_prime(int num);
 static int fast_cos(int angle);
 static int fast_sin(int angle);
+static void game_handle_user_events(void);
 
-
 /************** factors(): The factor main function ********************/
 void factors(void){
 
@@ -235,15 +238,18 @@
     return;
   } 
   
-  while (game_status==GAME_IN_PROGRESS){
-      last_time = SDL_GetTicks();
-      counter++; 
+  while (game_status==GAME_IN_PROGRESS)
+  {
+    last_time = SDL_GetTicks();
+    counter++; 
     
-      if(counter%15==0)
-        if(tux_img<IMG_TUX_CONSOLE4)
-          tux_img++;
-        else 
-          tux_img=IMG_TUX_CONSOLE1;
+    if(counter%15==0)
+    {
+      if(tux_img<IMG_TUX_CONSOLE4)
+        tux_img++;
+      else 
+        tux_img=IMG_TUX_CONSOLE1;
+    }
 
     game_handle_user_events();
 
@@ -291,7 +297,8 @@
 }
 
 /************** fractions(): The fractions main function ********************/
-void fractions(void){
+void fractions(void)
+{
 
   Uint32 last_time, now_time; 
   
@@ -315,59 +322,63 @@
   } 
 
   /************ Main Loop **************/
-  while (game_status==GAME_IN_PROGRESS){
-      last_time = SDL_GetTicks();
-      counter++;
+  while (game_status == GAME_IN_PROGRESS)
+  {
+    last_time = SDL_GetTicks();
+    counter++;
       
-      if(counter%15==0)
-        if(tux_img<IMG_TUX_CONSOLE4)
-          tux_img++;
-        else 
-          tux_img=IMG_TUX_CONSOLE1;
+    if(counter%15==0)
+    {    
+      if(tux_img<IMG_TUX_CONSOLE4)
+        tux_img++;
+      else 
+        tux_img=IMG_TUX_CONSOLE1;
+    }
 
-      game_handle_user_events();
+    game_handle_user_events();
 
-      FF_handle_ship();
-      FF_handle_asteroids();
-      FF_handle_answer();
-      FF_draw();
-      SDL_Flip(screen);
+    FF_handle_ship();
+    FF_handle_asteroids();
+    FF_handle_answer();
+    FF_draw();
+    SDL_Flip(screen);
 
-      game_status = check_exit_conditions();
+    game_status = check_exit_conditions();
 
-      if (paused)
-      {
-        pause_game();
-        paused = 0;
-      }
+    if (paused)
+    {
+      pause_game();
+      paused = 0;
+    }
 
 
 #ifndef NOSOUND
-      if (Opts_UsingSound())
+    if (Opts_UsingSound())
+    {
+      if (!Mix_PlayingMusic())
       {
-        if (!Mix_PlayingMusic())
-        {
-	    Mix_PlayMusic(musics[MUS_GAME + (rand() % 3)], 0);
-        }  
-      }
+        Mix_PlayMusic(musics[MUS_GAME + (rand() % 3)], 0);
+      }  
+    }
 #endif
 
-      /* Pause (keep frame-rate event) */
-      now_time = SDL_GetTicks();
-      if (now_time < last_time + MS_PER_FRAME)
-      {
+    /* Pause (keep frame-rate event) */
+    now_time = SDL_GetTicks();
+    if (now_time < last_time + MS_PER_FRAME)
+    {
         //Prevent any possibility of a time wrap-around
         // (this is a very unlikely problem unless there is an SDL bug
         //  or you leave tuxmath running for 49 days...)
-        now_time = (last_time+MS_PER_FRAME) - now_time;  // this holds the delay
-        if (now_time > MS_PER_FRAME)
-	  now_time = MS_PER_FRAME;
-        SDL_Delay(now_time);
-      }
+      now_time = (last_time+MS_PER_FRAME) - now_time;  // this holds the delay
+      if (now_time > MS_PER_FRAME)
+        now_time = MS_PER_FRAME;
+      SDL_Delay(now_time);
+    }
   }
   FF_over(game_status);
 }
 
+
 /************ Initialize all vars... ****************/
 static int FF_init(void){
   int i;
@@ -492,7 +503,7 @@
   static SDL_Surface* IMG_factors;
   static SDL_Surface* IMG_fractions;
 
-  SDL_Event event;
+//  SDL_Event event;
   SDL_Rect rect;
 
   float zoom;

Modified: tuxmath/trunk/src/tuxmath.h
===================================================================
--- tuxmath/trunk/src/tuxmath.h	2008-10-15 14:49:35 UTC (rev 762)
+++ tuxmath/trunk/src/tuxmath.h	2008-10-17 01:29:04 UTC (rev 763)
@@ -37,6 +37,7 @@
 
 #include "SDL.h"
 #include "SDL_ttf.h"
+#include "SDL_image.h"
 
 #ifndef NOSOUND
 #include "SDL_mixer.h"




More information about the Tux4kids-commits mailing list