[Tux4kids-commits] r769 - in tuxmath/trunk: . nsis po src

dbruce-guest at alioth.debian.org dbruce-guest at alioth.debian.org
Wed Nov 26 13:30:12 UTC 2008


Author: dbruce-guest
Date: 2008-11-26 13:30:11 +0000 (Wed, 26 Nov 2008)
New Revision: 769

Modified:
   tuxmath/trunk/Makefile.am
   tuxmath/trunk/config.guess
   tuxmath/trunk/config.h.in
   tuxmath/trunk/configure
   tuxmath/trunk/configure.ac
   tuxmath/trunk/nsis/tuxmath.nsi.in
   tuxmath/trunk/po/Makefile.in.in
   tuxmath/trunk/src/Makefile.am
   tuxmath/trunk/src/SDL_extras.c
   tuxmath/trunk/src/SDL_extras.h
   tuxmath/trunk/src/credits.c
   tuxmath/trunk/src/setup.c
Log:
fixed make dist_with_fonts target; minor tweaks elsewhere



Modified: tuxmath/trunk/Makefile.am
===================================================================
--- tuxmath/trunk/Makefile.am	2008-11-26 02:49:10 UTC (rev 768)
+++ tuxmath/trunk/Makefile.am	2008-11-26 13:30:11 UTC (rev 769)
@@ -35,10 +35,10 @@
 ## in this Makefile.am before the 'dist_with_fonts' target for that target
 ## to work - if it is in data/fonts/Makefile.am, it does not get expanded
 ## before the 'dist' target starts:
-data_fonts = AndikaDesRevG.ttf
+data_fonts='AndikaDesRevG.ttf'
 dist_with_fonts:
 	$(MAKE) $(AM_MAKEFLAGS) distdir=$(PACKAGE)_w_fonts-$(VERSION) \
-  dist_fonts=$(data_fonts) dist
+           dist_fonts=$(data_fonts) dist
 
 
 ## For building the NSIS executable Win32 installer - this rule first

Modified: tuxmath/trunk/config.guess
===================================================================
--- tuxmath/trunk/config.guess	2008-11-26 02:49:10 UTC (rev 768)
+++ tuxmath/trunk/config.guess	2008-11-26 13:30:11 UTC (rev 769)
@@ -4,7 +4,7 @@
 #   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
 #   Free Software Foundation, Inc.
 
-timestamp='2008-01-08'
+timestamp='2008-01-23'
 
 # This file is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License as published by
@@ -1484,9 +1484,9 @@
 the operating system you are using. It is advised that you
 download the most up to date version of the config scripts from
 
-  http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.guess
+  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
 and
-  http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.sub
+  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
 
 If the version you run ($0) is already up to date, please
 send the following data and any information you think might be

Modified: tuxmath/trunk/config.h.in
===================================================================
--- tuxmath/trunk/config.h.in	2008-11-26 02:49:10 UTC (rev 768)
+++ tuxmath/trunk/config.h.in	2008-11-26 13:30:11 UTC (rev 769)
@@ -152,6 +152,18 @@
 /* Define to 1 if you have the <libintl.h> header file. */
 #undef HAVE_LIBINTL_H
 
+/* Define to 1 if you have the `SDL_image' library (-lSDL_image). */
+#undef HAVE_LIBSDL_IMAGE
+
+/* Define to 1 if you have the `SDL_mixer' library (-lSDL_mixer). */
+#undef HAVE_LIBSDL_MIXER
+
+/* Define to 1 if you have the `SDL_Pango' library (-lSDL_Pango). */
+#undef HAVE_LIBSDL_PANGO
+
+/* Define to 1 if you have the `SDL_ttf' library (-lSDL_ttf). */
+#undef HAVE_LIBSDL_TTF
+
 /* Define to 1 if you have the <limits.h> header file. */
 #undef HAVE_LIMITS_H
 
@@ -391,9 +403,6 @@
 /* Define if the pthread_in_use() detection is hard. */
 #undef PTHREAD_IN_USE_DETECTION_HARD
 
-/* Defined when SDL_Pango support is present and compiled */
-#undef SDL_Pango
-
 /* Define as the maximum value of type 'size_t', if the system doesn't define
    it. */
 #undef SIZE_MAX

