[Tux4kids-commits] r1388 - in branches/commonification/tuxmath/trunk: data/images/igloos src

Bolesław Kulbabiński bolekk-guest at alioth.debian.org
Fri Aug 7 10:53:11 UTC 2009


Author: bolekk-guest
Date: 2009-08-07 10:53:10 +0000 (Fri, 07 Aug 2009)
New Revision: 1388

Added:
   branches/commonification/tuxmath/trunk/data/images/igloos/steam0.png
Removed:
   branches/commonification/tuxmath/trunk/data/images/igloos/steam5.png
Modified:
   branches/commonification/tuxmath/trunk/data/images/igloos/Makefile.am
   branches/commonification/tuxmath/trunk/data/images/igloos/steam1.png
   branches/commonification/tuxmath/trunk/data/images/igloos/steam2.png
   branches/commonification/tuxmath/trunk/data/images/igloos/steam3.png
   branches/commonification/tuxmath/trunk/data/images/igloos/steam4.png
   branches/commonification/tuxmath/trunk/src/factoroids.c
   branches/commonification/tuxmath/trunk/src/fileops.h
   branches/commonification/tuxmath/trunk/src/fileops_media.c
   branches/commonification/tuxmath/trunk/src/game.c
   branches/commonification/tuxmath/trunk/src/game.h
Log:
steam animation now handled as sprite

Modified: branches/commonification/tuxmath/trunk/data/images/igloos/Makefile.am
===================================================================
--- branches/commonification/tuxmath/trunk/data/images/igloos/Makefile.am	2009-08-06 22:39:09 UTC (rev 1387)
+++ branches/commonification/tuxmath/trunk/data/images/igloos/Makefile.am	2009-08-07 10:53:10 UTC (rev 1388)
@@ -16,9 +16,9 @@
   snow1.png \
   snow2.png \
   snow3.png \
+  steam0.png \
   steam1.png \
   steam2.png \
   steam3.png \
-  steam4.png \
-  steam5.png
+  steam4.png
 

Added: branches/commonification/tuxmath/trunk/data/images/igloos/steam0.png
===================================================================
(Binary files differ)


Property changes on: branches/commonification/tuxmath/trunk/data/images/igloos/steam0.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Modified: branches/commonification/tuxmath/trunk/data/images/igloos/steam1.png
===================================================================
(Binary files differ)

Modified: branches/commonification/tuxmath/trunk/data/images/igloos/steam2.png
===================================================================
(Binary files differ)

Modified: branches/commonification/tuxmath/trunk/data/images/igloos/steam3.png
===================================================================
(Binary files differ)

Modified: branches/commonification/tuxmath/trunk/data/images/igloos/steam4.png
===================================================================
(Binary files differ)

Deleted: branches/commonification/tuxmath/trunk/data/images/igloos/steam5.png
===================================================================
(Binary files differ)

Modified: branches/commonification/tuxmath/trunk/src/factoroids.c
===================================================================
--- branches/commonification/tuxmath/trunk/src/factoroids.c	2009-08-06 22:39:09 UTC (rev 1387)
+++ branches/commonification/tuxmath/trunk/src/factoroids.c	2009-08-07 10:53:10 UTC (rev 1388)
@@ -883,7 +883,7 @@
   {
     dest.x = xdead;
     dest.y = ydead;
-    SDL_BlitSurface(images[IMG_STEAM1+countdead], NULL, screen, &dest);
+    SDL_BlitSurface(sprites[ANIM_STEAM]->frame[countdead], NULL, screen, &dest);
     countdead++;
     if(countdead > 5)
     {

Modified: branches/commonification/tuxmath/trunk/src/fileops.h
===================================================================
--- branches/commonification/tuxmath/trunk/src/fileops.h	2009-08-06 22:39:09 UTC (rev 1387)
+++ branches/commonification/tuxmath/trunk/src/fileops.h	2009-08-07 10:53:10 UTC (rev 1388)
@@ -101,11 +101,6 @@
   IMG_IGLOO_INTACT,
   IMG_IGLOO_REBUILDING1,
   IMG_IGLOO_REBUILDING2,
-  IMG_STEAM1,
-  IMG_STEAM2,
-  IMG_STEAM3,
-  IMG_STEAM4,
-  IMG_STEAM5,
   IMG_CLOUD,
   IMG_SNOW1,
   IMG_SNOW2,
@@ -141,6 +136,7 @@
   ANIM_TUX_YAY,
   ANIM_TUX_YES,
   ANIM_TUX_FIST,
+  ANIM_STEAM,
   NUM_SPRITES
 };
 

Modified: branches/commonification/tuxmath/trunk/src/fileops_media.c
===================================================================
--- branches/commonification/tuxmath/trunk/src/fileops_media.c	2009-08-06 22:39:09 UTC (rev 1387)
+++ branches/commonification/tuxmath/trunk/src/fileops_media.c	2009-08-07 10:53:10 UTC (rev 1388)
@@ -96,11 +96,6 @@
   "igloos/intact.png",
   "igloos/rebuilding1.png",
   "igloos/rebuilding2.png",
-  "igloos/steam1.png",
-  "igloos/steam2.png",
-  "igloos/steam3.png",
-  "igloos/steam4.png",
-  "igloos/steam5.png",
   "igloos/cloud.png",
   "igloos/snow1.png",
   "igloos/snow2.png",
@@ -133,7 +128,8 @@
   "tux/tux-egypt-right",
   "tux/tux-yay",
   "tux/tux-yes",
-  "tux/tux-fist"
+  "tux/tux-fist",
+  "igloos/steam"
   };
 
   char fn[PATH_MAX];

