[Tux4kids-commits] [SCM] tuxhistory - Educational history game branch, master, updated. fc7ac65ee58c7db3966ebc4183b6afdfb0c2fbcc

julio (none) julio at julio-desktop.
Sat Jun 19 06:23:33 UTC 2010


The following commit has been merged in the master branch:
commit fc7ac65ee58c7db3966ebc4183b6afdfb0c2fbcc
Author: julio <julio at julio-desktop.(none)>
Date:   Sat Jun 19 01:22:31 2010 -0500

    making avilable the forest images in the game

diff --git a/src/fileops.h b/src/fileops.h
index 242d253..5be6b8e 100644
--- a/src/fileops.h
+++ b/src/fileops.h
@@ -358,6 +358,18 @@ enum {
     NUM_TERRAINS
 };
 
+enum{
+    OBJ_MIXED, // Forest images
+    OBJ_TROPICAL,
+    OBJ_CONIFER,
+    OBJ_SCRUB,
+    OBJ_BOREAL,
+    OBJ_WETLAND,
+    OBJ_RAIN,
+    OBJ_BROADLEAF,
+    NUM_OBJECTS // Must at the end.
+};
+
 /* Names for game sounds (formerly in sounds.h): */
 enum {
   SND_HARP,
diff --git a/src/fileops_media.c b/src/fileops_media.c
index 75f3ba0..cca6ca4 100644
--- a/src/fileops_media.c
+++ b/src/fileops_media.c
@@ -291,6 +291,20 @@ int load_image_data()
   };
 
 
+  char *objects_filenames[] = 
+  {
+      "forest/mixed.png",//Forest Files
+      "forest/tropical.png",
+      "forest/conifer.png",
+      "forest/scrub.png",
+      "forest/boreal.png",
+      "forest/wetland.png",
+      "forest/rain.png",
+      "forest/broadleaf.png"
+  };
+
+
+
   /* Load static images: */
   for (i = 0; i < NUM_IMAGES; i++)
   {
@@ -326,7 +340,7 @@ int load_image_data()
   /* Load terrain tildes*/
 
   j = 0;
-  k = 0;
+  //k = 0;
   for (i = 0; i < NUM_TERRAINS; i++)
   {
     terrain[i] = LoadImage(terrain_filenames[i], IMG_ALPHA);
@@ -341,6 +355,10 @@ int load_image_data()
         break;
     }*/
    }
+  for (i = 0; i < NUM_OBJECTS; i++)
+  {
+      objects[i] = LoadImage(objects_filenames[i], IMG_ALPHA);
+  }
 
 
 
diff --git a/src/game.c b/src/game.c
index fccd89a..44de444 100644
--- a/src/game.c
+++ b/src/game.c
@@ -160,6 +160,7 @@ static void game_draw(void)
     dest.y = 200;
 
     SDL_BlitSurface(terrain[TUNDRA_CENTER_1], NULL, screen, &dest);
+    SDL_BlitSurface(objects[OBJ_TROPICAL], NULL, screen, &dest);
 
     dest.x = (screen->w - images[IMG_STOP]->w - 5);
     dest.y = glyph_offset;
diff --git a/src/setup.c b/src/setup.c
index 88c634d..9e9f7d1 100644
--- a/src/setup.c
+++ b/src/setup.c
@@ -69,6 +69,7 @@ SDL_Surface* screen;
 SDL_Surface* images[NUM_IMAGES];
 sprite* sprites[NUM_SPRITES];
 SDL_Surface* terrain[NUM_TERRAINS];
+SDL_Surface* objects[NUM_OBJECTS];
 /* Need special handling to generate flipped versions of images. This
    is a slightly ugly hack arising from the use of the enum trick for
    NUM_IMAGES. */
diff --git a/src/tuxhistory.h b/src/tuxhistory.h
index 5744822..7b44c1b 100644
--- a/src/tuxhistory.h
+++ b/src/tuxhistory.h
@@ -64,6 +64,7 @@ extern SDL_Surface* images[];    /* declared in setup.c, used in same files as s
 extern sprite* sprites[];
 extern SDL_Surface* flipped_images[];
 extern SDL_Surface* terrain[];
+extern SDL_Surface* objects[];
 
 #define NUM_BLENDED_IGLOOS 15
 extern SDL_Surface* blended_igloos[];

-- 
tuxhistory - Educational history game



More information about the Tux4kids-commits mailing list