Modified: tuxmath/trunk/configure
===================================================================
--- tuxmath/trunk/configure	2008-11-26 02:49:10 UTC (rev 768)
+++ tuxmath/trunk/configure	2008-11-26 13:30:11 UTC (rev 769)
@@ -1367,7 +1367,6 @@
   --disable-threads       build without multithread safety
   --disable-rpath         do not hardcode runtime library paths
   --disable-sdltest       Do not try to compile and run a test SDL program
-  --enable-sdlpango    Enable SDL_Pango (default is  disabled)
 
 Optional Packages:
   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
@@ -13779,6 +13778,7 @@
 
 
 
+
 { echo "$as_me:$LINENO: checking for IMG_Load in -lSDL_image" >&5
 echo $ECHO_N "checking for IMG_Load in -lSDL_image... $ECHO_C" >&6; }
 if test "${ac_cv_lib_SDL_image_IMG_Load+set}" = set; then
@@ -13841,15 +13841,20 @@
 { echo "$as_me:$LINENO: result: $ac_cv_lib_SDL_image_IMG_Load" >&5
 echo "${ECHO_T}$ac_cv_lib_SDL_image_IMG_Load" >&6; }
 if test $ac_cv_lib_SDL_image_IMG_Load = yes; then
-  LIBS="$LIBS -lSDL_image"
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBSDL_IMAGE 1
+_ACEOF
+
+  LIBS="-lSDL_image $LIBS"
+
 else
   { { echo "$as_me:$LINENO: error: SDL_image not found! http://www.libsdl.org/projects/SDL_image" >&5
 echo "$as_me: error: SDL_image not found! http://www.libsdl.org/projects/SDL_image" >&2;}
    { (exit 1); exit 1; }; }
-
 fi
 
 
+
 { echo "$as_me:$LINENO: checking for Mix_OpenAudio in -lSDL_mixer" >&5
 echo $ECHO_N "checking for Mix_OpenAudio in -lSDL_mixer... $ECHO_C" >&6; }
 if test "${ac_cv_lib_SDL_mixer_Mix_OpenAudio+set}" = set; then
@@ -13912,15 +13917,20 @@
 { echo "$as_me:$LINENO: result: $ac_cv_lib_SDL_mixer_Mix_OpenAudio" >&5
 echo "${ECHO_T}$ac_cv_lib_SDL_mixer_Mix_OpenAudio" >&6; }
 if test $ac_cv_lib_SDL_mixer_Mix_OpenAudio = yes; then
-  LIBS="$LIBS -lSDL_mixer"
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBSDL_MIXER 1
+_ACEOF
+
+  LIBS="-lSDL_mixer $LIBS"
+
 else
   { { echo "$as_me:$LINENO: error: SDL_mixer not found! http://www.libsdl.org/projects/SDL_mixer" >&5
 echo "$as_me: error: SDL_mixer not found! http://www.libsdl.org/projects/SDL_mixer" >&2;}
    { (exit 1); exit 1; }; }
-
 fi
 
 
+
 { echo "$as_me:$LINENO: checking for TTF_Init in -lSDL_ttf" >&5
 echo $ECHO_N "checking for TTF_Init in -lSDL_ttf... $ECHO_C" >&6; }
 if test "${ac_cv_lib_SDL_ttf_TTF_Init+set}" = set; then
@@ -13983,15 +13993,20 @@
 { echo "$as_me:$LINENO: result: $ac_cv_lib_SDL_ttf_TTF_Init" >&5
 echo "${ECHO_T}$ac_cv_lib_SDL_ttf_TTF_Init" >&6; }
 if test $ac_cv_lib_SDL_ttf_TTF_Init = yes; then
-  LIBS="$LIBS -lSDL_ttf"
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBSDL_TTF 1
+_ACEOF
+
+  LIBS="-lSDL_ttf $LIBS"
+
 else
   { { echo "$as_me:$LINENO: error: SDL_ttf not found! http://www.libsdl.org/projects/SDL_ttf" >&5
 echo "$as_me: error: SDL_ttf not found! http://www.libsdl.org/projects/SDL_ttf" >&2;}
    { (exit 1); exit 1; }; }
-
 fi
 
 
+
 ##dnl Check for SDL_gfx:
 ##AC_CHECK_LIB([SDL_gfx],
 ##	[rotozoomSurface],
@@ -13999,14 +14014,8 @@
 ##	[AC_MSG_ERROR([SDL_gfx not found! http://www.ferzkopp.net/joomla/content/view/19/14/])]
 ##)
 
