[Tux4kids-commits] r201 - in tuxtype: branches/tuxtype-indic/tuxtype trunk trunk/nsis trunk/tuxtype trunk/tuxtype/data/fonts trunk/tuxtype/data/themes trunk/tuxtype/data/themes/bokmal trunk/tuxtype/data/themes/bokmal/images trunk/tuxtype/data/themes/bokmal/words trunk/tuxtype/data/themes/brazilian-portuguese trunk/tuxtype/data/themes/brazilian-portuguese/images trunk/tuxtype/data/themes/brazilian-portuguese/words trunk/tuxtype/data/themes/catalan/words trunk/tuxtype/data/themes/espanol/words trunk/tuxtype/data/themes/italian/words trunk/tuxtype/data/themes/russian

dbruce-guest at alioth.debian.org dbruce-guest at alioth.debian.org
Mon Aug 20 02:31:56 UTC 2007


Author: dbruce-guest
Date: 2007-08-20 02:31:56 +0000 (Mon, 20 Aug 2007)
New Revision: 201

Added:
   tuxtype/trunk/tuxtype/data/fonts/Rachana_g01.ttf
   tuxtype/trunk/tuxtype/data/themes/russian/settings.txt
   tuxtype/trunk/tuxtype/options.c
Modified:
   tuxtype/branches/tuxtype-indic/tuxtype/alphabet.c
   tuxtype/branches/tuxtype-indic/tuxtype/funcs.h
   tuxtype/trunk/ChangeLog
   tuxtype/trunk/Makefile
   tuxtype/trunk/config.h
   tuxtype/trunk/config.log
   tuxtype/trunk/config.status
   tuxtype/trunk/configure
   tuxtype/trunk/configure.ac
   tuxtype/trunk/nsis/tuxtype.nsi
   tuxtype/trunk/tuxtype/alphabet.c
   tuxtype/trunk/tuxtype/data/fonts/Makefile
   tuxtype/trunk/tuxtype/data/themes/Makefile.am
   tuxtype/trunk/tuxtype/data/themes/Makefile.in
   tuxtype/trunk/tuxtype/data/themes/bokmal/Makefile
   tuxtype/trunk/tuxtype/data/themes/bokmal/images/Makefile
   tuxtype/trunk/tuxtype/data/themes/bokmal/words/Makefile
   tuxtype/trunk/tuxtype/data/themes/brazilian-portuguese/Makefile
   tuxtype/trunk/tuxtype/data/themes/brazilian-portuguese/images/Makefile
   tuxtype/trunk/tuxtype/data/themes/brazilian-portuguese/words/Makefile
   tuxtype/trunk/tuxtype/data/themes/brazilian-portuguese/words/plants.txt
   tuxtype/trunk/tuxtype/data/themes/catalan/words/words1.txt
   tuxtype/trunk/tuxtype/data/themes/catalan/words/words2.txt
   tuxtype/trunk/tuxtype/data/themes/catalan/words/words3.txt
   tuxtype/trunk/tuxtype/data/themes/catalan/words/words4.txt
   tuxtype/trunk/tuxtype/data/themes/catalan/words/words5.txt
   tuxtype/trunk/tuxtype/data/themes/espanol/words/words1.txt
   tuxtype/trunk/tuxtype/data/themes/espanol/words/words2.txt
   tuxtype/trunk/tuxtype/data/themes/espanol/words/words3.txt
   tuxtype/trunk/tuxtype/data/themes/italian/words/word1.txt
   tuxtype/trunk/tuxtype/data/themes/italian/words/word2.txt
   tuxtype/trunk/tuxtype/data/themes/italian/words/word3.txt
   tuxtype/trunk/tuxtype/data/themes/italian/words/word4.txt
   tuxtype/trunk/tuxtype/data/themes/russian/Makefile.am
   tuxtype/trunk/tuxtype/data/themes/russian/Makefile.in
   tuxtype/trunk/tuxtype/funcs.h
   tuxtype/trunk/tuxtype/globals.h
   tuxtype/trunk/tuxtype/loaders.c
   tuxtype/trunk/tuxtype/main.c
   tuxtype/trunk/tuxtype/scripting.c
   tuxtype/trunk/tuxtype/setup.c
   tuxtype/trunk/tuxtype/theme.c
   tuxtype/trunk/tuxtype/titlescreen.c
Log:
Merge (mostly) of Indic branch; font selection supported;


Modified: tuxtype/branches/tuxtype-indic/tuxtype/alphabet.c
===================================================================
--- tuxtype/branches/tuxtype-indic/tuxtype/alphabet.c	2007-08-19 14:05:04 UTC (rev 200)
+++ tuxtype/branches/tuxtype-indic/tuxtype/alphabet.c	2007-08-20 02:31:56 UTC (rev 201)
@@ -151,7 +151,8 @@
   return colour;
 }
 
