[Tux4kids-commits] r1397 - branches/commonification/tuxtype/trunk/src

Bolesław Kulbabiński bolekk-guest at alioth.debian.org
Sat Aug 8 14:11:14 UTC 2009


Author: bolekk-guest
Date: 2009-08-08 14:11:14 +0000 (Sat, 08 Aug 2009)
New Revision: 1397

Modified:
   branches/commonification/tuxtype/trunk/src/Makefile.am
   branches/commonification/tuxtype/trunk/src/SDL_extras.c
   branches/commonification/tuxtype/trunk/src/SDL_extras.h
   branches/commonification/tuxtype/trunk/src/funcs.h
   branches/commonification/tuxtype/trunk/src/laser.c
   branches/commonification/tuxtype/trunk/src/main.c
   branches/commonification/tuxtype/trunk/src/playgame.c
   branches/commonification/tuxtype/trunk/src/practice.c
   branches/commonification/tuxtype/trunk/src/titlescreen.c
Log:
got rid of some unused macros and reduced number of compiler warnings in TuxType

Modified: branches/commonification/tuxtype/trunk/src/Makefile.am
===================================================================
--- branches/commonification/tuxtype/trunk/src/Makefile.am	2009-08-08 11:54:53 UTC (rev 1396)
+++ branches/commonification/tuxtype/trunk/src/Makefile.am	2009-08-08 14:11:14 UTC (rev 1397)
@@ -35,7 +35,7 @@
         -DVAR_PREFIX=\"$(VAR_PREFIX)\" \
         -DCONF_PREFIX=\"$(CONF_PREFIX)\" \
         -DDEBUG \
-	-DVERSION=\"@NAME_VERSION@\" -D$(SOUND)SOUND
+	    -D$(SOUND)SOUND
 
 AM_CPPFLAGS = -DLOCALEDIR=\"$(localedir)\" \
 	-DLOCALSTATEDIR=\"$(pkglocalstatedir)\" \

