[Tux4kids-commits] r313 - tuxmath/trunk/src

dbruce-guest at alioth.debian.org dbruce-guest at alioth.debian.org
Wed Oct 31 20:48:17 UTC 2007


Author: dbruce-guest
Date: 2007-10-31 20:48:17 +0000 (Wed, 31 Oct 2007)
New Revision: 313

Removed:
   tuxmath/trunk/src/theme.c
Modified:
   tuxmath/trunk/src/Makefile.am
   tuxmath/trunk/src/Makefile.in
   tuxmath/trunk/src/audio.c
   tuxmath/trunk/src/loaders.c
   tuxmath/trunk/src/titlescreen.c
   tuxmath/trunk/src/titlescreen.h
   tuxmath/trunk/src/tuxmath.c
Log:
more cruft removal



Modified: tuxmath/trunk/src/Makefile.am
===================================================================
--- tuxmath/trunk/src/Makefile.am	2007-10-31 11:21:15 UTC (rev 312)
+++ tuxmath/trunk/src/Makefile.am	2007-10-31 20:48:17 UTC (rev 313)
@@ -17,7 +17,6 @@
 	options.c	\
 	credits.c	\
 	highscore.c	\
-	theme.c		\
 	loaders.c	\
 	audio.c 	\
 	mathcards.c	\

Modified: tuxmath/trunk/src/Makefile.in
===================================================================
--- tuxmath/trunk/src/Makefile.in	2007-10-31 11:21:15 UTC (rev 312)
+++ tuxmath/trunk/src/Makefile.in	2007-10-31 20:48:17 UTC (rev 313)
@@ -68,19 +68,17 @@
 PROGRAMS = $(bin_PROGRAMS)
 am__objects_1 = tuxmath.$(OBJEXT) setup.$(OBJEXT) \
 	titlescreen.$(OBJEXT) game.$(OBJEXT) options.$(OBJEXT) \
-	credits.$(OBJEXT) highscore.$(OBJEXT) theme.$(OBJEXT) \
-	loaders.$(OBJEXT) audio.$(OBJEXT) mathcards.$(OBJEXT) \
-	fileops.$(OBJEXT) ConvertUTF.$(OBJEXT) SDL_extras.$(OBJEXT) \
-	lessons.$(OBJEXT)
+	credits.$(OBJEXT) highscore.$(OBJEXT) loaders.$(OBJEXT) \
+	audio.$(OBJEXT) mathcards.$(OBJEXT) fileops.$(OBJEXT) \
+	ConvertUTF.$(OBJEXT) SDL_extras.$(OBJEXT) lessons.$(OBJEXT)
 am_TuxMath_OBJECTS = $(am__objects_1)
 TuxMath_OBJECTS = $(am_TuxMath_OBJECTS)
 TuxMath_LDADD = $(LDADD)
 am_tuxmath_OBJECTS = tuxmath.$(OBJEXT) setup.$(OBJEXT) \
 	titlescreen.$(OBJEXT) game.$(OBJEXT) options.$(OBJEXT) \
-	credits.$(OBJEXT) highscore.$(OBJEXT) theme.$(OBJEXT) \
-	loaders.$(OBJEXT) audio.$(OBJEXT) mathcards.$(OBJEXT) \
-	fileops.$(OBJEXT) ConvertUTF.$(OBJEXT) SDL_extras.$(OBJEXT) \
-	lessons.$(OBJEXT)
+	credits.$(OBJEXT) highscore.$(OBJEXT) loaders.$(OBJEXT) \
+	audio.$(OBJEXT) mathcards.$(OBJEXT) fileops.$(OBJEXT) \
+	ConvertUTF.$(OBJEXT) SDL_extras.$(OBJEXT) lessons.$(OBJEXT)
 tuxmath_OBJECTS = $(am_tuxmath_OBJECTS)
 tuxmath_LDADD = $(LDADD)
 DEFAULT_INCLUDES = -I. -I$(top_builddir)@am__isrc@
@@ -253,7 +251,6 @@
 	options.c	\
 	credits.c	\
 	highscore.c	\
