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

dbruce at alioth.debian.org dbruce at alioth.debian.org
Thu Mar 8 21:31:16 CET 2007


Author: dbruce
Date: 2007-02-01 22:45:46 +0000 (Thu, 01 Feb 2007)
New Revision: 75

Modified:
   tuxmath/trunk/src/fileops.c
Log:
initial loading speeded up.



Modified: tuxmath/trunk/src/fileops.c
===================================================================
--- tuxmath/trunk/src/fileops.c	2007-01-31 23:18:29 UTC (rev 74)
+++ tuxmath/trunk/src/fileops.c	2007-02-01 22:45:46 UTC (rev 75)
@@ -2197,13 +2197,16 @@
       }
     
     /* Green 'status bar' during loading: */
-    dest.x = 0;
-    dest.y = (screen->h) - 10;
-    dest.w = ((screen->w) * (i + 1)) / total_files;
-    dest.h = 10;
-    
-    SDL_FillRect(screen, &dest, SDL_MapRGB(screen->format, 0, 255, 0));
-    SDL_Flip(screen);
+    /* Do this rarely so it doesn't take so much time to load */
+    if (i % 10 == 0) {
+      dest.x = 0;
+      dest.y = (screen->h) - 10;
+      dest.w = ((screen->w) * (i + 1)) / total_files;
+      dest.h = 10;
+      
+      SDL_FillRect(screen, &dest, SDL_MapRGB(screen->format, 0, 255, 0));
+      SDL_Flip(screen);
+    }
   }
   /* If we make it to here OK, return 1: */
   return 1;
@@ -2252,6 +2255,7 @@
         return 0;
       }
       
+      /*
       dest.x = 0;
       dest.y = (screen->h) - 10;
       dest.w = ((screen->w) * (i + 1 + NUM_IMAGES)) / total_files;
@@ -2259,6 +2263,7 @@
 
       SDL_FillRect(screen, &dest, SDL_MapRGB(screen->format, 0, 255, 0));
       SDL_Flip(screen);
+      */
     }
 
 
@@ -2276,13 +2281,15 @@
         return 0;
       }
       
-      dest.x = 0;
-      dest.y = (screen->h) - 10;
-      dest.w = ((screen->w) * (i + 1 + NUM_IMAGES + NUM_SOUNDS)) / total_files;
-      dest.h = 10;
-
-      SDL_FillRect(screen, &dest, SDL_MapRGB(screen->format, 0, 255, 0));
-      SDL_Flip(screen);
+      if (i == NUM_MUSICS-1) {
+	dest.x = 0;
+	dest.y = (screen->h) - 10;
+	dest.w = ((screen->w) * (i + 1 + NUM_IMAGES + NUM_SOUNDS)) / total_files;
+	dest.h = 10;
+	
+	SDL_FillRect(screen, &dest, SDL_MapRGB(screen->format, 0, 255, 0));
+	SDL_Flip(screen);
+      }
     }
   }
   return 1;




More information about the Tux4kids-commits mailing list