From 8304a6abfecbc1aba9bb9f0cfed4531e1bc6d644 Mon Sep 17 00:00:00 2001 From: Vince Weaver Date: Tue, 12 Jun 2018 00:44:34 -0400 Subject: [PATCH] tfv: datastructures --- gr-sim/tfv/Makefile | 2 +- gr-sim/tfv/tfv_mapinfo.h | 103 ++++++++++++++++++++++++++++++++++++++ gr-sim/tfv/tfv_worldmap.c | 2 + 3 files changed, 106 insertions(+), 1 deletion(-) create mode 100644 gr-sim/tfv/tfv_mapinfo.h diff --git a/gr-sim/tfv/Makefile b/gr-sim/tfv/Makefile index c8cb108e..01864d82 100644 --- a/gr-sim/tfv/Makefile +++ b/gr-sim/tfv/Makefile @@ -99,7 +99,7 @@ tfv.o: tfv.c ../gr-sim.h tfv_backgrounds.h tfv_sprites.h tfv: tfv.o tfv_backgrounds.o tfv_battle.o tfv_citymap.o tfv_flying.o \ tfv_info.o tfv_opener.o tfv_sprites.o tfv_textentry.o \ - tfv_title.o tfv_worldmap.o \ + tfv_title.o tfv_worldmap.o tfv_mapinfo.h \ $(GR_SIM) $(CC) $(LFLAGS) $(SDL_LIBS) -o tfv tfv.o \ tfv_backgrounds.o tfv_battle.o tfv_citymap.o tfv_flying.o \ diff --git a/gr-sim/tfv/tfv_mapinfo.h b/gr-sim/tfv/tfv_mapinfo.h new file mode 100644 index 00000000..ff6a6754 --- /dev/null +++ b/gr-sim/tfv/tfv_mapinfo.h @@ -0,0 +1,103 @@ +/* + Map + + 0 1 2 3 + +0 BEACH ARCTIC ARCTIC BELAIR + TREE MOUNTAIN + +1 BEACH LANDING GRASS FOREST + PINETREE MOUNTAIN + +2 BEACH GRASS GRASS FOREST + PALMTREE MOUNTAIN + +3 BEACH DESERT COLLEGE BEACH + CACTUS PARK +*/ + +/* This is surprisngly similar to how I name citties in Civ4 */ + +#define NORTH_BEACH 0 +#define ARCTIC_WOODS 1 +#define ARCTIC_MOUNTAINS 2 +#define BEL_AIR 3 +#define PINE_BEACH 4 +#define LANDING_SITE 5 +#define NORTH_MOUNTAIN 6 +#define NORTH_FOREST 7 +#define PALM_BEACH 8 +#define GRASSLAND 9 +#define MORIA 10 +#define SOUTH_FOREST 11 +#define SOUTH_BEACH 12 +#define CACTUS_RANCH 13 +#define COLLEGE_PARK 14 +#define OCEAN_CITY 15 +#define NOEXIT 255 + +struct location_type { + char *name; + int x0,x1,y0,y1; + int type; +}; + +struct map_info_type { + char *name; + int num_locations; + struct location_type locations[6]; + int floor_color; + int n_exit,s_exit,e_exit,w_exit; + int miny; +} map_info[16] = { + { + .name="North Beach", + .n_exit=NOEXIT; + .s_exit=PINE_BEACH; + .e_exit=NOEXIT; + .w_exit=ARTIC_WOODS: + }, + { + .name="Arctic Woods", + }, + { + .name="Arctic Mountains", + }, + { + .name="Bel Air", + }, + { + .name="Pine Beach", + }, + { + .name="Landing Site", + }, + { + .name="North Mountain", + }, + { + .name="North Forest", + }, + { + .name="Palm Beach", + }, + { + .name="Grassland", + }, + { + .name="Moria", + }, + { + .name="South Forest", + }, + { + .name="South Beach", + }, + { + .name="Cactus Ranch", + }, + { + .name="Ocean City", + }, + +}; diff --git a/gr-sim/tfv/tfv_worldmap.c b/gr-sim/tfv/tfv_worldmap.c index 8d55d9cb..b15c5b29 100644 --- a/gr-sim/tfv/tfv_worldmap.c +++ b/gr-sim/tfv/tfv_worldmap.c @@ -10,6 +10,8 @@ #include "tfv_sprites.h" #include "tfv_backgrounds.h" +#include "tfv_mapinfo.h" + /* In Town */