-	theme.c		\
 	loaders.c	\
 	audio.c 	\
 	mathcards.c	\
@@ -364,7 +361,6 @@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mathcards.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/options.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/setup.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/theme.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/titlescreen.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/tuxmath.Po at am__quote@
 

Modified: tuxmath/trunk/src/audio.c
===================================================================
--- tuxmath/trunk/src/audio.c	2007-10-31 11:21:15 UTC (rev 312)
+++ tuxmath/trunk/src/audio.c	2007-10-31 20:48:17 UTC (rev 313)
@@ -25,8 +25,6 @@
 
 #include "titlescreen.h"
 
-
-Mix_Chunk      *sound[NUM_WAVES];
 Mix_Music      *music;
 
 void playsound(int snd)

Modified: tuxmath/trunk/src/loaders.c
===================================================================
--- tuxmath/trunk/src/loaders.c	2007-10-31 11:21:15 UTC (rev 312)
+++ tuxmath/trunk/src/loaders.c	2007-10-31 20:48:17 UTC (rev 313)
@@ -124,7 +124,6 @@
   {
     case IMG_REGULAR:
     { 
-      LOG("mode = IMG_REGULAR\n");
 
       final_pic = SDL_DisplayFormat(tmp_pic);
       SDL_FreeSurface(tmp_pic);
@@ -133,7 +132,6 @@
 
     case IMG_ALPHA:
     {
-      LOG("mode = IMG_ALPHA\n");
 
       final_pic = SDL_DisplayFormatAlpha(tmp_pic);
       SDL_FreeSurface(tmp_pic);
@@ -142,7 +140,6 @@
 
     case IMG_COLORKEY:
     {
-      LOG("mode = IMG_COLORKEY\n");
 
       SDL_LockSurface(tmp_pic);
       SDL_SetColorKey(tmp_pic, (SDL_SRCCOLORKEY | SDL_RLEACCEL),
@@ -203,10 +200,7 @@
 		}
 	}
 
-	DEBUGCODE {
-		fprintf( stderr, "loading sprite %s - contains %d frames\n",
-		        name, new_sprite->num_frames );
-	}
+
 	
 	return new_sprite;
 }

Deleted: tuxmath/trunk/src/theme.c
===================================================================
--- tuxmath/trunk/src/theme.c	2007-10-31 11:21:15 UTC (rev 312)
+++ tuxmath/trunk/src/theme.c	2007-10-31 20:48:17 UTC (rev 313)
@@ -1,383 +0,0 @@
-/***************************************************************************
-                          theme.c 
- -  description: theme related code
-                             -------------------
-    begin                : Jan 6 2003
-    copyright            : (C) 2003 by Jesse Andrews et al
-    email                : jdandr2 at tux4kids.net
- 
-    Modified for use in tuxmath by David Bruce - 2006.
-    email                : <dbruce at tampabay.rr.com>
-                           <tuxmath-devel at lists.sourceforge.net>
- ***************************************************************************/
-
-/***************************************************************************
- *                                                                         *
- *   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"
-
-#include "tuxmath.h"
-#include "fileops.h"
-#include "titlescreen.h"
-
-#ifndef MACOSX
-#define NUM_PATHS 6
-const char PATHS[NUM_PATHS][PATH_MAX] = {
-	"./data",
-	DATA_PREFIX"/share/"PACKAGE"/data"
-	"/usr/share/"PACKAGE"/data",
-	"/usr/share/"PACKAGE,
-	"/usr/local/share/"PACKAGE"/data",
-        "/usr/local/share/"PACKAGE        //HACK added to accomodate 'make install' installation
-};
-#else
-#define NUM_PATHS 1
-const char PATHS[NUM_PATHS][PATH_MAX] = {
-	DATA_PREFIX"/data"
-};
-#endif
-	
-SDL_Surface *letters[255] = { NULL };
-unsigned char ALPHABET[256];
-unsigned char KEYMAP[256];
-unsigned char FINGER[256][10];
-int ALPHABET_SIZE;
-unsigned char realPath[2][PATH_MAX];
-char themeName[PATH_MAX];
-int useEnglish;
-
-
-#define MAX_LANGUAGES 100
-
-/* setup_theme: this function is in charge of setting up
- * the paths that the loaders use.  It will set a variable
- * numPaths = 1 or 2.  1 if we are just using the default,
- * 2 if there are two themes.  Then it will edit the varible
- * Paths[].  It will always put the theme path first, then
- * the default path
- */
-/*FIXME this should probably return an int - 1 if path found */ 
-/* successfully, 0 otherwise.                                */
-/*FIXME make it check for something more specific than './data' - */
-/* tuxtype and tuxmath get confused and fail if started from the */
-/* command line from within the others trunk directory. */
-void setupTheme( char *dirName )
-{
-  static struct stat dirStats;
-  int i;
-  int found = 0;
-  useEnglish = 1; // default is to use English if we cannot find theme
-
-  /* Look for the first path in PATHS[] that is valid.  */
-  /* If a valid path is found, it is copied to realPath[1]. */
-  for (i = 0; i<NUM_PATHS && !found; i++)  //NUM_PATHS currently 4 - see above
-  {
-    DEBUGCODE
-    {
-      fprintf(stderr, "setupTheme(): checking for: %s\n", PATHS[i]);
-    }
-
-    dirStats.st_mode = 0;
-    stat( PATHS[i], &dirStats );
-
-    if (S_IFDIR & dirStats.st_mode)
-    {
-      strncpy( realPath[1], PATHS[i], PATH_MAX-1);
-      strncpy( themeName, "", PATH_MAX-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]);
-      }
-    }
-  }
-
-  /* see if the realPath[1] as determined above contains a theme */
-  /* directory matching the dirName argument.  The path to the   */
-  /* theme will then be stored in realPath[0]:                   */
-  if (dirName != NULL)
-  {
-    char fullDir[PATH_MAX];
-
-    /* find the path to the theme */
-    sprintf( fullDir, "%s/themes/%s", realPath[1], dirName );
-    dirStats.st_mode = 0;
-    stat( fullDir, &dirStats );
-
-    if (S_IFDIR & dirStats.st_mode)
-    {
-      useEnglish = 0;
-      strncpy( realPath[0], fullDir, PATH_MAX-1 );
-      strncpy( themeName, dirName, PATH_MAX-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_Rect leftRect, rightRect;
-	SDL_Surface *world, *map, *photo;
-	SDL_Rect worldRect, photoRect;
-	SDL_Rect titleRects[8];
-	int stop = 0;
-	int loc = 0;
-	int old_loc = 1;
-
-	int themes = 1;
-	int i;
-	unsigned char fn[PATH_MAX];
-	unsigned char themeNames[MAX_LANGUAGES][PATH_MAX];
-	unsigned char themePaths[MAX_LANGUAGES][PATH_MAX];
-
-	int old_useEnglish;
-	char old_realPath[PATH_MAX];
-
-	DIR *themesDir;
-	struct dirent *themesFile;
-	struct stat fileStats;
-
-	old_useEnglish = useEnglish;
-	strncpy( old_realPath, realPath[0], PATH_MAX-1 );
-
-	sprintf( fn, "%s/themes/", realPath[1]);
-	themesDir = opendir(fn);
-
-	do {
-		themesFile = readdir(themesDir);
-		if (!themesFile)
-			break;
-
-		/* we ignore any hidden file and CVS */
-
-		if (themesFile->d_name[0] == '.') 
-			continue;
-
-		if (strcmp("CVS", themesFile->d_name)==0)
-			continue;
-
-		/* check to see if it is a directory */
-		sprintf( fn, "%s/themes/%s", realPath[1], themesFile->d_name);
-
-		fileStats.st_mode=0;
-		stat( fn, &fileStats );
-
-		if (S_IFDIR & fileStats.st_mode) {
-		    /* HACK: we should get the names from file :) */
-		    strncpy( themeNames[themes], themesFile->d_name, PATH_MAX-1);
-		    strncpy( themePaths[themes++], themesFile->d_name, PATH_MAX-1 );
-		}
-	} while (1);
-
-	closedir(themesDir);
-
-	useEnglish = 1;
-        // HACK: is font empty now???
-        /* NOTE now loading default_font in setup()
-	//font = LoadFont( ttf_font, ttf_font_size );
-
-	titles[0] = black_outline( "english", font, &white );
-	select[0] = black_outline( "english", font, &yellow);
-	for (i = 1; i<themes; i++) {
-		titles[i] = black_outline( themeNames[i], default_font, &white );
-		select[i] = black_outline( themeNames[i], default_font, &yellow);
-	}
-
-	world = LoadImage("world.png", IMG_ALPHA);
-	worldRect.x = 480 - (world->w/2);
-	worldRect.w = world->w;
-	worldRect.y = 10;
-	worldRect.h = world->h;
-
-	
-
-	TTF_CloseFont(font);
-
-	useEnglish = old_useEnglish;
-
-	bkg = LoadImage("main_bkg.png", IMG_REGULAR);
-
-	left = LoadImage("left.png", IMG_ALPHA);
-	leftRect.w = left->w; leftRect.h = left->h;
-	leftRect.x = 160 - 80 - (leftRect.w/2); leftRect.y = 430;
-
-	right = LoadImage("right.png", IMG_ALPHA);
-	rightRect.w = right->w; rightRect.h = right->h;
-	rightRect.x = 160 + 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;
-	}
-	
-
-	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<themes); 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;
-							break;
-						}
-					if (inRect( rightRect, event.button.x, event.button.y )) 
-						if (loc-(loc%8)+8 < themes) {
-							loc=loc-(loc%8)+8;
-							break;
-						}
-					for (i=0; (i<8) && (loc-(loc%8)+i<themes); i++) 
-						if (inRect(titleRects[i], event.button.x, event.button.y)) {
-							loc = loc-(loc%8)+i;
-							if (loc) {
-								/* --- set theme --- */
-								setupTheme(themePaths[loc]);
-							} else {
-								/* --- english --- */
-								setupTheme(NULL);
-							}
-							stop = 1;
-							break;
-						}
-					break;
-				case SDL_KEYDOWN:
-					if (event.key.keysym.sym == SDLK_ESCAPE) { 
-						useEnglish = old_useEnglish;
-						strncpy( realPath[0], old_realPath, PATH_MAX-1 );
-						stop = 1; 
-						break; 
-					}
-					if (event.key.keysym.sym == SDLK_RETURN) { 
-						if (loc) {
-							/* --- set theme --- */
-							setupTheme(themePaths[loc]);
-						} else {
-							/* --- english --- */
-							setupTheme(NULL);
-						}
-						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;
-					}
-
-					if ((event.key.keysym.sym == SDLK_RIGHT) || (event.key.keysym.sym == SDLK_PAGEDOWN)) {
-						if (loc-(loc%8)+8 < themes)
-							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<themes)
-							loc++;
-					}
-			}
-
-		if (old_loc != loc) {
-			int start;
-
-			SDL_BlitSurface( images[IMG_MENU_BKG], NULL, screen, NULL );
-
-			SDL_BlitSurface( world, NULL, screen, &worldRect );
-
-		        if (loc) setupTheme(themePaths[loc]); else setupTheme(NULL);
-
-			map = LoadImage( "map.png", IMG_ALPHA|IMG_NOT_REQUIRED );
-			if (map) {
-				SDL_BlitSurface( map, NULL, screen, &worldRect );
-				SDL_FreeSurface( map );
-			}
-
-			photo = LoadImage( "photo.png", IMG_ALPHA|IMG_NOT_REQUIRED );
-			if (photo) {
-				photoRect.x = 480 - (photo->w/2);
-				photoRect.y = 250;
-				photoRect.w = photo->w;
-				photoRect.h = photo->h;
-				SDL_BlitSurface( photo, NULL, screen, &photoRect );
-				SDL_FreeSurface( photo );
-			}
-
-			start = loc - (loc % 8);
-			for (i = start; (i < start + 8) && (i < themes); i++)
-                        {
-				titleRects[i%8].x = 160 - (titles[i]->w/2);
-				if (i == loc)
-					SDL_BlitSurface(select[loc], NULL, screen, &titleRects[i%8]);
-				else
-					SDL_BlitSurface(titles[i], NULL, screen, &titleRects[i%8]);
-			}
-
-			/* --- draw buttons --- */
-
-			if (start>0) 
-				SDL_BlitSurface(images[IMG_LEFT], NULL, screen, &leftRect );
-
-			if (start+8<themes) 
-				SDL_BlitSurface( images[IMG_RIGHT], NULL, screen, &rightRect );
-
-			SDL_UpdateRect(screen, 0, 0, 0 ,0);
-		}
-		SDL_Delay(40);
-		old_loc = loc;
-	}
-
-	/* --- clear graphics before quiting --- */ 
-
-	for (i = 0; i<themes; i++) {
-		SDL_FreeSurface(titles[i]);
-		SDL_FreeSurface(select[i]);
-	}
-
-	SDL_FreeSurface(world);
-//	SDL_FreeSurface(bkg);
-// 	SDL_FreeSurface(left);
-// 	SDL_FreeSurface(right);
-}