Modified: branches/commonification/tuxtype/trunk/src/SDL_extras.c
===================================================================
--- branches/commonification/tuxtype/trunk/src/SDL_extras.c	2009-08-08 11:54:53 UTC (rev 1396)
+++ branches/commonification/tuxtype/trunk/src/SDL_extras.c	2009-08-08 14:11:14 UTC (rev 1397)
@@ -1457,13 +1457,13 @@
   }
   else
   {
-    SDLPango_Matrix colormatrix = 
-    {
-      col->r,  col->r,  0,  0,
-      col->g,  col->g,  0,  0,
-      col->b,  col->b,  0,  0,
-      0,      255,      0,  0,
-    };
+    SDLPango_Matrix colormatrix =
+    {{
+      {col->r,  col->r,  0,  0},
+      {col->g,  col->g,  0,  0},
+      {col->b,  col->b,  0,  0},
+      {0,      255,      0,  0}
+    }};
     Set_SDL_Pango_Font_Size(size);
     SDLPango_SetDefaultColor(context, &colormatrix );
     SDLPango_SetText(context, t, -1);

Modified: branches/commonification/tuxtype/trunk/src/SDL_extras.h
===================================================================
--- branches/commonification/tuxtype/trunk/src/SDL_extras.h	2009-08-08 11:54:53 UTC (rev 1396)
+++ branches/commonification/tuxtype/trunk/src/SDL_extras.h	2009-08-08 14:11:14 UTC (rev 1397)
@@ -37,6 +37,8 @@
 //extra bkgd border around "erased" images.
 #define ERASE_MARGIN 5
 #define PIXEL_BITS 32
+#define MAX_SPRITE_FRAMES 30
+
 enum
 {
   WIPE_BLINDS_VERT,
@@ -96,13 +98,6 @@
 static const SDL_Color white 		= {0xff, 0xff, 0xff, 0x00};
 static const SDL_Color yellow 		= {0xff, 0xff, 0x00, 0x00};
 
-
-
-/* FIXME get rid of these 'evil' macros */
-#define NEXT_FRAME(SPRITE) if ((SPRITE)->num_frames) (SPRITE)->cur = (((SPRITE)->cur)+1) % (SPRITE)->num_frames;
-#define REWIND(SPRITE) (SPRITE)->cur = 0;
-#define MAX_SPRITE_FRAMES 30
-
 /*Text rendering functions: */
 int Setup_SDL_Text(void);
 void Cleanup_SDL_Text(void);

Modified: branches/commonification/tuxtype/trunk/src/funcs.h
===================================================================
--- branches/commonification/tuxtype/trunk/src/funcs.h	2009-08-08 11:54:53 UTC (rev 1396)
+++ branches/commonification/tuxtype/trunk/src/funcs.h	2009-08-08 14:11:14 UTC (rev 1397)
@@ -58,11 +58,12 @@
 void PlaySound(Mix_Chunk* snd);
 void AudioMusicLoad(const char* musicFilename, int repeatQty);
 void AudioMusicUnload(void);
-void MusicPlay(Mix_Music* musicData, int repeatQty);
 bool IsPlayingMusic();
 
 #endif //HAVE_LIBT4KCOMMON
 
+void MusicPlay(Mix_Music* musicData, int repeatQty);
+
 /* In laser.c:        */
 int PlayLaserGame(int diff_level);
 

Modified: branches/commonification/tuxtype/trunk/src/laser.c
===================================================================
--- branches/commonification/tuxtype/trunk/src/laser.c	2009-08-08 11:54:53 UTC (rev 1396)
+++ branches/commonification/tuxtype/trunk/src/laser.c	2009-08-08 14:11:14 UTC (rev 1397)
@@ -528,7 +528,7 @@
       
 		/* Draw cities: */
       
-		if (frame%2 == 0) NEXT_FRAME(shield);
+		if (frame%2 == 0) NextFrame(shield);
 		for (i = 0; i < NUM_CITIES; i++) {
 
 			/* Decide which image to display: */

Modified: branches/commonification/tuxtype/trunk/src/main.c
===================================================================
--- branches/commonification/tuxtype/trunk/src/main.c	2009-08-08 11:54:53 UTC (rev 1396)
+++ branches/commonification/tuxtype/trunk/src/main.c	2009-08-08 14:11:14 UTC (rev 1397)
@@ -203,9 +203,7 @@
 int main(int argc, char *argv[])
 {
   Uint32 lib_flags = 0;
-  int i;
 
-
   srand(time(NULL));
 
   Opts_Initialize(); // First, initialize settings with hard-coded defaults 

Modified: branches/commonification/tuxtype/trunk/src/playgame.c
===================================================================
--- branches/commonification/tuxtype/trunk/src/playgame.c	2009-08-08 11:54:53 UTC (rev 1396)
+++ branches/commonification/tuxtype/trunk/src/playgame.c	2009-08-08 14:11:14 UTC (rev 1397)
@@ -331,11 +331,9 @@
       }   /* ------ End of 'while' loop for handling user input ------- */
 
 
-
       /* --- fishy updates --- */
-      if ((frame% 3) == 0) 
-//      if ((frame % 10) == 0)
-        NEXT_FRAME(fish_sprite);
+      if ((frame% 3) == 0)
+        NextFrame(fish_sprite);
 
       if (fishies < local_max_fishies)
         SpawnFishies( diflevel, &fishies, &frame );
@@ -1356,13 +1354,13 @@
 				fish_object[i].alive = 0;
 				fish_object[i].can_eat = 0;
 
-				for (j = 0; j < fish_object[i].len; j++) 
+				for (j = 0; j < fish_object[i].len; j++)
 					EraseSprite(fish_sprite, CurrentBkgd(),  (fish_object[i].x + (j * fish_sprite->frame[0]->w)), fish_object[i].y);
 
 				*fish_left = *fish_left - 1;
 
 				tux_object.state = TUX_GULPING;
-				REWIND(tux_object.spr[TUX_GULPING][tux_object.facing]);
+			  tux_object.spr[TUX_GULPING][tux_object.facing]->cur = 0;
 				tux_object.dx = 0;
 				tux_object.endx = tux_object.x;
 
@@ -1384,12 +1382,12 @@
 {
   if (tux_object.state != TUX_GULPING)
   {
-    NEXT_FRAME(tux_object.spr[tux_object.state][tux_object.facing]);
+    NextFrame(tux_object.spr[tux_object.state][tux_object.facing]);
   }
   else
   {
-    NEXT_FRAME(tux_object.spr[TUX_GULPING][tux_object.facing]);
-    if (tux_object.spr[TUX_GULPING][tux_object.facing]->cur==0) 
+    NextFrame(tux_object.spr[TUX_GULPING][tux_object.facing]);
+    if (tux_object.spr[TUX_GULPING][tux_object.facing]->cur==0)
       tux_object.state = TUX_STANDING;
   }
 }

Modified: branches/commonification/tuxtype/trunk/src/practice.c
===================================================================
--- branches/commonification/tuxtype/trunk/src/practice.c	2009-08-08 11:54:53 UTC (rev 1396)
+++ branches/commonification/tuxtype/trunk/src/practice.c	2009-08-08 14:11:14 UTC (rev 1397)
@@ -755,7 +755,7 @@
                 if (tux_win && tux_win->frame[tux_win->cur])
                   SDL_BlitSurface(tux_win->frame[tux_win->cur], NULL, screen, &tux_loc);
                 SDL_UpdateRect(screen, tux_loc.x, tux_loc.y, tux_loc.w, tux_loc.h);
-                NEXT_FRAME(tux_win);
+                NextFrame(tux_win);
                 SDL_Delay(200);
               }
             }
@@ -815,7 +815,7 @@
 
       if (tux_stand && tux_stand->frame[tux_stand->cur])
         SDL_BlitSurface(tux_stand->frame[tux_stand->cur], NULL, screen, &tux_loc);
-      NEXT_FRAME(tux_stand);
+      NextFrame(tux_stand);
     }
 
     SDL_UpdateRect(screen, 0, 0, 0, 0);

Modified: branches/commonification/tuxtype/trunk/src/titlescreen.c
===================================================================
--- branches/commonification/tuxtype/trunk/src/titlescreen.c	2009-08-08 11:54:53 UTC (rev 1396)
+++ branches/commonification/tuxtype/trunk/src/titlescreen.c	2009-08-08 14:11:14 UTC (rev 1397)
@@ -580,7 +580,7 @@
 
       if (i %5 == 0)
       {
-        NEXT_FRAME(tux);
+        NextFrame(tux);
         SDL_BlitSurface(CurrentBkgd(), &loc, screen, &loc);
         SDL_BlitSurface(tux->frame[tux->cur], NULL, screen, &loc);
         SDL_UpdateRect(screen, loc.x, loc.y, loc.w, loc.h);




More information about the Tux4kids-commits mailing list