-have_sdlpango=no
-# Check whether --enable-sdlpango was given.
-if test "${enable_sdlpango+set}" = set; then
-  enableval=$enable_sdlpango; have_sdlpango=yes
-fi
 
-if test $have_sdlpango = "yes"; then
-	{ echo "$as_me:$LINENO: checking for SDLPango_Init in -lSDL_Pango" >&5
+{ echo "$as_me:$LINENO: checking for SDLPango_Init in -lSDL_Pango" >&5
 echo $ECHO_N "checking for SDLPango_Init in -lSDL_Pango... $ECHO_C" >&6; }
 if test "${ac_cv_lib_SDL_Pango_SDLPango_Init+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -14068,21 +14077,33 @@
 { echo "$as_me:$LINENO: result: $ac_cv_lib_SDL_Pango_SDLPango_Init" >&5
 echo "${ECHO_T}$ac_cv_lib_SDL_Pango_SDLPango_Init" >&6; }
 if test $ac_cv_lib_SDL_Pango_SDLPango_Init = yes; then
-  LIBS="$LIBS -lSDL_Pango"
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBSDL_PANGO 1
+_ACEOF
+
+  LIBS="-lSDL_Pango $LIBS"
+
 else
-  have_sdlpango=no
+  { echo "$as_me:$LINENO: WARNING: SDL_Pango not found http://sdlpango.sourceforge.net/" >&5
+echo "$as_me: WARNING: SDL_Pango not found http://sdlpango.sourceforge.net/" >&2;}
 fi
 
-fi
-if test "$have_sdlpango" = "yes"; then
 
-cat >>confdefs.h <<\_ACEOF
-#define SDL_Pango
-_ACEOF
 
-fi
 
+##dnl sdlpango support
+##have_sdlpango=no
 
+##AC_ARG_ENABLE(sdlpango, [  --enable-sdlpango    Enable SDL_Pango (default is  ##disabled)],have_sdlpango=yes)
+##if test $have_sdlpango = "yes"; then
+##	AC_CHECK_LIB([SDL_Pango],[SDLPango_Init],LIBS="$LIBS -lSDL_Pango",have_sdlpango=no)
+
+##fi
+##if test "$have_sdlpango" = "yes"; then
+##	AC_DEFINE([SDL_Pango],[],[Defined when SDL_Pango support is present and compiled])
+##fi
+
+
 # --------------------------------------------------------------------------------------
 # Checks for header files.
 # --------------------------------------------------------------------------------------
@@ -17120,18 +17141,6 @@
 
 
 
-# --------------------------------------------------------------------------
-# Support for old Qt-based config prog - get rid of this soon:
-# --------------------------------------------------------------------------
-#NSI_TUXMATH_CONF_DIR=no
-#AC_ARG_WITH(tuxmath_config-directory,AS_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)
 
 
 # ---------------------------------------------------------------

Modified: tuxmath/trunk/configure.ac
===================================================================
--- tuxmath/trunk/configure.ac	2008-11-26 02:49:10 UTC (rev 768)
+++ tuxmath/trunk/configure.ac	2008-11-26 13:30:11 UTC (rev 769)
@@ -20,7 +20,7 @@
 
 # Needed for gettext:
 AC_GNU_SOURCE
-AM_GNU_GETTEXT_VERSION([0.16])
+AM_GNU_GETTEXT_VERSION([0.17])
 AM_GNU_GETTEXT
 AM_GNU_GETTEXT_INTL_SUBDIR
 
@@ -77,25 +77,23 @@
 
 dnl Check for SDL_image: 
 AC_CHECK_LIB([SDL_image], 
-       [IMG_Load], 
-       LIBS="$LIBS -lSDL_image", 
-       [AC_MSG_ERROR([SDL_image not found! http://www.libsdl.org/projects/SDL_image])] 
-)
+             [IMG_Load],
+             ,
+             [AC_MSG_ERROR([SDL_image not found! http://www.libsdl.org/projects/SDL_image])])
 
 dnl Check for SDL_mixer:. 
 AC_CHECK_LIB([SDL_mixer], 
-       [Mix_OpenAudio], 
-       LIBS="$LIBS -lSDL_mixer", 
-       [AC_MSG_ERROR([SDL_mixer not found! http://www.libsdl.org/projects/SDL_mixer])] 
-)
+             [Mix_OpenAudio], 
+             ,
+             [AC_MSG_ERROR([SDL_mixer not found! http://www.libsdl.org/projects/SDL_mixer])])
 
 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])]
-)
+             [TTF_Init],
+             ,
+             [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],
@@ -103,17 +101,27 @@
 ##	[AC_MSG_ERROR([SDL_gfx not found! http://www.ferzkopp.net/joomla/content/view/19/14/])]
 ##)
 
-dnl sdlpango support
-have_sdlpango=no
-AC_ARG_ENABLE(sdlpango, [  --enable-sdlpango    Enable SDL_Pango (default is  disabled)],have_sdlpango=yes)
-if test $have_sdlpango = "yes"; then
-	AC_CHECK_LIB([SDL_Pango],[SDLPango_Init],LIBS="$LIBS -lSDL_Pango",have_sdlpango=no)
-fi
-if test "$have_sdlpango" = "yes"; then
-	AC_DEFINE([SDL_Pango],[],[Defined when SDL_Pango support is present and compiled])
-fi
+dnl Check for SDL_Pango (should work out correct way to allow disabling arg)
+AC_CHECK_LIB([SDL_Pango], 
+             [SDLPango_Init],
+             ,
+             [AC_MSG_WARN(SDL_Pango not found http://sdlpango.sourceforge.net/)])
 
 
+
+##dnl sdlpango support
+##have_sdlpango=no
+
+##AC_ARG_ENABLE(sdlpango, [  --enable-sdlpango    Enable SDL_Pango (default is  ##disabled)],have_sdlpango=yes)
+##if test $have_sdlpango = "yes"; then
+##	AC_CHECK_LIB([SDL_Pango],[SDLPango_Init],LIBS="$LIBS -lSDL_Pango",have_sdlpango=no)
+
+##fi
+##if test "$have_sdlpango" = "yes"; then
+##	AC_DEFINE([SDL_Pango],[],[Defined when SDL_Pango support is present and compiled])
+##fi
+
+
 # --------------------------------------------------------------------------------------
 # Checks for header files.
 # --------------------------------------------------------------------------------------
@@ -190,18 +198,6 @@
 
 AC_PATH_PROG(NSIS, makensis, [], [$PATH])
 
-# --------------------------------------------------------------------------
-# Support for old Qt-based config prog - get rid of this soon:
-# --------------------------------------------------------------------------
-#NSI_TUXMATH_CONF_DIR=no
-#AC_ARG_WITH(tuxmath_config-directory,AS_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)
 
 
 # ---------------------------------------------------------------

Modified: tuxmath/trunk/nsis/tuxmath.nsi.in
===================================================================
--- tuxmath/trunk/nsis/tuxmath.nsi.in	2008-11-26 02:49:10 UTC (rev 768)
+++ tuxmath/trunk/nsis/tuxmath.nsi.in	2008-11-26 13:30:11 UTC (rev 769)
@@ -31,7 +31,7 @@
 InstallDirRegKey HKLM SOFTWARE\${APP_PREFIX} "Install_Dir"
 
 # Licence text
-LicenseText "You must agree to this license before installing ${APP_NAME}"
+LicenseText "Please read the terms of the General Public License before installing ${APP_NAME}"
 LicenseData "mingw32\doc\COPYING.txt"
 
 # Directory browsing

Modified: tuxmath/trunk/po/Makefile.in.in
===================================================================
--- tuxmath/trunk/po/Makefile.in.in	2008-11-26 02:49:10 UTC (rev 768)
+++ tuxmath/trunk/po/Makefile.in.in	2008-11-26 13:30:11 UTC (rev 769)
@@ -56,7 +56,7 @@
 XGETTEXT_yes = @XGETTEXT_015@
 XGETTEXT = $(XGETTEXT_$(USE_MSGCTXT))
 MSGMERGE = msgmerge
-MSGMERGE_UPDATE = @MSGMERGE@ --update --previous
+MSGMERGE_UPDATE = @MSGMERGE@ --update
 MSGINIT = msginit
 MSGCONV = msgconv
 MSGFILTER = msgfilter
@@ -369,9 +369,9 @@
 	tmpdir=`pwd`; \
 	echo "$$lang:"; \
 	test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
-	echo "$${cdcmd}$(MSGMERGE) --previous $$lang.po $(DOMAIN).pot -o $$lang.new.po"; \
+	echo "$${cdcmd}$(MSGMERGE) $$lang.po $(DOMAIN).pot -o $$lang.new.po"; \
 	cd $(srcdir); \
-	if $(MSGMERGE) --previous $$lang.po $(DOMAIN).pot -o $$tmpdir/$$lang.new.po; then \
+	if $(MSGMERGE) $$lang.po $(DOMAIN).pot -o $$tmpdir/$$lang.new.po; then \
 	  if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \
 	    rm -f $$tmpdir/$$lang.new.po; \
 	  else \

Modified: tuxmath/trunk/src/Makefile.am
===================================================================
--- tuxmath/trunk/src/Makefile.am	2008-11-26 02:49:10 UTC (rev 768)
+++ tuxmath/trunk/src/Makefile.am	2008-11-26 13:30:11 UTC (rev 769)
@@ -61,6 +61,7 @@
 		tuxmath.h	\
 		ConvertUTF.h	\
 		SDL_extras.h	\
+		SDL_rotozoom.h	\
 		lessons.h	\
 		gettext.h	\
 		scandir.h	\

Modified: tuxmath/trunk/src/SDL_extras.c
===================================================================
--- tuxmath/trunk/src/SDL_extras.c	2008-11-26 02:49:10 UTC (rev 768)
+++ tuxmath/trunk/src/SDL_extras.c	2008-11-26 13:30:11 UTC (rev 769)
@@ -15,8 +15,10 @@
 #include "tuxmath.h"
 #include "pixels.h"
 
-#ifdef SDL_Pango
+#ifdef HAVE_LIBSDL_PANGO
 #include "SDL_Pango.h"
+SDLPango_Context* context = NULL;
+static SDLPango_Matrix* SDL_Colour_to_SDLPango_Matrix(const SDL_Color* cl);
 #endif
 
 
@@ -320,18 +322,40 @@
   return ret;
 }
 
-#ifdef SDL_Pango
-SDLPango_Context *context = NULL;
+
+#ifdef HAVE_LIBSDL_PANGO
+
 void init_SDLPango_Context()
 {
    context =  SDLPango_CreateContext_GivenFontDesc(DEFAULT_FONT_NAME);
 }
+
 void free_SDLPango_Context()
 {
   if(context != NULL)
     SDLPango_FreeContext(context);
   context = NULL;
 }
+
+
+SDLPango_Matrix* SDL_Colour_to_SDLPango_Matrix(const SDL_Color *cl)
+{
+  SDLPango_Matrix *colour;
+  colour=malloc(sizeof(SDLPango_Matrix));
+  int k;
+  for(k=0;k<4;k++){
+  	(*colour).m[0][k]=(*cl).r;
+  	(*colour).m[1][k]=(*cl).g;
+  	(*colour).m[2][k]=(*cl).b;
+  }
+  (*colour).m[3][0]=0;
+  (*colour).m[3][1]=255;
+  (*colour).m[3][2]=0;
+  (*colour).m[3][3]=0;
+
+  return colour;
+}
+
 #endif
 
 
@@ -360,7 +384,7 @@
   fprintf( stderr, "BlackOutline of \"%s\"\n", t );
 #endif
 
-#ifndef SDL_Pango
+#ifndef HAVE_LIBSDL_PANGO
   black_letters = TTF_RenderUTF8_Blended(font, t, black);
 #else
   if( context != NULL)
@@ -402,7 +426,7 @@
   SDL_FreeSurface(black_letters);
 
   /* --- Put the color version of the text on top! --- */
-#ifndef SDL_Pango
+#ifndef HAVE_LIBSDL_PANGO
   white_letters = TTF_RenderUTF8_Blended(font, t, *c);
 #else
   if( context != NULL)
@@ -441,6 +465,39 @@
 }
 
 
+/* This (fast) function just returns a non-outlined surf */
+/* using SDL_Pango if available, SDL_ttf as fallback     */
+SDL_Surface* SimpleText(const char *t, TTF_Font* font, SDL_Color* col)
+{
+  SDL_Surface* surf = NULL;
+
+#ifdef HAVE_LIBSDL_PANGO
+  SDLPango_Matrix colormatrix = {
+    col->r,  col->r,  0,  0,
+    col->g,  col->g,  0,  0,
+    col->b,  col->b,  0,  0,
+    0,      255,      0,  0,
+  };
+
+  if(context != NULL)
+  {
+    SDLPango_SetDefaultColor(context, &colormatrix );
+    SDLPango_SetText(context, t, -1);
+    surf = SDLPango_CreateSurfaceDraw(context);
+  }
+  else {
+    surf = TTF_RenderUTF8_Blended(font, t, *col);
+  }
+#else
+  surf = TTF_RenderUTF8_Blended(font, t, *col);
+#endif
+
+  return surf;
+}
+
+
+
+
 int inRect( SDL_Rect r, int x, int y) {
         if ((x < r.x) || (y < r.y) || (x > r.x + r.w) || (y > r.y + r.h))
                 return 0;

Modified: tuxmath/trunk/src/SDL_extras.h
===================================================================
--- tuxmath/trunk/src/SDL_extras.h	2008-11-26 02:49:10 UTC (rev 768)
+++ tuxmath/trunk/src/SDL_extras.h	2008-11-26 13:30:11 UTC (rev 769)
@@ -28,11 +28,8 @@
 #define amask 0xff000000
 #endif
 
-#ifdef SDL_Pango
 
-#include "SDL_Pango.h"
-
-extern SDLPango_Context *context;
+#ifdef HAVE_LIBSDL_PANGO
 void init_SDLPango_Context();
 void free_SDLPango_Context();
 #endif
@@ -41,6 +38,7 @@
 void RoundCorners(SDL_Surface* s, Uint16 radius);
 SDL_Surface* Flip(SDL_Surface *in, int x, int y);
 SDL_Surface* BlackOutline(const char *t, TTF_Font* font, SDL_Color* c);
+SDL_Surface* SimpleText(const char *t, TTF_Font* font, SDL_Color* col);
 int  inRect(SDL_Rect r, int x, int y);
 void DarkenScreen(Uint8 bits);
 void SwitchScreenMode(void);

Modified: tuxmath/trunk/src/credits.c
===================================================================
--- tuxmath/trunk/src/credits.c	2008-11-26 02:49:10 UTC (rev 768)
+++ tuxmath/trunk/src/credits.c	2008-11-26 13:30:11 UTC (rev 769)
@@ -28,10 +28,9 @@
 #include "fileops.h"
 #include "setup.h"
 #include "credits.h"
-#ifdef SDL_Pango
-#  include "SDL_extras.h"
-#endif
+#include "SDL_extras.h"
 
+
 char * credit_text[] = {
   "-TUX, OF MATH COMMAND",  /* '-' at beginning makes highlighted: */
   "COPYRIGHT 2001-2006",
@@ -570,7 +569,6 @@
 //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')
@@ -580,7 +578,7 @@
   
   if (str[0] == '-') //highlight text
   {
-    hloffset = 1;
+    str++;
     col.r = 128;
     col.g = 192;
     col.b = 255 - (40);
@@ -591,30 +589,11 @@
     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");
-  
-  SDLPango_Matrix colormatrix = {
-    col.r,  col.r, 0, 0,
-    col.g,  col.g, 0, 0,
-    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
-  
+
+  /* This func from SDL_extras draws with SDL_Pango if avail, */
+  /* with SDL_ttf as fallback:                                */
+  surf =  SimpleText(str, default_font, &col);
+
   dest.x -= surf->w / 2; //center text
   SDL_BlitSurface(surf, NULL, screen, &dest);
   SDL_FreeSurface(surf);

Modified: tuxmath/trunk/src/setup.c
===================================================================
--- tuxmath/trunk/src/setup.c	2008-11-26 02:49:10 UTC (rev 768)
+++ tuxmath/trunk/src/setup.c	2008-11-26 13:30:11 UTC (rev 769)
@@ -448,7 +448,7 @@
 
   atexit(TTF_Quit); // Maybe this is redundant?
 
-#ifdef SDL_Pango
+#ifdef HAVE_LIBSDL_PANGO
   if (SDLPango_Init () < 0)
   {
       fprintf(stderr,
@@ -724,7 +724,7 @@
     n_timesopened--;
   }
 
-#ifdef SDL_Pango
+#ifdef HAVE_LIBSDL_PANGO
    free_SDLPango_Context();
 #endif
 




More information about the Tux4kids-commits mailing list