Modified: tuxmath/trunk/src/titlescreen.c
===================================================================
--- tuxmath/trunk/src/titlescreen.c	2007-10-31 11:21:15 UTC (rev 312)
+++ tuxmath/trunk/src/titlescreen.c	2007-10-31 20:48:17 UTC (rev 313)
@@ -64,12 +64,7 @@
 unsigned char **lesson_list_filenames = NULL;
 int num_lessons = 0;
 
-// globals from tuxtype's globals.h defined outside of titlescreen.c (in tuxtype):
-int debugOn; //FIXME switch to TUXMATH_DEBUG
 
-
-
-
 /* --- media for menus --- */
 
 enum {
@@ -115,8 +110,6 @@
 sprite* Tux = NULL;
 
 
-settings localsettings;
-
 SDL_Event event;
 
 /* --- locations we need --- */
@@ -327,7 +320,6 @@
   fprintf(stderr, "->>Freeing title screen images\n");
 #endif
 
-  localsettings.menu_music = Opts_MenuMusic();
   TitleScreen_unload_media();
 
 #ifdef TUXMATH_DEBUG
@@ -1575,13 +1567,17 @@
 
     if (!screen)
     {
-      LOG("TransWipe(): screen not valid!\n");
+#ifdef TUXMATH_DEBUG
+      fprintf(stderr, "TransWipe(): screen not valid!\n");
+#endif
       return;
     }
 
     if (!newbkg)
     {
-      LOG("TransWipe(): newbkg not valid!\n");
+#ifdef TUXMATH_DEBUG
+      fprintf(stderr, "TransWipe(): newbkg not valid!\n");
+#endif
       return;
     }
 
@@ -1594,9 +1590,9 @@
 
         switch( type ) {
             case WIPE_BLINDS_VERT: {
-
-                LOG("--+ Doing 'WIPE_BLINDS_VERT'\n");
-
+ #ifdef TUXMATH_DEBUG
+                fprintf(stderr, "--+ Doing 'WIPE_BLINDS_VERT'\n");
+#endif
                 /* var1 is num of divisions
                    var2 is how many frames animation should take */
                 if( var1 < 1 ) var1 = 1;
@@ -1637,7 +1633,9 @@
 
                 break;
             } case WIPE_BLINDS_HORIZ: {
-                LOG("--+ Doing 'WIPE_BLINDS_HORIZ'\n");
+#ifdef TUXMATH_DEBUG
+                fprintf(stderr, "--+ Doing 'WIPE_BLINDS_HORIZ'\n");
+#endif
                 /* var1 is num of divisions
                    var2 is how many frames animation should take */
                 if( var1 < 1 ) var1 = 1;
@@ -1676,7 +1674,9 @@
 
                 break;
             } case WIPE_BLINDS_BOX: {
-                LOG("--+ Doing 'WIPE_BLINDS_BOX'\n");
+#ifdef TUXMATH_DEBUG
+                fprintf(stderr, "--+ Doing 'WIPE_BLINDS_BOX'\n");
+#endif
                 /* var1 is num of divisions
                    var2 is how many frames animation should take */
                 if( var1 < 1 ) var1 = 1;
@@ -1734,7 +1734,9 @@
                 break;
         }
     }
-    LOG("->TransWipe(): FINISH\n");
+#ifdef TUXMATH_DEBUG
+      fprintf(stderr, "->TransWipe(): FINISH\n");
+#endif
 }
 
 
