[Tux4kids-commits] [SCM] tuxhistory - Educational history game branch, master, updated. e7b3ed374f73798dcc635416e760ab5fae06f66d
julio (none)
julio at julio-desktop.
Tue Jun 15 20:46:04 UTC 2010
The following commit has been merged in the master branch:
commit e7b3ed374f73798dcc635416e760ab5fae06f66d
Author: julio <julio at julio-desktop.(none)>
Date: Tue Jun 15 15:44:59 2010 -0500
TuxHisotry can now load tildes to terrain array
diff --git a/src/fileops.h b/src/fileops.h
index da582cb..77c380b 100644
--- a/src/fileops.h
+++ b/src/fileops.h
@@ -81,6 +81,283 @@ enum {
NUM_SPRITES
};
+// NUM_OF_TERRAINS must be the last element.
+// Feel free to use this arguments in the th_terrain
+// array, and in your xml - map files. Borders
+// will be generated by th_make_map()
+enum{
+ HIGHSEA,
+ TUNDRA,
+ SWAMP,
+ UNEXPLORED,
+ DESERT,
+ GRASSLAND,
+ ARCTIC,
+ OCEAN,
+ MARSH,
+ SAVANNAH,
+ PLAINS,
+ PRAIRIE,
+ NUM_OF_TERRAINS
+};
+
+
+/* ---------------------------
+ * | | | |
+ * | | | |
+ * | NW | N | NE |
+ * --------+---------+--------
+ * | | NW N NE | |
+ * | | W C E | E |
+ * | | SW S SE | |
+ * --------+---------+--------
+ * | SW | S | SE |
+ * | | | |
+ * | | | |
+ * ---------------------------
+ */
+enum{
+ BORDER_E_ODD,
+ BORDER_SW_EVEN,
+ BORDER_NW_ODD,
+ BORDER_W_EVEN,
+ BORDER_NE_ODD,
+ BORDER_SE_EVEN,
+ BORDER_W_ODD,
+ BORDER_E_EVEN,
+ BORDER_SW_ODD,
+ BORDER_NW_EVEN,
+ CENTER_0,
+ BORDER_N_EVEN,
+ BODER_SE_ODD,
+ BORDER_NE_EVEN,
+ BORDER_S_ODD,
+ BORDER_N_ODD,
+ CENTER_1,
+ BORDER_S_EVEN,
+ NUM_COMPTILDE
+}
+
+enum {
+ HIGHSEAS_BORDER_E_ODD,
+ HIGHSEAS_BORDER_SW_EVEN,
+ HIGHSEAS_BORDER_NW_ODD,
+ HIGHSEAS_BORDER_W_EVEN,
+ HIGHSEAS_BORDER_NE_ODD,
+ HIGHSEAS_BORDER_SE_EVEN,
+ HIGHSEAS_BORDER_W_ODD,
+ HIGHSEAS_BORDER_E_EVEN,
+ HIGHSEAS_BORDER_SW_ODD,
+ HIGHSEAS_BORDER_NW_EVEN,
+ HIGHSEAS_CENTER_0,
+ HIGHSEAS_BORDER_N_EVEN,
+ HIGHSEAS_BODER_SE_ODD,
+ HIGHSEAS_BORDER_NE_EVEN,
+ HIGHSEAS_BORDER_S_ODD,
+ HIGHSEAS_BORDER_N_ODD,
+ HIGHSEAS_CENTER_1,
+ HIGHSEAS_BORDER_S_EVEN,
+ TUNDRA_BORDER_E_ODD,
+ TUNDRA_BORDER_SW_EVEN,
+ TUNDRA_BORDER_NW_ODD,
+ TUNDRA_BORDER_W_EVEN,
+ TUNDRA_BORDER_NE_ODD,
+ TUNDRA_BORDER_SE_EVEN,
+ TUNDRA_BORDER_W_ODD,
+ TUNDRA_BORDER_E_EVEN,
+ TUNDRA_BORDER_SW_ODD,
+ TUNDRA_BORDER_NW_EVEN,
+ TUNDRA_CENTER_0,
+ TUNDRA_BORDER_N_EVEN,
+ TUNDRA_BODER_SE_ODD,
+ TUNDRA_BORDER_NE_EVEN,
+ TUNDRA_BORDER_S_ODD,
+ TUNDRA_BORDER_N_ODD,
+ TUNDRA_CENTER_1,
+ TUNDRA_BORDER_S_EVEN,
+ SWAMP_BORDER_E_ODD,
+ SWAMP_BORDER_SW_EVEN,
+ SWAMP_BORDER_NW_ODD,
+ SWAMP_BORDER_W_EVEN,
+ SWAMP_BORDER_NE_ODD,
+ SWAMP_BORDER_SE_EVEN,
+ SWAMP_BORDER_W_ODD,
+ SWAMP_BORDER_E_EVEN,
+ SWAMP_BORDER_SW_ODD,
+ SWAMP_BORDER_NW_EVEN,
+ SWAMP_CENTER_0,
+ SWAMP_BORDER_N_EVEN,
+ SWAMP_BODER_SE_ODD,
+ SWAMP_BORDER_NE_EVEN,
+ SWAMP_BORDER_S_ODD,
+ SWAMP_BORDER_N_ODD,
+ SWAMP_CENTER_1,
+ SWAMP_BORDER_S_EVEN,
+ UNEXPLORED_BORDER_E_ODD,
+ UNEXPLORED_BORDER_SW_EVEN,
+ UNEXPLORED_BORDER_NW_ODD,
+ UNEXPLORED_BORDER_W_EVEN,
+ UNEXPLORED_BORDER_NE_ODD,
+ UNEXPLORED_BORDER_SE_EVEN,
+ UNEXPLORED_BORDER_W_ODD,
+ UNEXPLORED_BORDER_E_EVEN,
+ UNEXPLORED_BORDER_SW_ODD,
+ UNEXPLORED_BORDER_NW_EVEN,
+ UNEXPLORED_CENTER_0,
+ UNEXPLORED_BORDER_N_EVEN,
+ UNEXPLORED_BODER_SE_ODD,
+ UNEXPLORED_BORDER_NE_EVEN,
+ UNEXPLORED_BORDER_S_ODD,
+ UNEXPLORED_BORDER_N_ODD,
+ UNEXPLORED_CENTER_1,
+ UNEXPLORED_BORDER_S_EVEN,
+ DESERT_BORDER_E_ODD,
+ DESERT_BORDER_SW_EVEN,
+ DESERT_BORDER_NW_ODD,
+ DESERT_BORDER_W_EVEN,
+ DESERT_BORDER_NE_ODD,
+ DESERT_BORDER_SE_EVEN,
+ DESERT_BORDER_W_ODD,
+ DESERT_BORDER_E_EVEN,
+ DESERT_BORDER_SW_ODD,
+ DESERT_BORDER_NW_EVEN,
+ DESERT_CENTER_0,
+ DESERT_BORDER_N_EVEN,
+ DESERT_BODER_SE_ODD,
+ DESERT_BORDER_NE_EVEN,
+ DESERT_BORDER_S_ODD,
+ DESERT_BORDER_N_ODD,
+ DESERT_CENTER_1,
+ DESERT_BORDER_S_EVEN,
+ GRASSLAND_BORDER_E_ODD,
+ GRASSLAND_BORDER_SW_EVEN,
+ GRASSLAND_BORDER_NW_ODD,
+ GRASSLAND_BORDER_W_EVEN,
+ GRASSLAND_BORDER_NE_ODD,
+ GRASSLAND_BORDER_SE_EVEN,
+ GRASSLAND_BORDER_W_ODD,
+ GRASSLAND_BORDER_E_EVEN,
+ GRASSLAND_BORDER_SW_ODD,
+ GRASSLAND_BORDER_NW_EVEN,
+ GRASSLAND_CENTER_0,
+ GRASSLAND_BORDER_N_EVEN,
+ GRASSLAND_BODER_SE_ODD,
+ GRASSLAND_BORDER_NE_EVEN,
+ GRASSLAND_BORDER_S_ODD,
+ GRASSLAND_BORDER_N_ODD,
+ GRASSLAND_CENTER_1,
+ GRASSLAND_BORDER_S_EVEN,
+ ARCTIC_BORDER_E_ODD,
+ ARCTIC_BORDER_SW_EVEN,
+ ARCTIC_BORDER_NW_ODD,
+ ARCTIC_BORDER_W_EVEN,
+ ARCTIC_BORDER_NE_ODD,
+ ARCTIC_BORDER_SE_EVEN,
+ ARCTIC_BORDER_W_ODD,
+ ARCTIC_BORDER_E_EVEN,
+ ARCTIC_BORDER_SW_ODD,
+ ARCTIC_BORDER_NW_EVEN,
+ ARCTIC_CENTER_0,
+ ARCTIC_BORDER_N_EVEN,
+ ARCTIC_BODER_SE_ODD,
+ ARCTIC_BORDER_NE_EVEN,
+ ARCTIC_BORDER_S_ODD,
+ ARCTIC_BORDER_N_ODD,
+ ARCTIC_CENTER_1,
+ ARCTIC_BORDER_S_EVEN,
+ OCEAN_BORDER_E_ODD,
+ OCEAN_BORDER_SW_EVEN,
+ OCEAN_BORDER_NW_ODD,
+ OCEAN_BORDER_W_EVEN,
+ OCEAN_BORDER_NE_ODD,
+ OCEAN_BORDER_SE_EVEN,
+ OCEAN_BORDER_W_ODD,
+ OCEAN_BORDER_E_EVEN,
+ OCEAN_BORDER_SW_ODD,
+ OCEAN_BORDER_NW_EVEN,
+ OCEAN_CENTER_0,
+ OCEAN_BORDER_N_EVEN,
+ OCEAN_BODER_SE_ODD,
+ OCEAN_BORDER_NE_EVEN,
+ OCEAN_BORDER_S_ODD,
+ OCEAN_BORDER_N_ODD,
+ OCEAN_CENTER_1,
+ OCEAN_BORDER_S_EVEN,
+ MARSH_BORDER_E_ODD,
+ MARSH_BORDER_SW_EVEN,
+ MARSH_BORDER_NW_ODD,
+ MARSH_BORDER_W_EVEN,
+ MARSH_BORDER_NE_ODD,
+ MARSH_BORDER_SE_EVEN,
+ MARSH_BORDER_W_ODD,
+ MARSH_BORDER_E_EVEN,
+ MARSH_BORDER_SW_ODD,
+ MARSH_BORDER_NW_EVEN,
+ MARSH_CENTER_0,
+ MARSH_BORDER_N_EVEN,
+ MARSH_BODER_SE_ODD,
+ MARSH_BORDER_NE_EVEN,
+ MARSH_BORDER_S_ODD,
+ MARSH_BORDER_N_ODD,
+ MARSH_CENTER_1,
+ MARSH_BORDER_S_EVEN,
+ SAVANNAH_BORDER_E_ODD,
+ SAVANNAH_BORDER_SW_EVEN,
+ SAVANNAH_BORDER_NW_ODD,
+ SAVANNAH_BORDER_W_EVEN,
+ SAVANNAH_BORDER_NE_ODD,
+ SAVANNAH_BORDER_SE_EVEN,
+ SAVANNAH_BORDER_W_ODD,
+ SAVANNAH_BORDER_E_EVEN,
+ SAVANNAH_BORDER_SW_ODD,
+ SAVANNAH_BORDER_NW_EVEN,
+ SAVANNAH_CENTER_0,
+ SAVANNAH_BORDER_N_EVEN,
+ SAVANNAH_BODER_SE_ODD,
+ SAVANNAH_BORDER_NE_EVEN,
+ SAVANNAH_BORDER_S_ODD,
+ SAVANNAH_BORDER_N_ODD,
+ SAVANNAH_CENTER_1,
+ SAVANNAH_BORDER_S_EVEN,
+ PLAINS_BORDER_E_ODD,
+ PLAINS_BORDER_SW_EVEN,
+ PLAINS_BORDER_NW_ODD,
+ PLAINS_BORDER_W_EVEN,
+ PLAINS_BORDER_NE_ODD,
+ PLAINS_BORDER_SE_EVEN,
+ PLAINS_BORDER_W_ODD,
+ PLAINS_BORDER_E_EVEN,
+ PLAINS_BORDER_SW_ODD,
+ PLAINS_BORDER_NW_EVEN,
+ PLAINS_CENTER_0,
+ PLAINS_BORDER_N_EVEN,
+ PLAINS_BODER_SE_ODD,
+ PLAINS_BORDER_NE_EVEN,
+ PLAINS_BORDER_S_ODD,
+ PLAINS_BORDER_N_ODD,
+ PLAINS_CENTER_1,
+ PLAINS_BORDER_S_EVEN,
+ PRAIRIE_BORDER_E_ODD,
+ PRAIRIE_BORDER_SW_EVEN,
+ PRAIRIE_BORDER_NW_ODD,
+ PRAIRIE_BORDER_W_EVEN,
+ PRAIRIE_BORDER_NE_ODD,
+ PRAIRIE_BORDER_SE_EVEN,
+ PRAIRIE_BORDER_W_ODD,
+ PRAIRIE_BORDER_E_EVEN,
+ PRAIRIE_BORDER_SW_ODD,
+ PRAIRIE_BORDER_NW_EVEN,
+ PRAIRIE_CENTER_0,
+ PRAIRIE_BORDER_N_EVEN,
+ PRAIRIE_BODER_SE_ODD,
+ PRAIRIE_BORDER_NE_EVEN,
+ PRAIRIE_BORDER_S_ODD,
+ PRAIRIE_BORDER_N_ODD,
+ PRAIRIE_CENTER_1,
+ PRAIRIE_BORDER_S_EVEN,
+ NUM_TERRAINS
+}
+
/* Names for game sounds (formerly in sounds.h): */
enum {
SND_HARP,
diff --git a/src/fileops_media.c b/src/fileops_media.c
index 11c8499..9fa00e6 100644
--- a/src/fileops_media.c
+++ b/src/fileops_media.c
@@ -14,12 +14,9 @@ int glyph_offset;
/* returns 1 if all data files successfully loaded, 0 otherwise. */
-/* TODO load only "igloo" or "city" files, not both. */
-/* TODO get rid of files no longer used. */
-
int load_image_data()
{
- int i;
+ int i, j, k;
static char* image_filenames[NUM_IMAGES] = {
"status/title.png",
@@ -66,6 +63,7 @@ int load_image_data()
"status/gameover_won.png",
};
+
static char* sprite_filenames[NUM_IMAGES] = {
"comets/comet",
"comets/bonus_comet",
@@ -73,6 +71,227 @@ int load_image_data()
"comets/bonus_cometex"
};
+ static char* terrain_filenames[NUM_TERRAINS]
+ {
+ "terrain/highSeas/border_E_odd.png",//HIGHSEA
+ "terrain/highSeas/border_SW_even.png",
+ "terrain/highSeas/border_NW_odd.png",
+ "terrain/highSeas/border_W_even.png",
+ "terrain/highSeas/border_NE_odd.png",
+ "terrain/highSeas/border_SE_even.png",
+ "terrain/highSeas/border_W_odd.png",
+ "terrain/highSeas/border_E_even.png",
+ "terrain/highSeas/border_SW_odd.png",
+ "terrain/highSeas/border_NW_even.png",
+ "terrain/highSeas/center0.png",
+ "terrain/highSeas/border_N_even.png",
+ "terrain/highSeas/border_SE_odd.png",
+ "terrain/highSeas/border_NE_even.png",
+ "terrain/highSeas/border_S_odd.png",
+ "terrain/highSeas/border_N_odd.png",
+ "terrain/highSeas/center1.png",
+ "terrain/highSeas/border_S_even.png",
+ "terrain/tundra/border_E_odd.png",//TUNDRA
+ "terrain/tundra/border_SW_even.png",
+ "terrain/tundra/border_NW_odd.png",
+ "terrain/tundra/border_W_even.png",
+ "terrain/tundra/border_NE_odd.png",
+ "terrain/tundra/border_SE_even.png",
+ "terrain/tundra/border_W_odd.png",
+ "terrain/tundra/border_E_even.png",
+ "terrain/tundra/border_SW_odd.png",
+ "terrain/tundra/border_NW_even.png",
+ "terrain/tundra/center0.png",
+ "terrain/tundra/border_N_even.png",
+ "terrain/tundra/border_SE_odd.png",
+ "terrain/tundra/border_NE_even.png",
+ "terrain/tundra/border_S_odd.png",
+ "terrain/tundra/border_N_odd.png",
+ "terrain/tundra/center1.png",
+ "terrain/tundra/border_S_even.png",
+ "terrain/swamp/border_E_odd.png",//SWAMP
+ "terrain/swamp/border_SW_even.png",
+ "terrain/swamp/border_NW_odd.png",
+ "terrain/swamp/border_W_even.png",
+ "terrain/swamp/border_NE_odd.png",
+ "terrain/swamp/border_SE_even.png",
+ "terrain/swamp/border_W_odd.png",
+ "terrain/swamp/border_E_even.png",
+ "terrain/swamp/border_SW_odd.png",
+ "terrain/swamp/border_NW_even.png",
+ "terrain/swamp/center0.png",
+ "terrain/swamp/border_N_even.png",
+ "terrain/swamp/border_SE_odd.png",
+ "terrain/swamp/border_NE_even.png",
+ "terrain/swamp/border_S_odd.png",
+ "terrain/swamp/border_N_odd.png",
+ "terrain/swamp/center1.png",
+ "terrain/swamp/border_S_even.png",
+ "terrain/unexplored/border_E_odd.png",//UNEXPLORED
+ "terrain/unexplored/border_SW_even.png",
+ "terrain/unexplored/border_NW_odd.png",
+ "terrain/unexplored/border_W_even.png",
+ "terrain/unexplored/border_NE_odd.png",
+ "terrain/unexplored/border_SE_even.png",
+ "terrain/unexplored/border_W_odd.png",
+ "terrain/unexplored/border_E_even.png",
+ "terrain/unexplored/border_SW_odd.png",
+ "terrain/unexplored/border_NW_even.png",
+ "terrain/unexplored/center0.png",
+ "terrain/unexplored/border_N_even.png",
+ "terrain/unexplored/border_SE_odd.png",
+ "terrain/unexplored/border_NE_even.png",
+ "terrain/unexplored/border_S_odd.png",
+ "terrain/unexplored/border_N_odd.png",
+ "terrain/unexplored/center1.png",
+ "terrain/unexplored/border_S_even.png",
+ "terrain/desert/border_E_odd.png",//DESERT
+ "terrain/desert/border_SW_even.png",
+ "terrain/desert/border_NW_odd.png",
+ "terrain/desert/border_W_even.png",
+ "terrain/desert/border_NE_odd.png",
+ "terrain/desert/border_SE_even.png",
+ "terrain/desert/border_W_odd.png",
+ "terrain/desert/border_E_even.png",
+ "terrain/desert/border_SW_odd.png",
+ "terrain/desert/border_NW_even.png",
+ "terrain/desert/center0.png",
+ "terrain/desert/border_N_even.png",
+ "terrain/desert/border_SE_odd.png",
+ "terrain/desert/border_NE_even.png",
+ "terrain/desert/border_S_odd.png",
+ "terrain/desert/border_N_odd.png",
+ "terrain/desert/center1.png",
+ "terrain/desert/border_S_even.png",
+ "terrain/grassland/border_E_odd.png",//GRASSLAND
+ "terrain/grassland/border_SW_even.png",
+ "terrain/grassland/border_NW_odd.png",
+ "terrain/grassland/border_W_even.png",
+ "terrain/grassland/border_NE_odd.png",
+ "terrain/grassland/border_SE_even.png",
+ "terrain/grassland/border_W_odd.png",
+ "terrain/grassland/border_E_even.png",
+ "terrain/grassland/border_SW_odd.png",
+ "terrain/grassland/border_NW_even.png",
+ "terrain/grassland/center0.png",
+ "terrain/grassland/border_N_even.png",
+ "terrain/grassland/border_SE_odd.png",
+ "terrain/grassland/border_NE_even.png",
+ "terrain/grassland/border_S_odd.png",
+ "terrain/grassland/border_N_odd.png",
+ "terrain/grassland/center1.png",
+ "terrain/grassland/border_S_even.png",
+ "terrain/arctic/border_E_odd.png",//ARCTIC
+ "terrain/arctic/border_SW_even.png",
+ "terrain/arctic/border_NW_odd.png",
+ "terrain/arctic/border_W_even.png",
+ "terrain/arctic/border_NE_odd.png",
+ "terrain/arctic/border_SE_even.png",
+ "terrain/arctic/border_W_odd.png",
+ "terrain/arctic/border_E_even.png",
+ "terrain/arctic/border_SW_odd.png",
+ "terrain/arctic/border_NW_even.png",
+ "terrain/arctic/center0.png",
+ "terrain/arctic/border_N_even.png",
+ "terrain/arctic/border_SE_odd.png",
+ "terrain/arctic/border_NE_even.png",
+ "terrain/arctic/border_S_odd.png",
+ "terrain/arctic/border_N_odd.png",
+ "terrain/arctic/center1.png",
+ "terrain/arctic/border_S_even.png",
+ "terrain/ocean/border_E_odd.png",//OCEAN
+ "terrain/ocean/border_SW_even.png",
+ "terrain/ocean/border_NW_odd.png",
+ "terrain/ocean/border_W_even.png",
+ "terrain/ocean/border_NE_odd.png",
+ "terrain/ocean/border_SE_even.png",
+ "terrain/ocean/border_W_odd.png",
+ "terrain/ocean/border_E_even.png",
+ "terrain/ocean/border_SW_odd.png",
+ "terrain/ocean/border_NW_even.png",
+ "terrain/ocean/center0.png",
+ "terrain/ocean/border_N_even.png",
+ "terrain/ocean/border_SE_odd.png",
+ "terrain/ocean/border_NE_even.png",
+ "terrain/ocean/border_S_odd.png",
+ "terrain/ocean/border_N_odd.png",
+ "terrain/ocean/center1.png",
+ "terrain/ocean/border_S_even.png"
+ "terrain/marsh/border_E_odd.png",//MARSH
+ "terrain/marsh/border_SW_even.png",
+ "terrain/marsh/border_NW_odd.png",
+ "terrain/marsh/border_W_even.png",
+ "terrain/marsh/border_NE_odd.png",
+ "terrain/marsh/border_SE_even.png",
+ "terrain/marsh/border_W_odd.png",
+ "terrain/marsh/border_E_even.png",
+ "terrain/marsh/border_SW_odd.png",
+ "terrain/marsh/border_NW_even.png",
+ "terrain/marsh/center0.png",
+ "terrain/marsh/border_N_even.png",
+ "terrain/marsh/border_SE_odd.png",
+ "terrain/marsh/border_NE_even.png",
+ "terrain/marsh/border_S_odd.png",
+ "terrain/marsh/border_N_odd.png",
+ "terrain/marsh/center1.png",
+ "terrain/marsh/border_S_even.png",
+ "terrain/savannah/border_E_odd.png",//SAVANNAH
+ "terrain/savannah/border_SW_even.png",
+ "terrain/savannah/border_NW_odd.png",
+ "terrain/savannah/border_W_even.png",
+ "terrain/savannah/border_NE_odd.png",
+ "terrain/savannah/border_SE_even.png",
+ "terrain/savannah/border_W_odd.png",
+ "terrain/savannah/border_E_even.png",
+ "terrain/savannah/border_SW_odd.png",
+ "terrain/savannah/border_NW_even.png",
+ "terrain/savannah/center0.png",
+ "terrain/savannah/border_N_even.png",
+ "terrain/savannah/border_SE_odd.png",
+ "terrain/savannah/border_NE_even.png",
+ "terrain/savannah/border_S_odd.png",
+ "terrain/savannah/border_N_odd.png",
+ "terrain/savannah/center1.png",
+ "terrain/savannah/border_S_even.png",
+ "terrain/plains/border_E_odd.png",//PLAINS
+ "terrain/plains/border_SW_even.png",
+ "terrain/plains/border_NW_odd.png",
+ "terrain/plains/border_W_even.png",
+ "terrain/plains/border_NE_odd.png",
+ "terrain/plains/border_SE_even.png",
+ "terrain/plains/border_W_odd.png",
+ "terrain/plains/border_E_even.png",
+ "terrain/plains/border_SW_odd.png",
+ "terrain/plains/border_NW_even.png",
+ "terrain/plains/center0.png",
+ "terrain/plains/border_N_even.png",
+ "terrain/plains/border_SE_odd.png",
+ "terrain/plains/border_NE_even.png",
+ "terrain/plains/border_S_odd.png",
+ "terrain/plains/border_N_odd.png",
+ "terrain/plains/center1.png",
+ "terrain/plains/border_S_even.png",
+ "terrain/prairie/border_E_odd.png",//PRAIRIE
+ "terrain/prairie/border_SW_even.png",
+ "terrain/prairie/border_NW_odd.png",
+ "terrain/prairie/border_W_even.png",
+ "terrain/prairie/border_NE_odd.png",
+ "terrain/prairie/border_SE_even.png",
+ "terrain/prairie/border_W_odd.png",
+ "terrain/prairie/border_E_even.png",
+ "terrain/prairie/border_SW_odd.png",
+ "terrain/prairie/border_NW_even.png",
+ "terrain/prairie/center0.png",
+ "terrain/prairie/border_N_even.png",
+ "terrain/prairie/border_SE_odd.png",
+ "terrain/prairie/border_NE_even.png",
+ "terrain/prairie/border_S_odd.png",
+ "terrain/prairie/border_N_odd.png",
+ "terrain/prairie/center1.png",
+ "terrain/prairie/border_S_even.png"
+ }
+
+
/* Load static images: */
for (i = 0; i < NUM_IMAGES; i++)
{
@@ -105,6 +324,26 @@ int load_image_data()
}
}
+ /* Load terrain tildes*/
+
+ j = 0;
+ k = 0;
+ for (i = 0; i < NUM_TERRAINS; i++)
+ {
+ terrain[j][k] = LoadImage(terrain_filenames[i], IMG_ALPHA);
+ if (++k > NUM_COMPTILDE)
+ {
+ k=0;
+ j++;
+ }
+ if (j > NUM_OF_TERRAINS)
+ {
+ break;
+ }
+ }
+
+
+
glyph_offset = 0;
#ifdef REPLACE_WAVESCORE
diff --git a/src/map.h b/src/map.h
index 0c6381f..f4434a7 100644
--- a/src/map.h
+++ b/src/map.h
@@ -6,25 +6,6 @@
* directly.
*/
-// NUM_OF_TERRAINS must be the last element.
-// Feel free to use this arguments in the th_terrain
-// array, and in your xml - map files. Borders
-// will be generated by th_make_map()
-enum{
- ARCTIC,
- TUNDRA,
- OCEAN,
- HIGH_SEA,
- DESERT,
- PLAINS,
- GRASSLAND,
- PRAIRIE,
- SAVANNAH,
- SWAMP,
- MARSH,
- NUM_OF_TERRAINS
-};
-
// th_map is the main data strucutre
// th_map_tilde specifies the terrain
// of the isometric map
diff --git a/src/setup.c b/src/setup.c
index 7602b46..e5154eb 100644
--- a/src/setup.c
+++ b/src/setup.c
@@ -68,6 +68,7 @@ int fs_res_y = 0;
SDL_Surface* screen;
SDL_Surface* images[NUM_IMAGES];
sprite* sprites[NUM_SPRITES];
+SDL_Surface* terrain[NUM_OF_TERRAINS][NUM_COMPTILDE];
/* 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 4dfca5c..13b0e10 100644
--- a/src/tuxhistory.h
+++ b/src/tuxhistory.h
@@ -62,7 +62,8 @@ extern SDL_Color yellow;
extern SDL_Surface* screen; /* declared in setup.c; also used in game.c, options.c, fileops.c, credits.c, titlescreen.c */
extern SDL_Surface* images[]; /* declared in setup.c, used in same files as screen */
extern sprite* sprites[];
-extern SDL_Surface* flipped_images[];
+extern SDL_Surface* terrain[][];
+
#define NUM_BLENDED_IGLOOS 15
extern SDL_Surface* blended_igloos[];
extern int flipped_img_lookup[];
--
tuxhistory - Educational history game
More information about the Tux4kids-commits
mailing list