[Tux4kids-commits] r231 - in tuxmath/trunk: . data/fonts data/images/sprites data/missions/lessons docs src

dbruce-guest at alioth.debian.org dbruce-guest at alioth.debian.org
Fri Sep 7 15:04:35 UTC 2007


Author: dbruce-guest
Date: 2007-09-07 15:04:35 +0000 (Fri, 07 Sep 2007)
New Revision: 231

Added:
   tuxmath/trunk/configure.ac
   tuxmath/trunk/data/missions/lessons/lesson08.1
Removed:
   tuxmath/trunk/autogen.sh
   tuxmath/trunk/configure.in
   tuxmath/trunk/data/fonts/AndikaDesRevA.ttf
Modified:
   tuxmath/trunk/config.h.in
   tuxmath/trunk/data/fonts/Makefile.am
   tuxmath/trunk/data/images/sprites/Makefile.in
   tuxmath/trunk/data/missions/lessons/Makefile.am
   tuxmath/trunk/docs/INSTALL.txt
   tuxmath/trunk/docs/changelog
   tuxmath/trunk/src/Makefile.in
   tuxmath/trunk/src/fileops.c
   tuxmath/trunk/src/game.c
   tuxmath/trunk/src/setup.c
   tuxmath/trunk/src/titlescreen.c
   tuxmath/trunk/src/tuxmath.h
Log:
Fix of redrawing for "Custom Game"; update of changelog to reflect memory-related bugfix by TH; make sure program writes default settings into user config file when being 
run for first time; re-name of "configure.in" to "configure.ac"; version increment to 1.5.4


Deleted: tuxmath/trunk/autogen.sh
===================================================================
--- tuxmath/trunk/autogen.sh	2007-09-07 08:08:51 UTC (rev 230)
+++ tuxmath/trunk/autogen.sh	2007-09-07 15:04:35 UTC (rev 231)
@@ -1,3 +0,0 @@
-#!/bin/sh
-aclocal && autoheader && autoconf && automake --add-missing --copy
-

Modified: tuxmath/trunk/config.h.in
===================================================================
--- tuxmath/trunk/config.h.in	2007-09-07 08:08:51 UTC (rev 230)
+++ tuxmath/trunk/config.h.in	2007-09-07 15:04:35 UTC (rev 231)
@@ -1,4 +1,4 @@
-/* config.h.in.  Generated from configure.in by autoheader.  */
+/* config.h.in.  Generated from configure.ac by autoheader.  */
 
 /* Native MinGW32 build */
 #undef BUILD_MINGW32