@@ -1780,7 +1782,9 @@
 
     if (!src || !dst)
     {
-      LOG("AddRect(): src or dst invalid!\n");
+#ifdef TUXMATH_DEBUG 
+     fprintf(stderr, "AddRect(): src or dst invalid!\n");
+#endif
       return;
     }
 

Modified: tuxmath/trunk/src/titlescreen.h
===================================================================
--- tuxmath/trunk/src/titlescreen.h	2007-10-31 11:21:15 UTC (rev 312)
+++ tuxmath/trunk/src/titlescreen.h	2007-10-31 20:48:17 UTC (rev 313)
@@ -50,15 +50,8 @@
 #include "tuxmath.h"
 
 
-typedef struct {
-    char lang[PATH_MAX];
-    char path[PATH_MAX];
-    char window[PATH_MAX];
-    int sfx_volume;
-    int mus_volume;
-    int menu_music;
-} settings;
 
+
 typedef struct {
 	SDL_Surface *frame[MAX_SPRITE_FRAMES];
 	SDL_Surface *default_img;
@@ -75,27 +68,9 @@
   int button_same_width; // should all buttons have the same width?
 } menu_options;
 
-/* LOGGING works as such:
- *
- * - Use LOG if you want to output a string LOG( "Hello World");
- *   
- * - Use DOUT if you want to output a value of a variable and the
- *   name of the variable gives enough context:
- *   DOUT( specialCode );  would add to stderr: "specialCode = 1\n" or
- *   whatever value specialCode had
- *   
- * - Use DEBUGCODE if you need to do something more complicated like
- *   DEBUGCODE { fprintf(stderr, "examining letter %d\n", x); }
- *   since DOUT(x) "x = 1\n" gives little information since x is used
- *   all over the place!
- */
 
