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

tholy-guest at alioth.debian.org tholy-guest at alioth.debian.org
Wed Jun 18 10:23:16 UTC 2008


Author: tholy-guest
Date: 2008-06-18 10:23:16 +0000 (Wed, 18 Jun 2008)
New Revision: 531

Modified:
   tuxmath/trunk/src/titlescreen.c
Log:
Fix some drawing glitches in titlescreen animation.


Modified: tuxmath/trunk/src/titlescreen.c
===================================================================
--- tuxmath/trunk/src/titlescreen.c	2008-06-18 10:21:08 UTC (rev 530)
+++ tuxmath/trunk/src/titlescreen.c	2008-06-18 10:23:16 UTC (rev 531)
@@ -178,7 +178,7 @@
 
   Uint32 start = 0;
 
-  int i;
+  int i,TuxPixSkip,TitlePixSkip;
   int n_subdirs;
   char **subdir_names;
 
@@ -294,19 +294,25 @@
 
     Tuxdest.x = 0;
     Tuxdest.y = screen->h;
+    /*
     Tuxback.x = Tuxdest.x - Backrect.x;
     Tuxback.y = Tuxdest.y - Backrect.y;
+    */
     Tuxdest.w = Tuxback.w = Tux->frame[0]->w;
     Tuxdest.h = Tuxback.h = Tux->frame[0]->h;
     
 
     Titledest.x = screen->w;
     Titledest.y = 10;
+    /*
     Titleback.x = Titledest.x - Backrect.x;
     Titleback.y = Titledest.y - Backrect.y;
+    */
     Titledest.w = Titleback.w = images[IMG_MENU_TITLE]->w;
     Titledest.h = Titleback.h = images[IMG_MENU_TITLE]->h;
 
+    TuxPixSkip = Tux->frame[0]->h / (PRE_ANIM_FRAMES * PRE_FRAME_MULT);
+    TitlePixSkip = (screen->w) / (PRE_ANIM_FRAMES * PRE_FRAME_MULT);
 
     for (i = 0; i < (PRE_ANIM_FRAMES * PRE_FRAME_MULT); i++)
     {
@@ -317,18 +323,17 @@
         SDL_FillRect(screen, &screen->clip_rect, 0);
       SDL_BlitSurface(current_bkg, NULL, screen, &Backrect);
 
-      Tuxdest.y -= Tux->frame[0]->h / (PRE_ANIM_FRAMES * PRE_FRAME_MULT);
-      Tuxback.y -= Tux->frame[0]->h / (PRE_ANIM_FRAMES * PRE_FRAME_MULT);
-      Titledest.x -= (screen->w) / (PRE_ANIM_FRAMES * PRE_FRAME_MULT);
-      Titleback.y -= (screen->w) / (PRE_ANIM_FRAMES * PRE_FRAME_MULT);
+      Tuxdest.y -= TuxPixSkip;
+      //Tuxback.y -= Tux->frame[0]->h / (PRE_ANIM_FRAMES * PRE_FRAME_MULT);
+      Titledest.x -= TitlePixSkip;
+      //Titleback.y -= (screen->w) / (PRE_ANIM_FRAMES * PRE_FRAME_MULT);
 
       SDL_BlitSurface(Tux->frame[0], NULL, screen, &Tuxdest);
       SDL_BlitSurface(images[IMG_MENU_TITLE], NULL, screen, &Titledest);
       SDL_BlitSurface(images[IMG_STOP], NULL, screen, &stopRect);
 
-      SDL_UpdateRect(screen, Tuxdest.x, Tuxdest.y, Tuxdest.w, Tuxdest.h);
-      SDL_UpdateRect(screen, Titledest.x, Titledest.y, Titledest.w + 40,
-                     Titledest.h);
+      SDL_UpdateRect(screen, Tuxdest.x, Tuxdest.y, Tuxdest.w, Tuxdest.h + TuxPixSkip);
+      SDL_UpdateRect(screen, Titledest.x, Titledest.y, Titledest.w + TitlePixSkip, Titledest.h);
       SDL_UpdateRect(screen, stopRect.x, stopRect.y, stopRect.w, stopRect.h);
 
       while ((SDL_GetTicks() - start) < 33)




More information about the Tux4kids-commits mailing list