-
+/* This version basically uses the SDLPango lib instead of */
+/* TTF_RenderUTF*_Blended() to properly render Indic text. */
 SDL_Surface* BlackOutline(const unsigned char *t, TTF_Font *font, const SDL_Color *c)
 {
   SDL_Surface* out = NULL;

Modified: tuxtype/branches/tuxtype-indic/tuxtype/funcs.h
===================================================================
--- tuxtype/branches/tuxtype-indic/tuxtype/funcs.h	2007-08-19 14:05:04 UTC (rev 200)
+++ tuxtype/branches/tuxtype-indic/tuxtype/funcs.h	2007-08-20 02:31:56 UTC (rev 201)
@@ -21,12 +21,12 @@
 
 
 /* In alphabet.c */
-SDL_Surface* BlackOutline(const unsigned char *t, TTF_Font* font, const SDL_Color* c);
+SDL_Surface* BlackOutline(const unsigned char* t, TTF_Font* font, const SDL_Color* c);
 SDL_Surface* BlackOutline_wchar(wchar_t t, TTF_Font* font, const SDL_Color* c);
 void ClearWordList(void);
 void FreeLetters(void);
 void GenerateWordList(const char* wordFn);
-wchar_t GetLetter(void);
+wchar_t GetRandLetter(void);
 wchar_t* GetWord(void);
 SDL_Surface* GetWhiteGlyph(wchar_t t);
 SDL_Surface* GetRedGlyph(wchar_t t);
@@ -98,7 +98,7 @@
 
 /* In theme.c: */
 void ChooseTheme(void);
-void SetupTheme(const char *dirname);
+void SetupTheme(const char* dirname);
 
 
 /* In titlescreen.c: */

Modified: tuxtype/trunk/ChangeLog
===================================================================
--- tuxtype/trunk/ChangeLog	2007-08-19 14:05:04 UTC (rev 200)
+++ tuxtype/trunk/ChangeLog	2007-08-20 02:31:56 UTC (rev 201)
@@ -1,3 +1,16 @@
+v 1.5.11
+19 Aug 2007
+[ David Bruce ]
+       - Further development of settings struct.
+       - Got rid of realPath[] - paths now part of settings struct.
+       - program now looks for a settings file under the theme dir
+         when a theme is selected, allowing themes to specify a 
+         preferred font (or other settings).
+       - Incorporated most of changes from tuxtype-Indic branch.
+         Program will now require SDLPango (as well as pango itself
+         and glib) - for now, pango-related code #ifndef-ed out for
+         win32 until I figure out how to get Windows build to work.
+
 01 Aug 2007
 [ David Bruce ]
        - Removed KEYMAP array - wasn't being used correctly anyway.

Modified: tuxtype/trunk/Makefile
===================================================================
--- tuxtype/trunk/Makefile	2007-08-19 14:05:04 UTC (rev 200)
+++ tuxtype/trunk/Makefile	2007-08-20 02:31:56 UTC (rev 201)
@@ -113,9 +113,9 @@
 PACKAGE = tuxtype
 PACKAGE_BUGREPORT = tuxmath-devel at lists.sourceforge.net
 PACKAGE_NAME = tuxtype
-PACKAGE_STRING = tuxtype 1.5.9
+PACKAGE_STRING = tuxtype 1.5.11
 PACKAGE_TARNAME = tuxtype
-PACKAGE_VERSION = 1.5.9
+PACKAGE_VERSION = 1.5.11
 PATH_SEPARATOR = :
 SDL_CFLAGS = -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT
 SDL_CONFIG = /usr/bin/sdl-config
@@ -123,7 +123,7 @@
 SET_MAKE = 
 SHELL = /bin/sh
 STRIP = i586-mingw32msvc-strip
-VERSION = 1.5.9
+VERSION = 1.5.11
 WINDRES = /usr/bin/i586-mingw32msvc-windres
 abs_builddir = /home/dbruce/tux4kids/tuxtype/trunk
 abs_srcdir = /home/dbruce/tux4kids/tuxtype/trunk

Modified: tuxtype/trunk/config.h
===================================================================
--- tuxtype/trunk/config.h	2007-08-19 14:05:04 UTC (rev 200)
+++ tuxtype/trunk/config.h	2007-08-20 02:31:56 UTC (rev 201)
@@ -65,19 +65,19 @@
 #define PACKAGE_NAME "tuxtype"
 
 /* Define to the full name and version of this package. */
-#define PACKAGE_STRING "tuxtype 1.5.9"
+#define PACKAGE_STRING "tuxtype 1.5.11"
 
 /* Define to the one symbol short name of this package. */
 #define PACKAGE_TARNAME "tuxtype"
 
 /* Define to the version of this package. */
-#define PACKAGE_VERSION "1.5.9"
+#define PACKAGE_VERSION "1.5.11"
 
 /* Define to 1 if you have the ANSI C header files. */
 #define STDC_HEADERS 1
 
 /* Version number of package */
-#define VERSION "1.5.9"
+#define VERSION "1.5.11"
 
 /* Define to empty if `const' does not conform to ANSI C. */
 /* #undef const */

Modified: tuxtype/trunk/config.log
===================================================================
--- tuxtype/trunk/config.log	2007-08-19 14:05:04 UTC (rev 200)
+++ tuxtype/trunk/config.log	2007-08-20 02:31:56 UTC (rev 201)
@@ -1,7 +1,7 @@
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by tuxtype configure 1.5.9, which was
+It was created by tuxtype configure 1.5.11, which was
 generated by GNU Autoconf 2.61.  Invocation command line was
 
   $ configure --cache-file=cross-config.cache --target=i586-mingw32msvc --host=i586-mingw32msvc --build=i386-linux --prefix=/usr/local/cross-tools/i586-mingw32msvc --with-sdl-prefix
@@ -19,7 +19,7 @@
 /usr/bin/uname -p = unknown
 /bin/uname -X     = unknown
 
-/bin/arch              = x86_64
+/bin/arch              = unknown
 /usr/bin/arch -k       = unknown
 /usr/convex/getsysinfo = unknown
 /usr/bin/hostinfo      = unknown
@@ -29,6 +29,7 @@
 
 PATH: /usr/local/cross-tools/bin
 PATH: /usr/local/cross-tools/i586-mingw32msvc/bin
+PATH: /home/dbruce/bin
 PATH: /usr/local/bin
 PATH: /usr/bin
 PATH: /bin
@@ -39,7 +40,7 @@
 ## Core tests. ##
 ## ----------- ##
 
-configure:1682: creating cache cross-config.cache
+configure:1674: loading cache cross-config.cache
 configure:1804: checking build system type
 configure:1822: result: i386-pc-linux-gnu
 configure:1844: checking host system type
@@ -53,17 +54,12 @@
 configure:2079: checking for a thread-safe mkdir -p
 configure:2118: result: /bin/mkdir -p
 configure:2131: checking for gawk
-configure:2161: result: no
-configure:2131: checking for mawk
-configure:2147: found /usr/bin/mawk
 configure:2158: result: mawk
 configure:2169: checking whether make sets $(MAKE)
 configure:2190: result: yes
 configure:2270: checking for i586-mingw32msvc-strip
-configure:2286: found /usr/bin/i586-mingw32msvc-strip
 configure:2297: result: i586-mingw32msvc-strip
 configure:2390: checking for i586-mingw32msvc-gcc
-configure:2406: found /usr/bin/i586-mingw32msvc-gcc
 configure:2417: result: i586-mingw32msvc-gcc
 configure:2695: checking for C compiler version
 configure:2702: i586-mingw32msvc-gcc --version >&5
@@ -95,20 +91,12 @@
 configure:2885: $? = 0
 configure:2909: result: .exe
 configure:2915: checking for suffix of object files
-configure:2941: i586-mingw32msvc-gcc -c  -I/usr/local/cross-tools/i586-mingw32msvc/include conftest.c >&5
-configure:2944: $? = 0
 configure:2967: result: o
 configure:2971: checking whether we are using the GNU C compiler
-configure:3000: i586-mingw32msvc-gcc -c  -I/usr/local/cross-tools/i586-mingw32msvc/include conftest.c >&5
-configure:3006: $? = 0
 configure:3023: result: yes
 configure:3028: checking whether i586-mingw32msvc-gcc accepts -g
-configure:3058: i586-mingw32msvc-gcc -c -g -I/usr/local/cross-tools/i586-mingw32msvc/include conftest.c >&5
-configure:3064: $? = 0
 configure:3163: result: yes
 configure:3180: checking for i586-mingw32msvc-gcc option to accept ISO C89
-configure:3254: i586-mingw32msvc-gcc  -c -g -O2 -I/usr/local/cross-tools/i586-mingw32msvc/include conftest.c >&5
-configure:3260: $? = 0
 configure:3283: result: none needed
 configure:3312: checking for style of include used by make
 configure:3340: result: GNU
@@ -121,160 +109,92 @@
 configure:3562: checking whether make sets $(MAKE)
 configure:3583: result: yes
 configure:3650: checking for sdl-config
-configure:3668: found /usr/bin/sdl-config
 configure:3681: result: /usr/bin/sdl-config
 configure:3690: checking for SDL - version >= 1.2.5
 configure:3817: result: yes
 configure:3913: checking for Mix_PlayMusic in -lSDL_mixer
-configure:3948: i586-mingw32msvc-gcc -o conftest.exe -g -O2 -I/usr/local/cross-tools/i586-mingw32msvc/include -L/usr/local/cross-tools/i586-mingw32msvc/lib conftest.c -lSDL_mixer   >&5
-configure:3954: $? = 0
 configure:3972: result: yes
 configure:3988: checking for TTF_Init in -lSDL_ttf
-configure:4023: i586-mingw32msvc-gcc -o conftest.exe -g -O2 -I/usr/local/cross-tools/i586-mingw32msvc/include -L/usr/local/cross-tools/i586-mingw32msvc/lib conftest.c -lSDL_ttf  -lSDL_mixer  >&5
-configure:4029: $? = 0
 configure:4047: result: yes
 configure:4063: checking for IMG_Load in -lSDL_image
-configure:4098: i586-mingw32msvc-gcc -o conftest.exe -g -O2 -I/usr/local/cross-tools/i586-mingw32msvc/include -L/usr/local/cross-tools/i586-mingw32msvc/lib conftest.c -lSDL_image  -lSDL_ttf -lSDL_mixer  >&5
-configure:4104: $? = 0
 configure:4122: result: yes
-configure:4146: checking for native Win32
-configure:4156: result: yes
-configure:4180: checking for i586-mingw32msvc-windres
-configure:4198: found /usr/bin/i586-mingw32msvc-windres
-configure:4211: result: /usr/bin/i586-mingw32msvc-windres
-configure:4228: checking how to run the C preprocessor
-configure:4268: i586-mingw32msvc-gcc -E -I/usr/local/cross-tools/i586-mingw32msvc/include -idirafter /usr/local/cross-tools/i586-mingw32msvc/include/glibc conftest.c
-configure:4274: $? = 0
-configure:4305: i586-mingw32msvc-gcc -E -I/usr/local/cross-tools/i586-mingw32msvc/include -idirafter /usr/local/cross-tools/i586-mingw32msvc/include/glibc conftest.c
+configure:4152: checking for native Win32
+configure:4162: result: yes
+configure:4187: checking for i586-mingw32msvc-windres
+configure:4218: result: /usr/bin/i586-mingw32msvc-windres
+configure:4235: checking how to run the C preprocessor
+configure:4351: result: i586-mingw32msvc-gcc -E
+configure:4380: i586-mingw32msvc-gcc -E -I/usr/local/cross-tools/i586-mingw32msvc/include -idirafter /usr/local/cross-tools/i586-mingw32msvc/include/glibc conftest.c
+configure:4386: $? = 0
+configure:4417: i586-mingw32msvc-gcc -E -I/usr/local/cross-tools/i586-mingw32msvc/include -idirafter /usr/local/cross-tools/i586-mingw32msvc/include/glibc conftest.c
 conftest.c:14:28: ac_nonexistent.h: No such file or directory
-configure:4311: $? = 1
+configure:4423: $? = 1
 configure: failed program was:
 | /* confdefs.h.  */
 | #define PACKAGE_NAME "tuxtype"
 | #define PACKAGE_TARNAME "tuxtype"
-| #define PACKAGE_VERSION "1.5.9"
-| #define PACKAGE_STRING "tuxtype 1.5.9"
+| #define PACKAGE_VERSION "1.5.11"
+| #define PACKAGE_STRING "tuxtype 1.5.11"
 | #define PACKAGE_BUGREPORT "tuxmath-devel at lists.sourceforge.net"
 | #define PACKAGE "tuxtype"
-| #define VERSION "1.5.9"
+| #define VERSION "1.5.11"
 | #define HAVE_LIBSDL_MIXER 1
 | #define HAVE_LIBSDL_TTF 1
 | #define HAVE_LIBSDL_IMAGE 1
 | #define BUILD_MINGW32 1
 | /* end confdefs.h.  */
 | #include <ac_nonexistent.h>
-configure:4344: result: i586-mingw32msvc-gcc -E
-configure:4373: i586-mingw32msvc-gcc -E -I/usr/local/cross-tools/i586-mingw32msvc/include -idirafter /usr/local/cross-tools/i586-mingw32msvc/include/glibc conftest.c
-configure:4379: $? = 0
-configure:4410: i586-mingw32msvc-gcc -E -I/usr/local/cross-tools/i586-mingw32msvc/include -idirafter /usr/local/cross-tools/i586-mingw32msvc/include/glibc conftest.c
-conftest.c:14:28: ac_nonexistent.h: No such file or directory
-configure:4416: $? = 1
-configure: failed program was:
-| /* confdefs.h.  */
-| #define PACKAGE_NAME "tuxtype"
-| #define PACKAGE_TARNAME "tuxtype"
-| #define PACKAGE_VERSION "1.5.9"
-| #define PACKAGE_STRING "tuxtype 1.5.9"
-| #define PACKAGE_BUGREPORT "tuxmath-devel at lists.sourceforge.net"
-| #define PACKAGE "tuxtype"
-| #define VERSION "1.5.9"
-| #define HAVE_LIBSDL_MIXER 1
-| #define HAVE_LIBSDL_TTF 1
-| #define HAVE_LIBSDL_IMAGE 1
-| #define BUILD_MINGW32 1
-| /* end confdefs.h.  */
-| #include <ac_nonexistent.h>
-configure:4454: checking for grep that handles long lines and -e
-configure:4528: result: /bin/grep
-configure:4533: checking for egrep
-configure:4611: result: /bin/grep -E
-configure:4616: checking for ANSI C header files
-configure:4646: i586-mingw32msvc-gcc -c -g -O2 -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT -D__GW32__ -I/usr/local/cross-tools/i586-mingw32msvc/include -idirafter /usr/local/cross-tools/i586-mingw32msvc/include/glibc conftest.c >&5
-configure:4652: $? = 0
-configure:4780: result: yes
-configure:4804: checking for sys/types.h
-configure:4825: i586-mingw32msvc-gcc -c -g -O2 -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT -D__GW32__ -I/usr/local/cross-tools/i586-mingw32msvc/include -idirafter /usr/local/cross-tools/i586-mingw32msvc/include/glibc conftest.c >&5
-configure:4831: $? = 0
-configure:4847: result: yes
-configure:4804: checking for sys/stat.h
-configure:4825: i586-mingw32msvc-gcc -c -g -O2 -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT -D__GW32__ -I/usr/local/cross-tools/i586-mingw32msvc/include -idirafter /usr/local/cross-tools/i586-mingw32msvc/include/glibc conftest.c >&5
-configure:4831: $? = 0
-configure:4847: result: yes
-configure:4804: checking for stdlib.h
-configure:4825: i586-mingw32msvc-gcc -c -g -O2 -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT -D__GW32__ -I/usr/local/cross-tools/i586-mingw32msvc/include -idirafter /usr/local/cross-tools/i586-mingw32msvc/include/glibc conftest.c >&5
-configure:4831: $? = 0
-configure:4847: result: yes
-configure:4804: checking for string.h
-configure:4825: i586-mingw32msvc-gcc -c -g -O2 -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT -D__GW32__ -I/usr/local/cross-tools/i586-mingw32msvc/include -idirafter /usr/local/cross-tools/i586-mingw32msvc/include/glibc conftest.c >&5
-configure:4831: $? = 0
-configure:4847: result: yes
-configure:4804: checking for memory.h
-configure:4825: i586-mingw32msvc-gcc -c -g -O2 -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT -D__GW32__ -I/usr/local/cross-tools/i586-mingw32msvc/include -idirafter /usr/local/cross-tools/i586-mingw32msvc/include/glibc conftest.c >&5
-configure:4831: $? = 0
-configure:4847: result: yes
-configure:4804: checking for strings.h
-configure:4825: i586-mingw32msvc-gcc -c -g -O2 -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT -D__GW32__ -I/usr/local/cross-tools/i586-mingw32msvc/include -idirafter /usr/local/cross-tools/i586-mingw32msvc/include/glibc conftest.c >&5
-configure:4831: $? = 0
-configure:4847: result: yes
-configure:4804: checking for inttypes.h
-configure:4825: i586-mingw32msvc-gcc -c -g -O2 -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT -D__GW32__ -I/usr/local/cross-tools/i586-mingw32msvc/include -idirafter /usr/local/cross-tools/i586-mingw32msvc/include/glibc conftest.c >&5
-configure:4831: $? = 0
-configure:4847: result: yes
-configure:4804: checking for stdint.h
-configure:4825: i586-mingw32msvc-gcc -c -g -O2 -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT -D__GW32__ -I/usr/local/cross-tools/i586-mingw32msvc/include -idirafter /usr/local/cross-tools/i586-mingw32msvc/include/glibc conftest.c >&5
-configure:4831: $? = 0
-configure:4847: result: yes
-configure:4804: checking for unistd.h
-configure:4825: i586-mingw32msvc-gcc -c -g -O2 -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT -D__GW32__ -I/usr/local/cross-tools/i586-mingw32msvc/include -idirafter /usr/local/cross-tools/i586-mingw32msvc/include/glibc conftest.c >&5
-configure:4831: $? = 0
-configure:4847: result: yes
-configure:4865: checking for stdlib.h
-configure:4871: result: yes
-configure:4865: checking for string.h
-configure:4871: result: yes
-configure:5007: checking for an ANSI C-conforming const
-configure:5082: i586-mingw32msvc-gcc -c -g -O2 -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT -D__GW32__ -I/usr/local/cross-tools/i586-mingw32msvc/include -idirafter /usr/local/cross-tools/i586-mingw32msvc/include/glibc conftest.c >&5
-configure:5088: $? = 0
-configure:5103: result: yes
-configure:5113: checking for inline
-configure:5139: i586-mingw32msvc-gcc -c -g -O2 -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT -D__GW32__ -I/usr/local/cross-tools/i586-mingw32msvc/include -idirafter /usr/local/cross-tools/i586-mingw32msvc/include/glibc conftest.c >&5
-configure:5145: $? = 0
-configure:5163: result: inline
-configure:5192: checking for atexit
-configure:5248: i586-mingw32msvc-gcc -o conftest.exe -g -O2 -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT -D__GW32__ -I/usr/local/cross-tools/i586-mingw32msvc/include -idirafter /usr/local/cross-tools/i586-mingw32msvc/include/glibc -L/usr/local/cross-tools/i586-mingw32msvc/lib conftest.c -lmingw32 -lSDLmain -L/usr/lib -lSDL -lSDL_image -lSDL_ttf -lSDL_mixer  -lgw32c -luuid -lole32 -lwsock32 -mwindows >&5
-configure:5254: $? = 0
-configure:5272: result: yes
-configure:5192: checking for memset
-configure:5248: i586-mingw32msvc-gcc -o conftest.exe -g -O2 -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT -D__GW32__ -I/usr/local/cross-tools/i586-mingw32msvc/include -idirafter /usr/local/cross-tools/i586-mingw32msvc/include/glibc -L/usr/local/cross-tools/i586-mingw32msvc/lib conftest.c -lmingw32 -lSDLmain -L/usr/lib -lSDL -lSDL_image -lSDL_ttf -lSDL_mixer  -lgw32c -luuid -lole32 -lwsock32 -mwindows >&5
-conftest.c:50: warning: conflicting types for built-in function 'memset'
-configure:5254: $? = 0
-configure:5272: result: yes
-configure:5192: checking for strchr
-configure:5248: i586-mingw32msvc-gcc -o conftest.exe -g -O2 -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT -D__GW32__ -I/usr/local/cross-tools/i586-mingw32msvc/include -idirafter /usr/local/cross-tools/i586-mingw32msvc/include/glibc -L/usr/local/cross-tools/i586-mingw32msvc/lib conftest.c -lmingw32 -lSDLmain -L/usr/lib -lSDL -lSDL_image -lSDL_ttf -lSDL_mixer  -lgw32c -luuid -lole32 -lwsock32 -mwindows >&5
-conftest.c:51: warning: conflicting types for built-in function 'strchr'
-configure:5254: $? = 0
-configure:5272: result: yes
-configure:5192: checking for strstr
-configure:5248: i586-mingw32msvc-gcc -o conftest.exe -g -O2 -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT -D__GW32__ -I/usr/local/cross-tools/i586-mingw32msvc/include -idirafter /usr/local/cross-tools/i586-mingw32msvc/include/glibc -L/usr/local/cross-tools/i586-mingw32msvc/lib conftest.c -lmingw32 -lSDLmain -L/usr/lib -lSDL -lSDL_image -lSDL_ttf -lSDL_mixer  -lgw32c -luuid -lole32 -lwsock32 -mwindows >&5
-conftest.c:52: warning: conflicting types for built-in function 'strstr'
-configure:5254: $? = 0
-configure:5272: result: yes
-configure:5192: checking for malloc
-configure:5248: i586-mingw32msvc-gcc -o conftest.exe -g -O2 -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT -D__GW32__ -I/usr/local/cross-tools/i586-mingw32msvc/include -idirafter /usr/local/cross-tools/i586-mingw32msvc/include/glibc -L/usr/local/cross-tools/i586-mingw32msvc/lib conftest.c -lmingw32 -lSDLmain -L/usr/lib -lSDL -lSDL_image -lSDL_ttf -lSDL_mixer  -lgw32c -luuid -lole32 -lwsock32 -mwindows >&5
-conftest.c:53: warning: conflicting types for built-in function 'malloc'
-configure:5254: $? = 0
-configure:5272: result: yes
-configure:5324: checking for makensis
-configure:5342: found /usr/bin/makensis
-configure:5355: result: /usr/bin/makensis
-configure:5432: updating cache cross-config.cache
-configure:5496: creating ./config.status
+configure:4461: checking for grep that handles long lines and -e
+configure:4535: result: /bin/grep
+configure:4540: checking for egrep
+configure:4618: result: /bin/grep -E
+configure:4623: checking for ANSI C header files
+configure:4787: result: yes
+configure:4811: checking for sys/types.h
+configure:4854: result: yes
+configure:4811: checking for sys/stat.h
+configure:4854: result: yes
+configure:4811: checking for stdlib.h
+configure:4854: result: yes
+configure:4811: checking for string.h
+configure:4854: result: yes
+configure:4811: checking for memory.h
+configure:4854: result: yes
+configure:4811: checking for strings.h
+configure:4854: result: yes
+configure:4811: checking for inttypes.h
+configure:4854: result: yes
+configure:4811: checking for stdint.h
+configure:4854: result: yes
+configure:4811: checking for unistd.h
+configure:4854: result: yes
+configure:4872: checking for stdlib.h
+configure:4878: result: yes
+configure:4872: checking for string.h
+configure:4878: result: yes
+configure:5014: checking for an ANSI C-conforming const
+configure:5110: result: yes
+configure:5120: checking for inline
+configure:5170: result: inline
+configure:5199: checking for atexit
+configure:5279: result: yes
+configure:5199: checking for memset
+configure:5279: result: yes
+configure:5199: checking for strchr
+configure:5279: result: yes
+configure:5199: checking for strstr
+configure:5279: result: yes
+configure:5199: checking for malloc
+configure:5279: result: yes
+configure:5331: checking for makensis
+configure:5362: result: /usr/bin/makensis
+configure:5503: creating ./config.status
 
 ## ---------------------- ##
 ## Running config.status. ##
 ## ---------------------- ##
 
-This file was extended by tuxtype config.status 1.5.9, which was
+This file was extended by tuxtype config.status 1.5.11, which was
 generated by GNU Autoconf 2.61.  Invocation command line was
 
   CONFIG_FILES    = 
@@ -285,79 +205,83 @@
 
 on debian
 
-config.status:732: creating Makefile
-config.status:732: creating tuxtype/Makefile
-config.status:732: creating tuxtype/data/Makefile
-config.status:732: creating tuxtype/data/fonts/Makefile
-config.status:732: creating tuxtype/data/images/Makefile
-config.status:732: creating tuxtype/data/images/backgrounds/Makefile
-config.status:732: creating tuxtype/data/images/cities/Makefile
-config.status:732: creating tuxtype/data/images/comets/Makefile
-config.status:732: creating tuxtype/data/images/hands/Makefile
-config.status:732: creating tuxtype/data/images/keyboard/Makefile
-config.status:732: creating tuxtype/data/images/menu/Makefile
-config.status:732: creating tuxtype/data/images/status/Makefile
-config.status:732: creating tuxtype/data/images/tux/Makefile
-config.status:732: creating tuxtype/data/scripts/Makefile
-config.status:732: creating tuxtype/data/sounds/Makefile
-config.status:732: creating tuxtype/data/themes/Makefile
-config.status:732: creating tuxtype/data/themes/armenian/Makefile
-config.status:732: creating tuxtype/data/themes/armenian/images/Makefile
-config.status:732: creating tuxtype/data/themes/bokmal/Makefile
-config.status:732: creating tuxtype/data/themes/bokmal/words/Makefile
-config.status:732: creating tuxtype/data/themes/bokmal/images/Makefile
-config.status:732: creating tuxtype/data/themes/bokmal/images/status/Makefile
-config.status:732: creating tuxtype/data/themes/brazilian-portuguese/Makefile
-config.status:732: creating tuxtype/data/themes/brazilian-portuguese/images/Makefile
-config.status:732: creating tuxtype/data/themes/brazilian-portuguese/words/Makefile
-config.status:732: creating tuxtype/data/themes/catalan/Makefile
-config.status:732: creating tuxtype/data/themes/catalan/words/Makefile
-config.status:732: creating tuxtype/data/themes/dansk/Makefile
-config.status:732: creating tuxtype/data/themes/dansk/sounds/Makefile
-config.status:732: creating tuxtype/data/themes/dansk/words/Makefile
-config.status:732: creating tuxtype/data/themes/deutsch/Makefile
-config.status:732: creating tuxtype/data/themes/deutsch/words/Makefile
-config.status:732: creating tuxtype/data/themes/espanol/Makefile
-config.status:732: creating tuxtype/data/themes/espanol/images/Makefile
-config.status:732: creating tuxtype/data/themes/espanol/words/Makefile
-config.status:732: creating tuxtype/data/themes/euskara/Makefile
-config.status:732: creating tuxtype/data/themes/euskara/images/Makefile
-config.status:732: creating tuxtype/data/themes/euskara/words/Makefile
-config.status:732: creating tuxtype/data/themes/french/Makefile
-config.status:732: creating tuxtype/data/themes/french/words/Makefile
-config.status:732: creating tuxtype/data/themes/greek/Makefile
-config.status:732: creating tuxtype/data/themes/greek/words/Makefile
-config.status:732: creating tuxtype/data/themes/italian/Makefile
-config.status:732: creating tuxtype/data/themes/italian/words/Makefile
-config.status:732: creating tuxtype/data/themes/jamaican/Makefile
-config.status:732: creating tuxtype/data/themes/jamaican/images/Makefile
-config.status:732: creating tuxtype/data/themes/jamaican/words/Makefile
-config.status:732: creating tuxtype/data/themes/lithuanian/Makefile
-config.status:732: creating tuxtype/data/themes/lithuanian/images/Makefile
-config.status:732: creating tuxtype/data/themes/lithuanian/images/status/Makefile
-config.status:732: creating tuxtype/data/themes/lithuanian/sounds/Makefile
-config.status:732: creating tuxtype/data/themes/lithuanian/words/Makefile
-config.status:732: creating tuxtype/data/themes/nederlands/Makefile
-config.status:732: creating tuxtype/data/themes/nederlands/words/Makefile
-config.status:732: creating tuxtype/data/themes/nynorsk/Makefile
-config.status:732: creating tuxtype/data/themes/nynorsk/images/Makefile
-config.status:732: creating tuxtype/data/themes/nynorsk/images/status/Makefile
-config.status:732: creating tuxtype/data/themes/nynorsk/words/Makefile
-config.status:732: creating tuxtype/data/themes/russian/Makefile
-config.status:732: creating tuxtype/data/themes/russian/images/Makefile
-config.status:732: creating tuxtype/data/themes/russian/images/status/Makefile
-config.status:732: creating tuxtype/data/themes/russian/words/Makefile
-config.status:732: creating tuxtype/data/themes/svenska/Makefile
-config.status:732: creating tuxtype/data/themes/svenska/words/Makefile
-config.status:732: creating tuxtype/data/themes/swahili/Makefile
-config.status:732: creating tuxtype/data/themes/swahili/words/Makefile
-config.status:732: creating tuxtype/data/words/Makefile
-config.status:732: creating tuxtype/docs/Makefile
-config.status:732: creating tuxtype/docs/en/Makefile
-config.status:732: creating tuxtype.spec
-config.status:732: creating nsis/tuxtype.nsi
-config.status:732: creating config.h
-config.status:1015: executing depfiles commands
+config.status:736: creating Makefile
+config.status:736: creating tuxtype/Makefile
+config.status:736: creating tuxtype/data/Makefile
+config.status:736: creating tuxtype/data/fonts/Makefile
+config.status:736: creating tuxtype/data/images/Makefile
+config.status:736: creating tuxtype/data/images/backgrounds/Makefile
+config.status:736: creating tuxtype/data/images/cities/Makefile
+config.status:736: creating tuxtype/data/images/comets/Makefile
+config.status:736: creating tuxtype/data/images/hands/Makefile
+config.status:736: creating tuxtype/data/images/keyboard/Makefile
+config.status:736: creating tuxtype/data/images/menu/Makefile
+config.status:736: creating tuxtype/data/images/status/Makefile
+config.status:736: creating tuxtype/data/images/tux/Makefile
+config.status:736: creating tuxtype/data/scripts/Makefile
+config.status:736: creating tuxtype/data/sounds/Makefile
+config.status:736: creating tuxtype/data/themes/Makefile
+config.status:736: creating tuxtype/data/themes/armenian/Makefile
+config.status:736: creating tuxtype/data/themes/armenian/images/Makefile
+config.status:736: creating tuxtype/data/themes/bokmal/Makefile
+config.status:736: creating tuxtype/data/themes/bokmal/words/Makefile
+config.status:736: creating tuxtype/data/themes/bokmal/images/Makefile
+config.status:736: creating tuxtype/data/themes/bokmal/images/status/Makefile
+config.status:736: creating tuxtype/data/themes/brazilian-portuguese/Makefile
+config.status:736: creating tuxtype/data/themes/brazilian-portuguese/images/Makefile
+config.status:736: creating tuxtype/data/themes/brazilian-portuguese/words/Makefile
+config.status:736: creating tuxtype/data/themes/catalan/Makefile
+config.status:736: creating tuxtype/data/themes/catalan/words/Makefile
+config.status:736: creating tuxtype/data/themes/dansk/Makefile
+config.status:736: creating tuxtype/data/themes/dansk/sounds/Makefile
+config.status:736: creating tuxtype/data/themes/dansk/words/Makefile
+config.status:736: creating tuxtype/data/themes/deutsch/Makefile
+config.status:736: creating tuxtype/data/themes/deutsch/words/Makefile
+config.status:736: creating tuxtype/data/themes/espanol/Makefile
+config.status:736: creating tuxtype/data/themes/espanol/images/Makefile
+config.status:736: creating tuxtype/data/themes/espanol/words/Makefile
+config.status:736: creating tuxtype/data/themes/euskara/Makefile
+config.status:736: creating tuxtype/data/themes/euskara/images/Makefile
+config.status:736: creating tuxtype/data/themes/euskara/words/Makefile
+config.status:736: creating tuxtype/data/themes/french/Makefile
+config.status:736: creating tuxtype/data/themes/french/words/Makefile
+config.status:736: creating tuxtype/data/themes/greek/Makefile
+config.status:736: creating tuxtype/data/themes/greek/words/Makefile
+config.status:736: creating tuxtype/data/themes/italian/Makefile
+config.status:736: creating tuxtype/data/themes/italian/words/Makefile
+config.status:736: creating tuxtype/data/themes/jamaican/Makefile
+config.status:736: creating tuxtype/data/themes/jamaican/images/Makefile
+config.status:736: creating tuxtype/data/themes/jamaican/words/Makefile
+config.status:736: creating tuxtype/data/themes/lithuanian/Makefile
+config.status:736: creating tuxtype/data/themes/lithuanian/images/Makefile
+config.status:736: creating tuxtype/data/themes/lithuanian/images/status/Makefile
+config.status:736: creating tuxtype/data/themes/lithuanian/sounds/Makefile
+config.status:736: creating tuxtype/data/themes/lithuanian/words/Makefile
+config.status:736: creating tuxtype/data/themes/malayalam/Makefile
+config.status:736: creating tuxtype/data/themes/malayalam/images/Makefile
+config.status:736: creating tuxtype/data/themes/malayalam/images/status/Makefile
+config.status:736: creating tuxtype/data/themes/malayalam/words/Makefile
+config.status:736: creating tuxtype/data/themes/nederlands/Makefile
+config.status:736: creating tuxtype/data/themes/nederlands/words/Makefile
+config.status:736: creating tuxtype/data/themes/nynorsk/Makefile
+config.status:736: creating tuxtype/data/themes/nynorsk/images/Makefile
+config.status:736: creating tuxtype/data/themes/nynorsk/images/status/Makefile
+config.status:736: creating tuxtype/data/themes/nynorsk/words/Makefile
+config.status:736: creating tuxtype/data/themes/russian/Makefile
+config.status:736: creating tuxtype/data/themes/russian/images/Makefile
+config.status:736: creating tuxtype/data/themes/russian/images/status/Makefile
+config.status:736: creating tuxtype/data/themes/russian/words/Makefile
+config.status:736: creating tuxtype/data/themes/svenska/Makefile
+config.status:736: creating tuxtype/data/themes/svenska/words/Makefile
+config.status:736: creating tuxtype/data/themes/swahili/Makefile
+config.status:736: creating tuxtype/data/themes/swahili/words/Makefile
+config.status:736: creating tuxtype/data/words/Makefile
+config.status:736: creating tuxtype/docs/Makefile
+config.status:736: creating tuxtype/docs/en/Makefile
+config.status:736: creating tuxtype.spec
+config.status:736: creating nsis/tuxtype.nsi
+config.status:736: creating config.h
+config.status:1019: executing depfiles commands
 
 ## ---------------- ##
 ## Cache variables. ##
@@ -471,9 +395,9 @@
 PACKAGE='tuxtype'
 PACKAGE_BUGREPORT='tuxmath-devel at lists.sourceforge.net'
 PACKAGE_NAME='tuxtype'
-PACKAGE_STRING='tuxtype 1.5.9'
+PACKAGE_STRING='tuxtype 1.5.11'
 PACKAGE_TARNAME='tuxtype'
-PACKAGE_VERSION='1.5.9'
+PACKAGE_VERSION='1.5.11'
 PATH_SEPARATOR=':'
 SDL_CFLAGS='-I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT'
 SDL_CONFIG='/usr/bin/sdl-config'
@@ -481,7 +405,7 @@
 SET_MAKE=''
 SHELL='/bin/sh'
 STRIP='i586-mingw32msvc-strip'
-VERSION='1.5.9'
+VERSION='1.5.11'
 WINDRES='/usr/bin/i586-mingw32msvc-windres'
 ac_ct_CC=''
 am__fastdepCC_FALSE='#'
@@ -538,11 +462,11 @@
 
 #define PACKAGE_NAME "tuxtype"
 #define PACKAGE_TARNAME "tuxtype"
-#define PACKAGE_VERSION "1.5.9"
-#define PACKAGE_STRING "tuxtype 1.5.9"
+#define PACKAGE_VERSION "1.5.11"
+#define PACKAGE_STRING "tuxtype 1.5.11"
 #define PACKAGE_BUGREPORT "tuxmath-devel at lists.sourceforge.net"
 #define PACKAGE "tuxtype"
-#define VERSION "1.5.9"
+#define VERSION "1.5.11"
 #define HAVE_LIBSDL_MIXER 1
 #define HAVE_LIBSDL_TTF 1
 #define HAVE_LIBSDL_IMAGE 1
@@ -566,3 +490,21 @@
 #define HAVE_MALLOC 1
 
 configure: exit 0
+
+## ---------------------- ##
+## Running config.status. ##
+## ---------------------- ##
+
+This file was extended by tuxtype config.status 1.5.11, which was
+generated by GNU Autoconf 2.61.  Invocation command line was
+
+  CONFIG_FILES    = 
+  CONFIG_HEADERS  = 
+  CONFIG_LINKS    = 
+  CONFIG_COMMANDS = 
+  $ ./config.status config.h
+
+on debian
+
+config.status:736: creating config.h
+config.status:973: config.h is unchanged

Modified: tuxtype/trunk/config.status
===================================================================
--- tuxtype/trunk/config.status	2007-08-19 14:05:04 UTC (rev 200)
+++ tuxtype/trunk/config.status	2007-08-20 02:31:56 UTC (rev 201)
@@ -288,7 +288,7 @@
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by tuxtype $as_me 1.5.9, which was
+This file was extended by tuxtype $as_me 1.5.11, which was
 generated by GNU Autoconf 2.61.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -301,7 +301,7 @@
 "
 
 # Files that config.status was made for.
-config_files=" Makefile tuxtype/Makefile tuxtype/data/Makefile tuxtype/data/fonts/Makefile tuxtype/data/images/Makefile tuxtype/data/images/backgrounds/Makefile tuxtype/data/images/cities/Makefile tuxtype/data/images/comets/Makefile tuxtype/data/images/hands/Makefile tuxtype/data/images/keyboard/Makefile tuxtype/data/images/menu/Makefile tuxtype/data/images/status/Makefile tuxtype/data/images/tux/Makefile tuxtype/data/scripts/Makefile tuxtype/data/sounds/Makefile tuxtype/data/themes/Makefile tuxtype/data/themes/armenian/Makefile tuxtype/data/themes/armenian/images/Makefile tuxtype/data/themes/bokmal/Makefile tuxtype/data/themes/bokmal/words/Makefile tuxtype/data/themes/bokmal/images/Makefile tuxtype/data/themes/bokmal/images/status/Makefile tuxtype/data/themes/brazilian-portuguese/Makefile tuxtype/data/themes/brazilian-portuguese/images/Makefile tuxtype/data/themes/brazilian-portuguese/words/Makefile tuxtype/data/themes/catalan/Makefile tuxtype/data/themes/catalan/words/Makefile tuxtype/data/themes/dansk/Makefile tuxtype/data/themes/dansk/sounds/Makefile tuxtype/data/themes/dansk/words/Makefile tuxtype/data/themes/deutsch/Makefile tuxtype/data/themes/deutsch/words/Makefile tuxtype/data/themes/espanol/Makefile tuxtype/data/themes/espanol/images/Makefile tuxtype/data/themes/espanol/words/Makefile tuxtype/data/themes/euskara/Makefile tuxtype/data/themes/euskara/images/Makefile tuxtype/data/themes/euskara/words/Makefile tuxtype/data/themes/french/Makefile tuxtype/data/themes/french/words/Makefile tuxtype/data/themes/greek/Makefile tuxtype/data/themes/greek/words/Makefile tuxtype/data/themes/italian/Makefile tuxtype/data/themes/italian/words/Makefile tuxtype/data/themes/jamaican/Makefile tuxtype/data/themes/jamaican/images/Makefile tuxtype/data/themes/jamaican/words/Makefile tuxtype/data/themes/lithuanian/Makefile tuxtype/data/themes/lithuanian/images/Makefile tuxtype/data/themes/lithuanian/images/status/Makefile tuxtype/data/themes/lithuanian/sounds/Makefile tuxtype/data/themes/lithuanian/words/Makefile tuxtype/data/themes/nederlands/Makefile tuxtype/data/themes/nederlands/words/Makefile tuxtype/data/themes/nynorsk/Makefile tuxtype/data/themes/nynorsk/images/Makefile tuxtype/data/themes/nynorsk/images/status/Makefile tuxtype/data/themes/nynorsk/words/Makefile tuxtype/data/themes/russian/Makefile tuxtype/data/themes/russian/images/Makefile tuxtype/data/themes/russian/images/status/Makefile tuxtype/data/themes/russian/words/Makefile tuxtype/data/themes/svenska/Makefile tuxtype/data/themes/svenska/words/Makefile tuxtype/data/themes/swahili/Makefile tuxtype/data/themes/swahili/words/Makefile tuxtype/data/words/Makefile tuxtype/docs/Makefile tuxtype/docs/en/Makefile tuxtype.spec nsis/tuxtype.nsi"
+config_files=" Makefile tuxtype/Makefile tuxtype/data/Makefile tuxtype/data/fonts/Makefile tuxtype/data/images/Makefile tuxtype/data/images/backgrounds/Makefile tuxtype/data/images/cities/Makefile tuxtype/data/images/comets/Makefile tuxtype/data/images/hands/Makefile tuxtype/data/images/keyboard/Makefile tuxtype/data/images/menu/Makefile tuxtype/data/images/status/Makefile tuxtype/data/images/tux/Makefile tuxtype/data/scripts/Makefile tuxtype/data/sounds/Makefile tuxtype/data/themes/Makefile tuxtype/data/themes/armenian/Makefile tuxtype/data/themes/armenian/images/Makefile tuxtype/data/themes/bokmal/Makefile tuxtype/data/themes/bokmal/words/Makefile tuxtype/data/themes/bokmal/images/Makefile tuxtype/data/themes/bokmal/images/status/Makefile tuxtype/data/themes/brazilian-portuguese/Makefile tuxtype/data/themes/brazilian-portuguese/images/Makefile tuxtype/data/themes/brazilian-portuguese/words/Makefile tuxtype/data/themes/catalan/Makefile tuxtype/data/themes/catalan/words/Makefile tuxtype/data/themes/dansk/Makefile tuxtype/data/themes/dansk/sounds/Makefile tuxtype/data/themes/dansk/words/Makefile tuxtype/data/themes/deutsch/Makefile tuxtype/data/themes/deutsch/words/Makefile tuxtype/data/themes/espanol/Makefile tuxtype/data/themes/espanol/images/Makefile tuxtype/data/themes/espanol/words/Makefile tuxtype/data/themes/euskara/Makefile tuxtype/data/themes/euskara/images/Makefile tuxtype/data/themes/euskara/words/Makefile tuxtype/data/themes/french/Makefile tuxtype/data/themes/french/words/Makefile tuxtype/data/themes/greek/Makefile tuxtype/data/themes/greek/words/Makefile tuxtype/data/themes/italian/Makefile tuxtype/data/themes/italian/words/Makefile tuxtype/data/themes/jamaican/Makefile tuxtype/data/themes/jamaican/images/Makefile tuxtype/data/themes/jamaican/words/Makefile tuxtype/data/themes/lithuanian/Makefile tuxtype/data/themes/lithuanian/images/Makefile tuxtype/data/themes/lithuanian/images/status/Makefile tuxtype/data/themes/lithuanian/sounds/Makefile tuxtype/data/themes/lithuanian/words/Makefile tuxtype/data/themes/malayalam/Makefile tuxtype/data/themes/malayalam/images/Makefile tuxtype/data/themes/malayalam/images/status/Makefile tuxtype/data/themes/malayalam/words/Makefile tuxtype/data/themes/nederlands/Makefile tuxtype/data/themes/nederlands/words/Makefile tuxtype/data/themes/nynorsk/Makefile tuxtype/data/themes/nynorsk/images/Makefile tuxtype/data/themes/nynorsk/images/status/Makefile tuxtype/data/themes/nynorsk/words/Makefile tuxtype/data/themes/russian/Makefile tuxtype/data/themes/russian/images/Makefile tuxtype/data/themes/russian/images/status/Makefile tuxtype/data/themes/russian/words/Makefile tuxtype/data/themes/svenska/Makefile tuxtype/data/themes/svenska/words/Makefile tuxtype/data/themes/swahili/Makefile tuxtype/data/themes/swahili/words/Makefile tuxtype/data/words/Makefile tuxtype/docs/Makefile tuxtype/docs/en/Makefile tuxtype.spec nsis/tuxtype.nsi"
 config_headers=" config.h"
 config_commands=" depfiles"
 
@@ -333,7 +333,7 @@
 Report bugs to <bug-autoconf at gnu.org>."
 
 ac_cs_version="\
-tuxtype config.status 1.5.9
+tuxtype config.status 1.5.11
 configured by configure, generated by GNU Autoconf 2.61,
   with options \"'--cache-file=cross-config.cache' '--target=i586-mingw32msvc' '--host=i586-mingw32msvc' '--build=i386-linux' '--prefix=/usr/local/cross-tools/i586-mingw32msvc' '--with-sdl-prefix' 'build_alias=i386-linux' 'host_alias=i586-mingw32msvc' 'target_alias=i586-mingw32msvc' 'LDFLAGS=-L/usr/local/cross-tools/i586-mingw32msvc/lib' 'CPPFLAGS=-I/usr/local/cross-tools/i586-mingw32msvc/include'\"
 
@@ -489,6 +489,10 @@
     "tuxtype/data/themes/lithuanian/images/status/Makefile") CONFIG_FILES="$CONFIG_FILES tuxtype/data/themes/lithuanian/images/status/Makefile" ;;
     "tuxtype/data/themes/lithuanian/sounds/Makefile") CONFIG_FILES="$CONFIG_FILES tuxtype/data/themes/lithuanian/sounds/Makefile" ;;
     "tuxtype/data/themes/lithuanian/words/Makefile") CONFIG_FILES="$CONFIG_FILES tuxtype/data/themes/lithuanian/words/Makefile" ;;
+    "tuxtype/data/themes/malayalam/Makefile") CONFIG_FILES="$CONFIG_FILES tuxtype/data/themes/malayalam/Makefile" ;;
+    "tuxtype/data/themes/malayalam/images/Makefile") CONFIG_FILES="$CONFIG_FILES tuxtype/data/themes/malayalam/images/Makefile" ;;
+    "tuxtype/data/themes/malayalam/images/status/Makefile") CONFIG_FILES="$CONFIG_FILES tuxtype/data/themes/malayalam/images/status/Makefile" ;;
+    "tuxtype/data/themes/malayalam/words/Makefile") CONFIG_FILES="$CONFIG_FILES tuxtype/data/themes/malayalam/words/Makefile" ;;
     "tuxtype/data/themes/nederlands/Makefile") CONFIG_FILES="$CONFIG_FILES tuxtype/data/themes/nederlands/Makefile" ;;
     "tuxtype/data/themes/nederlands/words/Makefile") CONFIG_FILES="$CONFIG_FILES tuxtype/data/themes/nederlands/words/Makefile" ;;
     "tuxtype/data/themes/nynorsk/Makefile") CONFIG_FILES="$CONFIG_FILES tuxtype/data/themes/nynorsk/Makefile" ;;
@@ -569,8 +573,8 @@
 s, at PATH_SEPARATOR@,|#_!!_#|:,g
 s, at PACKAGE_NAME@,|#_!!_#|tuxtype,g
 s, at PACKAGE_TARNAME@,|#_!!_#|tuxtype,g
-s, at PACKAGE_VERSION@,|#_!!_#|1.5.9,g
-s, at PACKAGE_STRING@,|#_!!_#|tuxtype 1.5.9,g
+s, at PACKAGE_VERSION@,|#_!!_#|1.5.11,g
+s, at PACKAGE_STRING@,|#_!!_#|tuxtype 1.5.11,g
 s, at PACKAGE_BUGREPORT@,|#_!!_#|tuxmath-devel@|#_!!_#|lists.sourceforge.net,g
 s, at exec_prefix@,|#_!!_#|${prefix},g
 s, at prefix@,|#_!!_#|/usr/local/cross-tools/i586-mingw32msvc,g
@@ -620,7 +624,7 @@
 s, at am__isrc@,|#_!!_#|,g
 s, at CYGPATH_W@,|#_!!_#|echo,g
 s, at PACKAGE@,|#_!!_#|tuxtype,g
-s, at VERSION@,|#_!!_#|1.5.9,g
+s, at VERSION@,|#_!!_#|1.5.11,g
 s, at ACLOCAL@,|#_!!_#|${SHELL} /home/dbruce/tux4kids/tuxtype/trunk/missing --run aclocal-1.10,g
 s, at AUTOCONF@,|#_!!_#|${SHELL} /home/dbruce/tux4kids/tuxtype/trunk/missing --run autoconf,g
 s, at AUTOMAKE@,|#_!!_#|${SHELL} /home/dbruce/tux4kids/tuxtype/trunk/missing --run automake-1.10,g