Copied: tuxmath/trunk/configure.ac (from rev 212, tuxmath/trunk/configure.in)
===================================================================
--- tuxmath/trunk/configure.ac	                        (rev 0)
+++ tuxmath/trunk/configure.ac	2007-09-07 15:04:35 UTC (rev 231)
@@ -0,0 +1,164 @@
+#                                               -*- Autoconf -*-
+# Process this file with autoconf to produce a configure script.
+AC_INIT(tuxmath, 1.5.3, tuxmath-devel at lists.sourceforge.net)
+
+#AC_PREREQ(2.59)
+AC_CANONICAL_HOST
+AC_CANONICAL_TARGET
+
+AM_INIT_AUTOMAKE(tuxmath, 1.5.3)
+AM_CONFIG_HEADER(config.h)
+AM_MAINTAINER_MODE
+
+NAME_VERSION=$PACKAGE-$VERSION
+
+AC_DEFINE_UNQUOTED([PROGRAM_NAME], "$PACKAGE", [Name of the Program])
+
+AC_SUBST(NAME_VERSION)
+
+# Checks for programs.
+AC_PROG_CC
+AC_PROG_MAKE_SET
+
+dnl Check for SDL 
+SDL_VERSION=1.2.0
+
+AM_PATH_SDL($SDL_VERSION, :,
+         AC_MSG_ERROR([*** SDL version $SDL_VERSION not found!]) 
+) 
+
+CFLAGS="$CFLAGS $SDL_CFLAGS" 
+
+# Check platform - see if WinMain needed:
+AC_MSG_CHECKING([for native Win32])
+case "$host" in
+  *-*-mingw*)
+    native_win32=yes
+    ;;
+  *)
+    native_win32=no
+    ;;
+esac
+AC_MSG_RESULT([$native_win32])
+
+AM_CONDITIONAL(BUILD_MINGW32, test "$native_win32" = yes)
+if test "$native_win32" = yes; then
+   LIBS="$LIBS -lmingw32 -lSDLmain"
+fi
+
+
+LIBS="$LIBS $SDL_LIBS"
+
+# Checks for libraries.
+dnl Check for SDL_image: 
+AC_CHECK_LIB([SDL_image], 
+       [IMG_Load], 
+       LIBS="$LIBS -lSDL_image", 
+       [AC_MSG_ERROR([*** SDL_image library not found!])] 
+)
+
+dnl Check for SDL_mixer:. 
+AC_CHECK_LIB([SDL_mixer], 
+       [Mix_OpenAudio], 
+       LIBS="$LIBS -lSDL_mixer", 
+       [AC_MSG_ERROR([*** SDL_mixer library not found!])] 
+)
+
+dnl Check for SDL_ttf:
+AC_CHECK_LIB([SDL_ttf],
+	[TTF_Init],
+	LIBS="$LIBS -lSDL_ttf",
+	[AC_MSG_ERROR([SDL_ttf not found! http://www.libsdl.org/projects/SDL_ttf])]
+)
+
+
+# Checks for header files.
+AC_HEADER_DIRENT
+AC_HEADER_STDC
+AC_CHECK_HEADERS([stdlib.h string.h unistd.h])
+
+# Checks for typedefs, structures, and compiler characteristics.
+
+# Checks for library functions.
+AC_FUNC_CLOSEDIR_VOID
+# AC_FUNC_MALLOC
+AC_FUNC_STRTOD
+AC_CHECK_FUNCS([getcwd memset mkdir strcasecmp strchr strndup])
+
+
+dnl Set PACKAGE_DATA_DIR
+PACKAGE_DATA_DIR="data"
+
+
+AM_CONDITIONAL(BUILD_MINGW32, test "$native_win32" = yes)
+
+if test "$native_win32" = yes; then
+   AC_DEFINE([BUILD_MINGW32], 1,[Native MinGW32 build])
+   CFLAGS="$CFLAGS -D__GW32__"
+   LIBS="$LIBS -lgw32c -luuid -lole32 -lwsock32 -mwindows"
+   CPPFLAGS="$CPPFLAGS -idirafter $prefix/include/glibc"
+   #CPPFLAGS="$CPPFLAGS -I$prefix/include/glibc"
+   AC_PATH_PROG(WINDRES, "$target_alias-windres", no, [$PATH])
+fi
+
+AC_SUBST(PACKAGE_DATA_DIR)
+
+
+# Support for building NSIS Win32 installer:
+NSI_INSTALL_DIR=mingw32
+AC_SUBST(NSI_INSTALL_DIR)
+
+NSI_DLL_DIR=~/tuxmath_dll
+AC_ARG_WITH(dll-directory,AC_HELP_STRING(
+    [--with-dll-directory=path],
+    [set the path where dll for TuxMath are [$(NSI_DLL_DIR)]]), dll_path=$withval, dll_path=no)
+
+AM_CONDITIONAL(NSI_BUILD, test "$dll_path" = no)
+
+if test $dll_path != no; then
+NSI_DLL_DIR=$dll_path
+fi
+AC_SUBST(NSI_DLL_DIR)
+
+NSI_TUXMATH_CONF_DIR=no
+AC_ARG_WITH(tuxmath_config-directory,AC_HELP_STRING(
+    [--with-tuxmath_config-directory=path],
+    [set the path where dll for TuxMath are [$(NSI_TUXMATH_CONF_DIR)]]), tuxmath_config_path=$withval, tuxmath_config_path=no)
+
+AM_CONDITIONAL(NSI_USE_TUXMATH_CONF, test "$tuxmath_config_path" != no)
+
+if test $tuxmath_config_path != no; then
+NSI_TUXMATH_CONF_DIR=$tuxmath_config_path
+fi
+
+AC_SUBST(NSI_TUXMATH_CONF_DIR)
+
+AC_PATH_PROG(NSIS, makensis, no, [$PATH])
+
+AC_CONFIG_FILES([
+Makefile
+data/Makefile
+data/fonts/Makefile
+data/images/Makefile
+data/images/backgrounds/Makefile
+data/images/cities/Makefile
+data/images/comets/Makefile
+data/images/icons/Makefile
+data/images/igloos/Makefile
+data/images/penguins/Makefile
+data/images/sprites/Makefile
+data/images/status/Makefile
+data/images/title/Makefile
+data/images/tux/Makefile
+data/missions/Makefile
+data/missions/arcade/Makefile
+data/missions/lessons/Makefile
+data/sounds/Makefile
+docs/Makefile
+nsis/tuxmath.nsi
+nsis/tuxmath_with_conf.nsi
+src/Makefile
+src/po/Makefile
+])
+
+AC_OUTPUT

Deleted: tuxmath/trunk/configure.in
===================================================================
--- tuxmath/trunk/configure.in	2007-09-07 08:08:51 UTC (rev 230)
+++ tuxmath/trunk/configure.in	2007-09-07 15:04:35 UTC (rev 231)
@@ -1,164 +0,0 @@
-#                                               -*- Autoconf -*-
-# Process this file with autoconf to produce a configure script.
-AC_INIT(tuxmath, 1.5.3, tuxmath-devel at lists.sourceforge.net)
-
-#AC_PREREQ(2.59)
-AC_CANONICAL_HOST
-AC_CANONICAL_TARGET
-
-AM_INIT_AUTOMAKE(tuxmath, 1.5.3)
-AM_CONFIG_HEADER(config.h)
-AM_MAINTAINER_MODE
-
-NAME_VERSION=$PACKAGE-$VERSION
-
-AC_DEFINE_UNQUOTED([PROGRAM_NAME], "$PACKAGE", [Name of the Program])
-
-AC_SUBST(NAME_VERSION)
-
-# Checks for programs.
-AC_PROG_CC
-AC_PROG_MAKE_SET
-
-dnl Check for SDL 
-SDL_VERSION=1.2.0
-
-AM_PATH_SDL($SDL_VERSION, :,
-         AC_MSG_ERROR([*** SDL version $SDL_VERSION not found!]) 
-) 
-
-CFLAGS="$CFLAGS $SDL_CFLAGS" 
-
-# Check platform - see if WinMain needed:
-AC_MSG_CHECKING([for native Win32])
-case "$host" in
-  *-*-mingw*)
-    native_win32=yes
-    ;;
-  *)
-    native_win32=no
-    ;;
-esac
-AC_MSG_RESULT([$native_win32])
-
-AM_CONDITIONAL(BUILD_MINGW32, test "$native_win32" = yes)
-if test "$native_win32" = yes; then
-   LIBS="$LIBS -lmingw32 -lSDLmain"
-fi
-
-
-LIBS="$LIBS $SDL_LIBS"
-
-# Checks for libraries.
-dnl Check for SDL_image: 
-AC_CHECK_LIB([SDL_image], 
-       [IMG_Load], 
-       LIBS="$LIBS -lSDL_image", 
-       [AC_MSG_ERROR([*** SDL_image library not found!])] 
-)
-
-dnl Check for SDL_mixer:. 
-AC_CHECK_LIB([SDL_mixer], 
-       [Mix_OpenAudio], 
-       LIBS="$LIBS -lSDL_mixer", 
-       [AC_MSG_ERROR([*** SDL_mixer library not found!])] 
-)
-
-dnl Check for SDL_ttf:
-AC_CHECK_LIB([SDL_ttf],
-	[TTF_Init],
-	LIBS="$LIBS -lSDL_ttf",
-	[AC_MSG_ERROR([SDL_ttf not found! http://www.libsdl.org/projects/SDL_ttf])]
-)
-
-
-# Checks for header files.
-AC_HEADER_DIRENT
-AC_HEADER_STDC
-AC_CHECK_HEADERS([stdlib.h string.h unistd.h])
-
-# Checks for typedefs, structures, and compiler characteristics.
-
-# Checks for library functions.
-AC_FUNC_CLOSEDIR_VOID
-# AC_FUNC_MALLOC
-AC_FUNC_STRTOD
-AC_CHECK_FUNCS([getcwd memset mkdir strcasecmp strchr strndup])
-
-
-dnl Set PACKAGE_DATA_DIR
-PACKAGE_DATA_DIR="data"
-
-
-AM_CONDITIONAL(BUILD_MINGW32, test "$native_win32" = yes)
-
-if test "$native_win32" = yes; then
-   AC_DEFINE([BUILD_MINGW32], 1,[Native MinGW32 build])
-   CFLAGS="$CFLAGS -D__GW32__"
-   LIBS="$LIBS -lgw32c -luuid -lole32 -lwsock32 -mwindows"
-   CPPFLAGS="$CPPFLAGS -idirafter $prefix/include/glibc"
-   #CPPFLAGS="$CPPFLAGS -I$prefix/include/glibc"
-   AC_PATH_PROG(WINDRES, "$target_alias-windres", no, [$PATH])
-fi
-
-AC_SUBST(PACKAGE_DATA_DIR)
-
-
-# Support for building NSIS Win32 installer:
-NSI_INSTALL_DIR=mingw32
-AC_SUBST(NSI_INSTALL_DIR)
-
-NSI_DLL_DIR=~/tuxmath_dll
-AC_ARG_WITH(dll-directory,AC_HELP_STRING(
-    [--with-dll-directory=path],
-    [set the path where dll for TuxMath are [$(NSI_DLL_DIR)]]), dll_path=$withval, dll_path=no)
-
-AM_CONDITIONAL(NSI_BUILD, test "$dll_path" = no)
-
-if test $dll_path != no; then
-NSI_DLL_DIR=$dll_path
-fi
-AC_SUBST(NSI_DLL_DIR)
-
-NSI_TUXMATH_CONF_DIR=no
-AC_ARG_WITH(tuxmath_config-directory,AC_HELP_STRING(
-    [--with-tuxmath_config-directory=path],
-    [set the path where dll for TuxMath are [$(NSI_TUXMATH_CONF_DIR)]]), tuxmath_config_path=$withval, tuxmath_config_path=no)
-
-AM_CONDITIONAL(NSI_USE_TUXMATH_CONF, test "$tuxmath_config_path" != no)
-
-if test $tuxmath_config_path != no; then
-NSI_TUXMATH_CONF_DIR=$tuxmath_config_path
-fi
-
-AC_SUBST(NSI_TUXMATH_CONF_DIR)
-
-AC_PATH_PROG(NSIS, makensis, no, [$PATH])
-
-AC_CONFIG_FILES([
-Makefile
-data/Makefile
-data/fonts/Makefile
-data/images/Makefile
-data/images/backgrounds/Makefile
-data/images/cities/Makefile
-data/images/comets/Makefile
-data/images/icons/Makefile
-data/images/igloos/Makefile
-data/images/penguins/Makefile
-data/images/sprites/Makefile
-data/images/status/Makefile
-data/images/title/Makefile
-data/images/tux/Makefile
-data/missions/Makefile
-data/missions/arcade/Makefile
-data/missions/lessons/Makefile
-data/sounds/Makefile
-docs/Makefile
-nsis/tuxmath.nsi
-nsis/tuxmath_with_conf.nsi
-src/Makefile
-src/po/Makefile
-])
-
-AC_OUTPUT

Deleted: tuxmath/trunk/data/fonts/AndikaDesRevA.ttf
===================================================================
(Binary files differ)

Modified: tuxmath/trunk/data/fonts/Makefile.am
===================================================================
--- tuxmath/trunk/data/fonts/Makefile.am	2007-09-07 08:08:51 UTC (rev 230)
+++ tuxmath/trunk/data/fonts/Makefile.am	2007-09-07 15:04:35 UTC (rev 231)
@@ -1,3 +1,3 @@
 ## Makefile.am for tuxmath - data/fonts:
 
-EXTRA_DIST = AndikaDesRevA.ttf
+EXTRA_DIST = AndikaDesRevG.ttf

Modified: tuxmath/trunk/data/images/sprites/Makefile.in
===================================================================
--- tuxmath/trunk/data/images/sprites/Makefile.in	2007-09-07 08:08:51 UTC (rev 230)
+++ tuxmath/trunk/data/images/sprites/Makefile.in	2007-09-07 15:04:35 UTC (rev 231)
@@ -36,7 +36,7 @@
 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
-	$(top_srcdir)/configure.in
+	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs

Modified: tuxmath/trunk/data/missions/lessons/Makefile.am
===================================================================
--- tuxmath/trunk/data/missions/lessons/Makefile.am	2007-09-07 08:08:51 UTC (rev 230)
+++ tuxmath/trunk/data/missions/lessons/Makefile.am	2007-09-07 15:04:35 UTC (rev 231)
@@ -10,6 +10,7 @@
 	lesson06	\
 	lesson07	\
 	lesson08	\
+	lesson08.1	\
 	lesson09	\
 	lesson10	\
 	lesson11	\

Added: tuxmath/trunk/data/missions/lessons/lesson08.1
===================================================================
--- tuxmath/trunk/data/missions/lessons/lesson08.1	                        (rev 0)
+++ tuxmath/trunk/data/missions/lessons/lesson08.1	2007-09-07 15:04:35 UTC (rev 231)
@@ -0,0 +1,57 @@
+# Subtraction: 0 to 20
+play_through_list = 1
+allow_speedup = 1
+use_feedback = 1
+addition_allowed = 0
+subtraction_allowed = 1
+multiplication_allowed = 0
+division_allowed = 0
+typing_practice_allowed = 0
+allow_negatives = 0
+min_augend = 0
+max_augend = 10
+min_addend = 0
+max_addend = 10
+min_minuend = 0
+max_minuend = 20
+min_subtrahend = 0
+max_subtrahend = 20
+min_multiplier = 0
+max_multiplier = 10
+min_multiplicand = 0
+max_multiplicand = 10
+min_divisor = 0
+max_divisor = 10
+min_quotient = 0
+max_quotient = 10
+min_typing_num = 0
+max_typing_num = 10
+save_summary = 1
+question_copies = 1
+repeat_wrongs = 1
+copies_repeated_wrongs = 2
+format_add_answer_last = 0
+format_add_answer_first = 0
+format_add_answer_middle = 0
+format_sub_answer_last = 1
+format_sub_answer_first = 0
+format_sub_answer_middle = 0
+format_mult_answer_last = 0
+format_mult_answer_first = 0
+format_mult_answer_middle = 0
+format_div_answer_last = 0
+format_div_answer_first = 0
+format_div_answer_middle = 0
+max_answer = 999
+max_questions = 5000
+randomize = 1
+starting_comets = 2
+extra_comets_per_wave = 2
+max_comets = 10
+speed = 1.00
+max_speed = 10.00
+danger_level = 0.35
+danger_level_speedup = 1
+danger_level_max = 0.90
+city_explode_handicap = 0.00
+

Modified: tuxmath/trunk/docs/INSTALL.txt
===================================================================
--- tuxmath/trunk/docs/INSTALL.txt	2007-09-07 08:08:51 UTC (rev 230)
+++ tuxmath/trunk/docs/INSTALL.txt	2007-09-07 15:04:35 UTC (rev 231)
@@ -154,12 +154,25 @@
         make install.  (you might need "su" or "sudo" for this)
  
       If you use a subversion checkout, you will need to generate the configure
-      Tuxmath uses the Gnu Autoconf/Automake tools for development. The needed
-      autotools commands are in a small script, "autogen.sh", so the build
-      process becomes:
+      Tuxmath uses the Gnu Autoconf/Automake tools for development. You will need
+      to run Autoconf's "autoreconf" to generate the configure script, Makefile.in's,
+      and friend, so the build process becomes:
       
-      ./autogen.sh; ./configure; make; make install
+        autoreconf --install; ./configure; make; make install
 
+      Tuxmath supports "parallel" or "vpath" builds to avoid cluttering the source
+      tree with object files, so a clean way would be (starting within trunk):
+
+        autoreconf --install
+        cd ..
+        mkdir build
+        cd build
+        ../trunk/configure
+        make
+        make install
+
+      (which is what I do).
+
       By default, the build process will install tuxmath under /usr/local/share
       for the data and /usr/local/bin for the executable, which is simply
       called "tuxmath".
@@ -223,7 +236,7 @@
          and "make distclean" to get rid of the autogenerated files.
 
       7. From the trunk dir, run:
-         ./autogen.sh
+         autoreconf --install
          ./cross-configure.sh --with-sdl-prefix
          ./cross-make.sh
          ./cross-make.sh nsis

Modified: tuxmath/trunk/docs/changelog
===================================================================
--- tuxmath/trunk/docs/changelog	2007-09-07 08:08:51 UTC (rev 230)
+++ tuxmath/trunk/docs/changelog	2007-09-07 15:04:35 UTC (rev 231)
@@ -1,8 +1,37 @@
-changelog for "tuxmath"
-UNRELEASED
-   * FIXME: mention bugfixes from Tim and David here :)
 
 
+2007.Sep.07 (svn.debian.org/tux4kids - revision 231)
+  Version 1.5.4
+
+  Build:
+    * Renamed configure.in to configure.ac as is now preferred.
+    * Removed autogen.sh as autoreconf is preferred.
+  Game:
+    * Added lesson for "Subtraction 0-20"
+      (data/missions/lessons/lesson08.1)
+    * Added hackery to load_default_font() to get it to load
+      "/usr/share/fonts/truetype/ttf-sil-andika/AndikaDesRevG.ttf"
+      (Debian font location) if font not found under data path.
+    * Fixed minor problem with screen redrawing for "Custom Game".
+    * Setup now tries to write user config file (using default
+      settings) if user config file not found, e.g.  when the
+      game is run for the first time by that user.
+
+      David Bruce <dbruce at tampabay.rr.com>
+
+
+2007.Aug.27 (svn.debian.org/tux4kids - revision 215)
+
+  Code:
+    * Changed arrays in game.c to dynamic allocation, fixed a
+      crashing bug related to array bounds violation.
+  Game:
+    * Fix of "Custom Game" option to enable play based on user's
+      options file, also added on-screen explanatory text.
+
+      Tim Holy <holy at wustl.edu>
+
+
 2007.Aug.23 (svn.debian.org/tux4kids - revision 212)
   Version 1.5.3
 
@@ -34,7 +63,7 @@
   Options:
     * Fix memory leak in parsing options files
 
-  Tim Holy <holy at wustl.edu>
+      Tim Holy <holy at wustl.edu>
 
 	
 2007.Aug.19 (svn.debian.org/tux4kids - revision 199)
@@ -87,11 +116,11 @@
   Build:
     * First revision adds Xcode building for MacOSX
     * Second commit removes the earlier (incomplete) approach to a
-	UNIX-style build. (This was abandoned mainly for reasons of
-	building Universal Binaries---the SDL Frameworks supposedly
-	only work with Xcode)
+      UNIX-style build. (This was abandoned mainly for reasons of
+      building Universal Binaries---the SDL Frameworks supposedly
+      only work with Xcode)
 	
-        Tim Holy < holy at wustl period edu >
+      Tim Holy < holy at wustl period edu >
 	
 2007.Mar.08  (svn.debian.org/tux4kids - revision 125)
   Game:

Modified: tuxmath/trunk/src/Makefile.in
===================================================================
--- tuxmath/trunk/src/Makefile.in	2007-09-07 08:08:51 UTC (rev 230)
+++ tuxmath/trunk/src/Makefile.in	2007-09-07 15:04:35 UTC (rev 231)
@@ -45,7 +45,7 @@
 	$(srcdir)/Makefile.in
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
-	$(top_srcdir)/configure.in
+	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs

Modified: tuxmath/trunk/src/fileops.c
===================================================================
--- tuxmath/trunk/src/fileops.c	2007-09-07 08:08:51 UTC (rev 230)
+++ tuxmath/trunk/src/fileops.c	2007-09-07 15:04:35 UTC (rev 231)
@@ -2495,6 +2495,17 @@
   sprintf(fontfile, "%s/fonts/%s", DATA_PREFIX, DEFAULT_FONT_NAME);
 
   default_font = TTF_OpenFont(fontfile, DEFAULT_MENU_FONT_SIZE);
+
+  /* HACK - better font searching needed! */
+  /* This should mean that font wasn't bundled into data path, which for  */
+  /* now means we are using Debian, so grab from Debian installation loc: */
+  if (!default_font)
+  { 
+    sprintf(fontfile, "/usr/share/fonts/truetype/ttf-sil-andika/AndikaDesRevG.ttf");
+    default_font = TTF_OpenFont(fontfile, DEFAULT_MENU_FONT_SIZE);
+  }
+
+
   if (default_font != NULL)
   {
 #ifdef TUXMATH_DEBUG

Modified: tuxmath/trunk/src/game.c
===================================================================
--- tuxmath/trunk/src/game.c	2007-09-07 08:08:51 UTC (rev 230)
+++ tuxmath/trunk/src/game.c	2007-09-07 15:04:35 UTC (rev 231)
@@ -22,11 +22,13 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include <SDL.h>
+
+#include "SDL.h"
 #ifndef NOSOUND
-#include <SDL_mixer.h>
+#include "SDL_mixer.h"
 #endif
-#include <SDL_image.h>
+#include "SDL_image.h"
+
 #include "game.h"
 #include "fileops.h"
 #include "setup.h"

Modified: tuxmath/trunk/src/setup.c
===================================================================
--- tuxmath/trunk/src/setup.c	2007-09-07 08:08:51 UTC (rev 230)
+++ tuxmath/trunk/src/setup.c	2007-09-07 15:04:35 UTC (rev 231)
@@ -150,6 +150,12 @@
       fprintf(stderr, "\nCould not find user's config file.\n");
       /* can still proceed using hard-coded defaults.         */
     }
+
+    /* If game being run for first time, try to write file: */
+    if (!write_user_config_file())
+    {
+      fprintf(stderr, "\nUnable to write user's config file.\n");
+    }
   }
 
   /* Read the lessons directory to determine which lesson   */

Modified: tuxmath/trunk/src/titlescreen.c
===================================================================
--- tuxmath/trunk/src/titlescreen.c	2007-09-07 08:08:51 UTC (rev 230)
+++ tuxmath/trunk/src/titlescreen.c	2007-09-07 15:04:35 UTC (rev 231)
@@ -159,6 +159,7 @@
 void TitleScreen_unload_media(void);
 void NotImplemented(void);
 void HighScoreScreen(void);
+void HighScoreNameEntry(char* name_buf);
 void TransWipe(SDL_Surface* newbkg, int type, int var1, int var2);
 void UpdateScreen(int* frame);
 void AddRect(SDL_Rect* src, SDL_Rect* dst);
@@ -577,8 +578,8 @@
         char *s1, *s2, *s3, *s4;
         s1 = _("Edit 'options' file in your home directory");
         s2 = _("to create customized game!");
-        s3 = _("See README.txt for more information");
-        s4 = N_("tuxmath-devel at lists.sourceforge.net");
+        s3 = _("Press a key or click your mouse to start game.");
+        s4 = N_("See README.txt for more information");
         ShowMessage(s1, s2, s3, s4);
 
         if (read_user_config_file())
@@ -595,8 +596,9 @@
           {
             audioMusicLoad( "tuxi.ogg", -1 );
           }
-          redraw = 1;
         }
+
+        redraw = 1;
         break;
       }
 
