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

tholy-guest at alioth.debian.org tholy-guest at alioth.debian.org
Wed Jun 18 08:49:49 UTC 2008


Author: tholy-guest
Date: 2008-06-18 08:49:48 +0000 (Wed, 18 Jun 2008)
New Revision: 529

Modified:
   tuxmath/trunk/src/setup.c
   tuxmath/trunk/src/tuxmath.c
Log:
Don't lock the user's screen in case of X-trouble (reverse the atexit() registration).  Also, small cleanups to setup.


Modified: tuxmath/trunk/src/setup.c
===================================================================
--- tuxmath/trunk/src/setup.c	2008-06-17 17:31:28 UTC (rev 528)
+++ tuxmath/trunk/src/setup.c	2008-06-18 08:49:48 UTC (rev 529)
@@ -487,46 +487,39 @@
       Opts_SetSoundHWAvailable(1);
     else
       frequency = format = channels = 0; //more helpful than garbage
-    #ifdef TUXMATH_DEBUG
-    fprintf(stderr, "Sound mixer: frequency = %d, "
+    tmdprintf("Sound mixer: frequency = %d, "
                     "format = %x, "
                     "channels = %d, "
                     "n_timesopened = %d\n",
                     frequency,format,channels,n_timesopened);
-    #endif
   }
 
   #endif
   {
-    SDL_VideoInfo *videoInfo;
+    const SDL_VideoInfo *videoInfo;
     Uint32 surfaceMode;
     videoInfo = SDL_GetVideoInfo();
     if (videoInfo->hw_available)
     {
       surfaceMode = SDL_HWSURFACE;
-#ifdef TUXMATH_DEBUG
-      printf("HW mode\n");
-#endif
+      tmdprintf("HW mode\n");
     }
     else
     {
       surfaceMode = SDL_SWSURFACE;
-#ifdef TUXMATH_DEBUG
-      printf("SW mode\n");
-#endif
+      tmdprintf("SW mode\n");
     }
 
     //determine the best fullscreen resolution
     int i;
     SDL_Rect** modes = SDL_ListModes(videoInfo->vfmt, SDL_FULLSCREEN | surfaceMode);
-    if (modes != 0 && modes != -1) //if there is a "best" resolution
+    if (modes != (SDL_Rect**)0 && modes != (SDL_Rect**)-1) //if there is a "best" resolution
       {
       fs_res_x = modes[0]->w;
       fs_res_y = modes[0]->h;
-      tmdprintf("Optimal resolution is %dx%d\n", RES_X, RES_Y);
+      tmdprintf("Optimal resolution is %dx%d\n", fs_res_x, fs_res_y);
       }
 
-
     if (Opts_Fullscreen())
     {
       screen = SDL_SetVideoMode(fs_res_x, fs_res_y, PIXEL_BITS, SDL_FULLSCREEN | surfaceMode);

Modified: tuxmath/trunk/src/tuxmath.c
===================================================================
--- tuxmath/trunk/src/tuxmath.c	2008-06-17 17:31:28 UTC (rev 528)
+++ tuxmath/trunk/src/tuxmath.c	2008-06-18 08:49:48 UTC (rev 529)
@@ -54,9 +54,9 @@
 #endif
 
 
-  atexit(cleanup);  // register it so we clean up even if there is a crash
   setup(argc, argv);
-  TitleScreen();
+  TitleScreen();  /* Run the game! */
+  cleanup();
   return 0;
 }
 




More information about the Tux4kids-commits mailing list