@@ -931,11 +935,11 @@
 s/$/ /
 s,^\([	 #]*\)[^	 ]*\([	 ]*PACKAGE_NAME\)[	 (].*,\1define\2 "tuxtype" ,
 s,^\([	 #]*\)[^	 ]*\([	 ]*PACKAGE_TARNAME\)[	 (].*,\1define\2 "tuxtype" ,
-s,^\([	 #]*\)[^	 ]*\([	 ]*PACKAGE_VERSION\)[	 (].*,\1define\2 "1.5.9" ,
-s,^\([	 #]*\)[^	 ]*\([	 ]*PACKAGE_STRING\)[	 (].*,\1define\2 "tuxtype 1.5.9" ,
+s,^\([	 #]*\)[^	 ]*\([	 ]*PACKAGE_VERSION\)[	 (].*,\1define\2 "1.5.11" ,
+s,^\([	 #]*\)[^	 ]*\([	 ]*PACKAGE_STRING\)[	 (].*,\1define\2 "tuxtype 1.5.11" ,
 s,^\([	 #]*\)[^	 ]*\([	 ]*PACKAGE_BUGREPORT\)[	 (].*,\1define\2 "tuxmath-devel at lists.sourceforge.net" ,
 s,^\([	 #]*\)[^	 ]*\([	 ]*PACKAGE\)[	 (].*,\1define\2 "tuxtype" ,
-s,^\([	 #]*\)[^	 ]*\([	 ]*VERSION\)[	 (].*,\1define\2 "1.5.9" ,
+s,^\([	 #]*\)[^	 ]*\([	 ]*VERSION\)[	 (].*,\1define\2 "1.5.11" ,
 s,^\([	 #]*\)[^	 ]*\([	 ]*HAVE_LIBSDL_MIXER\)[	 (].*,\1define\2 1 ,
 s,^\([	 #]*\)[^	 ]*\([	 ]*HAVE_LIBSDL_TTF\)[	 (].*,\1define\2 1 ,
 s,^\([	 #]*\)[^	 ]*\([	 ]*HAVE_LIBSDL_IMAGE\)[	 (].*,\1define\2 1 ,

Modified: tuxtype/trunk/configure
===================================================================
--- tuxtype/trunk/configure	2007-08-19 14:05:04 UTC (rev 200)
+++ tuxtype/trunk/configure	2007-08-20 02:31:56 UTC (rev 201)
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.61 for tuxtype 1.5.10.
+# Generated by GNU Autoconf 2.61 for tuxtype 1.5.11.
 #
 # Report bugs to <tuxmath-devel at lists.sourceforge.net>.
 #
@@ -574,8 +574,8 @@
 # Identity of this package.
 PACKAGE_NAME='tuxtype'
 PACKAGE_TARNAME='tuxtype'
-PACKAGE_VERSION='1.5.10'
-PACKAGE_STRING='tuxtype 1.5.10'
+PACKAGE_VERSION='1.5.11'
+PACKAGE_STRING='tuxtype 1.5.11'
 PACKAGE_BUGREPORT='tuxmath-devel at lists.sourceforge.net'
 
 ac_unique_file="tuxtype/funcs.h"
@@ -1232,7 +1232,7 @@
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures tuxtype 1.5.10 to adapt to many kinds of systems.
+\`configure' configures tuxtype 1.5.11 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1303,7 +1303,7 @@
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of tuxtype 1.5.10:";;
+     short | recursive ) echo "Configuration of tuxtype 1.5.11:";;
    esac
   cat <<\_ACEOF
 
@@ -1397,7 +1397,7 @@
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-tuxtype configure 1.5.10
+tuxtype configure 1.5.11
 generated by GNU Autoconf 2.61
 
 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
@@ -1411,7 +1411,7 @@
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by tuxtype $as_me 1.5.10, which was
+It was created by tuxtype $as_me 1.5.11, which was
 generated by GNU Autoconf 2.61.  Invocation command line was
 
   $ $0 $@
@@ -2229,7 +2229,7 @@
 
 # Define the identity of the package.
  PACKAGE=tuxtype
- VERSION=1.5.10
+ VERSION=1.5.11
 
 
 cat >>confdefs.h <<_ACEOF
@@ -4135,6 +4135,12 @@
 fi
 
 
+# Only check for SDL_Pango if NOT building for Windows (for now):
+# AM_CONDITIONAL(BUILD_MINGW32, test "$native_win32" = yes)
+# if test "$native_win32" != yes; then
+# AC_CHECK_LIB([SDL_Pango], [SDLPango_Init], ,[AC_MSG_ERROR(SDL_Pango not found http://sdlpango.sourceforge.net/, )])
+# fi
+
 #
 SDL_CFLAGS=`sdl-config --cflags`
 CFLAGS="$CFLAGS $SDL_CFLAGS"
@@ -5288,7 +5294,7 @@
 # Sam's Install Kludge-work
 CPPFLAGS="$CPPFLAGS -DDATA_PREFIX=\\\"\$(prefix)\\\""
 
-ac_config_files="$ac_config_files Makefile tuxtype/Makefile tuxtype/data/Makefile tuxtype/data/fonts/Makefile tuxtype/data/images/Makefile tuxtype/data/images/backgrounds/Makefile tuxtype/data/images/cities/Makefile tuxtype/data/images/comets/Makefile tuxtype/data/images/hands/Makefile tuxtype/data/images/keyboard/Makefile tuxtype/data/images/menu/Makefile tuxtype/data/images/status/Makefile tuxtype/data/images/tux/Makefile tuxtype/data/scripts/Makefile tuxtype/data/sounds/Makefile tuxtype/data/themes/Makefile tuxtype/data/themes/armenian/Makefile tuxtype/data/themes/armenian/images/Makefile tuxtype/data/themes/bokmal/Makefile tuxtype/data/themes/bokmal/words/Makefile tuxtype/data/themes/bokmal/images/Makefile tuxtype/data/themes/bokmal/images/status/Makefile tuxtype/data/themes/brazilian-portuguese/Makefile tuxtype/data/themes/brazilian-portuguese/images/Makefile tuxtype/data/themes/brazilian-portuguese/words/Makefile tuxtype/data/themes/catalan/Makefile tuxtype/data/themes/catalan/words/Makefile tuxtype/data/themes/dansk/Makefile tuxtype/data/themes/dansk/sounds/Makefile tuxtype/data/themes/dansk/words/Makefile tuxtype/data/themes/deutsch/Makefile tuxtype/data/themes/deutsch/words/Makefile tuxtype/data/themes/espanol/Makefile tuxtype/data/themes/espanol/images/Makefile tuxtype/data/themes/espanol/words/Makefile tuxtype/data/themes/euskara/Makefile tuxtype/data/themes/euskara/images/Makefile tuxtype/data/themes/euskara/words/Makefile tuxtype/data/themes/french/Makefile tuxtype/data/themes/french/words/Makefile tuxtype/data/themes/greek/Makefile tuxtype/data/themes/greek/words/Makefile tuxtype/data/themes/italian/Makefile tuxtype/data/themes/italian/words/Makefile tuxtype/data/themes/jamaican/Makefile tuxtype/data/themes/jamaican/images/Makefile tuxtype/data/themes/jamaican/words/Makefile tuxtype/data/themes/lithuanian/Makefile tuxtype/data/themes/lithuanian/images/Makefile tuxtype/data/themes/lithuanian/images/status/Makefile tuxtype/data/themes/lithuanian/sounds/Makefile tuxtype/data/themes/lithuanian/words/Makefile tuxtype/data/themes/nederlands/Makefile tuxtype/data/themes/nederlands/words/Makefile tuxtype/data/themes/nynorsk/Makefile tuxtype/data/themes/nynorsk/images/Makefile tuxtype/data/themes/nynorsk/images/status/Makefile tuxtype/data/themes/nynorsk/words/Makefile tuxtype/data/themes/russian/Makefile tuxtype/data/themes/russian/images/Makefile tuxtype/data/themes/russian/images/status/Makefile tuxtype/data/themes/russian/words/Makefile tuxtype/data/themes/svenska/Makefile tuxtype/data/themes/svenska/words/Makefile tuxtype/data/themes/swahili/Makefile tuxtype/data/themes/swahili/words/Makefile tuxtype/data/words/Makefile tuxtype/docs/Makefile tuxtype/docs/en/Makefile tuxtype.spec"
+ac_config_files="$ac_config_files Makefile tuxtype/Makefile tuxtype/data/Makefile tuxtype/data/fonts/Makefile tuxtype/data/images/Makefile tuxtype/data/images/backgrounds/Makefile tuxtype/data/images/cities/Makefile tuxtype/data/images/comets/Makefile tuxtype/data/images/hands/Makefile tuxtype/data/images/keyboard/Makefile tuxtype/data/images/menu/Makefile tuxtype/data/images/status/Makefile tuxtype/data/images/tux/Makefile tuxtype/data/scripts/Makefile tuxtype/data/sounds/Makefile tuxtype/data/themes/Makefile tuxtype/data/themes/armenian/Makefile tuxtype/data/themes/armenian/images/Makefile tuxtype/data/themes/bokmal/Makefile tuxtype/data/themes/bokmal/words/Makefile tuxtype/data/themes/bokmal/images/Makefile tuxtype/data/themes/bokmal/images/status/Makefile tuxtype/data/themes/brazilian-portuguese/Makefile tuxtype/data/themes/brazilian-portuguese/images/Makefile tuxtype/data/themes/brazilian-portuguese/words/Makefile tuxtype/data/themes/catalan/Makefile tuxtype/data/themes/catalan/words/Makefile tuxtype/data/themes/dansk/Makefile tuxtype/data/themes/dansk/sounds/Makefile tuxtype/data/themes/dansk/words/Makefile tuxtype/data/themes/deutsch/Makefile tuxtype/data/themes/deutsch/words/Makefile tuxtype/data/themes/espanol/Makefile tuxtype/data/themes/espanol/images/Makefile tuxtype/data/themes/espanol/words/Makefile tuxtype/data/themes/euskara/Makefile tuxtype/data/themes/euskara/images/Makefile tuxtype/data/themes/euskara/words/Makefile tuxtype/data/themes/french/Makefile tuxtype/data/themes/french/words/Makefile tuxtype/data/themes/greek/Makefile tuxtype/data/themes/greek/words/Makefile tuxtype/data/themes/italian/Makefile tuxtype/data/themes/italian/words/Makefile tuxtype/data/themes/jamaican/Makefile tuxtype/data/themes/jamaican/images/Makefile tuxtype/data/themes/jamaican/words/Makefile tuxtype/data/themes/lithuanian/Makefile tuxtype/data/themes/lithuanian/images/Makefile tuxtype/data/themes/lithuanian/images/status/Makefile tuxtype/data/themes/lithuanian/sounds/Makefile tuxtype/data/themes/lithuanian/words/Makefile tuxtype/data/themes/malayalam/Makefile tuxtype/data/themes/malayalam/images/Makefile tuxtype/data/themes/malayalam/images/status/Makefile tuxtype/data/themes/malayalam/words/Makefile tuxtype/data/themes/nederlands/Makefile tuxtype/data/themes/nederlands/words/Makefile tuxtype/data/themes/nynorsk/Makefile tuxtype/data/themes/nynorsk/images/Makefile tuxtype/data/themes/nynorsk/images/status/Makefile tuxtype/data/themes/nynorsk/words/Makefile tuxtype/data/themes/russian/Makefile tuxtype/data/themes/russian/images/Makefile tuxtype/data/themes/russian/images/status/Makefile tuxtype/data/themes/russian/words/Makefile tuxtype/data/themes/svenska/Makefile tuxtype/data/themes/svenska/words/Makefile tuxtype/data/themes/swahili/Makefile tuxtype/data/themes/swahili/words/Makefile tuxtype/data/words/Makefile tuxtype/docs/Makefile tuxtype/docs/en/Makefile tuxtype.spec"
 
 
 # Support for building NSIS Win32 installer (adapted from TuxMath NSIS):
@@ -5790,7 +5796,7 @@
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by tuxtype $as_me 1.5.10, which was
+This file was extended by tuxtype $as_me 1.5.11, which was
 generated by GNU Autoconf 2.61.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -5843,7 +5849,7 @@
 _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF
 ac_cs_version="\\
-tuxtype config.status 1.5.10
+tuxtype config.status 1.5.11
 configured by $0, generated by GNU Autoconf 2.61,
   with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
 
@@ -6011,6 +6017,10 @@
     "tuxtype/data/themes/lithuanian/images/status/Makefile") CONFIG_FILES="$CONFIG_FILES tuxtype/data/themes/lithuanian/images/status/Makefile" ;;
     "tuxtype/data/themes/lithuanian/sounds/Makefile") CONFIG_FILES="$CONFIG_FILES tuxtype/data/themes/lithuanian/sounds/Makefile" ;;
     "tuxtype/data/themes/lithuanian/words/Makefile") CONFIG_FILES="$CONFIG_FILES tuxtype/data/themes/lithuanian/words/Makefile" ;;
+    "tuxtype/data/themes/malayalam/Makefile") CONFIG_FILES="$CONFIG_FILES tuxtype/data/themes/malayalam/Makefile" ;;
+    "tuxtype/data/themes/malayalam/images/Makefile") CONFIG_FILES="$CONFIG_FILES tuxtype/data/themes/malayalam/images/Makefile" ;;
+    "tuxtype/data/themes/malayalam/images/status/Makefile") CONFIG_FILES="$CONFIG_FILES tuxtype/data/themes/malayalam/images/status/Makefile" ;;
+    "tuxtype/data/themes/malayalam/words/Makefile") CONFIG_FILES="$CONFIG_FILES tuxtype/data/themes/malayalam/words/Makefile" ;;
     "tuxtype/data/themes/nederlands/Makefile") CONFIG_FILES="$CONFIG_FILES tuxtype/data/themes/nederlands/Makefile" ;;
     "tuxtype/data/themes/nederlands/words/Makefile") CONFIG_FILES="$CONFIG_FILES tuxtype/data/themes/nederlands/words/Makefile" ;;
     "tuxtype/data/themes/nynorsk/Makefile") CONFIG_FILES="$CONFIG_FILES tuxtype/data/themes/nynorsk/Makefile" ;;

Modified: tuxtype/trunk/configure.ac
===================================================================
--- tuxtype/trunk/configure.ac	2007-08-19 14:05:04 UTC (rev 200)
+++ tuxtype/trunk/configure.ac	2007-08-20 02:31:56 UTC (rev 201)
@@ -1,9 +1,9 @@
 # Process this file with autoconf to produce a configure script.
-AC_INIT(tuxtype, 1.5.10, tuxmath-devel at lists.sourceforge.net)
+AC_INIT(tuxtype, 1.5.11, tuxmath-devel at lists.sourceforge.net)
 AC_CANONICAL_HOST
 AC_CANONICAL_TARGET
 AM_CONFIG_HEADER(config.h)
-AM_INIT_AUTOMAKE(tuxtype, 1.5.10)
+AM_INIT_AUTOMAKE(tuxtype, 1.5.11)
 
 AC_CONFIG_SRCDIR([tuxtype/funcs.h])
 
@@ -37,6 +37,14 @@
 AC_CHECK_LIB([SDL_ttf], [TTF_Init], ,[AC_MSG_ERROR(SDL_ttf not found http://www.libsdl.org/projects/SDL_ttf, )])
 AC_CHECK_LIB([SDL_image], [IMG_Load], ,[AC_MSG_ERROR(SDL_image not found http://www.libsdl.org/projects/SDL_image, )])
 
+
+# FIXME this check still runs even for Win cross-build - must be commented out to do cross-build!
+# Only check for SDL_Pango if NOT building for Windows (for now):
+AM_CONDITIONAL(BUILD_MINGW32, test "$native_win32" = yes)
+if test "$native_win32" != yes; then
+  AC_CHECK_LIB([SDL_Pango], [SDLPango_Init], ,[AC_MSG_ERROR(SDL_Pango not found http://sdlpango.sourceforge.net/, )])
+fi
+
 #
 SDL_CFLAGS=`sdl-config --cflags`
 CFLAGS="$CFLAGS $SDL_CFLAGS"
@@ -139,6 +147,10 @@
 tuxtype/data/themes/lithuanian/images/status/Makefile
 tuxtype/data/themes/lithuanian/sounds/Makefile
 tuxtype/data/themes/lithuanian/words/Makefile
+tuxtype/data/themes/malayalam/Makefile
+tuxtype/data/themes/malayalam/images/Makefile
+tuxtype/data/themes/malayalam/images/status/Makefile
+tuxtype/data/themes/malayalam/words/Makefile
 tuxtype/data/themes/nederlands/Makefile
 tuxtype/data/themes/nederlands/words/Makefile
 tuxtype/data/themes/nynorsk/Makefile

Modified: tuxtype/trunk/nsis/tuxtype.nsi
===================================================================
--- tuxtype/trunk/nsis/tuxtype.nsi	2007-08-19 14:05:04 UTC (rev 200)
+++ tuxtype/trunk/nsis/tuxtype.nsi	2007-08-20 02:31:56 UTC (rev 201)
@@ -3,7 +3,7 @@
 # modified for tuxmath by Yves Combe (yves at ycombe.net)
 # modified for tuxtype by David Bruce (dbruce at tampabay.rr.com)
 
-!define PKG_VERSION "1.5.9"
+!define PKG_VERSION "1.5.11"
 !define PKG_PREFIX  "tuxtype"
 
 !define APP_PREFIX  "TuxType2"

Modified: tuxtype/trunk/tuxtype/alphabet.c
===================================================================
--- tuxtype/trunk/tuxtype/alphabet.c	2007-08-19 14:05:04 UTC (rev 200)
+++ tuxtype/trunk/tuxtype/alphabet.c	2007-08-20 02:31:56 UTC (rev 201)
@@ -16,6 +16,12 @@
  *                                                                         *
  ***************************************************************************/
 
+
+/* Needed to handle rendering issues for Indic languages*/
+#ifndef WIN32
+#include <SDL_Pango.h>
+#endif
+
 /* Needed to convert UTF-8 under Windows because we don't have glibc: */
 #include "ConvertUTF.h"  
 
@@ -48,6 +54,13 @@
 static void clear_keyboard(void);
 static int convert_from_UTF8(wchar_t* wide_word, const char* UTF8_word);
 
+
+#ifndef WIN32
+SDLPango_Matrix* SDL_Colour_to_SDLPango_Matrix(const SDL_Color* cl);
+#endif
+
+
+
 /*****************************************************/
 /*                                                   */
 /*          "Public" Functions                       */
@@ -56,64 +69,108 @@
 
 
 
-void LoadKeyboard( void ) {
-	unsigned char fn[FNLEN];
-	int l;
+/* FIXME would be better to get keymap from system somehow (SDL? X11?) - */
+/* all this does now is fiddle with the ALPHABET and FINGER arrays */
+int LoadKeyboard(void)
+{
+  unsigned char fn[FNLEN];
+  int found = 0;
 
-	clear_keyboard();
+  clear_keyboard();
 
-	for (l=settings.use_english; l<2; l++) {
-		sprintf( fn , "%s/keyboard.lst", realPath[l]);
-		if (CheckFile(fn)) {
-			unsigned char str[255];
-			wchar_t wide_str[255];
+  /* First look for keyboard.lst in theme path, if desired: */
+  if (!settings.use_english)
+  {
+    sprintf(fn , "%s/keyboard.lst", settings.theme_data_path);
+    if (CheckFile(fn))
+    {
+      found = 1;
+    }
+  }
 
-			FILE *f;
-			int i,j;
+  /* Now look in default path if desired or needed: */
+  if (!found)
+  {
+    sprintf(fn , "%s/keyboard.lst", settings.default_data_path);
+    if (CheckFile(fn))
+    {
+      found = 1;
+    }
+  }
 
-			f = fopen( fn, "r" );
+  if (!found)
+  {
+    fprintf(stderr, "LoadKeyboard(): Error finding file for keyboard setup!\n");
+    return 0;
+  }
+  
+  /* fn should now contain valid path to keyboard.lst: */
+  DEBUGCODE{fprintf(stderr, "fn = %s\n", fn);}
 
-			/* Should never fail as we just did the same thing in CheckFile(): */
-			if (f == NULL)
-				continue;
+  {
+    unsigned char str[255];
+    wchar_t wide_str[255];
 
-			do {
-				fscanf( f, "%[^\n]\n", str);
-                                /* Convert to wcs from UTF-8, if needed; */
-                                mbstowcs(wide_str, str, strlen(str) + 1);
+    FILE* f;
+    int i, j;
 
-				if (wcslen(wide_str) > 3) {
+    f = fopen( fn, "r" );
 
-					/* format is: FINGER(s)|Char(s) Upper/Lower */
+    if (f == NULL)
+    {
+      LOG("LoadKeyboard() - could not open keyboard.lst\n");
+      return 0;
+    }
 
-					/* advance past the fingers */
+    do
+    {
+      fscanf( f, "%[^\n]\n", str);
+      /* Convert to wcs from UTF-8, if needed; */
+      //mbstowcs(wide_str, str, strlen(str) + 1);
+      convert_from_UTF8(wide_str, str);
 
-					for (i=0; i<wcslen(wide_str) && wide_str[i] != '|'; i++);
+      if (wcslen(wide_str) > 3)
+      {
+        /* format is: FINGER(s)|Char(s) Upper/Lower */
 
-					i++; // pass the '|'
-					j = i; 
-					ALPHABET[(int)wide_str[j]] = 1;  // first character is default
+        /* advance past the fingers */
+        for (i = 0; i < wcslen(wide_str) && wide_str[i] != '|'; i++);
 
-					//for (i++; i<wcslen(wide_str); i++)
-					//	KEYMAP[(int)wide_str[i]] = wide_str[j];
+        i++; // pass the '|'
+        j = i; 
+        if ( ((int)wide_str[j] >= 0) 
+          && ((int)wide_str[j] < 256) )
+        {
+          ALPHABET[(int)wide_str[j]] = 1;  // first character is default
+        }
+        else
+          fprintf(stderr, "LoadKeyboard() - Unicode char outside supported range\n");
+        //for (i++; i<wcslen(wide_str); i++)
+        //KEYMAP[(int)wide_str[i]] = wide_str[j];
 
-					/* set the fingers for this letter */
+        /* set the fingers for this letter */
+        for (i=0; i<j-1; i++)
+        {
+          if (wide_str[i] >= '0' && wide_str[i] <= '9')
+          {
+            if ( ((int)wide_str[j] >= 0) 
+              && ((int)wide_str[j] < 256) )
+            {
+              FINGER[wide_str[j]][(int)(wide_str[i] - '0')] = 1;
+            }
+            else
+              fprintf(stderr, "LoadKeyboard() - Unicode char outside supported range\n");
+          }
+        }
+        ALPHABET_SIZE++;
+      }
+    } while (!feof(f));
 
-					for (i=0; i<j-1; i++)
-						if (wide_str[i]>='0' && wide_str[i]<='9')
-							FINGER[wide_str[j]][(int)(wide_str[i]-'0')]=1;
+    fclose(f);
 
-					ALPHABET_SIZE++;
-				}
-
-			} while (!feof(f));
-
-			fclose(f);
-
-			return;
-		}
-	}
-	fprintf( stderr, "Error finding file for keyboard setup!\n" );
+    LOG("Leaving LoadKeyboard()\n");
+    return 1;
+  }
 }
 
 
@@ -126,6 +183,12 @@
   SDL_Rect dstrect;
   Uint32 color_key;
 
+/* Simply passthrough to SDLPango version if available (i.e. not under Windows):*/
+#ifndef WIN32
+return BlackOutline_SDLPango(t, font, c);
+#endif
+
+
   if (!t || !font || !c)
   {
     fprintf(stderr, "BlackOutline(): invalid ptr parameter, returning.");
@@ -177,9 +240,121 @@
 }
 
 
+
+#ifndef WIN32
+/*Convert SDL_Colour to SDLPango_Matrix*/
+
+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;
+}
+
+
+
+/* This version basically uses the SDLPango lib instead of */
+/* TTF_RenderUTF*_Blended() to properly render Indic text. */
+SDL_Surface* BlackOutline_SDLPango(const unsigned char *t, TTF_Font *font, const SDL_Color *c)
+{
+  SDL_Surface* out = NULL;
+  SDL_Surface* black_letters = NULL;
+  SDL_Surface* white_letters = NULL;
+  SDL_Surface* bg = NULL;
+  SDL_Rect dstrect;
+  Uint32 color_key;
+
+  /* To covert SDL_Colour to SDLPango_Matrix */
+  SDLPango_Matrix* colour;
+  /* Create a context which contains Pango objects.*/
+  SDLPango_Context* context;
+
+
+  if (!t || !font || !c)
+  {
+    fprintf(stderr, "BlackOutline(): invalid ptr parameter, returning.");
+    return NULL;
+  }
+
+  colour=SDL_Colour_to_SDLPango_Matrix(c);
+  
+  /* Create the context */
+  context = SDLPango_CreateContext();	
+  SDLPango_SetDpi(context, 125.0, 125.0);
+  /* Set the color */
+  SDLPango_SetDefaultColor(context, MATRIX_TRANSPARENT_BACK_BLACK_LETTER );
+  SDLPango_SetBaseDirection(context, SDLPANGO_DIRECTION_LTR);
+  /* Set text to context */ 
+  SDLPango_SetMarkup(context,t, -1);  
+
+
+  black_letters = SDLPango_CreateSurfaceDraw(context);
+
+  if (!black_letters)
+  {
+    fprintf (stderr, "Warning - BlackOutline() could not create image for %s\n", t);
+    return NULL;
+  }
+
+  bg = SDL_CreateRGBSurface(SDL_SWSURFACE,
+                            (black_letters->w) + 5,
+                            (black_letters->h) + 5,
+                             32,
+                             RMASK, GMASK, BMASK, AMASK);
+
+  /* Draw text on a existing surface */
+  SDLPango_Draw(context, bg, 0, 0);
+  
+  /* Use color key for eventual transparency: */
+  color_key = SDL_MapRGB(bg->format, 10, 10, 10);
+  SDL_FillRect(bg, NULL, color_key);
+
+  /* Now draw black outline/shadow 2 pixels on each side: */
+  dstrect.w = black_letters->w;
+  dstrect.h = black_letters->h;
+
+  /* NOTE: can make the "shadow" more or less pronounced by */
+  /* changing the parameters of these loops.                */
+  for (dstrect.x = 1; dstrect.x < 4; dstrect.x++)
+    for (dstrect.y = 1; dstrect.y < 3; dstrect.y++)
+      SDL_BlitSurface(black_letters , NULL, bg, &dstrect );
+
+  SDL_FreeSurface(black_letters);
+
+  /* --- Put the color version of the text on top! --- */
+  SDLPango_SetDefaultColor(context, colour);
+  white_letters = SDLPango_CreateSurfaceDraw(context);
+  dstrect.x = 1;
+  dstrect.y = 1;
+  SDL_BlitSurface(white_letters, NULL, bg, &dstrect);
+  SDL_FreeSurface(white_letters);
+
+  /* --- Convert to the screen format for quicker blits --- */
+  SDL_SetColorKey(bg, SDL_SRCCOLORKEY|SDL_RLEACCEL, color_key);
+  out = SDL_DisplayFormatAlpha(bg);
+  SDL_FreeSurface(bg);
+
+  return out;
+}
+
+#endif
+/* End of win32-excluded coded */
+
+
 /* This version takes a single wide character and renders it with the */
 /* Unicode glyph versions of the SDL_ttf functions:                         */
-SDL_Surface* BlackOutline_wchar(wchar_t t, TTF_Font *font, const SDL_Color *c)
+SDL_Surface* BlackOutline_wchar(wchar_t t, TTF_Font* font, const SDL_Color* c)
 {
   SDL_Surface* out = NULL;
   SDL_Surface* black_letters = NULL;
@@ -289,19 +464,30 @@
 }
 
 
-/* FIXME won't handle Unicode chars beyond 255
+/* Returns a random Unicode char from the char_glyphs list: */
 /* --- get a letter --- */
-wchar_t GetLetter(void)
+wchar_t GetRandLetter(void)
 {
-  static int last = -1; // we don't want to return same letter twice in a row
-	int letter;
-	do {
-		letter = rand() % 255;
-	} while ((letter == last && ALPHABET_SIZE > 1) || ALPHABET[letter] == 0);
+  static wchar_t last = -1; // we don't want to return same letter twice in a row
+  wchar_t letter;
+  int i = 0;
 
-	last = letter;
+  if (!num_chars_used)
+  {
+    fprintf(stderr, "GetRandLetter() - no letters in list!\n");
+    last = -1;
+    return -1;
+  }
 
-	return letter;
+  do
+  {
+    i = rand() % num_chars_used;
+    letter = char_glyphs[i].unicode_value;
+  } while (letter == last);
+
+  last = letter;
+
+  return letter;
 }
 
 /******************************************************************************
@@ -579,6 +765,8 @@
     SDL_FreeSurface(char_glyphs[i].white_glyph);
     SDL_FreeSurface(char_glyphs[i].red_glyph);
   } 
+  /* List now empty: */
+  num_chars_used = 0;
 }
 
 
@@ -633,7 +821,7 @@
 /* the glyph's height above the baseline.                                                    */
 /*  So - 'x' and 'y' before the function should be the coords where the *origin* is supposed */
 /* to be, and after the function they will contain the correct coords for blitting of the    */
-/* glypg. OK?                                                                                */
+/* glyph. OK?                                                                                */
 int GetGlyphCoords(wchar_t t, int* x, int* y)
 {
   int i;
@@ -804,3 +992,5 @@
 
   return wcslen(wide_word);
 }
+
+

Modified: tuxtype/trunk/tuxtype/data/fonts/Makefile
===================================================================
--- tuxtype/trunk/tuxtype/data/fonts/Makefile	2007-08-19 14:05:04 UTC (rev 200)
+++ tuxtype/trunk/tuxtype/data/fonts/Makefile	2007-08-20 02:31:56 UTC (rev 201)
@@ -84,9 +84,9 @@
 PACKAGE = tuxtype
 PACKAGE_BUGREPORT = tuxmath-devel at lists.sourceforge.net
 PACKAGE_NAME = tuxtype
-PACKAGE_STRING = tuxtype 1.5.9
+PACKAGE_STRING = tuxtype 1.5.11
 PACKAGE_TARNAME = tuxtype
-PACKAGE_VERSION = 1.5.9
+PACKAGE_VERSION = 1.5.11
 PATH_SEPARATOR = :
 SDL_CFLAGS = -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT
 SDL_CONFIG = /usr/bin/sdl-config
@@ -94,7 +94,7 @@
 SET_MAKE = 
 SHELL = /bin/sh
 STRIP = i586-mingw32msvc-strip
-VERSION = 1.5.9
+VERSION = 1.5.11
 WINDRES = /usr/bin/i586-mingw32msvc-windres
 abs_builddir = /home/dbruce/tux4kids/tuxtype/trunk/tuxtype/data/fonts
 abs_srcdir = /home/dbruce/tux4kids/tuxtype/trunk/tuxtype/data/fonts

Added: tuxtype/trunk/tuxtype/data/fonts/Rachana_g01.ttf
===================================================================
(Binary files differ)


Property changes on: tuxtype/trunk/tuxtype/data/fonts/Rachana_g01.ttf
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Modified: tuxtype/trunk/tuxtype/data/themes/Makefile.am
===================================================================
--- tuxtype/trunk/tuxtype/data/themes/Makefile.am	2007-08-19 14:05:04 UTC (rev 200)
+++ tuxtype/trunk/tuxtype/data/themes/Makefile.am	2007-08-20 02:31:56 UTC (rev 201)
@@ -12,6 +12,7 @@
 italian\
 jamaican\
 lithuanian\
+malayalam\
 nederlands\
 nynorsk\
 russian\

Modified: tuxtype/trunk/tuxtype/data/themes/Makefile.in
===================================================================
--- tuxtype/trunk/tuxtype/data/themes/Makefile.in	2007-08-19 14:05:04 UTC (rev 200)
+++ tuxtype/trunk/tuxtype/data/themes/Makefile.in	2007-08-20 02:31:56 UTC (rev 201)
@@ -174,6 +174,7 @@
 italian\
 jamaican\
 lithuanian\
+malayalam\
 nederlands\
 nynorsk\
 russian\

Modified: tuxtype/trunk/tuxtype/data/themes/bokmal/Makefile
===================================================================
--- tuxtype/trunk/tuxtype/data/themes/bokmal/Makefile	2007-08-19 14:05:04 UTC (rev 200)
+++ tuxtype/trunk/tuxtype/data/themes/bokmal/Makefile	2007-08-20 02:31:56 UTC (rev 201)
@@ -96,9 +96,9 @@
 PACKAGE = tuxtype
 PACKAGE_BUGREPORT = tuxmath-devel at lists.sourceforge.net
 PACKAGE_NAME = tuxtype
-PACKAGE_STRING = tuxtype 1.5.9
+PACKAGE_STRING = tuxtype 1.5.11
 PACKAGE_TARNAME = tuxtype
-PACKAGE_VERSION = 1.5.9
+PACKAGE_VERSION = 1.5.11
 PATH_SEPARATOR = :
 SDL_CFLAGS = -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT
 SDL_CONFIG = /usr/bin/sdl-config
@@ -106,7 +106,7 @@
 SET_MAKE = 
 SHELL = /bin/sh
 STRIP = i586-mingw32msvc-strip
-VERSION = 1.5.9
+VERSION = 1.5.11
 WINDRES = /usr/bin/i586-mingw32msvc-windres
 abs_builddir = /home/dbruce/tux4kids/tuxtype/trunk/tuxtype/data/themes/bokmal
 abs_srcdir = /home/dbruce/tux4kids/tuxtype/trunk/tuxtype/data/themes/bokmal

Modified: tuxtype/trunk/tuxtype/data/themes/bokmal/images/Makefile
===================================================================
--- tuxtype/trunk/tuxtype/data/themes/bokmal/images/Makefile	2007-08-19 14:05:04 UTC (rev 200)
+++ tuxtype/trunk/tuxtype/data/themes/bokmal/images/Makefile	2007-08-20 02:31:56 UTC (rev 201)
@@ -96,9 +96,9 @@
 PACKAGE = tuxtype
 PACKAGE_BUGREPORT = tuxmath-devel at lists.sourceforge.net
 PACKAGE_NAME = tuxtype
-PACKAGE_STRING = tuxtype 1.5.9
+PACKAGE_STRING = tuxtype 1.5.11
 PACKAGE_TARNAME = tuxtype
-PACKAGE_VERSION = 1.5.9
+PACKAGE_VERSION = 1.5.11
 PATH_SEPARATOR = :
 SDL_CFLAGS = -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT
 SDL_CONFIG = /usr/bin/sdl-config
@@ -106,7 +106,7 @@
 SET_MAKE = 
 SHELL = /bin/sh
 STRIP = i586-mingw32msvc-strip
-VERSION = 1.5.9
+VERSION = 1.5.11
 WINDRES = /usr/bin/i586-mingw32msvc-windres
 abs_builddir = /home/dbruce/tux4kids/tuxtype/trunk/tuxtype/data/themes/bokmal/images
 abs_srcdir = /home/dbruce/tux4kids/tuxtype/trunk/tuxtype/data/themes/bokmal/images

Modified: tuxtype/trunk/tuxtype/data/themes/bokmal/words/Makefile
===================================================================
--- tuxtype/trunk/tuxtype/data/themes/bokmal/words/Makefile	2007-08-19 14:05:04 UTC (rev 200)
+++ tuxtype/trunk/tuxtype/data/themes/bokmal/words/Makefile	2007-08-20 02:31:56 UTC (rev 201)
@@ -84,9 +84,9 @@
 PACKAGE = tuxtype
 PACKAGE_BUGREPORT = tuxmath-devel at lists.sourceforge.net
 PACKAGE_NAME = tuxtype
-PACKAGE_STRING = tuxtype 1.5.9
+PACKAGE_STRING = tuxtype 1.5.11
 PACKAGE_TARNAME = tuxtype
-PACKAGE_VERSION = 1.5.9
+PACKAGE_VERSION = 1.5.11
 PATH_SEPARATOR = :
 SDL_CFLAGS = -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT
 SDL_CONFIG = /usr/bin/sdl-config
@@ -94,7 +94,7 @@
 SET_MAKE = 
 SHELL = /bin/sh
 STRIP = i586-mingw32msvc-strip
-VERSION = 1.5.9
+VERSION = 1.5.11
 WINDRES = /usr/bin/i586-mingw32msvc-windres
 abs_builddir = /home/dbruce/tux4kids/tuxtype/trunk/tuxtype/data/themes/bokmal/words
 abs_srcdir = /home/dbruce/tux4kids/tuxtype/trunk/tuxtype/data/themes/bokmal/words

Modified: tuxtype/trunk/tuxtype/data/themes/brazilian-portuguese/Makefile
===================================================================
--- tuxtype/trunk/tuxtype/data/themes/brazilian-portuguese/Makefile	2007-08-19 14:05:04 UTC (rev 200)
+++ tuxtype/trunk/tuxtype/data/themes/brazilian-portuguese/Makefile	2007-08-20 02:31:56 UTC (rev 201)
@@ -96,9 +96,9 @@
 PACKAGE = tuxtype
 PACKAGE_BUGREPORT = tuxmath-devel at lists.sourceforge.net
 PACKAGE_NAME = tuxtype
-PACKAGE_STRING = tuxtype 1.5.9
+PACKAGE_STRING = tuxtype 1.5.11
 PACKAGE_TARNAME = tuxtype
-PACKAGE_VERSION = 1.5.9
+PACKAGE_VERSION = 1.5.11
 PATH_SEPARATOR = :
 SDL_CFLAGS = -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT
 SDL_CONFIG = /usr/bin/sdl-config
@@ -106,7 +106,7 @@
 SET_MAKE = 
 SHELL = /bin/sh
 STRIP = i586-mingw32msvc-strip
-VERSION = 1.5.9
+VERSION = 1.5.11
 WINDRES = /usr/bin/i586-mingw32msvc-windres
 abs_builddir = /home/dbruce/tux4kids/tuxtype/trunk/tuxtype/data/themes/brazilian-portuguese
 abs_srcdir = /home/dbruce/tux4kids/tuxtype/trunk/tuxtype/data/themes/brazilian-portuguese

Modified: tuxtype/trunk/tuxtype/data/themes/brazilian-portuguese/images/Makefile
===================================================================
--- tuxtype/trunk/tuxtype/data/themes/brazilian-portuguese/images/Makefile	2007-08-19 14:05:04 UTC (rev 200)
+++ tuxtype/trunk/tuxtype/data/themes/brazilian-portuguese/images/Makefile	2007-08-20 02:31:56 UTC (rev 201)
@@ -84,9 +84,9 @@
 PACKAGE = tuxtype
 PACKAGE_BUGREPORT = tuxmath-devel at lists.sourceforge.net
 PACKAGE_NAME = tuxtype
-PACKAGE_STRING = tuxtype 1.5.9
+PACKAGE_STRING = tuxtype 1.5.11
 PACKAGE_TARNAME = tuxtype
-PACKAGE_VERSION = 1.5.9
+PACKAGE_VERSION = 1.5.11
 PATH_SEPARATOR = :
 SDL_CFLAGS = -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT
 SDL_CONFIG = /usr/bin/sdl-config
@@ -94,7 +94,7 @@
 SET_MAKE = 
 SHELL = /bin/sh
 STRIP = i586-mingw32msvc-strip
-VERSION = 1.5.9
+VERSION = 1.5.11
 WINDRES = /usr/bin/i586-mingw32msvc-windres
 abs_builddir = /home/dbruce/tux4kids/tuxtype/trunk/tuxtype/data/themes/brazilian-portuguese/images
 abs_srcdir = /home/dbruce/tux4kids/tuxtype/trunk/tuxtype/data/themes/brazilian-portuguese/images

Modified: tuxtype/trunk/tuxtype/data/themes/brazilian-portuguese/words/Makefile
===================================================================
--- tuxtype/trunk/tuxtype/data/themes/brazilian-portuguese/words/Makefile	2007-08-19 14:05:04 UTC (rev 200)
+++ tuxtype/trunk/tuxtype/data/themes/brazilian-portuguese/words/Makefile	2007-08-20 02:31:56 UTC (rev 201)
@@ -84,9 +84,9 @@
 PACKAGE = tuxtype
 PACKAGE_BUGREPORT = tuxmath-devel at lists.sourceforge.net
 PACKAGE_NAME = tuxtype
-PACKAGE_STRING = tuxtype 1.5.9
+PACKAGE_STRING = tuxtype 1.5.11
 PACKAGE_TARNAME = tuxtype
-PACKAGE_VERSION = 1.5.9
+PACKAGE_VERSION = 1.5.11
 PATH_SEPARATOR = :
 SDL_CFLAGS = -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT
 SDL_CONFIG = /usr/bin/sdl-config
@@ -94,7 +94,7 @@
 SET_MAKE = 
 SHELL = /bin/sh
 STRIP = i586-mingw32msvc-strip
-VERSION = 1.5.9
+VERSION = 1.5.11
 WINDRES = /usr/bin/i586-mingw32msvc-windres
 abs_builddir = /home/dbruce/tux4kids/tuxtype/trunk/tuxtype/data/themes/brazilian-portuguese/words
 abs_srcdir = /home/dbruce/tux4kids/tuxtype/trunk/tuxtype/data/themes/brazilian-portuguese/words

Modified: tuxtype/trunk/tuxtype/data/themes/brazilian-portuguese/words/plants.txt
===================================================================
--- tuxtype/trunk/tuxtype/data/themes/brazilian-portuguese/words/plants.txt	2007-08-19 14:05:04 UTC (rev 200)
+++ tuxtype/trunk/tuxtype/data/themes/brazilian-portuguese/words/plants.txt	2007-08-20 02:31:56 UTC (rev 201)
@@ -1,28 +1,28 @@
 Exercicios 2
-asdfg
-hjklç
-gfdsaçl
-hjklç
-asdfg
-açsldkfj
-fjdkslaç
-qwert
-yuiop
-poiuy
-trewq
-trewqpoi
-iopqwert
-qpworuty
-tyru
-eiwoqp
-cvbnm,.;
-,mnbvcxz
-bvcxz
-;.,mn
-nm,.;
-zxcvb
-z;x.c,vm
-bnvmc,x.
+ASDFG
+HJKLÇ
+GFDSAÇL
+HJKLÇ
+ASDFG
+AÇSLDKFJ
+FJDKSLAÇ
+QWERT
+YUIOP
+POIUY
+TREWQ
+TREWQPOI
+IOPQWERT
+QPWORUTY
+TYRU
+EIWOQP
+CVBNM,.;
+,MNBVCXZ
+BVCXZ
+;.,MN
+NM,.;
+ZXCVB
+Z;X.C,VM
+BNVMC,X.
 12345678
 09876543
 54309876

Modified: tuxtype/trunk/tuxtype/data/themes/catalan/words/words1.txt
===================================================================
--- tuxtype/trunk/tuxtype/data/themes/catalan/words/words1.txt	2007-08-19 14:05:04 UTC (rev 200)
+++ tuxtype/trunk/tuxtype/data/themes/catalan/words/words1.txt	2007-08-20 02:31:56 UTC (rev 201)
@@ -1,96 +1,96 @@
 Paraules de tres lletres
-amo
-ara
-avi
-baf
-bar
-ca
-car
-cec
-cim
-col
-com
-cop
-cor
-cos
-cot
-cuc
-dau
-dit
-era
-fam
-fat
-fel
-fem
-gat
-gec
-gos
-iot
-jou
-lli
-mal
-mam
-mar
-mas
-mat
-mel
-meu
-mim
-moc
-mor
-mos
-nap
-nas
-nau
-oca
-ona
-pa
-pal
-pam
-pas
-pau
-pes
-pet
-peu
-pi
-pit
-piu
-que
-ral
-ram
-rap
-ras
-rec
-rem
-res
-reu
-ric
-riu
-roc
-ros
-rot
-ruc
-sac
-sec
-set
-seu
-sis
-sol
-suc
-tac
-tap
-teu
-tic
-tos
-tot
-tou
-ull
-un
-una
-vas
-veu
-viu
-xai
-xic
-xoc
-xut
\ No newline at end of file
+AMO
+ARA
+AVI
+BAF
+BAR
+CA
+CAR
+CEC
+CIM
+COL
+COM
+COP
+COR
+COS
+COT
+CUC
+DAU
+DIT
+ERA
+FAM
+FAT
+FEL
+FEM
+GAT
+GEC
+GOS
+IOT
+JOU
+LLI
+MAL
+MAM
+MAR
+MAS
+MAT
+MEL
+MEU
+MIM
+MOC
+MOR
+MOS
+NAP
+NAS
+NAU
+OCA
+ONA
+PA
+PAL
+PAM
+PAS
+PAU
+PES
+PET
+PEU
+PI
+PIT
+PIU
+QUE
+RAL
+RAM
+RAP
+RAS
+REC
+REM
+RES
+REU
+RIC
+RIU
+ROC
+ROS
+ROT
+RUC
+SAC
+SEC
+SET
+SEU
+SIS
+SOL
+SUC
+TAC
+TAP
+TEU
+TIC
+TOS
+TOT
+TOU
+ULL
+UN
+UNA
+VAS
+VEU
+VIU
+XAI
+XIC
+XOC
+XUT
\ No newline at end of file

Modified: tuxtype/trunk/tuxtype/data/themes/catalan/words/words2.txt
===================================================================
--- tuxtype/trunk/tuxtype/data/themes/catalan/words/words2.txt	2007-08-19 14:05:04 UTC (rev 200)
+++ tuxtype/trunk/tuxtype/data/themes/catalan/words/words2.txt	2007-08-20 02:31:56 UTC (rev 201)
@@ -1,97 +1,97 @@
 Paraules de quatre lletres
-bata
-bena
-boca
-bola
-bota
-brau
-broc
-brut
-cala
-cama
-capa
-casa
-cara
-ceba
-cega
-coca
-cove
-dama
-dent
-dida
-disc
-dona
-duna
-fava
-fera
-fila
-fill
-fira
-fita
-fona
-fosa
-full
-fura
-gall
-gana
-gepa
-goma
-gota
-lava
-llet
-llit
-lona
-maco
-mare
-mesa
-meva
-mona
-mora
-nana
-nena
-pare
-pena
-pesa
-poca
-poda
-poma
-pont
-popa
-porc
-port
-preu
-prou
-quan
-rama
-rasa
-rata
-roba
-roca
-roda
-roja
-ruda
-rusc
-saba
-sala
-seva
-soca
-soda
-soga
-sola
-sopa
-sota
-suma
-suor
-suro
-taca
-tala
-tara
-tela
-tema
-teva
-tova
-unes
-vaca
-vaga
-vara
-xina
+BATA
+BENA
+BOCA
+BOLA
+BOTA
+BRAU
+BROC
+BRUT
+CALA
+CAMA
+CAPA
+CASA
+CARA
+CEBA
+CEGA
+COCA
+COVE
+DAMA
+DENT
+DIDA
+DISC
+DONA
+DUNA
+FAVA
+FERA
+FILA
+FILL
+FIRA
+FITA
+FONA
+FOSA
+FULL
+FURA
+GALL
+GANA
+GEPA
+GOMA
+GOTA
+LAVA
+LLET
+LLIT
+LONA
+MACO
+MARE
+MESA
+MEVA
+MONA
+MORA
+NANA
+NENA
+PARE
+PENA
+PESA
+POCA
+PODA
+POMA
+PONT
+POPA
+PORC
+PORT
+PREU
+PROU
+QUAN
+RAMA
+RASA
+RATA
+ROBA
+ROCA
+RODA
+ROJA
+RUDA
+RUSC
+SABA
+SALA
+SEVA
+SOCA
+SODA
+SOGA
+SOLA
+SOPA
+SOTA
+SUMA
+SUOR
+SURO
+TACA
+TALA
+TARA
+TELA
+TEMA
+TEVA
+TOVA
+UNES
+VACA
+VAGA
+VARA
+XINA

Modified: tuxtype/trunk/tuxtype/data/themes/catalan/words/words3.txt
===================================================================
--- tuxtype/trunk/tuxtype/data/themes/catalan/words/words3.txt	2007-08-19 14:05:04 UTC (rev 200)
+++ tuxtype/trunk/tuxtype/data/themes/catalan/words/words3.txt	2007-08-20 02:31:56 UTC (rev 201)
@@ -1,76 +1,76 @@
 Paraules de cinc lletres
-aigua
-anell
-bossa
-brusa
-caire
-#caçar
-calma
-capsa
-carta
-certa
-#coixí
-color
-corda
-cotxe
-cranc
-crema
-dents
-estel
-flors
-fossa
-freda
-gaire
-gelat
-gorra
-gossa
-llard
-llavi
-llera
-lliri
-lluna
-massa
-missa
-molsa
-mussa
-nyora
-ocell
-ossos
-paper
-perer
-#pinça
-pizza
-plata
-ploma
-pomer
-quant
-quasi
-quera
-raure
-rebre
-retre
-riure
-rossa
-salar
-sidra
-sirga
-sogra
-sucre
-tassa
-tarda
-tarja
-taula
-tenda
-terra
-tigre
-tolba
-trist
-turca
-ullal
-verda
-vespa
-vidre
-viure
-voral
-xamba
-zombi
\ No newline at end of file
+AIGUA
+ANELL
+BOSSA
+BRUSA
+CAIRE
+#CAÇAR
+CALMA
+CAPSA
+CARTA
+CERTA
+#COIXÍ
+COLOR
+CORDA
+COTXE
+CRANC
+CREMA
+DENTS
+ESTEL
+FLORS
+FOSSA
+FREDA
+GAIRE
+GELAT
+GORRA
+GOSSA
+LLARD
+LLAVI
+LLERA
+LLIRI
+LLUNA
+MASSA
+MISSA
+MOLSA
+MUSSA
+NYORA
+OCELL
+OSSOS
+PAPER
+PERER
+#PINÇA
+PIZZA
+PLATA
+PLOMA
+POMER
+QUANT
+QUASI
+QUERA
+RAURE
+REBRE
+RETRE
+RIURE
+ROSSA
+SALAR
+SIDRA
+SIRGA
+SOGRA
+SUCRE
+TASSA
+TARDA
+TARJA
+TAULA
+TENDA
+TERRA
+TIGRE
+TOLBA
+TRIST
+TURCA
+ULLAL
+VERDA
+VESPA
+VIDRE
+VIURE
+VORAL
+XAMBA
+ZOMBI
\ No newline at end of file

Modified: tuxtype/trunk/tuxtype/data/themes/catalan/words/words4.txt
===================================================================
--- tuxtype/trunk/tuxtype/data/themes/catalan/words/words4.txt	2007-08-19 14:05:04 UTC (rev 200)
+++ tuxtype/trunk/tuxtype/data/themes/catalan/words/words4.txt	2007-08-20 02:31:56 UTC (rev 201)
@@ -1,101 +1,101 @@
 Paraules de sis i més lletres
-aglomerat
-aixeta
-altaveu
-animal
-bicicleta
-bolquer
-bombeta
-brioix
-cabell
-cacauet
-cadira
-calaix
-callar
-camisa
-canari
-canella
-cantar
-carabassa
-carpeta
-cartolina
-caseta
-cassola
-cavall
-cigrons
-cintura
-cirera
-cocodril
-colors
-comprar
-costura
-creure
-cullera
-descosit
-despatx
-disquet
-elevar
-enciam
-escoltar
-esquirol
-estalvis
-estenedor
-finestra
-forquilla
-ganivet
-ganyota
-garrafa
-garrepa
-garriga
-garrofa
-gavarra
-geneta
-ginesta
-glapir
-glopejar
-golafre
-granota
-grapar
-greixar
-grenya
-gripau
-grunyir
-llenties
-llibre
-llibreta
-maduixa
-maneta
-masovera
-monitor
-motxilla
-orella
-paleta
-pantalla
-pantera
-paquet
-parlar
-parquet
-passeig
-pastanaga
-pastar
-patata
-pintar
-pintura
-plomada
-prunera
-rajola
-rasqueta
-remolatxa
-rentar
-revista
-rossinyol
-sabata
-samarreta
-sostre
-taronja
-teclat
-tractor
-tricicle
-vaixell
-vermell
-vinagre
+AGLOMERAT
+AIXETA
+ALTAVEU
+ANIMAL
+BICICLETA
+BOLQUER
+BOMBETA
+BRIOIX
+CABELL
+CACAUET
+CADIRA
+CALAIX
+CALLAR
+CAMISA
+CANARI
+CANELLA
+CANTAR
+CARABASSA
+CARPETA
+CARTOLINA
+CASETA
+CASSOLA
+CAVALL
+CIGRONS
+CINTURA
+CIRERA
+COCODRIL
+COLORS
+COMPRAR
+COSTURA
+CREURE
+CULLERA
+DESCOSIT
+DESPATX
+DISQUET
+ELEVAR
+ENCIAM
+ESCOLTAR
+ESQUIROL
+ESTALVIS
+ESTENEDOR
+FINESTRA
+FORQUILLA
+GANIVET
+GANYOTA
+GARRAFA
+GARREPA
+GARRIGA
+GARROFA
+GAVARRA
+GENETA
+GINESTA
+GLAPIR
+GLOPEJAR
+GOLAFRE
+GRANOTA
+GRAPAR
+GREIXAR
+GRENYA
+GRIPAU
+GRUNYIR
+LLENTIES
+LLIBRE
+LLIBRETA
+MADUIXA
+MANETA
+MASOVERA
+MONITOR
+MOTXILLA
+ORELLA
+PALETA
+PANTALLA
+PANTERA
+PAQUET
+PARLAR
+PARQUET
+PASSEIG
+PASTANAGA
+PASTAR
+PATATA
+PINTAR
+PINTURA
+PLOMADA
+PRUNERA
+RAJOLA
+RASQUETA
+REMOLATXA
+RENTAR
+REVISTA
+ROSSINYOL
+SABATA
+SAMARRETA
+SOSTRE
+TARONJA
+TECLAT
+TRACTOR
+TRICICLE
+VAIXELL
+VERMELL
+VINAGRE

Modified: tuxtype/trunk/tuxtype/data/themes/catalan/words/words5.txt
===================================================================
--- tuxtype/trunk/tuxtype/data/themes/catalan/words/words5.txt	2007-08-19 14:05:04 UTC (rev 200)
+++ tuxtype/trunk/tuxtype/data/themes/catalan/words/words5.txt	2007-08-20 02:31:56 UTC (rev 201)
@@ -1,13 +1,13 @@
 Paraules de lletres rares (test for non standard letters)
-#aquí     multikey --> acute accent followed by i  don't works
-#calçot   not standard letter --> c cedill  works
-#bòfia    multikey --> grave accent followed by o don't works
-#ànec     multikey --> grave accent followed by a don't works
-#iñaki    not standard letter --> n tilde works
-#col·legi not standard letter (shift+number3)--> middot works
-aquí
-calçot
-bòfia
-ànec
-iñaki
-col·legi
\ No newline at end of file
+#AQUÍ     MULTIKEY --> ACUTE ACCENT FOLLOWED BY I  DON'T WORKS
+#CALÇOT   NOT STANDARD LETTER --> C CEDILL  WORKS
+#BÒFIA    MULTIKEY --> GRAVE ACCENT FOLLOWED BY O DON'T WORKS
+#ÀNEC     MULTIKEY --> GRAVE ACCENT FOLLOWED BY A DON'T WORKS
+#IÑAKI    NOT STANDARD LETTER --> N TILDE WORKS
+#COL·LEGI NOT STANDARD LETTER (SHIFT+NUMBER3)--> MIDDOT WORKS
+AQUÍ
+CALÇOT
+BÒFIA
+ÀNEC
+IÑAKI
+COL·LEGI
\ No newline at end of file

Modified: tuxtype/trunk/tuxtype/data/themes/espanol/words/words1.txt
===================================================================
--- tuxtype/trunk/tuxtype/data/themes/espanol/words/words1.txt	2007-08-19 14:05:04 UTC (rev 200)
+++ tuxtype/trunk/tuxtype/data/themes/espanol/words/words1.txt	2007-08-20 02:31:56 UTC (rev 201)
@@ -1,25 +1,25 @@
-Words uno
-pan
-pez
-hora
-malo
-papa
-sed
-seca
-agua
-dedo
-ola
-hola
-mio
-dia
-feo
-tia
-pie
-una
-uno
-ojo
-boca
-cara
-mano
-rey
-bebe
+Words Uno
+PAN
+PEZ
+HORA
+MALO
+PAPA
+SED
+SECA
+AGUA
+DEDO
+OLA
+HOLA
+MIO
+DIA
+FEO
+TIA
+PIE
+UNA
+UNO
+OJO
+BOCA
+CARA
+MANO
+REY
+BEBE

Modified: tuxtype/trunk/tuxtype/data/themes/espanol/words/words2.txt
===================================================================
--- tuxtype/trunk/tuxtype/data/themes/espanol/words/words2.txt	2007-08-19 14:05:04 UTC (rev 200)
+++ tuxtype/trunk/tuxtype/data/themes/espanol/words/words2.txt	2007-08-20 02:31:56 UTC (rev 201)
@@ -1,27 +1,27 @@
-Words dos
-corta
-debil
-primo
-cigaro
-lapiz
-guapo
-hermosa
-nariz
-tengo
-museo
-cenar
-perro
-gatito
-musica
-padre
-mejor
-hermano
-facil
-claro
-espejo
-labios
-escala
-feliz
-libro
-sombra
+Words Dos
+CORTA
+DEBIL
+PRIMO
+CIGARO
+LAPIZ
+GUAPO
+HERMOSA
+NARIZ
+TENGO
+MUSEO
+CENAR
+PERRO
+GATITO
+MUSICA
+PADRE
+MEJOR
+HERMANO
+FACIL
+CLARO
+ESPEJO
+LABIOS
+ESCALA
+FELIZ
+LIBRO
+SOMBRA
 

Modified: tuxtype/trunk/tuxtype/data/themes/espanol/words/words3.txt
===================================================================
--- tuxtype/trunk/tuxtype/data/themes/espanol/words/words3.txt	2007-08-19 14:05:04 UTC (rev 200)
+++ tuxtype/trunk/tuxtype/data/themes/espanol/words/words3.txt	2007-08-20 02:31:56 UTC (rev 201)
@@ -1,25 +1,25 @@
-Words tres
-pelicula
-maestro
-trabajo
-divertir
-desayuno
-botella
-servicio
-escusado
-edificio
-ventana
-telefono
-pintura
-lectura
-leccion
-caballo
-corazon
-pensando
-general
-cuchara
-cuchillo
-cerebro
-montana
-asustado
-plastico
+Words Tres
+PELICULA
+MAESTRO
+TRABAJO
+DIVERTIR
+DESAYUNO
+BOTELLA
+SERVICIO
+ESCUSADO
+EDIFICIO
+VENTANA
+TELEFONO
+PINTURA
+LECTURA
+LECCION
+CABALLO
+CORAZON
+PENSANDO
+GENERAL
+CUCHARA
+CUCHILLO
+CEREBRO
+MONTANA
+ASUSTADO
+PLASTICO

Modified: tuxtype/trunk/tuxtype/data/themes/italian/words/word1.txt
===================================================================
--- tuxtype/trunk/tuxtype/data/themes/italian/words/word1.txt	2007-08-19 14:05:04 UTC (rev 200)
+++ tuxtype/trunk/tuxtype/data/themes/italian/words/word1.txt	2007-08-20 02:31:56 UTC (rev 201)
@@ -1,36 +1,36 @@
 Esercizi per le dita
-ruo
-qua
-sol
-pali
-ovi
-ozzo
-num
-fre
-art
-ret
-mat
-mar
-mur
-vor
-cre
-cri
-fol
-que
-qui
-quo
-zor
-sal
-sel
-oh
-ah
-ih
-uh
-eh
-ei
-oi
-ui
-per
-pro
-pri
-gri
+RUO
+QUA
+SOL
+PALI
+OVI
+OZZO
+NUM
+FRE
+ART
+RET
+MAT
+MAR
+MUR
+VOR
+CRE
+CRI
+FOL
+QUE
+QUI
+QUO
+ZOR
+SAL
+SEL
+OH
+AH
+IH
+UH
+EH
+EI
+OI
+UI
+PER
+PRO
+PRI
+GRI

Modified: tuxtype/trunk/tuxtype/data/themes/italian/words/word2.txt
===================================================================
--- tuxtype/trunk/tuxtype/data/themes/italian/words/word2.txt	2007-08-19 14:05:04 UTC (rev 200)
+++ tuxtype/trunk/tuxtype/data/themes/italian/words/word2.txt	2007-08-20 02:31:56 UTC (rev 201)
@@ -1,52 +1,52 @@
 Parole corte
-ala
-aia
-aria
-arte
-auto
-bere
-blu
-buio
-cane
-caro
-casa
-ciao
-ciò
-cioè
-cura
-due
-duro
-fumo
-gaia
-giro
-lana
-lava
-loro
-luce
-luna
-lupi
-mare
-mano
-moto
-muro
-naso
-nero
-nodo
-nove
-nubi
-oca
-ora
-orso
-orto
-otto
-pari
-sala
-sarà
-sei
-sole
-topo
-toro
-tre
-uno
-uovo
-vero
+ALA
+AIA
+ARIA
+ARTE
+AUTO
+BERE
+BLU
+BUIO
+CANE
+CARO
+CASA
+CIAO
+CIÒ
+CIOÈ
+CURA
+DUE
+DURO
+FUMO
+GAIA
+GIRO
+LANA
+LAVA
+LORO
+LUCE
+LUNA
+LUPI
+MARE
+MANO
+MOTO
+MURO
+NASO
+NERO
+NODO
+NOVE
+NUBI
+OCA
+ORA
+ORSO
+ORTO
+OTTO
+PARI
+SALA
+SARÀ
+SEI
+SOLE
+TOPO
+TORO
+TRE
+UNO
+UOVO
+VERO

Modified: tuxtype/trunk/tuxtype/data/themes/italian/words/word3.txt
===================================================================
--- tuxtype/trunk/tuxtype/data/themes/italian/words/word3.txt	2007-08-19 14:05:04 UTC (rev 200)
+++ tuxtype/trunk/tuxtype/data/themes/italian/words/word3.txt	2007-08-20 02:31:56 UTC (rev 201)
@@ -1,56 +1,56 @@
 Parole normali
-abate
-acqua
-aiuto
-amaca
-amici
-barca
-barile
-bravo
-burro
-carta
-cento
-cifra
-cinico
-cinque
-corda
-delta
-dentro
-denti
-dieci
-festa
-fuoco
-fuori
-fungo
-gatto
-giallo
-leone
-letto
-libro
-mille
-nelle
-perché
-pesca
-pesche
-pesci
-piedi
-quelle
-questi
-rosso
-salirà
-salirò
-sarta
-scuola
-sette
-sopra
-sotto
-suono
-sulla
-tenda
-testa
-tetto
-tigri
-vento
-verde
-volpe
-zero
+ABATE
+ACQUA
+AIUTO
+AMACA
+AMICI
+BARCA
+BARILE
+BRAVO
+BURRO
+CARTA
+CENTO
+CIFRA
+CINICO
+CINQUE
+CORDA
+DELTA
+DENTRO
+DENTI
+DIECI
+FESTA
+FUOCO
+FUORI
+FUNGO
+GATTO
+GIALLO
+LEONE
+LETTO
+LIBRO
+MILLE
+NELLE
+PERCHÉ
+PESCA
+PESCHE
+PESCI
+PIEDI
+QUELLE
+QUESTI
+ROSSO
+SALIRÀ
+SALIRÒ
+SARTA
+SCUOLA
+SETTE
+SOPRA
+SOTTO
+SUONO
+SULLA
+TENDA
+TESTA
+TETTO
+TIGRI
+VENTO
+VERDE
+VOLPE
+ZERO

Modified: tuxtype/trunk/tuxtype/data/themes/italian/words/word4.txt
===================================================================
--- tuxtype/trunk/tuxtype/data/themes/italian/words/word4.txt	2007-08-19 14:05:04 UTC (rev 200)
+++ tuxtype/trunk/tuxtype/data/themes/italian/words/word4.txt	2007-08-20 02:31:56 UTC (rev 201)
@@ -1,52 +1,52 @@
 Parole lunghe
-alloro
-arancia
-attenti
-banana
-basilico
-bruciato
-calcolare
-cinepresa
-circolo
-consiglio
-consumato
-coperta
-costume
-cotone
-cristallo
-crociera
-cucinare
-cuscino
-dispari
-dodici
-dormirà
-energia
-galline
-gondola
-lenzuolo
-mangiato
-marrone
-maiale
-minuto
-nuotando
-origano
-pallone
-patata
-pollame
-precipite
-volissime
-volmente
-quattordici
-quattro
-regalo
-ritrovo
-rosmarino
-salutare
-salvia
-secondo
-stoffa
-tesoro
-tessuto
-tredici
-undici
-venticello
+ALLORO
+ARANCIA
+ATTENTI
+BANANA
+BASILICO
+BRUCIATO
+CALCOLARE
+CINEPRESA
+CIRCOLO
+CONSIGLIO
+CONSUMATO
+COPERTA
+COSTUME
+COTONE
+CRISTALLO
+CROCIERA
+CUCINARE
+CUSCINO
+DISPARI
+DODICI
+DORMIRÀ
+ENERGIA
+GALLINE
+GONDOLA
+LENZUOLO
+MANGIATO
+MARRONE
+MAIALE
+MINUTO
+NUOTANDO
+ORIGANO
+PALLONE
+PATATA
+POLLAME
+PRECIPITE
+VOLISSIME
+VOLMENTE
+QUATTORDICI
+QUATTRO
+REGALO
+RITROVO
+ROSMARINO
+SALUTARE
+SALVIA
+SECONDO
+STOFFA
+TESORO
+TESSUTO
+TREDICI
+UNDICI
+VENTICELLO

Modified: tuxtype/trunk/tuxtype/data/themes/russian/Makefile.am
===================================================================
--- tuxtype/trunk/tuxtype/data/themes/russian/Makefile.am	2007-08-19 14:05:04 UTC (rev 200)
+++ tuxtype/trunk/tuxtype/data/themes/russian/Makefile.am	2007-08-20 02:31:56 UTC (rev 201)
@@ -3,14 +3,16 @@
 images\
 words
 
-EXTRA_DIST = keyboard.lst lang.po
+EXTRA_DIST = keyboard.lst lang.po settings.txt
 
 install-data-local:
 	$(mkinstalldirs) $(DESTDIR)$(prefix)/share/$(PACKAGE)/data/themes/russian
 	$(INSTALL_DATA) $(srcdir)/lang.po $(DESTDIR)$(prefix)/share/$(PACKAGE)/data/themes/russian/lang.po
 	$(mkinstalldirs) $(DESTDIR)$(prefix)/share/$(PACKAGE)/data/themes/russian
 	$(INSTALL_DATA) $(srcdir)/keyboard.lst $(DESTDIR)$(prefix)/share/$(PACKAGE)/data/themes/russian/keyboard.lst
+	$(INSTALL_DATA) $(srcdir)/settings.txt $(DESTDIR)$(prefix)/share/$(PACKAGE)/data/themes/russian/settings.txt
 
 uninstall-local:
 	rm -f $(DESTDIR)$(prefix)/share/$(PACKAGE)/data/themes/russian/keyboard.lst
 	rm -f $(DESTDIR)$(prefix)/share/$(PACKAGE)/data/themes/russian/lang.po
+	rm -f $(DESTDIR)$(prefix)/share/$(PACKAGE)/data/themes/russian/settings.txt

Modified: tuxtype/trunk/tuxtype/data/themes/russian/Makefile.in
===================================================================
--- tuxtype/trunk/tuxtype/data/themes/russian/Makefile.in	2007-08-19 14:05:04 UTC (rev 200)
+++ tuxtype/trunk/tuxtype/data/themes/russian/Makefile.in	2007-08-20 02:31:56 UTC (rev 201)
@@ -165,7 +165,7 @@
 images\
 words
 
-EXTRA_DIST = keyboard.lst lang.po
+EXTRA_DIST = keyboard.lst lang.po settings.txt
 all: all-recursive
 
 .SUFFIXES:
@@ -479,10 +479,12 @@
 	$(INSTALL_DATA) $(srcdir)/lang.po $(DESTDIR)$(prefix)/share/$(PACKAGE)/data/themes/russian/lang.po
 	$(mkinstalldirs) $(DESTDIR)$(prefix)/share/$(PACKAGE)/data/themes/russian
 	$(INSTALL_DATA) $(srcdir)/keyboard.lst $(DESTDIR)$(prefix)/share/$(PACKAGE)/data/themes/russian/keyboard.lst
+	$(INSTALL_DATA) $(srcdir)/settings.txt $(DESTDIR)$(prefix)/share/$(PACKAGE)/data/themes/russian/settings.txt
 
 uninstall-local:
 	rm -f $(DESTDIR)$(prefix)/share/$(PACKAGE)/data/themes/russian/keyboard.lst
 	rm -f $(DESTDIR)$(prefix)/share/$(PACKAGE)/data/themes/russian/lang.po
+	rm -f $(DESTDIR)$(prefix)/share/$(PACKAGE)/data/themes/russian/settings.txt
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
 .NOEXPORT:

Added: tuxtype/trunk/tuxtype/data/themes/russian/settings.txt
===================================================================
--- tuxtype/trunk/tuxtype/data/themes/russian/settings.txt	                        (rev 0)
+++ tuxtype/trunk/tuxtype/data/themes/russian/settings.txt	2007-08-20 02:31:56 UTC (rev 201)
@@ -0,0 +1 @@
+theme_font_name=DoulosSILR.ttf
\ No newline at end of file

Modified: tuxtype/trunk/tuxtype/funcs.h
===================================================================
--- tuxtype/trunk/tuxtype/funcs.h	2007-08-19 14:05:04 UTC (rev 200)
+++ tuxtype/trunk/tuxtype/funcs.h	2007-08-20 02:31:56 UTC (rev 201)
@@ -23,6 +23,11 @@
 /* In alphabet.c */
 SDL_Surface* BlackOutline(const unsigned char *t, TTF_Font* font, const SDL_Color* c);
 SDL_Surface* BlackOutline_wchar(wchar_t t, TTF_Font* font, const SDL_Color* c);
+
+#ifndef WIN32
+SDL_Surface* BlackOutline_SDLPango(const unsigned char *t, TTF_Font* font, const SDL_Color* c);
+#endif
+
 void ClearWordList(void);
 void FreeLetters(void);
 void GenerateWordList(const char* wordFn);
@@ -31,7 +36,7 @@
 SDL_Surface* GetWhiteGlyph(wchar_t t);
 SDL_Surface* GetRedGlyph(wchar_t t);
 int GetGlyphCoords(wchar_t t, int* x, int* y);
-void LoadKeyboard(void);
+int LoadKeyboard(void);
 int RenderLetters(const TTF_Font* letter_font);
 void UseAlphabet(void);
 
@@ -84,7 +89,7 @@
 
 
 /* In scripting.c: */
-void TestLesson(void);
+int TestLesson(void);
 void ProjectInfo(void);
 void InstructCascade(void);
 void InstructLaser(void);
@@ -95,11 +100,11 @@
 void LibInit(Uint32 lib_flags);
 void LoadSettings(void);
 void SaveSettings(void);
+int SetupPaths(const char* theme_dir);
+void Cleanup(void);
 
-
 /* In theme.c: */
 void ChooseTheme(void);
-void SetupTheme(const char *dirname);
 
 
 /* In titlescreen.c: */

Modified: tuxtype/trunk/tuxtype/globals.h
===================================================================
--- tuxtype/trunk/tuxtype/globals.h	2007-08-19 14:05:04 UTC (rev 200)
+++ tuxtype/trunk/tuxtype/globals.h	2007-08-20 02:31:56 UTC (rev 201)
@@ -65,6 +65,8 @@
 typedef struct game_option_type{
   char default_data_path[FNLEN];
   char theme_data_path[FNLEN];
+  char user_settings_path[FNLEN];
+  char global_settings_path[FNLEN];
   char theme_name[FNLEN];
   char lang[FNLEN];
   char theme_font_name[FNLEN];
@@ -74,6 +76,7 @@
   int sfx_volume;
   int mus_volume;
   int menu_music;
+  int menu_sound;
   int speed_up;
   int show_tux4kids;
   int debug_on;
@@ -92,6 +95,7 @@
 #define DEFAULT_SFX_VOLUME 100
 #define DEFAULT_MUS_VOLUME 100
 #define DEFAULT_MENU_MUSIC 1
+#define DEFAULT_MENU_SOUND 1
 #define DEFAULT_SPEED_UP 0
 #define DEFAULT_SHOW_TUX4KIDS 1
 #define DEFAULT_DEBUG_ON 0
@@ -102,10 +106,10 @@
 
 
 typedef struct {
-	SDL_Surface* frame[MAX_SPRITE_FRAMES];
-	SDL_Surface* default_img;
-	int num_frames;
-	int cur;
+  SDL_Surface* frame[MAX_SPRITE_FRAMES];
+  SDL_Surface* default_img;
+  int num_frames;
+  int cur;
 } sprite;
 
 #define _(str) gettext (str)
@@ -159,18 +163,17 @@
 
 /* Menu Prototypes */
 enum Game_Type { 
-	QUIT_GAME, CASCADE, OPTIONS, LESSONS,
-	INSTRUCT_CASCADE, CASCADE1, CASCADE2, CASCADE3, CASCADE4,
-	INSTRUCT_LASER,    LASER1,    LASER2,    LASER3,    LASER4,
-	FREETYPE, ASDF, ALL, MAIN, SET_LANGUAGE, PROJECT_INFO, EDIT_WORDLIST,
-	LEVEL1, LEVEL2, LEVEL3, LEVEL4, LASER, INSTRUCT, NOT_CODED, NONE};
+  QUIT_GAME, CASCADE, OPTIONS, LESSONS,
+  INSTRUCT_CASCADE, CASCADE1, CASCADE2, CASCADE3, CASCADE4,
+  INSTRUCT_LASER, LASER1, LASER2, LASER3, LASER4,
+  FREETYPE, ASDF, ALL, MAIN, SET_LANGUAGE, PROJECT_INFO, EDIT_WORDLIST,
+  LEVEL1, LEVEL2, LEVEL3, LEVEL4, LASER, INSTRUCT, NOT_CODED, NONE};
 
 /* Title sequence constants */
 #define PRE_ANIM_FRAMES	 10
 #define PRE_FRAME_MULT	 3
 #define MENU_SEP	 20
 
-/* paths */
 
 #define IMG_REGULAR  0x01
 #define IMG_COLORKEY 0x02
@@ -198,7 +201,7 @@
 extern SDL_Color yellow;
 
 extern SDL_Surface* bkg;
-extern SDL_Surface* letters[255];
+extern SDL_Surface* letters[255]; /* Will be going away */
 
 /* These need some work to support Unicode & i18n: */
 extern wchar_t ALPHABET[256];
@@ -206,12 +209,6 @@
 extern int ALPHABET_SIZE;
 
 
-/* Alternative language/word/image/sound theming */
-extern unsigned char realPath[2][FNLEN];
-extern char themeName[FNLEN];
-extern char fontName[FNLEN];
-//extern int useEnglish;
-
 enum {
 	WIN_WAV,
 	BITE_WAV,
@@ -226,7 +223,6 @@
 
 extern Mix_Chunk* sound[NUM_WAVES];
 extern Mix_Music*  music;
-//extern int sys_sound;
 
 #define MUSIC_FADE_OUT_MS	80
 

Modified: tuxtype/trunk/tuxtype/loaders.c
===================================================================
--- tuxtype/trunk/tuxtype/loaders.c	2007-08-19 14:05:04 UTC (rev 200)
+++ tuxtype/trunk/tuxtype/loaders.c	2007-08-20 02:31:56 UTC (rev 201)
@@ -80,7 +80,7 @@
   }
 
   /* --- create full path to the lang.po file --- */
-  sprintf( fn, "%s/lang.po", realPath[0]);
+  sprintf( fn, "%s/lang.po", settings.theme_data_path);
 
   /* FIXME should have program try to setlocale() to lang-specific locale -  */
   /* for now, at least get a default UTF-8 encoding set: */
@@ -199,45 +199,36 @@
 	return out;
 }
 
-TTF_Font* LoadFont(const char* fontfile, int fontsize ) {
-	TTF_Font *loadedFont = NULL;
-	char fn[FNLEN];
-	int i;
-/* char themeName[FNLEN]; */
 
+/* FIXME need code to search for font paths on different platforms */
+TTF_Font* LoadFont(const char* font_name, int font_size )
+{
+  TTF_Font* loaded_font = NULL;
+  char fn[FNLEN];
+  int i;
 
+  /* try to find font in default data dir: */
+  sprintf(fn, "%s/fonts/%s", settings.default_data_path, font_name );
 
-	/* try to find font first in theme dir, then in default */
-	for (i=settings.use_english; i<2; i++) {
-		sprintf( fn, "%s/fonts/%s", realPath[i], fontfile );
-	DEBUGCODE { fprintf(stderr, "LoadFont(): looking for %s using data paths\n", fn ); }
-		{
-			/* try to load the font, if successful, return font*/
+  DEBUGCODE { fprintf(stderr, "LoadFont(): looking for %s using data paths\n", fn); }
 
-			loadedFont = TTF_OpenFont( fn, fontsize );
-
-			if (loadedFont != NULL)
-				return loadedFont;
-		}
-	}
-
+  /* try to load the font, if successful, return font*/
+ loaded_font = TTF_OpenFont(fn, font_size);
+ if (loaded_font != NULL)
+   return loaded_font;
 		
 
-	/* this will work only on debian once Andika is included: */ 
-	/* "fallback" (the above _will_ fall): load the font with fixed-path */
-	sprintf( fn, "%s/%s", "/usr/share/fonts/truetype/ttf-andika/", fontfile );
-	DEBUGCODE { fprintf(stderr, "LoadFont(): looking for %s\n in OS' font path\n", fn ); }
+  /* HACK hard-coded for Debian once Andika is included: */ 
+  sprintf(fn, "%s/%s", "/usr/share/fonts/truetype/ttf-andika/", font_name);
+  DEBUGCODE { fprintf(stderr, "LoadFont(): looking for %s\n in OS' font path\n", fn); }
 
-	/* try to load the font, if successful, return font*/
-	loadedFont = TTF_OpenFont( fn, fontsize );
-	if (loadedFont != NULL)
-		return loadedFont;
+  /* try to load the font, if successful, return font*/
+  loaded_font = TTF_OpenFont(fn, font_size);
+  if (loaded_font != NULL)
+    return loaded_font;
 
-
-	fprintf(stderr, "FATAL ERROR: couldn't load font: %s\n", fontfile);
-	exit(1);
-
-	return NULL;
+  fprintf(stderr, "LoadFont(): Error - couldn't load font: %s\n", font_name);
+  return NULL;
 }
 
 /***********************
@@ -245,83 +236,95 @@
 ************************/
 SDL_Surface* LoadImage(const char* datafile, int mode)
 {
-	int i;
-	int oldDebug;  //so we can turn off debug output for this func only
-	SDL_Surface* tmp_pic = NULL, *final_pic = NULL;
-	char         fn[FNLEN];
+  int oldDebug;  //so we can turn off debug output for this func only
+  SDL_Surface* tmp_pic = NULL, *final_pic = NULL;
+  char fn[FNLEN];
 
-	oldDebug = settings.debug_on;  // suppress output for now
-	settings.debug_on = 0;
+  oldDebug = settings.debug_on;  // suppress output for now
+  settings.debug_on = 0;
 
-	DEBUGCODE { fprintf(stderr, "LoadImage: loading %s\n", datafile ); }
+  DEBUGCODE { fprintf(stderr, "LoadImage: loading %s\n", datafile ); }
 
-	/* truth table for start of loop, since we only use theme on those conditions!
-              useEng    IMG_NO_THEME    i
-                 0           0          0
-                 0           1          1
-                 1           0          1
-                 1           1          1
-	 */
+  /* Look for image under theme path if desired: */
+  if (!settings.use_english && !(mode & IMG_NO_THEME))
+  {
+    sprintf(fn, "%s/images/%s", settings.theme_data_path, datafile);
+    DEBUGCODE { fprintf(stderr, "LoadImage: looking in %s\n", fn); }
 
-	for (i = (settings.use_english || (mode & IMG_NO_THEME)); i<2; i++) {
+    tmp_pic = IMG_Load(fn);
+    if (tmp_pic != NULL)
+      DEBUGCODE { fprintf(stderr, "Graphics file %s successfully loaded\n", fn);}
+    else
+      DEBUGCODE { fprintf(stderr, "Warning: graphics file %s could not be loaded\n", fn);}
+  }
 
-		sprintf( fn, "%s/images/%s", realPath[i], datafile );
-		DEBUGCODE { fprintf(stderr, "LoadImage: looking in %s\n", fn); }
+  /* If we don't have a valid image yet, try the default path: */
+  if (!tmp_pic)
+  {
+    sprintf(fn, "%s/images/%s", settings.default_data_path, datafile);
+    DEBUGCODE { fprintf(stderr, "LoadImage: looking in %s\n", fn); }
 
-		{
-			tmp_pic = IMG_Load( fn );
-			if (tmp_pic != NULL)
-				break; 
-			else
-			DEBUGCODE { fprintf(stderr, "Warning: graphics file %s is corrupt\n", fn);}
-		}
-	}
+    tmp_pic = IMG_Load(fn);
+    if (tmp_pic != NULL)
+      DEBUGCODE { fprintf(stderr, "Graphics file %s successfully loaded\n", fn);}
+    else
+      DEBUGCODE { fprintf(stderr, "Warning: graphics file %s could not be loaded\n", fn);}
+  }
 
-	if (tmp_pic == NULL) {
-		if (mode & IMG_NOT_REQUIRED)
-		{ 
-			settings.debug_on = oldDebug;
-			return NULL;
-		}
+  /* Couldn't load image - action depends on whether image is essential: */
+  if (!tmp_pic)
+  {
+    if (mode & IMG_NOT_REQUIRED)
+    { 
+      settings.debug_on = oldDebug;
+      return NULL;
+    }
 
-		fprintf(stderr, "ERROR could not load required graphics file %s\n", datafile);
-		exit(1);
-	}
+    fprintf(stderr, "ERROR could not load required graphics file %s\n", datafile);
+    exit(1);
+  }
 
-	/* finally setup the image to the proper format */
 
-	switch (mode & IMG_MODES) {
+  /* If we get to here, success - setup the image in the proper format: */
 
-		case IMG_REGULAR: { 
-			final_pic = SDL_DisplayFormat(tmp_pic);
-			SDL_FreeSurface(tmp_pic);
-			break;
-		}
+  switch (mode & IMG_MODES)
+  {
+    case IMG_REGULAR:
+    { 
+      final_pic = SDL_DisplayFormat(tmp_pic);
+      SDL_FreeSurface(tmp_pic);
+      break;
+    }
 
-		case IMG_ALPHA: {
-			final_pic = SDL_DisplayFormatAlpha(tmp_pic);
-			SDL_FreeSurface(tmp_pic);
-			break;
-		}
+    case IMG_ALPHA:
+    {
+      final_pic = SDL_DisplayFormatAlpha(tmp_pic);
+      SDL_FreeSurface(tmp_pic);
+      break;
+    }
 
-		case IMG_COLORKEY: {
-			SDL_LockSurface(tmp_pic);
-			SDL_SetColorKey(tmp_pic, (SDL_SRCCOLORKEY | SDL_RLEACCEL), SDL_MapRGB(tmp_pic->format, 255, 255, 0));
-			final_pic = SDL_DisplayFormat(tmp_pic);
-			SDL_FreeSurface(tmp_pic);
-			break;
-		}
+    case IMG_COLORKEY:
+    {
+      SDL_LockSurface(tmp_pic);
+      SDL_SetColorKey(tmp_pic,
+                      (SDL_SRCCOLORKEY | SDL_RLEACCEL),
+                      SDL_MapRGB(tmp_pic->format, 255, 255, 0));
+      final_pic = SDL_DisplayFormat(tmp_pic);
+      SDL_FreeSurface(tmp_pic);
+      break;
+    }
 
-		default: {
-			LOG ("Image mode not recognized\n");
-		}
-	}
+    default:
+    {
+      LOG ("Image mode not recognized\n");
+    }
+  }
 
-	LOG( "LOADIMAGE: Done\n" );
+  LOG( "LoadImage(): Done\n" );
 
-	settings.debug_on = oldDebug;
+  settings.debug_on = oldDebug;
 
-	return (final_pic);
+  return (final_pic);
 }
 
 sprite* FlipSprite(sprite* in, int X, int Y ) {
@@ -380,40 +383,51 @@
 ****************************/
 Mix_Chunk* LoadSound(const char* datafile )
 { 
-	Mix_Chunk* tempChunk=NULL;
-	char fn[FNLEN];
-	int i;
+  Mix_Chunk* tempChunk = NULL;
+  char fn[FNLEN];
 
-	for (i = settings.use_english; i<2; i++) {
-		sprintf(fn , "%s/sounds/%s", realPath[i], datafile);
-		tempChunk = Mix_LoadWAV(fn);
-		if (tempChunk)
-			return tempChunk;
-	}
+  /* First look under theme path if desired: */
+  if (!settings.use_english)
+  {
+    sprintf(fn , "%s/sounds/%s", settings.theme_data_path, datafile);
+    tempChunk = Mix_LoadWAV(fn);
+    if (tempChunk)
+      return tempChunk;
+  }
 
-	/* didn't find anything... fail peacefully */
-
-	return NULL;
+  /* If nothing loaded yet, try default path: */
+  if (!tempChunk)
+  {
+    sprintf(fn , "%s/sounds/%s", settings.default_data_path, datafile);
+    tempChunk = Mix_LoadWAV(fn);
+    return tempChunk;
+  }
 }
 
+
 /************************
 	LoadMusic : Load
 	music from a datafile
 *************************/
 Mix_Music* LoadMusic(const char* datafile )
 { 
-	char            fn[FNLEN];
-	Mix_Music	*tempMusic;
-	int i;
+  Mix_Music* temp_music = NULL;
+  char fn[FNLEN];
 
-	for (i = settings.use_english; i<2; i++) {
-		sprintf( fn , "%s/sounds/%s", realPath[i], datafile );
-		tempMusic = Mix_LoadMUS(fn);
-		if (tempMusic)
-			return tempMusic;
-	}
+  /* First look under theme path if desired: */
+  if (!settings.use_english)
+  {
+    sprintf(fn , "%s/sounds/%s", settings.theme_data_path, datafile);
+    temp_music = Mix_LoadMUS(fn);
+    if (temp_music)
+      return temp_music;
+  }
 
-	/* didn't find anything... fail peacefully */
-
-	return NULL;
+  /* If nothing loaded yet, try default path: */
+  if (!temp_music)
+  {
+    sprintf(fn , "%s/sounds/%s", settings.default_data_path, datafile);
+    temp_music = Mix_LoadMUS(fn);
+    return temp_music;
+  }
 }

Modified: tuxtype/trunk/tuxtype/main.c
===================================================================
--- tuxtype/trunk/tuxtype/main.c	2007-08-19 14:05:04 UTC (rev 200)
+++ tuxtype/trunk/tuxtype/main.c	2007-08-20 02:31:56 UTC (rev 201)
@@ -49,8 +49,8 @@
 
 	srand(time(NULL));
 
-	// This sets realPath[] to the default theme file path:
-	SetupTheme(NULL);
+	// This sets settings.default_data_path to the default theme file path:
+	SetupPaths(NULL);
 
 	LoadSettings();
 	DEBUGCODE { printf("Window setting from config file is: %d\n", settings.fullscreen);}
@@ -131,7 +131,7 @@
 			
 			if ((strcmp(argv[i], "-t") == 0) |
 			    (strcmp(argv[i], "--theme") == 0)) 
-				SetupTheme(argv[++i]);
+				SetupPaths(argv[++i]);
 		}
 
 	DEBUGCODE {
@@ -153,10 +153,17 @@
 
 	LoadLang();
 	LoadKeyboard();
+
+	/* Now actually play the game: */
 	TitleScreen();
 
+
 	SaveSettings();
 
+	/* Release heap: */
+	Cleanup();
+
+
 	LOG( "---GAME DONE, EXIT---- Thank you.\n" );
 
 	return EXIT_SUCCESS;

Added: tuxtype/trunk/tuxtype/options.c
===================================================================
--- tuxtype/trunk/tuxtype/options.c	                        (rev 0)
+++ tuxtype/trunk/tuxtype/options.c	2007-08-20 02:31:56 UTC (rev 201)
@@ -0,0 +1,48 @@
+/***************************************************************************
+ -  file: options.c
+ -  description: Functions supporting settings struct for Tux Typing
+                             -------------------
+    begin                : Wed July 11 2007
+    copyright            : (C) 2000 by David Bruce
+                           dbruce at tampabay.rr.com
+
+    project email        : tuxmath-devel at sourceforge.net
+    website              : http://tux4kids.alioth.debian.org
+
+ ***************************************************************************/
+
+/***************************************************************************
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License as published by  *
+ *   the Free Software Foundation; either version 2 of the License, or     *
+ *   (at your option) any later version.                                   *
+ *                                                                         *
+ ***************************************************************************/
+
+#include "globals.h"
+#include "funcs.h"
+
+/* Local function prototypes: */
+
+/* Global (for now) settings struct: */
+game_option_type settings;
+
+/* Simply stick all the default values into the settings struct: */
+void Opts_Initialize(void)
+{
+  strncpy(settings.theme_font_name, DEFAULT_MENU_FONT, FNLEN);
+  settings.use_english = DEFAULT_USE_ENGLISH;
+  settings.fullscreen = DEFAULT_FULLSCREEN;
+  settings.sys_sound = DEFAULT_SYS_SOUND;
+  settings.sfx_volume = DEFAULT_SFX_VOLUME;
+  settings.mus_volume = DEFAULT_MUS_VOLUME;
+  settings.menu_music = DEFAULT_MENU_MUSIC;
+  settings.menu_sound = DEFAULT_MENU_SOUND;
+  settings.speed_up = DEFAULT_SPEED_UP;
+  settings.show_tux4kids = DEFAULT_SHOW_TUX4KIDS;
+  settings.debug_on = DEFAULT_DEBUG_ON;
+  settings.o_lives = DEFAULT_O_LIVES;
+  settings.sound_vol = DEFAULT_SOUND_VOL;
+  settings.hidden = DEFAULT_HIDDEN; 
+}

Modified: tuxtype/trunk/tuxtype/scripting.c
===================================================================
--- tuxtype/trunk/tuxtype/scripting.c	2007-08-19 14:05:04 UTC (rev 200)
+++ tuxtype/trunk/tuxtype/scripting.c	2007-08-20 02:31:56 UTC (rev 201)
@@ -38,238 +38,310 @@
 
 void InstructCascade(void)
 {
-    char fn[FNLEN];
-    sprintf( fn, "%s/scripts/cascade.xml", realPath[settings.use_english] );
-    if (load_script( fn ) != 0) return; // bail if any errors occur
-    run_script();
+  char fn[FNLEN];
+
+  if (settings.use_english)
+    sprintf( fn, "%s/scripts/cascade.xml", settings.default_data_path);
+  else
+    sprintf( fn, "%s/scripts/cascade.xml", settings.theme_data_path);
+
+  if (load_script( fn ) != 0)
+    return; // bail if any errors occur
+  run_script();
 }
 
 
 void InstructLaser(void)
 {
-    char fn[FNLEN];
-    sprintf( fn, "%s/scripts/laser.xml", realPath[settings.use_english] );
-    if (load_script( fn ) != 0) return; // bail if any errors occur
-    { int i; for (i=0; i<20; i++) {
-    run_script(); SDL_Delay(500); }}
+  int i;
+  char fn[FNLEN];
+
+  if (settings.use_english)
+    sprintf( fn, "%s/scripts/cascade.xml", settings.default_data_path);
+  else
+    sprintf( fn, "%s/scripts/cascade.xml", settings.theme_data_path);
+
+  if (load_script( fn ) != 0)
+    return; // bail if any errors occur
+
+  for (i = 0; i < 20; i++)
+  {
+    run_script();
+    SDL_Delay(500);
+  }
 }
 
 
 void ProjectInfo(void)
 {
-    char fn[FNLEN]; 
-    sprintf( fn, "%s/scripts/projectInfo.xml", realPath[1]);
-    if (load_script( fn ) != 0) return; // bail if any errors occur
-    run_script();
+  char fn[FNLEN]; 
+
+  if (settings.use_english)
+    sprintf( fn, "%s/scripts/cascade.xml", settings.default_data_path);
+  else
+    sprintf( fn, "%s/scripts/cascade.xml", settings.theme_data_path);
+
+  if (load_script( fn ) != 0)
+    return; // bail if any errors occur
+
+  run_script();
 }
 
 
-void TestLesson( void ) {
-	SDL_Surface *left, *right, *pointer, *bkg;
-	SDL_Surface *filenames[200];
+int TestLesson( void )
+{
+  SDL_Surface* left = NULL, *right = NULL, *pointer = NULL, *bkg = NULL;
+  SDL_Surface *filenames[200] = {NULL};
+
+  SDL_Rect spot, arrow_area;
+  SDL_Rect leftRect, rightRect;
+  SDL_Rect titleRects[8];
 	
-	SDL_Rect spot, arrow_area;
-	SDL_Rect leftRect, rightRect;
-	SDL_Rect titleRects[8];
+  int stop = 0;
+  int loc = 0;
+  int old_loc = 1;
+  int i;
+  int c = 0;
+  int found = 0;
 	
-	int stop = 0;
-	int loc = 0;
-	int old_loc = 1;
-	int i;
-	int c = 0;
-	
-	char fn[FNLEN]; 
-	unsigned char wordlistFile[200][200];
-	unsigned char wordPath[FNLEN];
+  char fn[FNLEN]; 
+  unsigned char wordlistFile[200][200];
+  unsigned char wordPath[FNLEN];
 
-	DIR *wordsDir;
-	struct dirent *wordsFile;
-//	FILE *tempFile;
+  DIR* wordsDir = NULL;
+  struct dirent* wordsFile = NULL;
 
-	pointer = LoadImage( "right.png", IMG_ALPHA );
-	bkg = LoadImage( "main_bkg.png", IMG_REGULAR );
+  pointer = LoadImage( "right.png", IMG_ALPHA );
+  bkg = LoadImage( "main_bkg.png", IMG_REGULAR );
+  left = LoadImage("left.png", IMG_ALPHA);       
+  right = LoadImage("right.png", IMG_ALPHA);
 
-	SDL_ShowCursor(0);
+  if (!pointer || !bkg || !left ||!right)
+  {
+    fprintf(stderr, "TestLesson() - needed image not found\n");
+    /* Free anything that got loaded: */
+    SDL_FreeSurface(pointer);
+    SDL_FreeSurface(left);
+    SDL_FreeSurface(right);
+    SDL_FreeSurface(bkg);
+    return 0;
+  }
 
-	/* find the directory to load wordlists from */
+  SDL_ShowCursor(0);
 
-	for (i=settings.use_english; i<2; i++) {
-		sprintf( wordPath, "%s/scripts", realPath[i] );
-		if (CheckFile(wordPath))
-			break;
-	}
+  /* find the directory to load wordlists from */
+  /* First look in theme path, if desired: */
+  if (!settings.use_english)
+  {
+    sprintf( wordPath, "%s/scripts", settings.theme_data_path);
+    if (CheckFile(wordPath))
+    {
+      found = 1;
+    }
+  }
 
-	if (i==2) {
-		fprintf(stderr, "ERROR: Unable to find wordlist directory\n");
-		exit(1);
-	}
-	spot.x=60;
-	spot.y=20;
+  /* Now look in default path if desired or needed: */
+  if (!found)
+  {
+    sprintf( wordPath, "%s/scripts", settings.default_data_path);
+    if (CheckFile(wordPath))
+    {
+      found = 1;
+    }
+  }
 
+  if (!found)
+  {
+    fprintf(stderr, "TestLesson(): Error finding script directory!\n");
+    return 0;
+  }
 
-	/* create a list of all the .txt files */
+  /* What is this location? */
+  spot.x=60;
+  spot.y=20;
 
-	wordsDir = opendir( wordPath );	
-	font = LoadFont(settings.theme_font_name, MENU_FONT_SIZE);
-	do {
-		wordsFile = readdir(wordsDir);
-		if (!wordsFile)
-			break;
 
-		/* must have at least .txt at the end */
-		if (strlen(wordsFile->d_name) < 5)
-			continue;
+  /* create a list of all the .xml files */
 
-		if (strcmp(&wordsFile->d_name[strlen(wordsFile->d_name)-4],".xml"))
-			continue;
+  wordsDir = opendir( wordPath );	
+  font = LoadFont(settings.theme_font_name, MENU_FONT_SIZE);
+  do
+  {
+    wordsFile = readdir(wordsDir);
+    if (!wordsFile)
+      break;
 
-		sprintf( wordlistFile[c], "%s", wordsFile->d_name );
+    /* must have at least '.xml' at the end */
+    if (strlen(wordsFile->d_name) < 5)
+      continue;
 
-		filenames[c] = TTF_RenderUTF8_Blended(  font, wordsFile->d_name, white);
-		SDL_BlitSurface( filenames[c], NULL, screen, &spot );
-                SDL_FreeSurface(filenames[c]);
-		c++;
-		spot.y += MENU_FONT_SIZE;
+    if (strcmp(&wordsFile->d_name[strlen(wordsFile->d_name)-4],".xml"))
+      continue;
 
-		/* load the name for the wordlist from the file ... (1st line) */
-/*		tempFile = fopen( wordlistFile[lists], "r" );
-		if (tempFile==NULL) continue;
-		fscanf( tempFile, "%[^\n]\n", wordlistName[lists] );
-*/
-		/* check to see if it has a \r at the end of it (dos format!) */
-/*		if (wordlistName[lists][ strlen(wordlistName[lists])-1 ] == '\r')
-			wordlistName[lists][ strlen(wordlistName[lists])-1 ] = '\0';
-		lists++;
+    sprintf( wordlistFile[c], "%s", wordsFile->d_name );
 
-		fclose(tempFile);*/
-		
-	} while (1);
+    filenames[c] = TTF_RenderUTF8_Blended(  font, wordsFile->d_name, white);
+    SDL_BlitSurface( filenames[c], NULL, screen, &spot );
+    SDL_FreeSurface(filenames[c]);
+    c++;
+    spot.y += MENU_FONT_SIZE;
+  } while (1); /* Leave loop when readdir() returns NULL */
 
-	TTF_CloseFont(font);
-	closedir( wordsDir );	
-	SDL_Flip( screen );
+  TTF_CloseFont(font);
+  closedir(wordsDir);	
+  SDL_Flip(screen);
 
-	left = LoadImage("left.png", IMG_ALPHA);       
-        leftRect.w = left->w; leftRect.h = left->h;
-        leftRect.x = 320 - 80 - (leftRect.w/2); leftRect.y = 430;
+  /* Should be safe - tested 'left' and 'right' above: */
+  leftRect.w = left->w; leftRect.h = left->h;
+  leftRect.x = 320 - 80 - (leftRect.w/2); leftRect.y = 430;
 
-        right = LoadImage("right.png", IMG_ALPHA);
-        rightRect.w = right->w; rightRect.h = right->h;
-        rightRect.x = 320 + 80 - (rightRect.w/2); rightRect.y = 430;
+  rightRect.w = right->w; rightRect.h = right->h;
+  rightRect.x = 320 + 80 - (rightRect.w/2); rightRect.y = 430;
 
-        /* set initial rect sizes */
-        titleRects[0].y = 30;
-        titleRects[0].w = titleRects[0].h = titleRects[0].x = 0;
-        for (i = 1; i<8; i++) { 
-                titleRects[i].y = titleRects[i-1].y + 50;
-                titleRects[i].w = titleRects[i].h = titleRects[i].x = 0;
-        }
-	arrow_area.x = 0;
-	arrow_area.y = 0;
-	arrow_area.w = 59;
-	arrow_area.h = 479;
+  /* set initial rect sizes */
+  titleRects[0].y = 30;
+  titleRects[0].w = titleRects[0].h = titleRects[0].x = 0;
 
-	while (!stop) {
-                while (SDL_PollEvent(&event))
-                        switch (event.type) {
-                                case SDL_QUIT:
-                                        exit(0);
-                                        break;
-                                case SDL_MOUSEMOTION:
-                                        for (i=0; (i<8) && (loc-(loc%8)+i<c); i++)
-                                                if (inRect( titleRects[i], event.motion.x, event.motion.y )) {
-                                                        loc = loc-(loc%8)+i;
-                                                        break;
-                                                }
+  for (i = 1; i<8; i++)
+  { 
+    titleRects[i].y = titleRects[i-1].y + 50;
+    titleRects[i].w = titleRects[i].h = titleRects[i].x = 0;
+  }
 
-                                        break;
-                                case SDL_MOUSEBUTTONDOWN:
-                                        if (inRect( leftRect, event.button.x, event.button.y ))
-                                                if (loc-(loc%8)-8 >= 0) {
-                                                        loc=loc-(loc%8)-8;
-                                                        break;
-                                                }
-                                        if (inRect( rightRect, event.button.x, event.button.y ))
-                                                if (loc-(loc%8)+8 < c) {
-                                                        loc=loc-(loc%8)+8;
-                                                        break;
-                                                }
-                                        for (i=0; (i<8) && (loc-(loc%8)+i<c); i++)
-                                                if (inRect(titleRects[i], event.button.x, event.button.y)) {
-                                                        loc = loc-(loc%8)+i;
-							ClearWordList(); /* clear old selection */
-							if (loc==0)
-							  UseAlphabet(); 
-							else
-							  GenerateWordList(wordlistFile[loc]);
- 
-                                                        stop = 1;
-                                                        break;
-                                                }
-                                        break;
-                                case SDL_KEYDOWN:
-                                        if (event.key.keysym.sym == SDLK_ESCAPE) { stop = 2; break; }
-                                        if (event.key.keysym.sym == SDLK_RETURN) {
-						sprintf( fn, "%s/scripts/%s", realPath[1], wordlistFile[loc]);
-                                                stop = 1;
-                                                break;
-                                        }
+  arrow_area.x = 0;
+  arrow_area.y = 0;
+  arrow_area.w = 59;
+  arrow_area.h = 479;
 
-                                        if ((event.key.keysym.sym == SDLK_LEFT) || (event.key.keysym.sym == SDLK_PAGEUP)) {
-                                                if (loc-(loc%8)-8 >= 0)
-                                                        loc=loc-(loc%8)-8;
-                                        	SDL_ShowCursor(1);}
+  while (!stop)
+  {
+    while (SDL_PollEvent(&event))
 
-                                        if ((event.key.keysym.sym == SDLK_RIGHT) || (event.key.keysym.sym == SDLK_PAGEDOWN)) {
-                                                if (loc-(loc%8)+8 < c)
-                                                        loc=(loc-(loc%8)+8);
-                                        }
+      switch (event.type)
+      {
+        case SDL_QUIT:
+          exit(0);
+          break;
 
-                                        if (event.key.keysym.sym == SDLK_UP) {
-                                                if (loc > 0)
-                                                        loc--;
-                                        }
+        case SDL_MOUSEMOTION:
+          for (i=0; (i<8) && (loc-(loc%8)+i<c); i++)
+            if (inRect( titleRects[i], event.motion.x, event.motion.y ))
+            {
+              loc = loc-(loc%8)+i;
+              break;
+            }
+          break;
 
-                                        if (event.key.keysym.sym == SDLK_DOWN) {
-                                                if (loc+1< c)
-                                                        loc++;
-                                        }
-                        }
+        case SDL_MOUSEBUTTONDOWN:
+          if (inRect( leftRect, event.button.x, event.button.y ))
+            if (loc-(loc%8)-8 >= 0)
+            {
+              loc=loc-(loc%8)-8;
+              break;
+            }
 
-               if (stop == 2) {
-                        SDL_FreeSurface(pointer);
-                        SDL_FreeSurface(left);
-                        SDL_FreeSurface(right);
-                        SDL_FreeSurface(bkg);
-                        return;
-               }
-               if (old_loc != loc) {
-                        int start;
+          if (inRect( rightRect, event.button.x, event.button.y ))
+            if (loc-(loc%8)+8 < c)
+            {
+              loc=loc-(loc%8)+8;
+              break;
+            }
 
-                        SDL_BlitSurface( bkg, &arrow_area, screen, NULL);
+          for (i=0; (i<8) && (loc-(loc%8)+i<c); i++)
+            if (inRect(titleRects[i], event.button.x, event.button.y))
+            {
+              loc = loc-(loc%8)+i;
+              ClearWordList(); /* clear old selection */
+              if (loc==0)
+                UseAlphabet(); 
+              else
+                GenerateWordList(wordlistFile[loc]);
 
-                        start = loc;
-                        for (i = start; i < c; i++) {
-                                spot.x = 5;
-                                spot.y = (i * MENU_FONT_SIZE) + 18;
-                                if (i == loc)
-                                        SDL_BlitSurface(pointer, NULL, screen, &spot);
-                        }
+              stop = 1;
+              break;
+            }
+          break;
 
-                        SDL_Flip(screen);
-                }
-                SDL_Delay(40);
-                old_loc = loc;
-        }
+        case SDL_KEYDOWN:
+          if (event.key.keysym.sym == SDLK_ESCAPE)
+          { 
+            stop = 2;
+            break;
+          }
 
-	SDL_FreeSurface(pointer);
+          if (event.key.keysym.sym == SDLK_RETURN)
+          {
+            sprintf(fn, "%s/scripts/%s", settings.default_data_path, wordlistFile[loc]);
+            stop = 1;
+            break;
+          }
+
+          if ((event.key.keysym.sym == SDLK_LEFT) || (event.key.keysym.sym == SDLK_PAGEUP))
+          {
+            if (loc-(loc%8)-8 >= 0)
+              loc=loc-(loc%8)-8;
+            SDL_ShowCursor(1);
+          }
+
+          if ((event.key.keysym.sym == SDLK_RIGHT) || (event.key.keysym.sym == SDLK_PAGEDOWN))
+          {
+            if (loc-(loc%8)+8 < c)
+              loc=(loc-(loc%8)+8);
+          }
+
+          if (event.key.keysym.sym == SDLK_UP)
+          {
+            if (loc > 0)
+              loc--;
+          }
+
+          if (event.key.keysym.sym == SDLK_DOWN)
+          {
+            if (loc+1< c)
+              loc++;
+          }
+      }
+
+      if (stop == 2)
+      {
+        SDL_FreeSurface(pointer);
         SDL_FreeSurface(left);
         SDL_FreeSurface(right);
         SDL_FreeSurface(bkg);
+        return;
+      }
 
-    if (load_script( fn ) != 0) return; // bail if any errors occur
+      if (old_loc != loc)
+      {
+        int start;
+        SDL_BlitSurface( bkg, &arrow_area, screen, NULL);
+
+        start = loc;
+        for (i = start; i < c; i++)
+        {
+          spot.x = 5;
+          spot.y = (i * MENU_FONT_SIZE) + 18;
+          if (i == loc)
+            SDL_BlitSurface(pointer, NULL, screen, &spot);
+        }
+
+        SDL_Flip(screen);
+      }
+
+      SDL_Delay(40);
+      old_loc = loc;
+    }
+
+    SDL_FreeSurface(pointer);
+    SDL_FreeSurface(left);
+    SDL_FreeSurface(right);
+    SDL_FreeSurface(bkg);
+
+    if (load_script( fn ) != 0)
+      return 0; // bail if any errors occur
     run_script();
     SDL_ShowCursor(1);
+  return 1; 
 }
 
 

Modified: tuxtype/trunk/tuxtype/setup.c
===================================================================
--- tuxtype/trunk/tuxtype/setup.c	2007-08-19 14:05:04 UTC (rev 200)
+++ tuxtype/trunk/tuxtype/setup.c	2007-08-20 02:31:56 UTC (rev 201)
@@ -20,10 +20,21 @@
 #include "globals.h"
 #include "funcs.h"
 
-//global vars
+#define NUM_PATHS 4
 
-//int hidden; // Read the README file in the image directory for info on this ;)
+const char PATHS[NUM_PATHS][FNLEN] = 
+{
+  "./data",
+  "/usr/share/"PACKAGE"/data",
+  "/usr/local/share/"PACKAGE"/data",
+  DATA_PREFIX"/share/"PACKAGE"/data"
+};
 
+
+/* Local function prototypes: */
+int load_settings_fp(FILE* fp);
+int load_settings_filename(const char* fn);
+
 /***************************
 	GraphicsInit: Initializes the graphic system
 ****************************/
@@ -94,7 +105,7 @@
 		}
 
 
-	atexit(SDL_Quit); // fire and forget... 
+//	atexit(SDL_Quit); // fire and forget... 
 
 	LOG( "-SDL Library init'd successfully\n" );
 
@@ -111,7 +122,7 @@
 		exit(2);
 	}
 
-	atexit(TTF_Quit);
+//	atexit(TTF_Quit);
 
 	SDL_EnableKeyRepeat( 0, SDL_DEFAULT_REPEAT_INTERVAL );
 	/* Need this to get Unicode values from keysyms: */
@@ -123,75 +134,139 @@
 /* Load the settings from a file... make sure to update SaveSettings if you change
  *  what can be saved/loaded 
  */
-void LoadSettings( void ) {
+void LoadSettings(void)
+{
+  char fn[FNLEN];
+// 	char setting[FNLEN];
+// 	char value[FNLEN];
+//	FILE *settingsFile;
 	
-	char fn[FNLEN];
-	char setting[FNLEN];
-	char value[FNLEN];
-	FILE *settingsFile;
-	
-	/* set the settings directory/file */
+  /* set the settings directory/file */
 
-	#ifdef WIN32
-		snprintf( fn, FNLEN-1, "userdata/settings.txt" );
-		LOG("WIN32 defined\n");
-	#else
-		snprintf( fn, FNLEN-1, (const char*)"%s/.tuxtype/settings.txt", getenv("HOME") );
-		LOG("WIN32 not defined\n");
-	#endif
+#ifdef WIN32
+  snprintf(fn, FNLEN - 1, "userdata/settings.txt");
+  LOG("WIN32 defined\n");
+#else
+  snprintf(fn, FNLEN - 1, (const char*)"%s/.tuxtype/settings.txt", getenv("HOME"));
+  LOG("WIN32 not defined\n");
+#endif
 
-	DEBUGCODE { printf("LoadSettings: settings file is '%s'\n", fn ); }
-	
-	LOG("LoadSettings: trying to open settings file\n");
-	
-	settingsFile = fopen( fn, "r" );
+  DEBUGCODE { printf("LoadSettings: settings file is '%s'\n", fn ); }
 
-	/* FIXME should set complete default profile if file not found */
-	if (settingsFile == NULL) {
-		printf("LoadSettings: Settings file does not exist! settings not loaded\n");
-		settings.mus_volume = 100;
-		settings.sfx_volume = 100;
-		return;
-	}
+  LOG("LoadSettings: trying to open settings file\n");
+
+  load_settings_filename(fn);
+}
+
+
+
+/* Load the settings if given the complete pathname to the settings file.  Returns 1 if
+   able to call load_settings_fp() successfully on named file.
+ */
+int load_settings_filename(const char* fn)
+{
+  FILE* fp = fopen(fn, "r");
+
+  if (!fp)
+  {
+    fprintf(stderr, "load_settings_filename(): Settings file could not be opened! settings not loaded\n");
+    return;
+  }
 	
-	/* we load all the settings here */
-	
-	while (!feof(settingsFile)) {
-		fscanf( settingsFile, "%[^=]=%[^\n]\n", setting, value );
-	
-		DEBUGCODE { printf( "%s = %s", setting, value ); }
-		
-		if (strncmp( setting, "lang", FNLEN ) == 0 ) {
-			DEBUGCODE { printf("LoadSettings: Setting language to %s", value); }
-			strncpy(settings.lang, value, FNLEN-1 );
-			settings.lang[FNLEN-1]=0;
-			SetupTheme(value);
-		}
-		if (strncmp( setting, "o_lives", FNLEN ) == 0 ) {
-			DEBUGCODE { printf("LoadSettings: Setting lives to %s", value); }
-			settings.o_lives = atoi(value);
-		}
-		if (strncmp( setting, "mus_volume", FNLEN ) == 0 ) {
-			DEBUGCODE { printf("LoadSettings: Setting music volume to %s", value); }
-			settings.mus_volume = atoi(value);
-		}
-		if (strncmp( setting, "sfx_volume", FNLEN ) == 0 ) {
-			DEBUGCODE { printf("LoadSettings: Setting effects volume to %s", value); }
-			settings.sfx_volume = atoi(value);
-		}
-		if (strncmp( setting, "menu_music", FNLEN ) == 0 ) {
-			DEBUGCODE { printf("LoadSettings: Setting menu music to %s", value); }
-			settings.menu_music = atoi(value);
-		}
-		if (strncmp( setting, "fullscreen", FNLEN ) == 0 ) {
-			settings.fullscreen = atoi(value);
-		}
-	}
-	
-	fclose( settingsFile );
+  if (!load_settings_fp(fp))
+  {
+    fprintf(stderr, "No settings in settings file.\n");
+    fclose(fp); /* still need to close fp */
+    return 0;
+  }
 
+  /* Success! */
+  fclose(fp);
+  return 1;
 }
 
+
+/* Load the settings if given an open FILE* pointer to the settings file.  Returns 1 if
+   at least one setting value found, 0 otherwise. It does not close the FILE*.
+ */
+int load_settings_fp(FILE* fp)
+{
+  char setting[FNLEN]; /* these don't really need to be 'FNLEN' long */
+  char value[FNLEN];
+  int setting_found = 0;
+
+  if (!fp)
+  {
+    fprintf(stderr, "load_settings_fp() - FILE* parameter NULL\n");
+    return 0;
+  }
+
+  /* we load all the settings here */
+  while (!feof(fp))
+  {
+    fscanf(fp, "%[^=]=%[^\n]\n", setting, value );
+
+    DEBUGCODE {fprintf(stderr, "%s = %s", setting, value );}
+
+    if (strncmp( setting, "lang", FNLEN ) == 0 )
+    {
+      DEBUGCODE {fprintf(stderr, "LoadSettings: Setting language to %s", value);}
+      strncpy(settings.lang, value, FNLEN - 1);
+      setting_found = 1;
+      SetupPaths(value); /* Does this really belong here? */ 
+    }
+    else if (strncmp( setting, "o_lives", FNLEN ) == 0 )
+    {
+      DEBUGCODE {fprintf(stderr, "LoadSettings: Setting lives to %s", value);}
+      settings.o_lives = atoi(value);
+      setting_found = 1;
+   }
+    else if (strncmp( setting, "mus_volume", FNLEN ) == 0 )
+    {
+      DEBUGCODE {fprintf(stderr, "LoadSettings: Setting music volume to %s", value);}
+      settings.mus_volume = atoi(value);
+      setting_found = 1;
+    }
+    else if (strncmp(setting, "sfx_volume", FNLEN) == 0)
+    {
+      DEBUGCODE {fprintf(stderr, "LoadSettings: Setting effects volume to %s", value);}
+      settings.sfx_volume = atoi(value);
+      setting_found = 1;
+    }
+    else if (strncmp(setting, "menu_music", FNLEN) == 0)
+    {
+      DEBUGCODE {fprintf(stderr, "LoadSettings: Setting menu music to %s", value);}
+      settings.menu_music = atoi(value);
+      setting_found = 1;
+    }
+    else if (strncmp( setting, "fullscreen", FNLEN ) == 0 )
+    {
+      settings.fullscreen = atoi(value);
+      setting_found = 1;
+    }
+    else if (strncmp( setting, "theme_font_name", FNLEN ) == 0 )
+    {
+      DEBUGCODE {fprintf(stderr, "load_settings_fp(): Setting theme font to %s", value);}
+      strncpy(settings.theme_font_name, value, FNLEN - 1);
+      setting_found = 1;
+    }
+    else
+      DEBUGCODE {fprintf(stderr, "load_settings_fp(): unrecognized string: %s", value);}
+
+  }
+
+
+  if (setting_found)
+    return 1;
+  else
+  {
+    fprintf(stderr, "load_settings_fp() - no settings in file - empty or corrupt?\n");
+    return 0;
+  }
+}
+
+
+
 /* Save the settings from a file... make sure to update LoadSettings if you change
  *  what can be saved/loaded 
  */
@@ -224,8 +299,8 @@
 	}
 	
 	/* Save all the settings here! */
-	if (strncmp( themeName, "", FNLEN) != 0)
-		fprintf( settingsFile, "lang=%s\n", themeName );
+	if (strncmp(settings.theme_name, "", FNLEN) != 0)
+		fprintf( settingsFile, "lang=%s\n", settings.theme_name );
 	if (settings.o_lives > 9)
 		fprintf( settingsFile, "o_lives=%d\n", settings.o_lives );
 
@@ -240,5 +315,125 @@
 // 	} else {
 // 		fprintf( settingsFile, "fullscreen=%s\n", "0");
 // 	}
-	fclose( settingsFile );
+	fclose(settingsFile);
 }
+
+
+/* Check for default (English) and theme data paths and update settings struct. */
+/* Returns 0 if default data path not found, 1 if successfully located.         */
+/* If theme not found, still returns 1 but settings changed to use English.     */
+/* TODO should have this function set up the user and global settings paths.    */
+/* TODO settings should be re-loaded when theme changes.                        */
+
+int SetupPaths(const char* theme_dir)
+{
+  int i;
+  settings.use_english = 1; // default is to use English if we cannot find theme
+
+  /* First find default data path: */
+  for (i = 0; i < NUM_PATHS; i++)
+  {
+
+    DEBUGCODE
+    {
+      fprintf(stderr, "SetupPaths(): checking for '%s' as default data path\n", PATHS[i]);
+    }
+
+    if (CheckFile(PATHS[i]))
+    {
+      strncpy(settings.default_data_path, PATHS[i], FNLEN - 1);
+
+      DEBUGCODE
+      {
+        fprintf(stderr, "path '%s' found, copy to settings.default_data_path\n", PATHS[i]);
+      }
+      break;
+    }
+    else
+    {
+      DEBUGCODE
+      {
+        fprintf(stderr, "path '%s' not found.\n", PATHS[i]);
+      }
+    }
+  }
+
+  /* If we didn't find a data path, print error msg and get out: */
+  if (i >= NUM_PATHS) /* (shouldn't actually ever be > NUM_PATHS) */
+  {
+    fprintf(stderr, "SetupPaths(): Error - could not find data path.\n");
+    return 0;
+  }
+
+
+  /* Now look for theme directory: */
+  if (theme_dir != NULL)
+  {
+    char full_theme_path[FNLEN];
+    char theme_settings_path[FNLEN];
+
+    sprintf(full_theme_path, "%s/themes/%s", settings.default_data_path, theme_dir);
+
+    DEBUGCODE
+    {
+      fprintf(stderr, "SetupPaths(): checking for '%s' as theme path\n", full_theme_path);
+    }
+
+    if (CheckFile(full_theme_path)) /* Theme found - set it up! */
+    {
+      settings.use_english = 0;
+      strncpy(settings.theme_data_path, full_theme_path, FNLEN - 1);
+      DEBUGCODE
+      {
+        fprintf(stderr, "settings.theme_data_path is: %s\n", settings.theme_data_path);
+      }
+ 
+      strncpy(settings.theme_name, theme_dir, FNLEN - 1);
+      /* (Need to do this in case we are changing from a theme with */
+      /* a special font to a theme that uses the default, but lacks */
+      /* an explicit statement to use the default(                  */
+      strncpy(settings.theme_font_name, DEFAULT_MENU_FONT, FNLEN);
+
+      /* Load fontname or any other theme-specific settings: */
+      sprintf(theme_settings_path, "%s/settings.txt", full_theme_path);
+
+      DEBUGCODE
+      {
+        fprintf(stderr, "theme_settings_path is: %s\n", theme_settings_path);
+      }
+
+      load_settings_filename(theme_settings_path);
+    }
+    else /* Theme not found! */
+    {
+      settings.use_english = 1; // default is to use English if we cannot find theme
+      strcpy(settings.theme_name, "");
+      strncpy(settings.theme_font_name, DEFAULT_MENU_FONT, FNLEN);
+      fprintf(stderr, "SetupPaths(): could not find '%s'\n", full_theme_path);
+    }
+  }
+  else /* No theme name passed as arg so just use English: */
+  {
+    settings.use_english = 1; // default is to use English if we cannot find theme
+    strcpy(settings.theme_name, "");
+  }
+
+
+  DEBUGCODE
+  {
+    fprintf(stderr, "Leaving SetupPaths():\n");
+    fprintf(stderr, "default_data_path: '%s'\n", settings.default_data_path);
+    fprintf(stderr, "theme_data_path: '%s'\n\n", settings.theme_data_path);
+  }
+  return 1;	
+}
+
+
+void Cleanup(void)
+{
+  SDL_FreeSurface(screen);
+  screen = NULL;
+
+  SDL_Quit();
+  TTF_Quit();
+}

Modified: tuxtype/trunk/tuxtype/theme.c
===================================================================
--- tuxtype/trunk/tuxtype/theme.c	2007-08-19 14:05:04 UTC (rev 200)
+++ tuxtype/trunk/tuxtype/theme.c	2007-08-20 02:31:56 UTC (rev 201)
@@ -19,23 +19,11 @@
 #include "globals.h"
 #include "funcs.h"
 
-#define NUM_PATHS 4
 
-const char PATHS[NUM_PATHS][FNLEN] = {
-	"./data",
-	"/usr/share/"PACKAGE"/data",
-	"/usr/local/share/"PACKAGE"/data",
-	DATA_PREFIX"/share/"PACKAGE"/data"
-};
-
 SDL_Surface *letters[255] = {NULL};
 wchar_t ALPHABET[256];
 unsigned char FINGER[256][10];
 int ALPHABET_SIZE;
-unsigned char realPath[2][FNLEN];
-char themeName[FNLEN];
-char fontName[FNLEN];
-//int useEnglish;
 
 
 #define MAX_LANGUAGES 100
@@ -48,68 +36,14 @@
  * the default path
  */
 
-/*FIXME should check for 'font_name' file, get name and change to requested font */
 
-void SetupTheme(const char* dirName)
-{
-	int i;
-	int found = 0;
-	settings.use_english=1; // default is to use English if we cannot find theme
-
-	for (i=0; i<NUM_PATHS && !found; i++) {
-
-		DEBUGCODE{
-		fprintf(stderr, "SetupTheme(): checking for: %s\n", PATHS[i]);
-		}
-
-		if (CheckFile(PATHS[i]))
-                {
-			strncpy(realPath[1], PATHS[i], FNLEN - 1);
-			strncpy(themeName, "", FNLEN - 1);
-			found = 1; /* so quit looking */
-
-			DEBUGCODE{
-			fprintf(stderr, "path '%s' found, copy to realPath[1]\n", PATHS[i]);
-			}
-		}
-		else {
-			DEBUGCODE{
-			fprintf(stderr, "path '%s' not found.\n", PATHS[i]);
-			}
-		}
-
-	}
-
-	if (dirName != NULL) {
-		char fullDir[FNLEN];
-
-		/* find the path to the theme */
-		sprintf( fullDir, "%s/themes/%s", realPath[1], dirName );
-
-		if (CheckFile(fullDir))
-                {
-			settings.use_english=0;
-			strncpy( realPath[0], fullDir, FNLEN-1 );
-			strncpy( themeName, dirName, FNLEN-1 );
-		}
-	}
-	DEBUGCODE
-	{
-		fprintf(stderr, "Leaving SetupTheme():\n");
-		if (dirName != NULL)
-			fprintf(stderr, "realPath[0] = %s\n", realPath[0]);
-		fprintf(stderr, "realPath[1] = %s\n", realPath[1]);
-	}
-	
-}
-
 void ChooseTheme(void)
 {
-	SDL_Surface *titles[MAX_LANGUAGES];
-	SDL_Surface *select[MAX_LANGUAGES];
-	SDL_Surface *left, *right;
+	SDL_Surface* titles[MAX_LANGUAGES] = {NULL};
+	SDL_Surface* select[MAX_LANGUAGES] = {NULL};
+	SDL_Surface* left = NULL, *right = NULL;
 	SDL_Rect leftRect, rightRect;
-	SDL_Surface *world, *map, *photo;
+	SDL_Surface* world = NULL, *map = NULL, *photo = NULL;
 	SDL_Rect worldRect, photoRect;
 	SDL_Rect titleRects[8];
 	int stop = 0;
@@ -123,16 +57,16 @@
 	unsigned char themePaths[MAX_LANGUAGES][FNLEN];
 
 	int old_use_english;
-	char old_realPath[FNLEN];
+	char old_theme_path[FNLEN];
 
 	DIR *themesDir;
 	struct dirent *themesFile;
 //	struct stat fileStats;
 
 	old_use_english = settings.use_english;
-	strncpy( old_realPath, realPath[0], FNLEN-1 );
+	strncpy(old_theme_path, settings.theme_data_path, FNLEN - 1);
 
-	sprintf( fn, "%s/themes/", realPath[1]);
+	sprintf(fn, "%s/themes/", settings.default_data_path);
 	themesDir = opendir(fn);
 
 	do {
@@ -149,10 +83,8 @@
 			continue;
 
 		/* check to see if it is a directory */
-		sprintf( fn, "%s/themes/%s", realPath[1], themesFile->d_name);
+		sprintf(fn, "%s/themes/%s", settings.default_data_path, themesFile->d_name);
 
-//		fileStats.st_mode=0;
-//		stat( fn, &fileStats );
 
 		/* CheckFile() returns 2 if dir, 1 if file, 0 if neither: */
 		if (CheckFile(fn) == 2) {
@@ -238,10 +170,10 @@
 							loc = loc-(loc%8)+i;
 							if (loc) {
 								/* --- set theme --- */
-								SetupTheme(themePaths[loc]);
+								SetupPaths(themePaths[loc]);
 							} else {
 								/* --- english --- */
-								SetupTheme(NULL);
+								SetupPaths(NULL);
 							}
 							stop = 1;
 							break;
@@ -250,17 +182,17 @@
 				case SDL_KEYDOWN:
 					if (event.key.keysym.sym == SDLK_ESCAPE) { 
 						settings.use_english = old_use_english;
-						strncpy( realPath[0], old_realPath, FNLEN-1 );
+						strncpy(settings.theme_data_path, old_theme_path, FNLEN - 1);
 						stop = 1; 
 						break; 
 					}
 					if (event.key.keysym.sym == SDLK_RETURN) { 
 						if (loc) {
 							/* --- set theme --- */
-							SetupTheme(themePaths[loc]);
+							SetupPaths(themePaths[loc]);
 						} else {
 							/* --- english --- */
-							SetupTheme(NULL);
+							SetupPaths(NULL);
 						}
 						stop = 1;
 						break;
@@ -295,7 +227,7 @@
 
 			SDL_BlitSurface( world, NULL, screen, &worldRect );
 
-		        if (loc) SetupTheme(themePaths[loc]); else SetupTheme(NULL);
+		        if (loc) SetupPaths(themePaths[loc]); else SetupPaths(NULL);
 
 			map = LoadImage( "map.png", IMG_ALPHA|IMG_NOT_REQUIRED );
 			if (map) {

Modified: tuxtype/trunk/tuxtype/titlescreen.c
===================================================================
--- tuxtype/trunk/tuxtype/titlescreen.c	2007-08-19 14:05:04 UTC (rev 200)
+++ tuxtype/trunk/tuxtype/titlescreen.c	2007-08-20 02:31:56 UTC (rev 201)
@@ -24,27 +24,28 @@
 /* --- media for menus --- */
 
 /* images of regular and selected text of menu items: */
-SDL_Surface *reg_text[TITLE_MENU_ITEMS + 1][TITLE_MENU_DEPTH + 1];
-SDL_Surface *sel_text[TITLE_MENU_ITEMS + 1][TITLE_MENU_DEPTH + 1];
-sprite *reg;
-sprite *sel;
+SDL_Surface* reg_text[TITLE_MENU_ITEMS + 1][TITLE_MENU_DEPTH + 1] = {NULL};
+SDL_Surface* sel_text[TITLE_MENU_ITEMS + 1][TITLE_MENU_DEPTH + 1] = {NULL};
+sprite* reg = NULL;
+sprite* sel = NULL;
 /* this will contain pointers to all of the menu 'icons' */
-sprite *menu_gfx[TITLE_MENU_ITEMS + 1][TITLE_MENU_DEPTH + 1];
+sprite* menu_gfx[TITLE_MENU_ITEMS + 1][TITLE_MENU_DEPTH + 1] = {NULL};
 /* keep track of the width of each menu: */
 int     menu_width[TITLE_MENU_DEPTH + 1];
 
 /* NOTE for 'depth', think pages like a restaurant menu, */
 /* not heirarchical depth - choice of term is misleading */
 int menu_depth; // how deep we are in the menu
-int menu_sound; // status of menu sound effects
-int menu_music; // status of menu sound effects
+//int menu_sound; // status of menu sound effects
+//int menu_music; // status of menu sound effects
 
 /* --- other media --- */
-SDL_Surface *title;
-SDL_Surface *speaker;
-SDL_Surface *speakeroff;
-sprite *Tux;
-Mix_Chunk *snd_move, *snd_select;
+SDL_Surface* title = NULL;
+SDL_Surface* speaker = NULL;
+SDL_Surface* speakeroff = NULL;
+sprite* Tux = NULL;
+Mix_Chunk* snd_move = NULL;
+Mix_Chunk* snd_select = NULL;
 
 /* --- locations we need --- */
 SDL_Rect text_dst[TITLE_MENU_ITEMS + 1];     // location of text for menu
@@ -57,7 +58,7 @@
 static int chooseWordlist(void);
 static void draw_button(int id, sprite* s);
 static void not_implemented(void);
-static void load_media(void);
+static int load_media(void);
 static void load_menu(void);
 static void unload_media(void);
 static void unload_menu(void);
@@ -101,8 +102,8 @@
 
   if (settings.sys_sound)
   {
-    menu_sound = 1;
-    menu_music = settings.menu_music;
+    settings.menu_sound = 1;
+    settings.menu_music = 1;
   }
 
 
@@ -117,23 +118,31 @@
 
   if (settings.show_tux4kids)
   {
-    SDL_Surface *standby;
+    SDL_Surface* standby = NULL;
     standby = LoadImage("standby.png", IMG_REGULAR|IMG_NO_THEME);
 
-    dest.x = ((screen->w) / 2) - (standby->w) / 2;  // Center horizontally
-    dest.y = ((screen->h) / 2) - (standby->h) / 2;  // Center vertically
-    dest.w = standby->w;
-    dest.h = standby->h;
+    if (standby) /* Avoid segfault */
+    { 
+      dest.x = ((screen->w) / 2) - (standby->w) / 2;  // Center horizontally
+      dest.y = ((screen->h) / 2) - (standby->h) / 2;  // Center vertically
+      dest.w = standby->w;
+      dest.h = standby->h;
 
-    SDL_FillRect(screen, NULL, SDL_MapRGB(screen->format, 0, 0, 0));
-    SDL_BlitSurface(standby, NULL, screen, &dest);
-    SDL_UpdateRect(screen, 0, 0, 0, 0);
-    SDL_FreeSurface(standby);  // Unload image
+      SDL_FillRect(screen, NULL, SDL_MapRGB(screen->format, 0, 0, 0));
+      SDL_BlitSurface(standby, NULL, screen, &dest);
+      SDL_UpdateRect(screen, 0, 0, 0, 0);
+      SDL_FreeSurface(standby);  // Unload image
+    }
   }
 
 
   /* Load media and menu data: */
-  load_media();
+  if (!load_media())
+  {
+    fprintf(stderr, "TitleScreen - load_media() failed!");
+    return;
+  }
+
   SDL_WM_GrabInput(SDL_GRAB_ON); // User input goes to TuxType, not window manager
 
 
@@ -202,13 +211,13 @@
   SDL_BlitSurface(title, NULL, screen, &Titledest);
 
   /* Pick speaker graphic according to whether music is on: */
-  if ( menu_music )
+  if ( settings.menu_music )
     SDL_BlitSurface(speaker, NULL, screen, &spkrdest);
   else
     SDL_BlitSurface(speakeroff, NULL, screen, &spkrdest);
 
   /* Start playing menu music if desired: */
-  if (menu_music)
+  if (settings.menu_music)
     MusicLoad( "tuxi.ogg", -1 );
 
   LOG( "Tux and Title are in place now\n" );
@@ -268,7 +277,7 @@
                 (cursor.y >= menu_button[j].y && cursor.y <= (menu_button[j].y + menu_button[j].h)))
             {
               menu_opt = menu_item[j][menu_depth];
-              if (menu_sound)
+              if (settings.menu_sound)
               {
                 PlaySound(snd_select);
               }
@@ -284,14 +293,14 @@
           if ((cursor.x >= spkrdest.x && cursor.x <= (spkrdest.x + spkrdest.w)) && 
               (cursor.y >= spkrdest.y && cursor.y <= (spkrdest.y + spkrdest.h)))
           {
-            if (menu_music)
+            if (settings.menu_music)
             {
               MusicUnload();
-              menu_music = 0;
+              settings.menu_music = 0;
             }
             else
             {
-              menu_music = 1;
+              settings.menu_music = 1;
               MusicLoad("tuxi.ogg", -1);
             }
             redraw = 1;
@@ -321,7 +330,7 @@
               else
                 menu_opt = QUIT_GAME;
 
-              if (menu_sound)
+              if (settings.menu_sound)
                 PlaySound(snd_select);
               break;
             }
@@ -339,14 +348,14 @@
             /* Toggle menu music: */
             case SDLK_F11:
             {
-              if (menu_music)
+              if (settings.menu_music)
               {
                 MusicUnload( );
-                menu_music=0;
+                settings.menu_music=0;
               }
               else
               {
-                menu_music=1;
+                settings.menu_music=1;
                 MusicLoad("tuxi.ogg", -1);
               }
               redraw = 1;
@@ -367,7 +376,7 @@
 
             case SDLK_UP:
             {
-              if (menu_sound)
+              if (settings.menu_sound)
                 PlaySound(snd_move);
               key_menu--;
               if (key_menu < 1)
@@ -379,7 +388,7 @@
             case SDLK_DOWN:
             {
               key_menu++;
-              if (menu_sound)
+              if (settings.menu_sound)
                 PlaySound(snd_move);
               if (key_menu > 5)
                 key_menu = 1;
@@ -392,7 +401,7 @@
               if (key_menu)
               {
                 menu_opt = menu_item[key_menu][menu_depth];
-                if (menu_sound)
+                if (settings.menu_sound)
                   PlaySound(snd_select);
               }
               break;
@@ -489,7 +498,7 @@
       SDL_Flip( screen );
       unload_media();
 
-      if (menu_music)
+      if (settings.menu_music)
         MusicUnload( );
 
       TestLesson();
@@ -497,7 +506,7 @@
       load_media();
       redraw = 1;
 
-      if (menu_music)
+      if (settings.menu_music)
         MusicLoad( "tuxi.ogg", -1 );
     }
 
@@ -511,7 +520,7 @@
       load_media();
       redraw = 1;
 
-      if (menu_music)
+      if (settings.menu_music)
         MusicLoad( "tuxi.ogg", -1 );
     }
 
@@ -530,7 +539,7 @@
 
         load_media();
 
-        if (menu_music)
+        if (settings.menu_music)
           MusicLoad( "tuxi.ogg", -1 );
       }
 
@@ -552,7 +561,7 @@
 
         load_media();
 
-        if (menu_music)
+        if (settings.menu_music)
           MusicLoad( "tuxi.ogg", -1 );
       }
 
@@ -575,7 +584,7 @@
 
         load_media();
 
-        if (menu_music)
+        if (settings.menu_music)
           MusicLoad( "tuxi.ogg", -1 );
       }
 
@@ -598,7 +607,7 @@
 
         load_media();
 
-        if (menu_music)
+        if (settings.menu_music)
           MusicLoad( "tuxi.ogg", -1 );
       }
 
@@ -619,7 +628,7 @@
 
       load_media();
 
-      if (menu_music)
+      if (settings.menu_music)
         MusicLoad( "tuxi.ogg", -1 );
 
       redraw = 1;
@@ -645,7 +654,7 @@
       SDL_BlitSurface(bkg, NULL, screen, NULL); 
       SDL_BlitSurface(title, NULL, screen, &Titledest);
 
-      if ( menu_music )
+      if ( settings.menu_music )
         SDL_BlitSurface(speaker, NULL, screen, &spkrdest);
       else
         SDL_BlitSurface(speakeroff, NULL, screen, &spkrdest);
@@ -754,7 +763,7 @@
 
     // HACK This is still more than we need to update every frame but
     // it cuts cpu on my machine %60 so it seems better...
-    if ( menu_music )
+    if ( settings.menu_music )
       SDL_BlitSurface(speaker, NULL, screen, &spkrdest);
     else
       SDL_BlitSurface(speakeroff, NULL, screen, &spkrdest);
@@ -787,7 +796,6 @@
 
   LOG( "->>Freeing title screen images\n" );
 
-  settings.menu_music = menu_music;
   unload_media();
 
   LOG( "->TitleScreen():END \n" );
@@ -865,102 +873,113 @@
 
 static void load_menu(void)
 {
-	unsigned char fn[FNLEN];
-	int max, i, j;
+  unsigned char fn[FNLEN];
+  int max, i, j;
 
-	SDL_ShowCursor(1);
+  SDL_ShowCursor(1);
 
-	LOG("loading & parsing menu\n");
-	
-	for (j = 1; j <= TITLE_MENU_DEPTH; j++)  /* Each 'depth' is a different menu */
-	{
-		max = 0;
-		for (i = 1; i <= TITLE_MENU_ITEMS; i++)
-		{
-			DEBUGCODE
-			{
-			  fprintf(stderr, "i = '%d'\tj = '%d'\ttext = '%s'\n",
-                                  i, j,  _((unsigned char*)menu_text[i][j]));
-			}
-			/* --- create text surfaces --- */
-			reg_text[i][j] = BlackOutline( _((unsigned char*)menu_text[i][j]), font, &white);
-			sel_text[i][j] = BlackOutline( _((unsigned char*)menu_text[i][j]), font, &yellow);
+  LOG("loading & parsing menu\n");
 
-			if (sel_text[i][j]->w > max)
-				max = sel_text[i][j]->w;
+  for (j = 1; j <= TITLE_MENU_DEPTH; j++)  /* Each 'depth' is a different menu */
+  {
+    max = 0;
+    for (i = 1; i <= TITLE_MENU_ITEMS; i++)
+    {
+      DEBUGCODE
+      {
+        fprintf(stderr, "i = '%d'\tj = '%d'\ttext = '%s'\n",
+                i, j,  _((unsigned char*)menu_text[i][j]));
+      }
 
-			/* --- load animated icon for menu item --- */
-			sprintf(fn, "menu/%s", menu_icon[i][j]);
-			menu_gfx[i][j] = LoadSprite(fn, IMG_ALPHA);
-		}
-		menu_width[j] = max + 20 + 40; // Not clear where '20' and '40' are coming from
-	}
+      /* --- create text surfaces --- */
+      reg_text[i][j] = BlackOutline( _((unsigned char*)menu_text[i][j]), font, &white);
+      sel_text[i][j] = BlackOutline( _((unsigned char*)menu_text[i][j]), font, &yellow);
 
-	LOG("done creating graphics, now setting positions\n");
+      /* (first make sure ptr valid to avoid segfault) */
+      if (sel_text[i][j] && sel_text[i][j]->w > max)
+        max = sel_text[i][j]->w;
 
+      /* --- load animated icon for menu item --- */
+      sprintf(fn, "menu/%s", menu_icon[i][j]);
+      menu_gfx[i][j] = LoadSprite(fn, IMG_ALPHA);
+    }
+    menu_width[j] = max + 20 + 40; // Not clear where '20' and '40' are coming from
+  }
 
-	/* --- setup menu item destinations --- */
+  LOG("done creating graphics, now setting positions\n");
 
+  /* --- setup menu item destinations --- */
+  menu_button[1].x = 240;
+  menu_button[1].y = 100;
+  menu_button[1].w = menu_width[1];  //calc from width of widest menu item
+  /* we should only get to here after we know 'sel' successfully loaded, so safe: */
+  menu_button[1].h = sel->frame[1]->h; //height of sprite image
 
-	menu_button[1].x = 240;
-	menu_button[1].y = 100;
-	menu_button[1].w = menu_width[1];  //calc from width of widest menu item
-	menu_button[1].h = sel->frame[1]->h; //height of sprite image
+  menu_gfxdest[1].x = menu_button[1].x + 6; // inset graphic by (6, 4) */
+  menu_gfxdest[1].y = menu_button[1].y + 4;
+  menu_gfxdest[1].w = 40;
+  menu_gfxdest[1].h = 50;
 
-	menu_gfxdest[1].x = menu_button[1].x + 6; // inset graphic by (6, 4) */
-	menu_gfxdest[1].y = menu_button[1].y + 4;
-	menu_gfxdest[1].w = 40;
-	menu_gfxdest[1].h = 50;
+  text_dst[1].y = menu_button[1].y + 15;
 
-	text_dst[1].y = menu_button[1].y+15;
+  /* FIXME each menu item drawn hardcoded 60 pixels below last - */
+  /* perhaps increment should be "menu_button[j-1].h + MENU_ITEM_GAP" */
+  for (j = 2; j < 6; j++) 
+  {
+    /* --- setup vertical location of button text --- */
+    text_dst[j].y = text_dst[j-1].y + 60;
 
-	/* FIXME each menu item drawn hardcoded 60 pixels below last - */
-	/* perhaps increment should be "menu_button[j-1].h + MENU_ITEM_GAP" */
-	for (j=2; j<6; j++) 
-	{
-		/* --- setup vertical location of button text --- */
-		text_dst[j].y = text_dst[j-1].y + 60;
+    /* --- setup location of button background --- */
+    menu_button[j].x = menu_button[j-1].x;
+    menu_button[j].y = menu_button[j-1].y + 60;
+    menu_button[j].w = menu_button[j-1].w;
+    menu_button[j].h = menu_button[j-1].h;
 
-		/* --- setup location of button background --- */
-		menu_button[j].x = menu_button[j-1].x;
-		menu_button[j].y = menu_button[j-1].y + 60;
-		menu_button[j].w = menu_button[j-1].w;
-		menu_button[j].h = menu_button[j-1].h;
-
-		/* --- setup location of animated icon --- */
-		menu_gfxdest[j].x = menu_gfxdest[j-1].x;
-		menu_gfxdest[j].y = menu_gfxdest[j-1].y + 60;
-		menu_gfxdest[j].w = menu_gfxdest[j-1].w;
-		menu_gfxdest[j].h = menu_gfxdest[j-1].h;
-	}
+    /* --- setup location of animated icon --- */
+    menu_gfxdest[j].x = menu_gfxdest[j-1].x;
+    menu_gfxdest[j].y = menu_gfxdest[j-1].y + 60;
+    menu_gfxdest[j].w = menu_gfxdest[j-1].w;
+    menu_gfxdest[j].h = menu_gfxdest[j-1].h;
+  }
 }
 
+
 static void unload_menu(void)
 {
-	int i,j;
+  int i,j;
 
-	for (i = 1; i <= TITLE_MENU_ITEMS; i++)
-		for (j = 1; j <= TITLE_MENU_DEPTH; j++) {
-			SDL_FreeSurface(reg_text[i][j]);
-			SDL_FreeSurface(sel_text[i][j]);
-			FreeSprite(menu_gfx[i][j]);
-	}
+  for (i = 1; i <= TITLE_MENU_ITEMS; i++)
+  {
+    for (j = 1; j <= TITLE_MENU_DEPTH; j++)
+    {
+      SDL_FreeSurface(reg_text[i][j]);
+      SDL_FreeSurface(sel_text[i][j]);
+      FreeSprite(menu_gfx[i][j]);
+      reg_text[i][j] = sel_text[i][j] = menu_gfx[i][j] = NULL;
+    }
+  }
 }
 
-static void load_media(void)
+
+static int load_media(void)
 {
   DEBUGCODE
   {
     fprintf(stderr, "Entering load_media():\n");
-    fprintf(stderr, "realPath[0] = %s\n", realPath[0]);
-    fprintf(stderr, "realPath[1] = %s\n", realPath[1]);
+    fprintf(stderr, "default_data_path = %s\n", settings.default_data_path);
+    fprintf(stderr, "theme_data_path = %s\n", settings.theme_data_path);
   }
 
   /* --- load sounds --- */
-  if (menu_sound)
+  if (settings.menu_sound)
   {
     snd_move = LoadSound("tock.wav");
     snd_select = LoadSound("pop.wav");
+    if (!snd_move || !snd_select)
+    {
+      fprintf(stderr, "Could not load menu sounds - turning menu_sound off\n");
+      settings.menu_sound = 0;
+    }
   }
  
   /* --- load graphics --- */
@@ -968,117 +987,154 @@
   speaker = LoadImage( "sound.png", IMG_ALPHA );
   speakeroff = LoadImage( "nosound.png", IMG_ALPHA );
   bkg = LoadImage( "main_bkg.png", IMG_REGULAR );
-
   sel = LoadSprite("menu/sel", IMG_ALPHA);
   reg = LoadSprite("menu/reg", IMG_ALPHA);
-
   Tux = LoadSprite("tux", IMG_ALPHA);
+  font = LoadFont(settings.theme_font_name, MENU_FONT_SIZE);
 
-  font = LoadFont(settings.theme_font_name, MENU_FONT_SIZE);
+  /* Make sure we were successful: */
+  if (!title
+   || !speaker
+   || !speakeroff
+   || !bkg
+   || !sel
+   || !reg
+   || !Tux
+   || !font)
+  {
+    fprintf(stderr, "load_media() - could not load all needed files\n");
+    unload_media();
+    return 0;
+  }
+
   /* Should probably call this directly from TitleScreen() */
   load_menu();
+  return 1;
 }
 
+
+
 static void unload_media(void)
 {
+  /* --- unload sounds --- */
+  if (settings.menu_sound){
+    Mix_FreeChunk(snd_move);
+    snd_move = NULL;
+    Mix_FreeChunk(snd_select);
+    snd_select = NULL;
+  }
 
-	/* --- unload sounds --- */
+  /* --- unload graphics --- */
+  SDL_FreeSurface(title);
+  title = NULL;
+  SDL_FreeSurface(speaker);
+  speaker = NULL;
+  SDL_FreeSurface(speakeroff);
+  speakeroff = NULL;
+  SDL_FreeSurface(bkg);
+  bkg = NULL;
+  FreeSprite(sel);
+  sel = NULL;
+  FreeSprite(reg);
+  reg = NULL;
+  FreeSprite(Tux);
+  Tux = NULL;
+  TTF_CloseFont(font);
+  font = NULL;
 
-	if (menu_sound){
-	    Mix_FreeChunk(snd_move);
-	    Mix_FreeChunk(snd_select);
-	}
+  unload_menu();
+}
 
-	/* --- unload graphics --- */
+static void not_implemented(void)
+{
+  SDL_Surface *s1 = NULL, *s2 = NULL, *s3 = NULL, *s4 = NULL;
+  sprite* tux = NULL;
+  SDL_Rect loc;
+  int finished = 0, i;
 
-	SDL_FreeSurface(title);
-	SDL_FreeSurface(speaker);
-	SDL_FreeSurface(speakeroff);
-	SDL_FreeSurface(bkg);
+  LOG( "NotImplemented() - creating text\n" );
 
-	FreeSprite(sel);
-	FreeSprite(reg);
+  s1 = BlackOutline( _("Work In Progress!"), font, &white);
+  s2 = BlackOutline( _("This feature is not ready yet"), font, &white);
+  s3 = BlackOutline( _("Discuss the future of TuxTyping at"), font, &white);
 
-	FreeSprite(Tux);
+  /* we always want the URL in english */
+  /* NOTE: all fonts are almost certain to include glyphs for ASCII, */
+  /* so the following "english_font" hackery is probably unnecessary: */
+  if (!settings.use_english)
+  {
+    TTF_Font *english_font;
+    settings.use_english = 1;
+    english_font = LoadFont(DEFAULT_MENU_FONT, MENU_FONT_SIZE);
+    s4 = BlackOutline( "http://tuxtype.sf.net/forums", english_font, &white);
+    TTF_CloseFont(english_font);
+    settings.use_english = 0;
+  }
+  else 
+    s4 = BlackOutline( "http://tuxtype.sf.net/forums", font, &white);
 
-	TTF_CloseFont(font);
-	unload_menu();
-}
+  tux = LoadSprite("tux/tux-egypt", IMG_ALPHA);
 
-static void not_implemented(void) {
-	SDL_Surface *s1, *s2, *s3, *s4;
-	sprite *tux;
-	SDL_Rect loc;
-	int finished = 0, i;
+  if (s1 && s2 && s3 && s4 && tux && bkg)
+  {
+    LOG( "NotImplemented() - drawing screen\n" );
 
-        LOG( "NotImplemented() - creating text\n" );
+    SDL_BlitSurface( bkg, NULL, screen, NULL );
+    loc.x = 320-(s1->w/2); loc.y = 10;
+    SDL_BlitSurface( s1, NULL, screen, &loc);
+    loc.x = 320-(s2->w/2); loc.y = 60;
+    SDL_BlitSurface( s2, NULL, screen, &loc);
+    loc.x = 320-(s3->w/2); loc.y = 400;
+    SDL_BlitSurface( s3, NULL, screen, &loc);
+    loc.x = 320-(s4->w/2); loc.y = 440;
+    SDL_BlitSurface( s4, NULL, screen, &loc);
 
-	s1 = BlackOutline( _("Work In Progress!"), font, &white);
-	s2 = BlackOutline( _("This feature is not ready yet"), font, &white);
-	s3 = BlackOutline( _("Discuss the future of TuxTyping at"), font, &white);
+    loc.x = 320-(tux->frame[0]->w/2);
+    loc.y = 200;
+    loc.w = tux->frame[0]->w;
+    loc.h = tux->frame[0]->h;
+    SDL_BlitSurface( tux->frame[tux->cur], NULL, screen, &loc);
 
-	/* we always want the URL in english */
-	/* NOTE: all fonts are almost certain to include glyphs for ASCII, */
-        /* so the following "english_font" hackery is probably unnecessary: */
-	if (!settings.use_english) {
-		TTF_Font *english_font;
-		settings.use_english = 1;
-		english_font = LoadFont(DEFAULT_MENU_FONT, MENU_FONT_SIZE);
-		s4 = BlackOutline( "http://tuxtype.sf.net/forums", english_font, &white);
-		TTF_CloseFont(english_font);
-		settings.use_english = 0;
-	} else 
-		s4 = BlackOutline( "http://tuxtype.sf.net/forums", font, &white);
+    SDL_UpdateRect(screen, 0, 0, 0, 0);
 
-        LOG( "NotImplemented() - drawing screen\n" );
+    i = 0;
 
-	SDL_BlitSurface( bkg, NULL, screen, NULL );
-	loc.x = 320-(s1->w/2); loc.y = 10;
-	SDL_BlitSurface( s1, NULL, screen, &loc);
-	loc.x = 320-(s2->w/2); loc.y = 60;
-	SDL_BlitSurface( s2, NULL, screen, &loc);
-	loc.x = 320-(s3->w/2); loc.y = 400;
-	SDL_BlitSurface( s3, NULL, screen, &loc);
-	loc.x = 320-(s4->w/2); loc.y = 440;
-	SDL_BlitSurface( s4, NULL, screen, &loc);
+    while (!finished)
+    {
+      while (SDL_PollEvent(&event)) 
+      {
+        switch (event.type)
+        {
+          case SDL_QUIT:
+            exit(0);
+          case SDL_MOUSEBUTTONDOWN:
+          case SDL_KEYDOWN:
+            finished = 1;
+        }
+      }
 
-	tux = LoadSprite("tux/tux-egypt", IMG_ALPHA);
+      i++;
 
-	loc.x = 320-(tux->frame[0]->w/2);
-	loc.y = 200;
-	loc.w = tux->frame[0]->w;
-	loc.h = tux->frame[0]->h;
-	SDL_BlitSurface( tux->frame[tux->cur], NULL, screen, &loc);
+      if (i %5 == 0)
+      {
+        NEXT_FRAME(tux);
+        SDL_BlitSurface( bkg, &loc, screen, &loc);
+        SDL_BlitSurface( tux->frame[tux->cur], NULL, screen, &loc);
+        SDL_UpdateRect(screen, loc.x, loc.y, loc.w, loc.h);
+      }
 
-	SDL_UpdateRect(screen, 0, 0, 0, 0);
+      SDL_Delay(40);
+    }
+  }
+  else
+    fprintf(stderr, "NotImplemented() - could not load needed graphic\n");
 
-	i=0;
-	while (!finished) {
-		while (SDL_PollEvent(&event)) 
-			switch (event.type) {
-				case SDL_QUIT:
-					exit(0);
-				case SDL_MOUSEBUTTONDOWN:
-				case SDL_KEYDOWN:
-					finished=1;
-			}
-		i++;
-		if (i%5==0) {
-			NEXT_FRAME(tux);
-			SDL_BlitSurface( bkg, &loc, screen, &loc);
-			SDL_BlitSurface( tux->frame[tux->cur], NULL, screen, &loc);
-			SDL_UpdateRect(screen, loc.x, loc.y, loc.w, loc.h);
-		}
-
-			
-		SDL_Delay(40);
-	}
-
-	SDL_FreeSurface(s1);
-	SDL_FreeSurface(s2);
-	SDL_FreeSurface(s3);
-	SDL_FreeSurface(s4);
-	FreeSprite(tux);
+  SDL_FreeSurface(s1);
+  SDL_FreeSurface(s2);
+  SDL_FreeSurface(s3);
+  SDL_FreeSurface(s4);
+  FreeSprite(tux);
+  s1 = s2 = s3 = s4 = tux = NULL;
 }
 
 
@@ -1091,120 +1147,168 @@
  */
 static int chooseWordlist(void)
 {
-	SDL_Surface *titles[MAX_WORD_LISTS];
-	SDL_Surface *select[MAX_WORD_LISTS];
-	SDL_Surface *left, *right;
-	SDL_Rect leftRect, rightRect;
-	SDL_Rect titleRects[8];
-	int stop = 0;
-	int loc = 0;
-	int old_loc = 1;
-	int lists = 1;
-	int i;
-	unsigned char wordPath[FNLEN];
-	unsigned char wordlistFile[MAX_WORD_LISTS][200];
-	unsigned char wordlistName[MAX_WORD_LISTS][200];
+  SDL_Surface* titles[MAX_WORD_LISTS] = {NULL};
+  SDL_Surface* select[MAX_WORD_LISTS] = {NULL};
+  SDL_Surface* left = NULL, *right = NULL;
+  SDL_Rect leftRect, rightRect;
+  SDL_Rect titleRects[8];
+  int stop = 0;
+  int loc = 0;
+  int old_loc = 1;
+  int lists = 1;
+  int i;
+  unsigned char wordPath[FNLEN];
+  unsigned char wordlistFile[MAX_WORD_LISTS][200];
+  unsigned char wordlistName[MAX_WORD_LISTS][200];
 
-	DIR *wordsDir;
-	struct dirent *wordsFile;
-	FILE *tempFile;
+  DIR* wordsDir = NULL;
+  struct dirent* wordsFile = NULL;
+  FILE* tempFile = NULL;
 
-	LOG("Entering chooseWordlist():\n");
+  LOG("Entering chooseWordlist():\n");
 
-	/* find the directory to load wordlists from */
+  /* find the directory to load wordlists from */
 
-	for (i = settings.use_english; i < 2; i++) {
-		sprintf(wordPath, "%s/words", realPath[i]);
-		if (CheckFile(wordPath))
-			break;
-	}
+  /* Check under theme directory first, if theme selected: */
+  if (!settings.use_english)  /* Using theme: */
+  {
+    sprintf(wordPath,"%s/words", settings.theme_data_path);
+    if (!CheckFile(wordPath))
+    {
+      fprintf(stderr, "chooseWordList() - theme contains no wordlist dir \n");
+      return 0;
+    }
+  }
+  else  /* No theme selected - using English: */
+  {
+    sprintf(wordPath,"%s/words", settings.default_data_path);
+    if (!CheckFile(wordPath))
+    {
+      fprintf(stderr, "chooseWordList() - data path contains no wordlist dir \n");
+      return 0;
+    }
+  }
 
+  /* If we get to here, we know there is at least a wordlist directory */
+  /* but not necessarily any valid files.                              */
 
-	if (i==2) {
-		fprintf(stderr, "ERROR: Unable to find wordlist directory\n");
-		return;
-//		exit(1);
-	}
+  DEBUGCODE { fprintf(stderr, "wordPath is: %s\n", wordPath); }
 
-	DEBUGCODE { fprintf(stderr, "wordPath is: %s\n", wordPath); }
+  /* create a list of all the .txt files */
 
-	/* create a list of all the .txt files */
+  wordsDir = opendir( wordPath );	
 
-	wordsDir = opendir( wordPath );	
+  do
+  {
+    wordsFile = readdir(wordsDir);
+    if (!wordsFile)
+      break; /* Loop continues until break occurs */
 
-	do {
-		wordsFile = readdir(wordsDir);
-		if (!wordsFile)
-			break;
+    /* must have at least .txt at the end */
+    if (strlen(wordsFile->d_name) < 5)
+      continue;
 
-		/* must have at least .txt at the end */
-		if (strlen(wordsFile->d_name) < 5)
-			continue;
+    if (strcmp(&wordsFile->d_name[strlen(wordsFile->d_name)-4],".txt"))
+      continue;
 
-		if (strcmp(&wordsFile->d_name[strlen(wordsFile->d_name)-4],".txt"))
-			continue;
+    sprintf(wordlistFile[lists], "%s/%s", wordPath, wordsFile->d_name);
 
-		sprintf( wordlistFile[lists], "%s/%s", wordPath, wordsFile->d_name );
+    /* load the name for the wordlist from the file ... (1st line) */
+    tempFile = fopen( wordlistFile[lists], "r" );
+    if (!tempFile)
+      continue;
 
-		/* load the name for the wordlist from the file ... (1st line) */
-		tempFile = fopen( wordlistFile[lists], "r" );
-		if (tempFile==NULL) continue;
-		fscanf( tempFile, "%[^\n]\n", wordlistName[lists] );
+    fscanf(tempFile, "%[^\n]\n", wordlistName[lists]);
 
-		/* check to see if it has a \r at the end of it (dos format!) */
-		if (wordlistName[lists][ strlen(wordlistName[lists])-1 ] == '\r')
-			wordlistName[lists][ strlen(wordlistName[lists])-1 ] = '\0';
-		lists++;
+    /* check to see if it has a \r at the end of it (dos format!) */
+    if (wordlistName[lists][strlen(wordlistName[lists]) - 1] == '\r')
+      wordlistName[lists][strlen(wordlistName[lists]) - 1] = '\0';
 
-		fclose(tempFile);
-		
-	} while (1);
+    lists++;
 
-	closedir( wordsDir );	
+    fclose(tempFile);
+  } while (1); /* Loop continues until break occurs */
 
-	/* let the user pick the list */
+  closedir(wordsDir);	
 
-	titles[0] = BlackOutline( _("Alphabet"), font, &white );
-	select[0] = BlackOutline( _("Alphabet"), font, &yellow);
-	for (i = 1; i<lists; i++) {
-		titles[i] = BlackOutline( wordlistName[i], font, &white );
-		select[i] = BlackOutline( wordlistName[i], font, &yellow);
-	}
 
-	SDL_FreeSurface(bkg);
-        bkg = LoadImage("main_bkg.png", IMG_REGULAR);
 
-        left = LoadImage("left.png", IMG_ALPHA);       
-        leftRect.w = left->w; leftRect.h = left->h;
-        leftRect.x = 320 - 80 - (leftRect.w/2); leftRect.y = 430;
+  /* let the user pick the list */
 
-        right = LoadImage("right.png", IMG_ALPHA);
-        rightRect.w = right->w; rightRect.h = right->h;
-        rightRect.x = 320 + 80 - (rightRect.w/2); rightRect.y = 430;
+  /* Render SDL_Surfaces for list entries: */
+  titles[0] = BlackOutline( _("Alphabet"), font, &white );
+  select[0] = BlackOutline( _("Alphabet"), font, &yellow);
 
-        /* set initial rect sizes */
-        titleRects[0].y = 30;
-        titleRects[0].w = titleRects[0].h = titleRects[0].x = 0;
-        for (i = 1; i<8; i++) { 
-                titleRects[i].y = titleRects[i-1].y + 50;
-                titleRects[i].w = titleRects[i].h = titleRects[i].x = 0;
-        }
+  for (i = 1; i<lists; i++)
+  {
+    titles[i] = BlackOutline( wordlistName[i], font, &white );
+    select[i] = BlackOutline( wordlistName[i], font, &yellow);
+  }
 
-        while (!stop) {
-                while (SDL_PollEvent(&event))
-                        switch (event.type) {
-                                case SDL_QUIT:
-                                        exit(0);
-                                        break;
-                                case SDL_MOUSEMOTION:
-                                        for (i=0; (i<8) && (loc-(loc%8)+i<lists); i++)
-                                                if (inRect( titleRects[i], event.motion.x, event.motion.y )) {
-                                                        loc = loc-(loc%8)+i;
-                                                        break;
-                                                }
+  SDL_FreeSurface(bkg);
+  bkg = LoadImage("main_bkg.png", IMG_REGULAR);
+  left = LoadImage("left.png", IMG_ALPHA);
+  right = LoadImage("right.png", IMG_ALPHA);
 
-                                        break;
-                                case SDL_MOUSEBUTTONDOWN:
+  /* Get out if needed surface not loaded successfully: */
+  if (!bkg || !left || !right)
+  {
+    fprintf(stderr, "chooseWordList(): needed image not available\n");
+  
+    for (i = 0; i<lists; i++)
+    {
+      SDL_FreeSurface(titles[i]);
+      SDL_FreeSurface(select[i]);
+      titles[i] = select[i] = NULL;
+    }
+
+    SDL_FreeSurface(bkg);
+    SDL_FreeSurface(left);
+    SDL_FreeSurface(right);
+    bkg = left = right = NULL;
+
+    return 0;
+  }
+  
+
+
+  leftRect.w = left->w; leftRect.h = left->h;
+  leftRect.x = 320 - 80 - (leftRect.w/2); leftRect.y = 430;
+
+  rightRect.w = right->w; rightRect.h = right->h;
+  rightRect.x = 320 + 80 - (rightRect.w/2); rightRect.y = 430;
+
+  /* set initial rect sizes */
+  titleRects[0].y = 30;
+  titleRects[0].w = titleRects[0].h = titleRects[0].x = 0;
+
+  for (i = 1; i < 8; i++)
+  { 
+    titleRects[i].y = titleRects[i - 1].y + 50;
+    titleRects[i].w = titleRects[i].h = titleRects[i].x = 0;
+  }
+
+  /* Main event loop for this screen: */
+  while (!stop)
+  {
+    while (SDL_PollEvent(&event))
+    {
+      switch (event.type)
+      {
+        case SDL_QUIT:
+          exit(0); /* FIXME may need to cleanup memory and exit more cleanly */
+          break;
+
+        case SDL_MOUSEMOTION:
+          for (i=0; (i<8) && (loc-(loc%8)+i<lists); i++)
+            if (inRect( titleRects[i], event.motion.x, event.motion.y ))
+            {
+              loc = loc-(loc%8)+i;
+              break;
+            }
+          break;
+
+        case SDL_MOUSEBUTTONDOWN:
                                         if (inRect( leftRect, event.button.x, event.button.y ))
                                                 if (loc-(loc%8)-8 >= 0) {
                                                         loc=loc-(loc%8)-8;
@@ -1258,9 +1362,10 @@
                                                 if (loc+1<lists)
                                                         loc++;
                                         }
-                        }
+      }
+    }
 
-                if (old_loc != loc) {
+    if (old_loc != loc) {
                         int start;
 
                         SDL_BlitSurface( bkg, NULL, screen, NULL );
@@ -1286,24 +1391,27 @@
                 }
                 SDL_Delay(40);
                 old_loc = loc;
-        }
+  }
 
-	/* --- clear graphics before leaving function --- */ 
+  /* --- clear graphics before leaving function --- */ 
+  for (i = 0; i<lists; i++)
+  {
+    SDL_FreeSurface(titles[i]);
+    SDL_FreeSurface(select[i]);
+    titles[i] = select[i] = NULL;
+  }
 
-	for (i = 0; i<lists; i++) {
-		SDL_FreeSurface(titles[i]);
-		SDL_FreeSurface(select[i]);
-	}
+  SDL_FreeSurface(bkg);
+  SDL_FreeSurface(left);
+  SDL_FreeSurface(right);
+  bkg = left = right = NULL; /* Maybe overkill - left and right about to be destroyed anyway */
 
-	SDL_FreeSurface(left);
-	SDL_FreeSurface(right);
+  DEBUGCODE { fprintf( stderr, "Leaving chooseWordlist();\n" ); }
 
-        DEBUGCODE { fprintf( stderr, "Leaving chooseWordlist();\n" ); }
+  if (stop == 2)
+    return 0;
 
-	if (stop == 2)
-		return 0;
-
-	return 1;
+  return 1;
 }
 
 




More information about the Tux4kids-commits mailing list