@@ -1506,6 +1508,8 @@
   }  // End of while (!finished) loop
 }
 
+
+/* FIXME add some background shading to improve legibility */
 void ShowMessage(char* str1, char* str2, char* str3, char* str4)
 {
   SDL_Surface *s1, *s2, *s3, *s4;
@@ -1550,44 +1554,48 @@
   fprintf(stderr, "NotImplemented() - drawing screen\n" );
 #endif
 
-  /* Draw lines of text: */
+  /* Redraw background: */
   if (images[IMG_MENU_BKG])
     SDL_BlitSurface( images[IMG_MENU_BKG], NULL, screen, NULL );
+
+  /* Red "Stop" circle in upper right corner to go back to main menu: */
+  if (images[IMG_STOP])
+  {
+    stopRect.w = images[IMG_STOP]->w;
+    stopRect.h = images[IMG_STOP]->h;
+    stopRect.x = screen->w - images[IMG_STOP]->w;
+    stopRect.y = 0;
+    SDL_BlitSurface(images[IMG_STOP], NULL, screen, &stopRect);
+  }
+
+  if (Tux && Tux->num_frames) /* make sure sprite has at least one frame */
+  {
+    SDL_BlitSurface(Tux->frame[0], NULL, screen, &Tuxdest);
+  }
+
+  /* Draw lines of text (do after drawing Tux so text is in front): */
   if (s1)
   {
-    loc.x = 320-(s1->w/2); loc.y = 10;
+    loc.x = 320 - (s1->w/2); loc.y = 10;
     SDL_BlitSurface( s1, NULL, screen, &loc);
   }
   if (s2)
   {
-    loc.x = 320-(s2->w/2); loc.y = 60;
+    loc.x = 320 - (s2->w/2); loc.y = 60;
     SDL_BlitSurface( s2, NULL, screen, &loc);
   }
   if (s3)
   {
-    loc.x = 320-(s3->w/2); loc.y = 400;
+    loc.x = 320 - (s3->w/2); loc.y = 300;
     SDL_BlitSurface( s3, NULL, screen, &loc);
   }
   if (s4)
   {
-    loc.x = 320-(s4->w/2); loc.y = 440;
+    loc.x = 320 - (s4->w/2); loc.y = 340;
     SDL_BlitSurface( s4, NULL, screen, &loc);
   }
 
-  /* Red "Stop" circle in upper right corner to go back to main menu: */
-  if (images[IMG_STOP])
-  {
-    stopRect.w = images[IMG_STOP]->w;
-    stopRect.h = images[IMG_STOP]->h;
-    stopRect.x = screen->w - images[IMG_STOP]->w;
-    stopRect.y = 0;
-    SDL_BlitSurface(images[IMG_STOP], NULL, screen, &stopRect);
-  }
-
-  if (Tux && Tux->num_frames) /* make sure sprite has at least one frame */
-  {
-    SDL_BlitSurface(Tux->frame[0], NULL, screen, &Tuxdest);
-  }
+  /* and update: */
   SDL_UpdateRect(screen, 0, 0, 0, 0);
 
   while (!finished)

Modified: tuxmath/trunk/src/tuxmath.h
===================================================================
--- tuxmath/trunk/src/tuxmath.h	2007-09-07 08:08:51 UTC (rev 230)
+++ tuxmath/trunk/src/tuxmath.h	2007-09-07 15:04:35 UTC (rev 231)
@@ -39,11 +39,11 @@
 #endif
 #endif
 
-#include <SDL.h>
-#include <SDL_ttf.h>
+#include "SDL.h"
+#include "SDL_ttf.h"
 
 #ifndef NOSOUND
-#include <SDL_mixer.h>
+#include "SDL_mixer.h"
 #endif
 
 //#define NOSOUND
@@ -102,7 +102,7 @@
 #define MIN_COMETS 1
 #define MAX_MAX_COMETS 100
 
-#define DEFAULT_FONT_NAME "AndikaDesRevA.ttf"
+#define DEFAULT_FONT_NAME "AndikaDesRevG.ttf"
 #define DEFAULT_MENU_FONT_SIZE 18
 
 




More information about the Tux4kids-commits mailing list