[Tux4kids-commits] r1417 - in branches/commonification/tuxtype/trunk: data/images src

Bolesław Kulbabiński bolekk-guest at alioth.debian.org
Tue Aug 11 23:35:34 UTC 2009


Author: bolekk-guest
Date: 2009-08-11 23:35:34 +0000 (Tue, 11 Aug 2009)
New Revision: 1417

Modified:
   branches/commonification/tuxtype/trunk/data/images/fishy-.png
   branches/commonification/tuxtype/trunk/data/images/fishy0.png
   branches/commonification/tuxtype/trunk/data/images/fishy1.png
   branches/commonification/tuxtype/trunk/data/images/fishy2.png
   branches/commonification/tuxtype/trunk/data/images/fishy3.png
   branches/commonification/tuxtype/trunk/data/images/splat0.png
   branches/commonification/tuxtype/trunk/src/fileops_media.c
   branches/commonification/tuxtype/trunk/src/fileops_media.h
   branches/commonification/tuxtype/trunk/src/playgame.c
Log:
moved two playgame.c sprites to fileops_media

Modified: branches/commonification/tuxtype/trunk/data/images/fishy-.png
===================================================================
(Binary files differ)

Modified: branches/commonification/tuxtype/trunk/data/images/fishy0.png
===================================================================
(Binary files differ)

Modified: branches/commonification/tuxtype/trunk/data/images/fishy1.png
===================================================================
(Binary files differ)

Modified: branches/commonification/tuxtype/trunk/data/images/fishy2.png
===================================================================
(Binary files differ)

Modified: branches/commonification/tuxtype/trunk/data/images/fishy3.png
===================================================================
(Binary files differ)

Modified: branches/commonification/tuxtype/trunk/data/images/splat0.png
===================================================================
(Binary files differ)

Modified: branches/commonification/tuxtype/trunk/src/fileops_media.c
===================================================================
--- branches/commonification/tuxtype/trunk/src/fileops_media.c	2009-08-11 21:47:02 UTC (rev 1416)
+++ branches/commonification/tuxtype/trunk/src/fileops_media.c	2009-08-11 23:35:34 UTC (rev 1417)
@@ -46,7 +46,15 @@
 };
 
 static char* sprite_filenames[NUM_SPRITES] = {
-  "/images/num_"
+  "/images/num_",
+  "/images/fishy",
+  "/images/splat",
+  "/images/tux/walk",
+	"/images/tux/stand",
+	"/images/tux/run",
+	"/images/tux/gulp",
+	"/images/tux/win",
+	"/images/tux/yipe"
 };
 
 static char* sound_filenames[NUM_SOUNDS] = {
@@ -207,12 +215,14 @@
   sprites[id] = NULL;
 
   if(!settings.use_english)
+  {
     sprintf(fn, "%s%s", settings.theme_data_path, sprite_filenames[id]);
 
-  if(rect)
-    sprites[id] = LoadSpriteOfBoundingBox(fn, IMG_ALPHA, rect->w, rect->h);
-  else
-    sprites[id] = LoadSprite(fn, IMG_ALPHA);
+    if(rect)
+      sprites[id] = LoadSpriteOfBoundingBox(fn, IMG_ALPHA, rect->w, rect->h);
+    else
+      sprites[id] = LoadSprite(fn, IMG_ALPHA);
+  }
 
   if(NULL == sprites[id])
   {

Modified: branches/commonification/tuxtype/trunk/src/fileops_media.h
===================================================================
--- branches/commonification/tuxtype/trunk/src/fileops_media.h	2009-08-11 21:47:02 UTC (rev 1416)
+++ branches/commonification/tuxtype/trunk/src/fileops_media.h	2009-08-11 23:35:34 UTC (rev 1417)
@@ -46,6 +46,14 @@
 
 enum {
   ANIM_NUMS,
+  ANIM_FISHY,
+  ANIM_SPLAT,
+  ANIM_TUX_WALKING,
+	ANIM_TUX_STANDING,
+	ANIM_TUX_RUNNING,
+	ANIM_TUX_GULPING,
+	ANIM_TUX_WINNING,
+	ANIM_TUX_YIPING,
   NUM_SPRITES
 };
 

Modified: branches/commonification/tuxtype/trunk/src/playgame.c
===================================================================
--- branches/commonification/tuxtype/trunk/src/playgame.c	2009-08-11 21:47:02 UTC (rev 1416)
+++ branches/commonification/tuxtype/trunk/src/playgame.c	2009-08-11 23:35:34 UTC (rev 1417)
@@ -84,6 +84,8 @@
 void LoadCascadeMedia()
 {
   SetSprite(ANIM_NUMS, NULL);
+  SetSprite(ANIM_FISHY, NULL);
+  SetSprite(ANIM_SPLAT, NULL);
 }
 
 
@@ -531,7 +533,7 @@
 		return 0;
 
 	for (i=0; i < wcslen(fish_object[f].word); i++) 
-		if (fish_object[f].word[i] != tux_object.word[tux_object.wordlen -                                           wcslen(fish_object[f].word) + i])
+		if (fish_object[f].word[i] != tux_object.word[tux_object.wordlen - wcslen(fish_object[f].word) + i])
 			return 0;
 
 	return 1;
@@ -606,8 +608,8 @@
                   settings.theme_font_name);
 	}
 
-        RenderLetters(FISHY_FONT_SIZE);
-        LOG( " Done rendering letters \n ");
+  RenderLetters(FISHY_FONT_SIZE);
+  LOG( " Done rendering letters \n ");
 
 
 	curlev = BlackOutline(gettext("Level"), LABEL_FONT_SIZE, &white);
@@ -675,8 +677,8 @@
 
 	LOG( "=LoadFishies()\n" );
 
-	fish_sprite = LoadSpriteNoPrefix( "/images/fishy", IMG_COLORKEY );
-	splat_sprite = LoadSpriteNoPrefix( "/images/splat", IMG_COLORKEY );
+  fish_sprite = GetSprite(ANIM_FISHY);
+  splat_sprite = GetSprite(ANIM_SPLAT);
 
 	for (i = 0; i < MAX_FISHIES_HARD; i++) {
 		fish_object[i].alive = 1;
@@ -816,12 +818,6 @@
     tux_object.spr[i][LEFT] = NULL;
   }
 
-  LOG( "-Freeing fishies\n" );
-
-  if (fish_sprite)
-    FreeSprite(fish_sprite);
-  if (splat_sprite)
-    FreeSprite(splat_sprite);
   fish_sprite = splat_sprite = NULL;
 
   LOG( "-Freeing other game graphics\n" );




More information about the Tux4kids-commits mailing list