Modified: branches/commonification/tuxmath/trunk/src/game.c
===================================================================
--- branches/commonification/tuxmath/trunk/src/game.c	2009-08-06 22:39:09 UTC (rev 1387)
+++ branches/commonification/tuxmath/trunk/src/game.c	2009-08-07 10:53:10 UTC (rev 1388)
@@ -46,12 +46,12 @@
 
 #define CITY_EXPL_START (3 * 5)  /* Must be mult. of 5 (number of expl frames) */
 #define ANIM_FRAME_LENGTH 4 /* number of real frames per one animation frame */
+#define STEAM_FRAME_LENGTH 3
 #define GAMEOVER_COUNTER_START 40
 #define LEVEL_START_WAIT_START 20
 #define LASER_START 5
 #define FLAPPING_START 12
 #define FLAPPING_INTERVAL 500
-#define STEAM_START 15
 #define IGLOO_SWITCH_START 8
 #define STANDING_COUNTER_START 8
 #define EVAPORATING_COUNTER_START 100
@@ -1374,7 +1374,7 @@
             PlaySound(sounds[SND_IGLOO_SIZZLE]);
             cities[this_city].counter = IGLOO_SWITCH_START;
             steam[this_city].status = STEAM_ON;
-            steam[this_city].counter = STEAM_START;
+            steam[this_city].counter = STEAM_FRAME_LENGTH * sprites[ANIM_STEAM]->num_frames;
           }
           else {
             if (cities[comets[i].city].hits_left == 2) {
@@ -1670,9 +1670,9 @@
       }
     }
     if (steam[i].status == STEAM_OFF)
-      steam[i].img = -1;
+      steam[i].img = NULL;
     else {
-      steam[i].img = IMG_STEAM5 - steam[i].counter/3;
+      steam[i].img = sprites[ANIM_STEAM]->frame[sprites[ANIM_STEAM]->num_frames - 1 - (steam[i].counter / STEAM_FRAME_LENGTH)];
       steam[i].layer = 2;
     }
   }
@@ -2046,7 +2046,7 @@
         }
         if (steam[i].layer == current_layer &&
             steam[i].status == STEAM_ON) {
-          this_image = images[steam[i].img];
+          this_image = steam[i].img;
           dest.x = cities[i].x - (this_image->w / 2);
           dest.y = (screen->h) - this_image->h - ((4 * images[IMG_IGLOO_INTACT]->h) / 7);
           dest.w = (this_image->w);

Modified: branches/commonification/tuxmath/trunk/src/game.h
===================================================================
--- branches/commonification/tuxmath/trunk/src/game.h	2009-08-06 22:39:09 UTC (rev 1387)
+++ branches/commonification/tuxmath/trunk/src/game.h	2009-08-07 10:53:10 UTC (rev 1388)
@@ -19,6 +19,8 @@
 #ifndef GAME_H
 #define GAME_H
 
+#include "SDL.h"
+
 #define MAX_COMETS 10
 #define NUM_CITIES 4   /* MUST BE AN EVEN NUMBER! */
 
@@ -68,7 +70,8 @@
 
 typedef struct steam_type {
   int status, counter;
-  int img,layer;
+  SDL_Surface* img;
+  int layer;
 } steam_type;
 
 #define NUM_SNOWFLAKES 100




More information about the Tux4kids-commits mailing list