| version 1.42 | | version 1.43 |
|---|
| | |
| /* | | /* |
| * static char *rcsid_weather_c = | | * static char *rcsid_weather_c = |
| * "$Id: weather.c,v 1.42 2005/10/28 19:08:53 akirschbaum Exp $"; | | * "$Id: weather.c,v 1.43 2005/11/01 09:02:55 akirschbaum Exp $"; |
| */ | | */ |
| /* | | /* |
| CrossFire, A Multiplayer game for X-windows | | CrossFire, A Multiplayer game for X-windows |
| | |
| extern unsigned long todtick; | | extern unsigned long todtick; |
| extern weathermap_t **weathermap; | | extern weathermap_t **weathermap; |
| | | |
| int gulf_stream_speed[GULF_STREAM_WIDTH][WEATHERMAPTILESY]; | | static void dawn_to_dusk(const timeofday_t *tod); |
| int gulf_stream_dir[GULF_STREAM_WIDTH][WEATHERMAPTILESY]; | | static void write_skymap(void); |
| int gulf_stream_start; | | static void write_pressuremap(void); |
| int gulf_stream_direction; | | static void read_pressuremap(void); |
| | | static void init_pressure(void); |
| | | static void write_winddirmap(void); |
| | | static void read_winddirmap(void); |
| | | static void write_windspeedmap(void); |
| | | static void read_windspeedmap(void); |
| | | static void init_wind(void); |
| | | static void write_gulfstreammap(void); |
| | | static void read_gulfstreammap(void); |
| | | static void init_gulfstreammap(void); |
| | | static void write_humidmap(void); |
| | | static void read_humidmap(void); |
| | | static void write_elevmap(void); |
| | | static void read_elevmap(void); |
| | | static void write_watermap(void); |
| | | static void read_watermap(void); |
| | | static void init_humid_elev(void); |
| | | static void write_temperaturemap(void); |
| | | static void read_temperaturemap(void); |
| | | static void init_temperature(void); |
| | | static void write_rainfallmap(void); |
| | | static void read_rainfallmap(void); |
| | | static void init_rainfall(void); |
| | | static void init_weatheravoid (weather_avoids_t wa[]); |
| | | static void perform_weather(void); |
| | | static object *avoid_weather(int *av, mapstruct *m, int x, int y, int *gs, int grow); |
| | | static void calculate_temperature(mapstruct *m, int wx, int wy); |
| | | static void let_it_snow(mapstruct *m, int wx, int wy); |
| | | static void singing_in_the_rain(mapstruct *m, int wx, int wy); |
| | | static void plant_a_garden(mapstruct *m, int wx, int wy); |
| | | static void change_the_world(mapstruct *m, int wx, int wy); |
| | | static void feather_map(mapstruct *m, int wx, int wy); |
| | | static const char *weathermap_to_worldmap_corner(int wx, int wy, int *x, int *y, int dir); |
| | | static int polar_distance(int x, int y, int equator); |
| | | static void update_humid(void); |
| | | static int humid_tile(int x, int y); |
| | | static void temperature_calc(int x, int y, const timeofday_t *tod); |
| | | static int real_temperature(int x, int y); |
| | | static void smooth_pressure(void); |
| | | static void perform_pressure(void); |
| | | static void smooth_wind(void); |
| | | static void plot_gulfstream(void); |
| | | static void compute_sky(void); |
| | | static void process_rain(void); |
| | | static void spin_globe(void); |
| | | static void write_weather_images(void); |
| | | |
| | | static int gulf_stream_speed[GULF_STREAM_WIDTH][WEATHERMAPTILESY]; |
| | | static int gulf_stream_dir[GULF_STREAM_WIDTH][WEATHERMAPTILESY]; |
| | | static int gulf_stream_start; |
| | | static int gulf_stream_direction; |
| | | |
| const int season_timechange[5][HOURS_PER_DAY] = { | | static const int season_timechange[5][HOURS_PER_DAY] = { |
| /* 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 2 3 4 5 6 7 | | /* 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 2 3 4 5 6 7 |
| 8 9 10 11 12 13 */ | | 8 9 10 11 12 13 */ |
| {0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 1, 1, | | {0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 1, 1, |
| | |
| 1, 1, 1, 1, 1, 0} | | 1, 1, 1, 1, 1, 0} |
| }; | | }; |
| | | |
| const int season_tempchange[HOURS_PER_DAY] = { | | static const int season_tempchange[HOURS_PER_DAY] = { |
| /* 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 2 3 4 5 6 7 | | /* 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 2 3 4 5 6 7 |
| 8 9 10 11 12 13 */ | | 8 9 10 11 12 13 */ |
| 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 1, 1, | | 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 1, 1, |
| | |
| * on the ocean, and other things like that. | | * on the ocean, and other things like that. |
| */ | | */ |
| | | |
| weather_avoids_t weather_avoids[] = { | | static weather_avoids_t weather_avoids[] = { |
| {"snow", 1, NULL}, | | {"snow", 1, NULL}, |
| {"snow2", 1, NULL}, | | {"snow2", 1, NULL}, |
| {"snow3", 1, NULL}, | | {"snow3", 1, NULL}, |
| | |
| * field is unused. | | * field is unused. |
| */ | | */ |
| | | |
| weather_avoids_t growth_avoids[] = { | | static weather_avoids_t growth_avoids[] = { |
| {"cobblestones", 0, NULL}, | | {"cobblestones", 0, NULL}, |
| {"cobblestones2", 0, NULL}, | | {"cobblestones2", 0, NULL}, |
| {"flagstone", 0, NULL}, | | {"flagstone", 0, NULL}, |
| | |
| * The fourth field is 1 if you want to match arch->name, 0 to match ob->name. | | * The fourth field is 1 if you want to match arch->name, 0 to match ob->name. |
| */ | | */ |
| | | |
| weather_replace_t weather_replace[] = { | | static weather_replace_t weather_replace[] = { |
| {"impossible_match", "snow5", NULL, 0}, | | {"impossible_match", "snow5", NULL, 0}, |
| {"impossible_match2", "snow4", NULL, 0}, /* placeholders */ | | {"impossible_match2", "snow4", NULL, 0}, /* placeholders */ |
| {"impossible_match3", "snow3", NULL, 0}, | | {"impossible_match3", "snow3", NULL, 0}, |
| | |
| * the meanings of all of the fields. | | * the meanings of all of the fields. |
| */ | | */ |
| | | |
| weather_grow_t weather_grow[] = { | | static const weather_grow_t weather_grow[] = { |
| /* herb, tile, random, rfmin, rfmax, humin, humax, tempmin, tempmax, elevmin, elevmax, season */ | | /* herb, tile, random, rfmin, rfmax, humin, humax, tempmin, tempmax, elevmin, elevmax, season */ |
| {"mint", "grass", 10, 1.0, 2.0, 30, 100, 10, 25, -100, 9999, 2}, | | {"mint", "grass", 10, 1.0, 2.0, 30, 100, 10, 25, -100, 9999, 2}, |
| {"rose_red", "grass", 15, 1.0, 2.0, 30, 100, 10, 25, -100, 9999, 2}, | | {"rose_red", "grass", 15, 1.0, 2.0, 30, 100, 10, 25, -100, 9999, 2}, |
| | |
| * parameter is a base tile to lay down underneath the herb tile. | | * parameter is a base tile to lay down underneath the herb tile. |
| */ | | */ |
| | | |
| weather_grow_t weather_tile[] = { | | static const weather_grow_t weather_tile[] = { |
| /* herb, tile, random, rfmin, rfmax, humin, humax, tempmin, tempmax, elevmin, elevmax */ | | /* herb, tile, random, rfmin, rfmax, humin, humax, tempmin, tempmax, elevmin, elevmax */ |
| {"dunes", NULL, 2, 0.0, 0.03, 0, 20, 10, 99, 0, 4000, 0}, | | {"dunes", NULL, 2, 0.0, 0.03, 0, 20, 10, 99, 0, 4000, 0}, |
| {"desert", NULL, 1, 0.0, 0.05, 0, 20, 10, 99, 0, 4000, 0}, | | {"desert", NULL, 1, 0.0, 0.05, 0, 20, 10, 99, 0, 4000, 0}, |
| | |
| * 7 3 3 7 | | * 7 3 3 7 |
| * 654 218 | | * 654 218 |
| */ | | */ |
| const uint32 directions[] = { | | static const uint32 directions[] = { |
| 0x0000FFFF, /* south */ | | 0x0000FFFF, /* south */ |
| 0x000000FF, /* south west */ | | 0x000000FF, /* south west */ |
| 0x00FF00FF, /* west */ | | 0x00FF00FF, /* west */ |
| | |
| }; | | }; |
| | | |
| /* Colours used for weather types. */ | | /* Colours used for weather types. */ |
| const uint32 skies[] = { | | static const uint32 skies[] = { |
| 0x000000FF, /* SKY_CLEAR 0 */ | | 0x000000FF, /* SKY_CLEAR 0 */ |
| 0x000000BD, /* SKY_LIGHTCLOUD 1 */ | | 0x000000BD, /* SKY_LIGHTCLOUD 1 */ |
| 0x0000007E, /* SKY_OVERCAST 2 */ | | 0x0000007E, /* SKY_OVERCAST 2 */ |
| | |
| * time of day as an argument. | | * time of day as an argument. |
| */ | | */ |
| | | |
| void dawn_to_dusk(timeofday_t *tod) | | static void dawn_to_dusk(const timeofday_t *tod) |
| { | | { |
| mapstruct *m; | | mapstruct *m; |
| | | |
| | |
| * Please don't modify tod in the dependant function. | | * Please don't modify tod in the dependant function. |
| */ | | */ |
| | | |
| void tick_the_clock() | | void tick_the_clock(void) |
| { | | { |
| timeofday_t tod; | | timeofday_t tod; |
| | | |
| | |
| | | |
| /* sky. We never read this map, only write it for debugging purposes */ | | /* sky. We never read this map, only write it for debugging purposes */ |
| | | |
| void write_skymap() | | static void write_skymap(void) |
| { | | { |
| char filename[MAX_BUF]; | | char filename[MAX_BUF]; |
| FILE *fp; | | FILE *fp; |
| | |
| | | |
| /* pressure */ | | /* pressure */ |
| | | |
| void write_pressuremap() | | static void write_pressuremap(void) |
| { | | { |
| char filename[MAX_BUF]; | | char filename[MAX_BUF]; |
| FILE *fp; | | FILE *fp; |
| | |
| fclose(fp); | | fclose(fp); |
| } | | } |
| | | |
| void read_pressuremap() | | static void read_pressuremap(void) |
| { | | { |
| char filename[MAX_BUF]; | | char filename[MAX_BUF]; |
| FILE *fp; | | FILE *fp; |
| | |
| fclose(fp); | | fclose(fp); |
| } | | } |
| | | |
| void init_pressure() | | static void init_pressure(void) |
| { | | { |
| int x, y; | | int x, y; |
| int l, n, k, r; | | int l, n, k, r; |
| | |
| | | |
| /* winddir */ | | /* winddir */ |
| | | |
| void write_winddirmap() | | static void write_winddirmap(void) |
| { | | { |
| char filename[MAX_BUF]; | | char filename[MAX_BUF]; |
| FILE *fp; | | FILE *fp; |
| | |
| fclose(fp); | | fclose(fp); |
| } | | } |
| | | |
| void read_winddirmap() | | static void read_winddirmap(void) |
| { | | { |
| char filename[MAX_BUF]; | | char filename[MAX_BUF]; |
| FILE *fp; | | FILE *fp; |
| | |
| | | |
| /* windspeed */ | | /* windspeed */ |
| | | |
| void write_windspeedmap() | | static void write_windspeedmap(void) |
| { | | { |
| char filename[MAX_BUF]; | | char filename[MAX_BUF]; |
| FILE *fp; | | FILE *fp; |
| | |
| fclose(fp); | | fclose(fp); |
| } | | } |
| | | |
| void read_windspeedmap() | | static void read_windspeedmap(void) |
| { | | { |
| char filename[MAX_BUF]; | | char filename[MAX_BUF]; |
| FILE *fp; | | FILE *fp; |
| | |
| | | |
| /* initialize the wind randomly. Does both direction and speed in one pass */ | | /* initialize the wind randomly. Does both direction and speed in one pass */ |
| | | |
| void init_wind() | | static void init_wind(void) |
| { | | { |
| int x, y; | | int x, y; |
| | | |
| | |
| | | |
| /* gulf stream */ | | /* gulf stream */ |
| | | |
| void write_gulfstreammap() | | static void write_gulfstreammap(void) |
| { | | { |
| char filename[MAX_BUF]; | | char filename[MAX_BUF]; |
| FILE *fp; | | FILE *fp; |
| | |
| fclose(fp); | | fclose(fp); |
| } | | } |
| | | |
| void read_gulfstreammap() | | static void read_gulfstreammap(void) |
| { | | { |
| char filename[MAX_BUF]; | | char filename[MAX_BUF]; |
| FILE *fp; | | FILE *fp; |
| | |
| fclose(fp); | | fclose(fp); |
| } | | } |
| | | |
| void init_gulfstreammap() | | static void init_gulfstreammap(void) |
| { | | { |
| int x, y, tx; | | int x, y, tx; |
| | | |
| | |
| | | |
| /* humidity */ | | /* humidity */ |
| | | |
| void write_humidmap() | | static void write_humidmap(void) |
| { | | { |
| char filename[MAX_BUF]; | | char filename[MAX_BUF]; |
| FILE *fp; | | FILE *fp; |
| | |
| fclose(fp); | | fclose(fp); |
| } | | } |
| | | |
| void read_humidmap() | | static void read_humidmap(void) |
| { | | { |
| char filename[MAX_BUF]; | | char filename[MAX_BUF]; |
| FILE *fp; | | FILE *fp; |
| | |
| | | |
| /* average elevation */ | | /* average elevation */ |
| | | |
| void write_elevmap() | | static void write_elevmap(void) |
| { | | { |
| char filename[MAX_BUF]; | | char filename[MAX_BUF]; |
| FILE *fp; | | FILE *fp; |
| | |
| fclose(fp); | | fclose(fp); |
| } | | } |
| | | |
| void read_elevmap() | | static void read_elevmap(void) |
| { | | { |
| char filename[MAX_BUF]; | | char filename[MAX_BUF]; |
| FILE *fp; | | FILE *fp; |
| | |
| | | |
| /* water % */ | | /* water % */ |
| | | |
| void write_watermap() | | static void write_watermap(void) |
| { | | { |
| char filename[MAX_BUF]; | | char filename[MAX_BUF]; |
| FILE *fp; | | FILE *fp; |
| | |
| fclose(fp); | | fclose(fp); |
| } | | } |
| | | |
| void read_watermap() | | static void read_watermap(void) |
| { | | { |
| char filename[MAX_BUF]; | | char filename[MAX_BUF]; |
| FILE *fp; | | FILE *fp; |
| | |
| * initialize both humidity and elevation | | * initialize both humidity and elevation |
| */ | | */ |
| | | |
| void init_humid_elev() | | static void init_humid_elev(void) |
| { | | { |
| int x, y, tx, ty, nx, ny, ax, ay, j; | | int x, y, tx, ty, nx, ny, ax, ay, j; |
| int spwtx, spwty; | | int spwtx, spwty; |
| | |
| | | |
| /* temperature */ | | /* temperature */ |
| | | |
| void write_temperaturemap() | | static void write_temperaturemap(void) |
| { | | { |
| char filename[MAX_BUF]; | | char filename[MAX_BUF]; |
| FILE *fp; | | FILE *fp; |
| | |
| fclose(fp); | | fclose(fp); |
| } | | } |
| | | |
| void read_temperaturemap() | | static void read_temperaturemap(void) |
| { | | { |
| char filename[MAX_BUF]; | | char filename[MAX_BUF]; |
| FILE *fp; | | FILE *fp; |
| | |
| fclose(fp); | | fclose(fp); |
| } | | } |
| | | |
| void init_temperature() | | static void init_temperature(void) |
| { | | { |
| int x, y; | | int x, y; |
| timeofday_t tod; | | timeofday_t tod; |
| | |
| | | |
| /* rainfall */ | | /* rainfall */ |
| | | |
| void write_rainfallmap() | | static void write_rainfallmap(void) |
| { | | { |
| char filename[MAX_BUF]; | | char filename[MAX_BUF]; |
| FILE *fp; | | FILE *fp; |
| | |
| fclose(fp); | | fclose(fp); |
| } | | } |
| | | |
| void read_rainfallmap() | | static void read_rainfallmap(void) |
| { | | { |
| char filename[MAX_BUF]; | | char filename[MAX_BUF]; |
| FILE *fp; | | FILE *fp; |
| | |
| fclose(fp); | | fclose(fp); |
| } | | } |
| | | |
| void init_rainfall() | | static void init_rainfall(void) |
| { | | { |
| int x, y; | | int x, y; |
| int days; | | int days; |
| | |
| | | |
| | | |
| | | |
| void init_weatheravoid (weather_avoids_t wa[]){ | | static void init_weatheravoid (weather_avoids_t wa[]){ |
| int i; | | int i; |
| for (i=0; wa[i].name != NULL; i++) { | | for (i=0; wa[i].name != NULL; i++) { |
| wa[i].what=find_archetype(wa[i].name); | | wa[i].what=find_archetype(wa[i].name); |
| } | | } |
| } | | } |
| | | |
| int wmperformstartx; | | static int wmperformstartx; |
| int wmperformstarty; | | static int wmperformstarty; |
| | | |
| /* | | /* |
| * This function initializes the weather system. It should be called once, | | * This function initializes the weather system. It should be called once, |
| | |
| */ | | */ |
| | | |
| | | |
| void init_weather() | | void init_weather(void) |
| { | | { |
| int y, tx, ty; | | int y, tx, ty; |
| char filename[MAX_BUF]; | | char filename[MAX_BUF]; |
| | |
| * etc etc etc. Not actual *weather*, but weather *effects*. | | * etc etc etc. Not actual *weather*, but weather *effects*. |
| */ | | */ |
| | | |
| void perform_weather() | | static void perform_weather(void) |
| { | | { |
| mapstruct *m; | | mapstruct *m; |
| char filename[MAX_BUF]; | | char filename[MAX_BUF]; |
| | |
| * destroy/melt it. | | * destroy/melt it. |
| */ | | */ |
| | | |
| object *avoid_weather(int *av, mapstruct *m, int x, int y, int *gs, int grow) | | static object *avoid_weather(int *av, mapstruct *m, int x, int y, int *gs, int grow) |
| { | | { |
| int avoid, gotsnow, i, n; | | int avoid, gotsnow, i, n; |
| | | |
| | |
| /* Temperature is used in a lot of weather function. | | /* Temperature is used in a lot of weather function. |
| * This need to be precalculated before used. | | * This need to be precalculated before used. |
| */ | | */ |
| void calculate_temperature(mapstruct *m, int wx, int wy){ | | static void calculate_temperature(mapstruct *m, int wx, int wy){ |
| int x,y; | | int x,y; |
| for (x=0; x < settings.worldmaptilesizex; x++) { | | for (x=0; x < settings.worldmaptilesizex; x++) { |
| for (y=0; y < settings.worldmaptilesizey; y++) { | | for (y=0; y < settings.worldmaptilesizey; y++) { |
| | |
| * weather_effect() | | * weather_effect() |
| */ | | */ |
| | | |
| void let_it_snow(mapstruct *m, int wx, int wy) | | static void let_it_snow(mapstruct *m, int wx, int wy) |
| { | | { |
| int x, y, i; | | int x, y, i; |
| int nx, ny, j, d; | | int nx, ny, j, d; |
| int avoid, two, temp, sky, gotsnow, found, nodstk; | | int avoid, two, temp, sky, gotsnow, found, nodstk; |
| char *doublestack, *doublestack2; | | const char *doublestack, *doublestack2; |
| object *ob, *tmp, *oldsnow, *topfloor; | | object *ob, *tmp, *oldsnow, *topfloor; |
| archetype *at; | | archetype *at; |
| | | |
| | |
| * weather_effect() | | * weather_effect() |
| */ | | */ |
| | | |
| void singing_in_the_rain(mapstruct *m, int wx, int wy) | | static void singing_in_the_rain(mapstruct *m, int wx, int wy) |
| { | | { |
| int x, y, i; | | int x, y, i; |
| int nx, ny, d, j; | | int nx, ny, d, j; |
| int avoid, two, temp, sky, gotsnow, found, nodstk; | | int avoid, two, temp, sky, gotsnow, found, nodstk; |
| object *ob, *tmp, *oldsnow, *topfloor; | | object *ob, *tmp, *oldsnow, *topfloor; |
| char *doublestack, *doublestack2; | | const char *doublestack, *doublestack2; |
| archetype *at; | | archetype *at; |
| | | |
| for (nx=0; nx < settings.worldmaptilesizex; nx++) { | | for (nx=0; nx < settings.worldmaptilesizex; nx++) { |
| | |
| * weather_effect() | | * weather_effect() |
| */ | | */ |
| | | |
| void plant_a_garden(mapstruct *m, int wx, int wy) | | static void plant_a_garden(mapstruct *m, int wx, int wy) |
| { | | { |
| int x, y, i; | | int x, y, i; |
| int avoid, two, temp, sky, gotsnow, found, days; | | int avoid, two, temp, sky, gotsnow, found, days; |
| | |
| * This should be called from weather_effect() | | * This should be called from weather_effect() |
| */ | | */ |
| | | |
| void change_the_world(mapstruct *m, int wx, int wy) | | static void change_the_world(mapstruct *m, int wx, int wy) |
| { | | { |
| int x, y, i; | | int x, y, i; |
| int nx, ny, j, d; | | int nx, ny, j, d; |
| | |
| * This should be called from weather_effect() | | * This should be called from weather_effect() |
| */ | | */ |
| | | |
| void feather_map(mapstruct *m, int wx, int wy) | | static void feather_map(mapstruct *m, int wx, int wy) |
| { | | { |
| int x, y, i, nx, ny, j; | | int x, y, i, nx, ny, j; |
| int avoid, two, gotsnow, nodstk; | | int avoid, two, gotsnow, nodstk; |
| | |
| * value is the name of the map that corner resides in. | | * value is the name of the map that corner resides in. |
| */ | | */ |
| | | |
| const char *weathermap_to_worldmap_corner(int wx, int wy, int *x, int *y, int dir) | | static const char *weathermap_to_worldmap_corner(int wx, int wy, int *x, int *y, int dir) |
| { | | { |
| int spwtx, spwty; | | int spwtx, spwty; |
| int tx, ty, nx, ny; | | int tx, ty, nx, ny; |
| | |
| */ | | */ |
| | | |
| | | |
| int polar_distance(int x, int y, int equator) | | static int polar_distance(int x, int y, int equator) |
| { | | { |
| if ((x+y) > equator) { /* south pole */ | | if ((x+y) > equator) { /* south pole */ |
| x = WEATHERMAPTILESX - x; | | x = WEATHERMAPTILESX - x; |
| | |
| * update the humidity for all weathermap tiles. | | * update the humidity for all weathermap tiles. |
| */ | | */ |
| | | |
| void update_humid() | | static void update_humid(void) |
| { | | { |
| int x, y; | | int x, y; |
| | | |
| | |
| * square. | | * square. |
| */ | | */ |
| | | |
| int humid_tile(int x, int y) | | static int humid_tile(int x, int y) |
| { | | { |
| int ox, oy, humid; | | int ox, oy, humid; |
| | | |
| | |
| * time of day in *tod. | | * time of day in *tod. |
| */ | | */ |
| | | |
| void temperature_calc(int x, int y, timeofday_t *tod) | | static void temperature_calc(int x, int y, const timeofday_t *tod) |
| { | | { |
| int dist, equator, elev, n; | | int dist, equator, elev, n; |
| float diff, tdiff; | | float diff, tdiff; |
| | |
| * weathermap coordinates. | | * weathermap coordinates. |
| */ | | */ |
| | | |
| int real_temperature(int x, int y) | | static int real_temperature(int x, int y) |
| { | | { |
| int i, temp; | | int i, temp; |
| timeofday_t tod; | | timeofday_t tod; |
| | |
| | | |
| /* this code simply smooths the pressure map */ | | /* this code simply smooths the pressure map */ |
| | | |
| void smooth_pressure() | | static void smooth_pressure(void) |
| { | | { |
| int x, y; | | int x, y; |
| int k; | | int k; |
| | |
| * smoothing algorithim.. This causes the pressure to change very slowly | | * smoothing algorithim.. This causes the pressure to change very slowly |
| */ | | */ |
| | | |
| void perform_pressure() | | static void perform_pressure(void) |
| { | | { |
| int x, y, l, n, j, k; | | int x, y, l, n, j, k; |
| | | |
| | |
| * a quick pass to update the windspeed. | | * a quick pass to update the windspeed. |
| */ | | */ |
| | | |
| void smooth_wind() | | static void smooth_wind(void) |
| { | | { |
| int x, y; | | int x, y; |
| int tx, ty, dx, dy; | | int tx, ty, dx, dy; |
| | |
| * to avoid the windsmoothing scrambling the jet stream. | | * to avoid the windsmoothing scrambling the jet stream. |
| */ | | */ |
| | | |
| void plot_gulfstream() | | static void plot_gulfstream(void) |
| { | | { |
| int x, y, tx; | | int x, y, tx; |
| | | |
| | |
| * square. | | * square. |
| */ | | */ |
| | | |
| void compute_sky() | | static void compute_sky(void) |
| { | | { |
| int x, y; | | int x, y; |
| int temp; | | int temp; |
| | |
| * Keep track of how much rain has fallen in a given weathermap square. | | * Keep track of how much rain has fallen in a given weathermap square. |
| */ | | */ |
| | | |
| void process_rain() | | static void process_rain(void) |
| { | | { |
| int x, y, rain; | | int x, y, rain; |
| | | |
| | |
| * What the hell, lets spin the planet backwards. | | * What the hell, lets spin the planet backwards. |
| */ | | */ |
| | | |
| void spin_globe() | | static void spin_globe(void) |
| { | | { |
| int x, y; | | int x, y; |
| int buffer_humid; | | int buffer_humid; |
| | |
| * Writes two other files that are useful for creating animations and web pages. | | * Writes two other files that are useful for creating animations and web pages. |
| */ | | */ |
| | | |
| void write_weather_images() | | static void write_weather_images(void) |
| { | | { |
| char filename[MAX_BUF]; | | char filename[MAX_BUF]; |
| FILE *fp; | | FILE *fp; |