-#define LOG( str ) if (debugOn) fprintf( stderr, str );
-#define DEBUGCODE if (debugOn) 
-#define DOUT(x) if (debugOn) fprintf(stderr, "%s = %d\n", #x, x);
 
 
-
 #define menu_font  "AndikaDesRevA.ttf"  /*  "GenAI102.ttf" */
 #define menu_font_size	18
 
@@ -114,17 +89,6 @@
 #define	FRAMES_PER_SEC	                50
 #define FULL_CIRCLE		        140
 
-/* Menu Prototypes */
-/*
-enum Game_Type { 
-	LESSONS, ARCADE, OPTIONS, GAME_OPTIONS, QUIT_GAME,
-        ARCADE_CADET, ARCADE_SCOUT, ARCADE_RANGER, ARCADE_ACE, HIGH_SCORES,
-        MAIN, INTERFACE_OPTIONS, HELP, CREDITS, PROJECT_INFO,
-        INSTRUCT_CASCADE, CASCADE1, CASCADE2, CASCADE3, CASCADE4,
-	INSTRUCT_LASER,    LASER1,    LASER2,    LASER3,    LASER4,
-	FREETYPE, ASDF, ALL, SET_LANGUAGE, EDIT_WORDLIST,
-	LEVEL1, LEVEL2, LEVEL3, LEVEL4, LASER, INSTRUCT, NOT_CODED, NONE};
-*/
 
 /* Title sequence constants */
 #define PRE_ANIM_FRAMES			10
@@ -141,53 +105,15 @@
 #define IMG_NOT_REQUIRED 0x10
 #define IMG_NO_THEME     0x20
 
-//Game difficulty levels
-enum { EASY, MEDIUM, HARD, INSANE, INF_PRACT };
-#define NUM_LEVELS		        4
 
+
 extern SDL_Surface *screen;
 //extern TTF_Font  *font;
 extern SDL_Event  event;
 
 
-
 extern SDL_Surface *bkg;
-extern SDL_Surface *letters[255];
 
-extern unsigned char ALPHABET[256];
-extern unsigned char KEYMAP[256];
-extern unsigned char FINGER[256][10];
-extern int ALPHABET_SIZE;
-
-//global vars
-extern int speed_up;
-extern int show_tux4kids;
-extern int debugOn;
-extern int o_lives;
-extern int sound_vol;
-extern int hidden; // Read the README file in the image directory for info on this ;)
-
-/* Alternative language/word/image/sound theming */
-extern unsigned char realPath[2][PATH_MAX];
-extern char themeName[PATH_MAX];
-extern int useEnglish;
-
-enum {
-	WIN_WAV,
-	BITE_WAV,
-	LOSE_WAV,
-	RUN_WAV,
-	SPLAT_WAV,
-	WINFINAL_WAV,
-	EXCUSEME_WAV,
-	PAUSE_WAV,
-	NUM_WAVES
-};
-
-extern Mix_Chunk      *sound[NUM_WAVES];
-extern Mix_Music      *music;
-extern int sys_sound;
-
 #define MUSIC_FADE_OUT_MS	80
 
 enum {
@@ -227,32 +153,27 @@
 /********************************/
 
 /*In titlescreen.c */
-
-void TitleScreen( void );
+void TitleScreen(void);
 int ChooseMission(void);  //FIXME really should be in fileops.c
-int choose_menu_item(const unsigned char**,sprite**,int,menu_options);
+int choose_menu_item(const unsigned char**, sprite**, int, menu_options);
 void set_default_menu_options(menu_options *);
 
-/* in theme.c (from tuxtype): */
-void chooseTheme(void);
-void setupTheme( char *dirname );
 
 /* in loaders.c (from tuxtype): */
 int         checkFile( const char *file );
 TTF_Font* LoadFont(const unsigned char* font_name, int font_size);
-void         LoadLang( void );
-Mix_Chunk   *LoadSound( char *datafile );
-SDL_Surface *LoadImage( char *datafile, int mode );
-sprite      *LoadSprite( char *name, int MODE );
-sprite      *FlipSprite( sprite *in, int X, int Y );
-void         FreeSprite( sprite *gfx );
+Mix_Chunk   *LoadSound( char* datafile );
+SDL_Surface *LoadImage( char* datafile, int mode );
+sprite      *LoadSprite( char* name, int MODE );
+sprite      *FlipSprite( sprite* in, int X, int Y );
+void         FreeSprite( sprite* gfx );
 Mix_Music   *LoadMusic( char *datafile );
 void next_frame(sprite* s);
 
 /* in audio.c  (from tuxtype): */
 void playsound(int snd);
-void audioMusicLoad( char *musicFilename, int repeatQty );
-void audioMusicUnload( void );
-void audioMusicPlay( Mix_Music *musicData, int repeatQty );
+void audioMusicLoad(char* musicFilename, int repeatQty);
+void audioMusicUnload(void);
+void audioMusicPlay(Mix_Music* musicData, int repeatQty);
 
 #endif //TITLESCREEN_H

Modified: tuxmath/trunk/src/tuxmath.c
===================================================================
--- tuxmath/trunk/src/tuxmath.c	2007-10-31 11:21:15 UTC (rev 312)
+++ tuxmath/trunk/src/tuxmath.c	2007-10-31 20:48:17 UTC (rev 313)
@@ -41,12 +41,8 @@
 #endif
 #endif
 
-/* Link control of tuxtype-derived code's debug to TUXMATH_DEBUG: */
-  debugOn = 0; //for tuxtype-derived code  
-#ifdef TUXMATH_DEBUG
-  debugOn = 1;
-#endif
 
+
   setup(argc, argv);
   atexit(cleanup);  // register it so we clean up even if there is a crash
   TitleScreen();




More information about the Tux4kids-commits mailing list