![]() |
Crossfire Server, Trunk
1.75.0
|
Adds weather effects to the world map. More...
Data Structures | |
struct | DensityConfig |
Structure to hold density data entries. More... | |
struct | weather_avoids_t |
Defines a tile the weather system should avoid. More... | |
struct | weather_grow_t |
Defines a tile where something can grow. More... | |
struct | weather_replace_t |
Defines a tile the weather system can change to another tile. More... | |
struct | weather_settings_t |
Weather settings definition structure Stolen from the settings file, as they are unused by everything that isn't weather. More... | |
struct | weathermap_t |
This is an overlay structure of the whole world. More... | |
Macros | |
#define | BLUE 2 |
#define | EQUATOR_BASE_TEMP 30 /* C */ |
#define | GREEN 1 |
#define | GULF_STREAM_BASE_SPEED 40 /* base speed of gulf stream */ |
#define | GULF_STREAM_WIDTH 3 /* width of gulf stream */ |
#define | POLAR_BASE_TEMP 0 /* C */ |
#define | PRESSURE_AREA 180 |
#define | PRESSURE_ITERATIONS 30 |
#define | PRESSURE_MAX 1040 |
#define | PRESSURE_MIN 960 |
#define | PRESSURE_ROUNDING_FACTOR 2 |
#define | PRESSURE_ROUNDING_ITER 1 |
#define | PRESSURE_SPIKES 3 |
#define | RED 0 |
#define | SEASONAL_ADJUST 10 /* polar distance */ |
#define | SKY_BLIZZARD 16 |
#define | SKY_CLEAR 0 |
#define | SKY_FOG 7 |
#define | SKY_HAIL 8 |
#define | SKY_HEAVY_RAIN 5 |
#define | SKY_HEAVY_SNOW 15 |
#define | SKY_HURRICANE 6 |
#define | SKY_LIGHT_RAIN 3 |
#define | SKY_LIGHT_SNOW 13 /* add 10 to rain to get snow */ |
#define | SKY_LIGHTCLOUD 1 |
#define | SKY_OVERCAST 2 |
#define | SKY_RAIN 4 /* rain -> storm has lightning */ |
#define | SKY_SNOW 14 |
#define | WEATHER_NO_FLOOR 2 /* If set, we clear FLAG_IS_FLOOR */ |
#define | WEATHER_NO_SAVE 4 /* If set, we set FLAG_NO_SAVE */ |
#define | WEATHER_OVERLAY 1 /* If set, we set FLAG_OVERLAY_FLOOR */ |
Weather insert flags. More... | |
#define | WEATHERMAPTILESX 100 |
#define | WEATHERMAPTILESY 100 |
#define | WIND_FACTOR 4.0 |
This is a multiplier for the wind caused by pressure differences. More... | |
Functions | |
static object * | avoid_weather (int *const av, const mapstruct *m, const int x, const int y, int *const gs, const int grow) |
Check the current square to see if we should avoid this one for weather processing. More... | |
static void | calculate_temperature (mapstruct *m) |
Temperature is used in a lot of weather function. More... | |
void | cfweather_close () |
void | cfweather_init (Settings *settings, ServerSettings *serv) |
Weather module initialisation. More... | |
static void | change_the_world (mapstruct *const m) |
Process worldmap regrowth. More... | |
static int | check_replace_match (const object *ob, const weather_replace_t *rep_struct) |
Refactor the code to look for arch or object name as it's own code. More... | |
static void | command_weather (object *op, const char *params) |
Player is wondering about the weather. More... | |
void | compute_sky () |
Let the madness, begin. More... | |
static void | do_map_precipitation (mapstruct *const m) |
Do the precipitation for a given map. More... | |
static void | do_precipitation (mapstruct *const m, const int x, const int y, const int temp, const int sky) |
Handle adding precipitation to the map. More... | |
static int | do_water_elev_calc (mapstruct *const m, const int x, const int y, int *const water, int64_t *const elev, int *const trees) |
Do the water and elevation updates on the given map tile. More... | |
static void | do_weather_insert (mapstruct *const m, int x, int y, const archetype *at, const int8_t object_flags, uint16_t material, int insert_flags) |
Do an object insert for weather effects. More... | |
static int | get_config_tile (const int x, const int y, const mapstruct *m, const DensityConfig *list) |
Get config tile retrieves the desired tile's associated value from a given space. More... | |
static char * | get_next_field (char *line) |
Finds the start of the next field in the provided string Skips past interceding commas and spaces. More... | |
static int | humid_tile (const int x, const int y, const int dark) |
Calculate the humidity of the given weather tile. More... | |
static int | init_config_vals (const Settings *settings, const char *conf_filename, DensityConfig **list) |
Read a config file that tells how many units (for an arbitrary purpose) a given arch is worth during calculations. More... | |
static void | init_gulfstreammap () |
Initialize the gulf stream. More... | |
static void | init_humid_elev (const Settings *settings) |
Initialize humidity, water, forestry, and elevation. More... | |
static void | init_pressure () |
Reset pressure map. More... | |
static void | init_rainfall () |
Initialize rainfall. More... | |
static void | init_temperature () |
Initialize the temperature based on the time. More... | |
static int | init_weather_replace (const Settings *settings, const char *conf_filename, weather_replace_t **list) |
Load the weather replacement definitions from file. More... | |
static void | init_weather_settings (Settings *settings) |
static int | init_weatheravoid (const Settings *settings, const char *conf_filename, weather_avoids_t **wa) |
Load the weather/growth avoid defintions from file. More... | |
static void | init_wind () |
Initialize the wind randomly. More... | |
static void | let_it_snow (mapstruct *const m) |
Put or remove snow. More... | |
static int | load_humidity_map_part (mapstruct **m, const int dir, const int x, const int y, int *const tx, int *const ty) |
Method to abstract some of the mess of the humidity map. More... | |
static void | perform_pressure () |
Perform small randomizations in the pressure map. More... | |
void | perform_weather () |
This routine slowly loads the world, patches it up due to the weather, and saves it back to disk. More... | |
static void | plant_a_garden (mapstruct *const m) |
Process growth of various plants. More... | |
static void | plot_gulfstream () |
Plot the gulfstream map over the wind map. More... | |
static int | polar_distance (int x, int y, const int equator) |
Calculates the distance to the nearest pole. More... | |
void | process_rain () |
Keep track of how much rain has fallen in a given weathermap square. More... | |
static int | read_elevmap (const Settings *settings) |
Load the elevation information. More... | |
static int | read_forestrymap (const Settings *settings) |
Read the forestry map from the localdir. More... | |
static int | read_gulfstreammap (const Settings *settings) |
Read the gulf stream, or initialize it if no saved information. More... | |
static int | read_humidmap (const Settings *settings) |
Attempt to read humidity information, or barring that, read the maps and initialize elevation, humidity, water, and forestry maps. More... | |
static int | read_pressuremap (const Settings *settings) |
Read the pressure information from disk. More... | |
static int | read_rainfallmap (const Settings *settings) |
Read or initialize rainfall information. More... | |
static int | read_temperaturemap (const Settings *settings) |
Load or initialize temperature information. More... | |
static int | read_watermap (const Settings *settings) |
Load water information from localdir. More... | |
static int | read_weatherposition (const Settings *settings) |
Read the weather map position from file. More... | |
static int | read_winddirmap (const Settings *settings) |
Read the wind direction. More... | |
static int | read_windspeedmap (const Settings *settings) |
Read the wind speed. More... | |
static int | real_temperature (int x, int y, const timeofday_t *tod) |
Compute the real (adjusted) temperature of a given weathermap tile. More... | |
int | real_world_temperature (int x, int y, mapstruct *m) |
Compute the temperature for a specific square. More... | |
static void | singing_in_the_rain (mapstruct *const m) |
Process rain. More... | |
static void | smooth_pressure () |
This code simply smooths the pressure map. More... | |
static void | smooth_wind () |
It doesn't really smooth it as such. More... | |
static void | spin_globe () |
The world spinning drags the weather with it. More... | |
static void | temperature_calc (const int x, const int y, const timeofday_t *tod) |
Calculate temperature of a spot. More... | |
void | tick_weather () |
Do the weather calculations in order. More... | |
static void | update_humid () |
Update the humidity for all weathermap tiles. More... | |
static int | weather_clock_listener (int *type,...) |
Global clock event handling for weather. More... | |
static void | weather_effect (mapstruct *const m) |
Perform actual effect of weather. More... | |
static int | weather_listener (int *type,...) |
Global event handling for weather. More... | |
static int | weather_object_listener (int *type,...) |
Global object-process handling for weather. More... | |
static char * | weathermap_to_worldmap_corner (const int wx, const int wy, int *const x, int *const y, const int dir, char *const buffer, const int bufsize) |
Return the path of the map in specified direction. More... | |
static uint8_t | wind_blow_object (mapstruct *const m, const int x, const int y, const MoveType move_type, int32_t wt, const living *stats) |
Calculate the direction to push an object from wind. More... | |
static int | worldmap_to_weathermap (const int x, const int y, int *const wx, int *const wy, mapstruct *const m) |
Convert coordinates from world map to weather tiles. More... | |
static int | write_elevmap (const Settings *settings) |
Save the average elevation information to localdir. More... | |
static int | write_forestrymap (const Settings *settings) |
Write the forestry map to the localdir. More... | |
int | write_gulfstreammap (const Settings *settings) |
Save the gulf stream to localdir. More... | |
int | write_humidmap (const Settings *settings) |
Save humidity information to localdir. More... | |
int | write_pressuremap (const Settings *settings) |
Save pressure information to localdir. More... | |
int | write_rainfallmap (const Settings *settings) |
Save rainfall information to localdir. More... | |
int | write_skymap (void) |
Write the sky map. More... | |
int | write_temperaturemap (const Settings *settings) |
Save temperature information to localdir. More... | |
static int | write_watermap (const Settings *settings) |
Save water percent information to localdir. More... | |
int | write_weather_images () |
Dump all the weather data as an image. More... | |
int | write_winddirmap (const Settings *settings) |
Save wind direction to localdir. More... | |
int | write_windspeedmap (const Settings *settings) |
Save the wind speed to localdir. More... | |
Variables | |
int | weather_replace_t::arch_or_name |
If set, tile matches the archetype name, else the object's name. More... | |
int32_t | weathermap_t::avgelev |
Average elevation. More... | |
static command_registration | command_handler = 0 |
uint8_t | weathermap_t::darkness |
Indicates level of darkness of map. More... | |
static const uint32_t | directions [] |
Colours used for wind directions. More... | |
archetype * | weather_replace_t::doublestack_arch |
If set, this other archetype will be added atop special_snow. More... | |
uint16_t | weather_settings_t::dynamiclevel |
How dynamic is the world? More... | |
int | weather_grow_t::elevmax |
Maximum elevation for herb to grow. More... | |
int | weather_grow_t::elevmin |
Minimum elevation for herb to grow. More... | |
DensityConfig * | forest_list = NULL |
int8_t | weathermap_t::forestry |
Range of forestedness. More... | |
static event_registration | global_clock_handler = 0 |
static event_registration | global_map_handler = 0 |
static event_registration | global_mapload_handler = 0 |
static event_registration | global_object_handler = 0 |
weather_avoids_t * | growth_avoids = NULL |
static int | gulf_stream_dir [GULF_STREAM_WIDTH][WEATHERMAPTILESY] |
Direction of the gulf stream. More... | |
static int | gulf_stream_direction |
static int | gulf_stream_speed [GULF_STREAM_WIDTH][WEATHERMAPTILESY] |
Gulf stream variables. More... | |
static int | gulf_stream_start |
const char * | weather_grow_t::herb |
Arch name of item to grow. More... | |
int | weather_grow_t::humax |
Maximum humidity for herb to grow. More... | |
int8_t | weathermap_t::humid |
Humitidy of this tile. More... | |
int | weather_grow_t::humin |
Minimum humidity for herb to grow. More... | |
int | DensityConfig::is_obj |
sstring | DensityConfig::name |
sstring | weather_avoids_t::name |
Tile archetype name. More... | |
DensityConfig * | DensityConfig::next |
weather_avoids_t * | weather_avoids_t::next |
The next item in the avoid list. More... | |
weather_replace_t * | weather_replace_t::next |
The next item in the replace list. More... | |
int16_t | weathermap_t::pressure |
Barometric pressure (mb). More... | |
uint32_t | weathermap_t::rainfall |
Cumulative rainfall. More... | |
int | weather_grow_t::random |
Random apparition factor. More... | |
int16_t | weathermap_t::realtemp |
Temperature at a given calculation step for this tile. More... | |
float | weather_grow_t::rfmax |
Maximum rainfall for herb to grow (inches/day). More... | |
float | weather_grow_t::rfmin |
Minimum rainfall for herb to grow (inches/day). More... | |
int | weather_grow_t::season |
Season the herb can grow. More... | |
static const int | season_tempchange [HOURS_PER_DAY] |
How to alter the temperature, based on the hour of the day. More... | |
static const uint32_t | skies [] |
Colours used for weather types. More... | |
int8_t | weathermap_t::sky |
Sky conditions. More... | |
int | weather_avoids_t::snow |
Is this a long-term weather effect, like snow or a puddle? Used for various tests. More... | |
archetype * | weather_replace_t::special_snow |
The archetype name of the tile to place over specified tile. More... | |
int16_t | weathermap_t::temp |
Base temperature of this tile (F). More... | |
int | weather_grow_t::tempmax |
Maximum temperature for herb to grow. More... | |
int | weather_grow_t::tempmin |
Minimum temperature for herb to grow. More... | |
sstring | weather_replace_t::tile |
Tile archetype or object name. More... | |
const char * | weather_grow_t::tile |
Arch tile to grow on, NULL if anything. More... | |
unsigned long | todtick |
Game world time, in in-game hours. More... | |
int | DensityConfig::value_density |
int8_t | weathermap_t::water |
-100 - 100 percentage of water tiles. More... | |
DensityConfig * | water_list = NULL |
weather_avoids_t * | weather_avoids = NULL |
weather_replace_t * | weather_evaporate = NULL |
static const weather_grow_t | weather_grow [] |
The table below is used to grow things on the map. More... | |
weather_replace_t * | weather_replace = NULL |
weather_replace_t * | weather_snowmelt = NULL |
static const weather_grow_t | weather_tile [] |
The table below uses the same format as the one above. More... | |
weathermap_t ** | weathermap |
int8_t | weathermap_t::winddir |
Direction of wind. More... | |
int8_t | weathermap_t::windspeed |
Windspeed of this tile. More... | |
static int | wmperformstartx |
Current weather tile position. More... | |
static int | wmperformstarty |
Current weather tile position. More... | |
uint32_t | weather_settings_t::worldmaptilesizex |
Number of squares wide in a wm tile. More... | |
uint32_t | weather_settings_t::worldmaptilesizey |
Number of squares high in a wm tile. More... | |
static weather_settings_t | wset |
Adds weather effects to the world map.
#define BLUE 2 |
Definition at line 3499 of file cfweather.cpp.
#define EQUATOR_BASE_TEMP 30 /* C */ |
Definition at line 34 of file cfweather.cpp.
#define GREEN 1 |
Definition at line 3498 of file cfweather.cpp.
#define GULF_STREAM_BASE_SPEED 40 /* base speed of gulf stream */ |
Definition at line 37 of file cfweather.cpp.
#define GULF_STREAM_WIDTH 3 /* width of gulf stream */ |
Definition at line 36 of file cfweather.cpp.
#define POLAR_BASE_TEMP 0 /* C */ |
Definition at line 33 of file cfweather.cpp.
#define PRESSURE_AREA 180 |
Definition at line 41 of file cfweather.cpp.
#define PRESSURE_ITERATIONS 30 |
Definition at line 40 of file cfweather.cpp.
#define PRESSURE_MAX 1040 |
Definition at line 45 of file cfweather.cpp.
#define PRESSURE_MIN 960 |
Definition at line 46 of file cfweather.cpp.
#define PRESSURE_ROUNDING_FACTOR 2 |
Definition at line 42 of file cfweather.cpp.
#define PRESSURE_ROUNDING_ITER 1 |
Definition at line 43 of file cfweather.cpp.
#define PRESSURE_SPIKES 3 |
Definition at line 44 of file cfweather.cpp.
#define RED 0 |
Definition at line 3497 of file cfweather.cpp.
#define SEASONAL_ADJUST 10 /* polar distance */ |
Definition at line 35 of file cfweather.cpp.
#define SKY_BLIZZARD 16 |
Definition at line 63 of file cfweather.cpp.
#define SKY_CLEAR 0 |
Definition at line 49 of file cfweather.cpp.
#define SKY_FOG 7 |
Definition at line 57 of file cfweather.cpp.
#define SKY_HAIL 8 |
Definition at line 58 of file cfweather.cpp.
#define SKY_HEAVY_RAIN 5 |
Definition at line 54 of file cfweather.cpp.
#define SKY_HEAVY_SNOW 15 |
Definition at line 62 of file cfweather.cpp.
#define SKY_HURRICANE 6 |
Definition at line 55 of file cfweather.cpp.
#define SKY_LIGHT_RAIN 3 |
Definition at line 52 of file cfweather.cpp.
Definition at line 60 of file cfweather.cpp.
#define SKY_LIGHTCLOUD 1 |
Definition at line 50 of file cfweather.cpp.
#define SKY_OVERCAST 2 |
Definition at line 51 of file cfweather.cpp.
#define SKY_RAIN 4 /* rain -> storm has lightning */ |
Definition at line 53 of file cfweather.cpp.
#define SKY_SNOW 14 |
Definition at line 61 of file cfweather.cpp.
#define WEATHER_NO_FLOOR 2 /* If set, we clear FLAG_IS_FLOOR */ |
Definition at line 618 of file cfweather.cpp.
#define WEATHER_NO_SAVE 4 /* If set, we set FLAG_NO_SAVE */ |
Definition at line 619 of file cfweather.cpp.
#define WEATHER_OVERLAY 1 /* If set, we set FLAG_OVERLAY_FLOOR */ |
Weather insert flags.
Definition at line 617 of file cfweather.cpp.
#define WEATHERMAPTILESX 100 |
Definition at line 75 of file cfweather.cpp.
#define WEATHERMAPTILESY 100 |
Definition at line 76 of file cfweather.cpp.
#define WIND_FACTOR 4.0 |
This is a multiplier for the wind caused by pressure differences.
The type of overal climate you get depends on this. Too little wind, and the rain hugs the coast. Too much wind, and there are hurricanes and blizzards everywhere. 1 is too little.
Definition at line 72 of file cfweather.cpp.
|
static |
Check the current square to see if we should avoid this one for weather processing.
[out] | av | will contain how many tiles should be avoided. Mustn't be NULL. |
m | map to process. | |
x | ||
y | coordinates to process. | |
[out] | gs | will contain how many snow/rain tiles are here. Mustn't be NULL. |
grow | if 1, use the growth table, rather than the avoidance table. |
Definition at line 533 of file cfweather.cpp.
References object::above, object::arch, FLAG_IS_FLOOR, GET_MAP_OB, growth_avoids, m, M_ICE, M_LIQUID, object::material, weather_avoids_t::name, archetype::name, weather_avoids_t::next, QUERY_FLAG, weather_avoids_t::snow, and weather_avoids.
Referenced by change_the_world(), let_it_snow(), plant_a_garden(), and singing_in_the_rain().
|
static |
Temperature is used in a lot of weather function.
This need to be precalculated before used.
m | map for which to calculate the temperature. Must be a world map. |
Definition at line 1428 of file cfweather.cpp.
References m, real_world_temperature(), weathermap_t::realtemp, weathermap, worldmap_to_weathermap(), weather_settings_t::worldmaptilesizex, weather_settings_t::worldmaptilesizey, and wset.
Referenced by weather_effect().
void cfweather_close | ( | ) |
Definition at line 4930 of file cfweather.cpp.
References command_handler, command_unregister(), EVENT_CLOCK, EVENT_MAPREADY, EVENT_TIME, events_unregister_global_handler(), forest_list, FREE_AND_CLEAR, free_string(), global_clock_handler, global_map_handler, global_object_handler, growth_avoids, DensityConfig::name, weather_avoids_t::name, DensityConfig::next, weather_avoids_t::next, weather_replace_t::next, weather_replace_t::tile, water_list, weather_avoids, weather_evaporate, weather_replace, weather_snowmelt, weathermap, and WEATHERMAPTILESX.
void cfweather_init | ( | Settings * | settings, |
ServerSettings * | serv | ||
) |
Weather module initialisation.
settings | server settings. |
Definition at line 4824 of file cfweather.cpp.
References command_handler, command_register(), COMMAND_TYPE_NORMAL, command_weather(), compute_sky(), ServerSettings::disabled_plugins, weather_settings_t::dynamiclevel, EVENT_CLOCK, EVENT_MAPREADY, EVENT_TIME, events_register_global_handler(), fatal(), forest_list, global_clock_handler, global_map_handler, global_object_handler, growth_avoids, gulf_stream_dir, gulf_stream_direction, GULF_STREAM_WIDTH, init_config_vals(), init_weather_replace(), init_weather_settings(), init_weatheravoid(), llevDebug, llevInfo, LOG(), OUT_OF_MEMORY, read_elevmap(), read_forestrymap(), read_gulfstreammap(), read_humidmap(), read_pressuremap(), read_rainfallmap(), read_temperaturemap(), read_watermap(), read_weatherposition(), read_winddirmap(), read_windspeedmap(), rndm(), settings, water_list, weather_avoids, weather_clock_listener(), weather_evaporate, weather_listener(), weather_object_listener(), weather_replace, weather_snowmelt, weathermap, WEATHERMAPTILESX, WEATHERMAPTILESY, Settings::worldmapstartx, Settings::worldmapstarty, weather_settings_t::worldmaptilesizex, Settings::worldmaptilesx, Settings::worldmaptilesy, and wset.
|
static |
Process worldmap regrowth.
This should be called from weather_effect().
m | map we are currently processing. |
Definition at line 2072 of file cfweather.cpp.
References object::above, object::arch, avoid_weather(), d, days, do_weather_insert(), find_archetype(), is_valid_types_gen::found, freearr_x, freearr_y, GET_MAP_OB, weather_grow_t::herb, HOURS_PER_DAY, INS_ABOVE_FLOOR_ONLY, INS_NO_MERGE, INS_NO_WALK_ON, INS_ON_TOP, m, archetype::name, object_free(), object_remove(), OUT_OF_REAL_MAP, weathermap_t::rainfall, weathermap_t::realtemp, weather_grow_t::rfmin, rndm(), weathermap_t::sky, weather_grow_t::tile, todtick, weather_tile, weathermap, worldmap_to_weathermap(), weather_settings_t::worldmaptilesizex, weather_settings_t::worldmaptilesizey, and wset.
Referenced by weather_effect().
|
static |
Refactor the code to look for arch or object name as it's own code.
Since we are using shared strings to store our arch/object names, we can simply use pointer arithmetic in order to compare.
ob | The external object we are checking Should not be NULL |
rep_struct | The weather_replace struct we are looking at. Should not be NULL |
Definition at line 601 of file cfweather.cpp.
References object::arch, weather_replace_t::arch_or_name, object::name, archetype::name, and weather_replace_t::tile.
Referenced by let_it_snow(), and singing_in_the_rain().
|
static |
Player is wondering about the weather.
op | player asking for information. |
params | unused. |
Definition at line 4638 of file cfweather.cpp.
References buf, draw_ext_info, draw_ext_info_format(), weather_settings_t::dynamiclevel, FLAG_WIZ, object::map, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_WEATHER, NDI_UNIQUE, QUERY_FLAG, real_world_temperature(), weathermap_t::sky, SKY_BLIZZARD, SKY_CLEAR, SKY_FOG, SKY_HAIL, SKY_HEAVY_RAIN, SKY_HEAVY_SNOW, SKY_HURRICANE, SKY_LIGHT_RAIN, SKY_LIGHT_SNOW, SKY_LIGHTCLOUD, SKY_OVERCAST, SKY_RAIN, SKY_SNOW, weathermap, worldmap_to_weathermap(), wset, object::x, and object::y.
Referenced by cfweather_init().
void compute_sky | ( | ) |
Let the madness, begin.
This function is the one that ties everything together. Here we loop over all the weathermaps, and compare the various conditions we have calculated up to now, to figure out what the sky conditions are for each square.
Definition at line 1101 of file cfweather.cpp.
References get_tod(), MAX, MIN, PRESSURE_MAX, PRESSURE_MIN, real_temperature(), weathermap_t::sky, SKY_FOG, SKY_HAIL, SKY_HURRICANE, SKY_LIGHT_RAIN, weathermap, WEATHERMAPTILESX, and WEATHERMAPTILESY.
Referenced by cfweather_init(), and perform_weather().
|
static |
Do the precipitation for a given map.
m | The map we wish to process. |
Definition at line 1559 of file cfweather.cpp.
References do_precipitation(), m, real_world_temperature(), weathermap_t::realtemp, weathermap_t::sky, weathermap, and worldmap_to_weathermap().
Referenced by weather_listener().
|
static |
Handle adding precipitation to the map.
m | The map we are acting on. |
x,y | The coordinates on the map we are handling. |
temp | The temperature at the tile we are handling. |
sky | The current sky conditions. |
Definition at line 1481 of file cfweather.cpp.
References object::above, object::arch, do_weather_insert(), find_archetype(), find_string(), GET_MAP_OB, INS_NO_MERGE, INS_NO_WALK_ON, INS_ON_TOP, m, archetype::name, object_free(), object_remove(), rndm(), SKY_BLIZZARD, SKY_HEAVY_RAIN, SKY_HEAVY_SNOW, SKY_HURRICANE, SKY_LIGHT_RAIN, SKY_LIGHT_SNOW, SKY_RAIN, SKY_SNOW, sstring, and WEATHER_NO_SAVE.
Referenced by do_map_precipitation(), and singing_in_the_rain().
|
static |
Do the water and elevation updates on the given map tile.
m | The map we are working on |
x | |
y | The x,y coordinates we are handling for the current space. |
water | Pointer to a water count variable. Will be updated by this function. |
elev | Pointer to an elevation sum variable. Will be updated by this function. |
trees | Pointer to a forestry sum variable. Will be updated by this function. |
Definition at line 2711 of file cfweather.cpp.
References object::elevation, FLAG_IS_WATER, forest_list, get_config_tile(), GET_MAP_OB, m, QUERY_FLAG, and water_list.
Referenced by init_humid_elev().
|
static |
Do an object insert for weather effects.
m | The map to insert the weather effect on. Must not be NULL. |
x | |
y | The location to insert the object at. |
at | The archetype to create an object from. |
object_flags | If first bit is 1, sets FLAG_OVERLAY_FLOOR on the created object. If second bit is 1, clears FLAG_IS_FLOOR. If third bit is 1, sets FLAG_NO_SAVE. Used for precipitation. |
material | The material of the object. If 0, will skip setting the material |
insert_flags | The flags to pass to object_insert_in_map |
Definition at line 647 of file cfweather.cpp.
References CLEAR_FLAG, archetype::clone, FLAG_IS_FLOOR, FLAG_NO_SAVE, FLAG_OVERLAY_FLOOR, m, object::material, object_copy(), object_insert_in_map(), object_new(), SET_FLAG, WEATHER_NO_FLOOR, WEATHER_NO_SAVE, WEATHER_OVERLAY, object::x, and object::y.
Referenced by change_the_world(), do_precipitation(), let_it_snow(), plant_a_garden(), and singing_in_the_rain().
|
static |
Get config tile retrieves the desired tile's associated value from a given space.
This can be used for trees, deserts, water, anything of the sort.
x | |
y | The coordinates on the map we wish to check |
m | The map the coordinates belong to. |
list | The list we are pulling from. This allows us to use the same code for denoting water as for denoting trees. |
Definition at line 416 of file cfweather.cpp.
References object::above, object::arch, GET_MAP_OB, DensityConfig::is_obj, list, m, DensityConfig::name, object::name, archetype::name, DensityConfig::next, and DensityConfig::value_density.
Referenced by do_water_elev_calc(), and real_world_temperature().
|
static |
Finds the start of the next field in the provided string Skips past interceding commas and spaces.
Used in all the config initializations, but not the weathermap initializations
line | The line to process. We will null terminate the end of the current field directly here, so we must pass as non-const. |
Definition at line 680 of file cfweather.cpp.
References is_valid_types_gen::line.
Referenced by init_config_vals(), init_weather_replace(), and init_weatheravoid().
|
static |
Calculate the humidity of the given weather tile.
x | |
y | weathermap coordinates we wish to calculate humidity for. |
dark | The darkness amount on the world. Presumably from get_world_darkness(). |
Definition at line 1202 of file cfweather.cpp.
References weathermap_t::humid, MAX, MAX_DARKNESS, rndm(), SKY_BLIZZARD, SKY_CLEAR, SKY_FOG, SKY_HAIL, SKY_HEAVY_RAIN, SKY_HEAVY_SNOW, SKY_HURRICANE, SKY_LIGHT_RAIN, SKY_LIGHT_SNOW, SKY_LIGHTCLOUD, SKY_OVERCAST, SKY_RAIN, SKY_SNOW, weathermap_t::water, weathermap, WEATHERMAPTILESX, WEATHERMAPTILESY, and weathermap_t::windspeed.
Referenced by update_humid().
|
static |
Read a config file that tells how many units (for an arbitrary purpose) a given arch is worth during calculations.
By defining in a file, we get our structure to be non-static, so we can do pointer comparisons on the object name or arch rather than string comparisons on the name.
settings | Pointer to the settings structure, so we can get the directory where the config is stored. |
conf_filename | The name of the config file we are loading. |
list | Pointer to the list we are appending entries to. |
Definition at line 2386 of file cfweather.cpp.
References add_string(), bufferreader_current_line(), bufferreader_destroy(), bufferreader_init_from_file(), bufferreader_next_line(), Settings::confdir, fatal(), is_valid_types_gen::found, get_next_field(), DensityConfig::is_obj, is_valid_types_gen::line, list, llevError, LOG(), MAX_BUF, name, DensityConfig::name, DensityConfig::next, OUT_OF_MEMORY, settings, and DensityConfig::value_density.
Referenced by cfweather_init().
|
static |
Initialize the gulf stream.
Definition at line 2909 of file cfweather.cpp.
References dirdiff(), GULF_STREAM_BASE_SPEED, gulf_stream_dir, gulf_stream_direction, gulf_stream_speed, gulf_stream_start, GULF_STREAM_WIDTH, rndm(), WEATHERMAPTILESX, and WEATHERMAPTILESY.
Referenced by read_gulfstreammap().
|
static |
Initialize humidity, water, forestry, and elevation.
This is a fairly expensive operation, so we only do this if the elevation map is not already existant.
settings | Pointer to the settings structure. We use multiple values from it. |
Definition at line 2742 of file cfweather.cpp.
References weathermap_t::avgelev, delete_map(), do_water_elev_calc(), weathermap_t::forestry, weathermap_t::humid, load_humidity_map_part(), m, MAX, MIN, settings, update_humid(), weathermap_t::water, weathermap, WEATHERMAPTILESX, WEATHERMAPTILESY, weather_settings_t::worldmaptilesizex, weather_settings_t::worldmaptilesizey, Settings::worldmaptilesx, Settings::worldmaptilesy, and wset.
Referenced by read_humidmap().
|
static |
Reset pressure map.
Sets the whole map to 1013 mbar, then adds some disturbances in two different ways.
Definition at line 3008 of file cfweather.cpp.
References weathermap_t::pressure, PRESSURE_AREA, PRESSURE_ITERATIONS, PRESSURE_MAX, PRESSURE_MIN, PRESSURE_SPIKES, rndm(), smooth_pressure(), weathermap, WEATHERMAPTILESX, and WEATHERMAPTILESY.
Referenced by read_pressuremap().
|
static |
Initialize rainfall.
Appears to just give a very rough estimate of rainfall amounts. Could probably be better, but should be fine despite this.
Definition at line 2878 of file cfweather.cpp.
References days, HOURS_PER_DAY, weathermap_t::rainfall, todtick, weathermap, WEATHERMAPTILESX, and WEATHERMAPTILESY.
Referenced by read_rainfallmap().
|
static |
Initialize the temperature based on the time.
This is actually used at every recalculation step, too. Calls temperature_calc to do the heavy lifting.
Definition at line 2861 of file cfweather.cpp.
References get_tod(), temperature_calc(), WEATHERMAPTILESX, and WEATHERMAPTILESY.
Referenced by read_temperaturemap(), and tick_weather().
|
static |
Load the weather replacement definitions from file.
settings | The settings structure we wish to use for install paths. We want confdir specifically for this one. |
conf_filename | The name of the file we are loading. |
list | pointer to a list to link elements of the weatheravoid to. |
Definition at line 2553 of file cfweather.cpp.
References add_string(), weather_replace_t::arch_or_name, bufferreader_current_line(), bufferreader_destroy(), bufferreader_init_from_file(), bufferreader_next_line(), Settings::confdir, weather_replace_t::doublestack_arch, fatal(), find_archetype(), is_valid_types_gen::found, get_next_field(), is_valid_types_gen::line, list, llevError, LOG(), MAX_BUF, name, weather_replace_t::next, OUT_OF_MEMORY, settings, weather_replace_t::special_snow, and weather_replace_t::tile.
Referenced by cfweather_init().
|
static |
Definition at line 3045 of file cfweather.cpp.
References buf, Settings::confdir, weather_settings_t::dynamiclevel, llevError, LOG(), MAX_BUF, settings, strcasecmp(), weather_settings_t::worldmaptilesizex, weather_settings_t::worldmaptilesizey, and wset.
Referenced by cfweather_init().
|
static |
Load the weather/growth avoid defintions from file.
settings | The settings structure we wish to use for install paths. We want confdir specifically for this one. |
conf_filename | The name of the file we are loading. |
wa | pointer to a list to link elements of the weatheravoid to. |
Definition at line 2471 of file cfweather.cpp.
References add_string(), bufferreader_current_line(), bufferreader_destroy(), bufferreader_init_from_file(), bufferreader_next_line(), Settings::confdir, fatal(), is_valid_types_gen::found, get_next_field(), is_valid_types_gen::line, llevError, LOG(), MAX_BUF, name, weather_avoids_t::name, weather_avoids_t::next, OUT_OF_MEMORY, settings, and weather_avoids_t::snow.
Referenced by cfweather_init().
|
static |
Initialize the wind randomly.
Does both direction and speed in one pass
Values for speed are fairly low – the calculations for wind are built in a way where this is not a problem.
Definition at line 2991 of file cfweather.cpp.
References rndm(), weathermap, WEATHERMAPTILESX, WEATHERMAPTILESY, weathermap_t::winddir, and weathermap_t::windspeed.
Referenced by read_winddirmap().
|
static |
Put or remove snow.
This should be called from weather_effect().
m | map we are currently processing. Must be a world map. |
Definition at line 1582 of file cfweather.cpp.
References above, object::above, object::arch, avoid_weather(), object::below, check_replace_match(), d, do_weather_insert(), find_archetype(), find_string(), FLAG_IS_FLOOR, is_valid_types_gen::found, freearr_x, freearr_y, GET_MAP_OB, INS_ABOVE_FLOOR_ONLY, INS_NO_MERGE, INS_NO_WALK_ON, INS_ON_TOP, m, M_ICE, M_LIQUID, object::name, archetype::name, weather_replace_t::next, object_free(), object_remove(), OUT_OF_REAL_MAP, QUERY_FLAG, weathermap_t::realtemp, rndm(), weathermap_t::sky, SKY_FOG, SKY_HEAVY_SNOW, SKY_LIGHT_SNOW, SKY_OVERCAST, sstring, strcasecmp(), WEATHER_NO_FLOOR, WEATHER_NO_SAVE, WEATHER_OVERLAY, weather_replace, weather_snowmelt, weathermap, worldmap_to_weathermap(), weather_settings_t::worldmaptilesizex, weather_settings_t::worldmaptilesizey, and wset.
Referenced by weather_effect().
|
static |
Method to abstract some of the mess of the humidity map.
Loads a specific corner of the map based on dir.
dir | The map corner to handle. Should be one of 2, 4, 6, or 8. |
x | |
y | The x,y coordinates of the weather map we are handling. |
tx | |
ty | Pointers to the coordinates on the map we are loading. The looping structure needs these. |
Definition at line 2668 of file cfweather.cpp.
References load_overlay_map(), m, mapfile_load(), MAX_BUF, and weathermap_to_worldmap_corner().
Referenced by init_humid_elev().
|
static |
Perform small randomizations in the pressure map.
Then, apply the smoothing algorithim.. This causes the pressure to change very slowly
Definition at line 827 of file cfweather.cpp.
References weathermap_t::humid, weathermap_t::pressure, PRESSURE_SPIKES, rndm(), smooth_pressure(), weathermap, WEATHERMAPTILESX, and WEATHERMAPTILESY.
Referenced by tick_weather().
void perform_weather | ( | ) |
This routine slowly loads the world, patches it up due to the weather, and saves it back to disk.
In this way, the world constantly feels the effects of weather uniformly, without relying on players wandering.
The main point of this is stuff like growing herbs, soil, decaying crap, etc etc etc. Not actual weather, but weather effects.
Definition at line 2248 of file cfweather.cpp.
References compute_sky(), delete_map(), weather_settings_t::dynamiclevel, llevError, Settings::localdir, LOG(), m, MAP_IN_MEMORY, MAX_BUF, players_on_map(), ready_map_name(), save_map(), SAVE_MODE_OVERLAY, settings, TRUE, weather_effect(), wmperformstartx, wmperformstarty, Settings::worldmapstartx, Settings::worldmapstarty, Settings::worldmaptilesx, Settings::worldmaptilesy, and wset.
Referenced by weather_clock_listener().
|
static |
Process growth of various plants.
This should be called from weather_effect().
m | map we are currently processing. |
Definition at line 1973 of file cfweather.cpp.
References above, object::above, object::arch, avoid_weather(), days, do_weather_insert(), find_archetype(), is_valid_types_gen::found, GET_MAP_OB, weather_grow_t::herb, HOURS_PER_DAY, INS_ABOVE_FLOOR_ONLY, INS_NO_MERGE, INS_NO_WALK_ON, m, MIN, archetype::name, object_free(), object_remove(), weathermap_t::rainfall, weathermap_t::realtemp, weather_grow_t::rfmin, rndm(), weathermap_t::sky, weather_grow_t::tile, todtick, weather_grow, WEATHER_OVERLAY, weathermap, worldmap_to_weathermap(), weather_settings_t::worldmaptilesizex, weather_settings_t::worldmaptilesizey, and wset.
Referenced by weather_effect().
|
static |
Plot the gulfstream map over the wind map.
This is done after the wind, to avoid the windsmoothing scrambling the jet stream.
Definition at line 1304 of file cfweather.cpp.
References dirdiff(), GULF_STREAM_BASE_SPEED, gulf_stream_dir, gulf_stream_direction, gulf_stream_speed, gulf_stream_start, GULF_STREAM_WIDTH, rndm(), similar_direction(), weathermap, WEATHERMAPTILESX, WEATHERMAPTILESY, weathermap_t::winddir, and weathermap_t::windspeed.
Referenced by tick_weather().
|
static |
Calculates the distance to the nearest pole.
x | |
y | weathermap coordinates. |
equator | current location of the equator. |
Definition at line 384 of file cfweather.cpp.
References WEATHERMAPTILESX, and WEATHERMAPTILESY.
Referenced by temperature_calc().
void process_rain | ( | ) |
Keep track of how much rain has fallen in a given weathermap square.
This is called at the beginning of every in-game hour (tod.minute == 0) To make some amount of sampling effect out of totals.
Definition at line 1400 of file cfweather.cpp.
References weathermap_t::rainfall, weathermap_t::sky, SKY_FOG, SKY_LIGHT_SNOW, SKY_OVERCAST, weathermap, WEATHERMAPTILESX, and WEATHERMAPTILESY.
Referenced by weather_clock_listener().
|
static |
Load the elevation information.
Does not attempt to initalize elevation, since humidity should have tried to do that already.
settings | The settings information structure we wish to use. Specifically, we grab localdir from it |
Definition at line 3906 of file cfweather.cpp.
References weathermap_t::avgelev, bufferreader_data(), bufferreader_destroy(), bufferreader_init_from_file(), llevDebug, llevError, Settings::localdir, LOG(), MAX, MAX_BUF, MIN, settings, weathermap, WEATHERMAPTILESX, and WEATHERMAPTILESY.
Referenced by cfweather_init().
|
static |
Read the forestry map from the localdir.
The forestry map contains the measure of how forested a given weather map tile is. The values of each tree tile are defined in the forestry data (and initialized in init_config_vals(), and the values read here are calculated at the same time as humidity, water, and elevation. Here we merely read the resultant values in.
settings | Pointer to the Settings structure that designates where different install directories are located. In this case, we care about localdir. |
Definition at line 3779 of file cfweather.cpp.
References bufferreader_data(), bufferreader_destroy(), bufferreader_init_from_file(), weathermap_t::forestry, llevDebug, llevError, Settings::localdir, LOG(), MAX, MAX_BUF, MIN, settings, weathermap, WEATHERMAPTILESX, and WEATHERMAPTILESY.
Referenced by cfweather_init().
|
static |
Read the gulf stream, or initialize it if no saved information.
settings | The settings structure we use to locate config folders. Here we want localdir specifically. |
Definition at line 4142 of file cfweather.cpp.
References bufferreader_data(), bufferreader_destroy(), bufferreader_init_from_file(), gulf_stream_dir, gulf_stream_speed, gulf_stream_start, GULF_STREAM_WIDTH, in, init_gulfstreammap(), llevDebug, llevError, llevInfo, Settings::localdir, LOG(), MAX, MAX_BUF, MIN, rndm(), settings, WEATHERMAPTILESY, and write_gulfstreammap().
Referenced by cfweather_init().
|
static |
Attempt to read humidity information, or barring that, read the maps and initialize elevation, humidity, water, and forestry maps.
Must be called before attempting to read elevation, humidity, water, or forestry, as those all do not attempt initialization if they cannot find their file to read from.
settings | The settings structure. We use this for localdir and to pass to initialization if needed. |
Definition at line 3842 of file cfweather.cpp.
References bufferreader_data(), bufferreader_destroy(), bufferreader_init_from_file(), weathermap_t::humid, init_humid_elev(), llevDebug, llevError, llevInfo, Settings::localdir, LOG(), MAX, MAX_BUF, MIN, settings, weathermap, WEATHERMAPTILESX, WEATHERMAPTILESY, write_elevmap(), write_forestrymap(), write_humidmap(), and write_watermap().
Referenced by cfweather_init().
|
static |
Read the pressure information from disk.
If it doesn't exist, initialize pressure.
settings | Pointer to the settings structure so we can reach localdir |
Definition at line 4357 of file cfweather.cpp.
References bufferreader_data(), bufferreader_destroy(), bufferreader_init_from_file(), init_pressure(), llevDebug, llevError, llevInfo, Settings::localdir, LOG(), MAX, MAX_BUF, MIN, weathermap_t::pressure, PRESSURE_MAX, PRESSURE_MIN, settings, weathermap, WEATHERMAPTILESX, WEATHERMAPTILESY, and write_pressuremap().
Referenced by cfweather_init().
|
static |
Read or initialize rainfall information.
Initialization depends on humidity, so it must be called after humidity is initialized.
settings | The settings structure we use to locate config folders. Here we want localdir specifically. |
Definition at line 4085 of file cfweather.cpp.
References bufferreader_data(), bufferreader_destroy(), bufferreader_init_from_file(), init_rainfall(), llevDebug, llevError, llevInfo, Settings::localdir, LOG(), MAX_BUF, settings, weathermap, WEATHERMAPTILESX, WEATHERMAPTILESY, and write_rainfallmap().
Referenced by cfweather_init().
|
static |
Load or initialize temperature information.
Depends on water info, so must be initialized after humidity.
settings | The settings structure we're using. |
Definition at line 4023 of file cfweather.cpp.
References bufferreader_data(), bufferreader_destroy(), bufferreader_init_from_file(), init_temperature(), llevDebug, llevError, llevInfo, Settings::localdir, LOG(), MAX, MAX_BUF, MIN, settings, weathermap_t::temp, weathermap, WEATHERMAPTILESX, WEATHERMAPTILESY, and write_temperaturemap().
Referenced by cfweather_init().
|
static |
Load water information from localdir.
Since This requires us to look at all the map pieces, it should be initialized by the humidity code before we reach here.
settings | The settings structure. We specifically want localdir. |
Definition at line 3965 of file cfweather.cpp.
References bufferreader_data(), bufferreader_destroy(), bufferreader_init_from_file(), llevDebug, llevError, Settings::localdir, LOG(), MAX, MAX_BUF, MIN, settings, weathermap_t::water, weathermap, WEATHERMAPTILESX, and WEATHERMAPTILESY.
Referenced by cfweather_init().
|
static |
Read the weather map position from file.
settings | A pointer to the settings structure. We actually use a couple of these instead of just localdir. |
Definition at line 4419 of file cfweather.cpp.
References bufferreader_data(), bufferreader_destroy(), bufferreader_init_from_file(), llevDebug, llevError, Settings::localdir, LOG(), MAX_BUF, settings, wmperformstartx, wmperformstarty, Settings::worldmaptilesx, and Settings::worldmaptilesy.
Referenced by cfweather_init().
|
static |
Read the wind direction.
Will initialize the entirety of wind if file doesn't exist.
settings | The settings structure we will use to find localdir |
Definition at line 4293 of file cfweather.cpp.
References bufferreader_data(), bufferreader_destroy(), bufferreader_init_from_file(), d, init_wind(), llevDebug, llevError, llevInfo, Settings::localdir, LOG(), MAX_BUF, rndm(), settings, weathermap, WEATHERMAPTILESX, WEATHERMAPTILESY, weathermap_t::winddir, write_winddirmap(), and write_windspeedmap().
Referenced by cfweather_init().
|
static |
Read the wind speed.
We do not init here, since winddir should have handled that already. Depends on wind direction loading having been run before it as a result.
settings | Pointer to the settings structure. We want localdir from it. |
Definition at line 4238 of file cfweather.cpp.
References bufferreader_data(), bufferreader_destroy(), bufferreader_init_from_file(), llevDebug, llevError, Settings::localdir, LOG(), MAX, MAX_BUF, MIN, settings, weathermap, WEATHERMAPTILESX, WEATHERMAPTILESY, and weathermap_t::windspeed.
Referenced by cfweather_init().
|
static |
Compute the real (adjusted) temperature of a given weathermap tile.
This takes into account the wind, base temp, sunlight, and other fun things. Seasons are automatically handled by moving the equator. Elevation is partially considered in the base temp. x and y are the weathermap coordinates.
x | |
y | weathermap coordinates. |
tod | Pointer to an already-filled-out time-of-day structure. |
Definition at line 895 of file cfweather.cpp.
References timeofday_t::hour, HOURS_PER_DAY, season_tempchange, SKY_BLIZZARD, SKY_CLEAR, SKY_HURRICANE, SKY_LIGHTCLOUD, weathermap_t::temp, weathermap_t::water, weathermap, and weathermap_t::windspeed.
Referenced by compute_sky(), real_world_temperature(), and write_weather_images().
int real_world_temperature | ( | int | x, |
int | y, | ||
mapstruct * | m | ||
) |
Compute the temperature for a specific square.
Used to normalize elevation.
x | |
y | map coordinates. |
m | map we're on. |
Definition at line 968 of file cfweather.cpp.
References weathermap_t::avgelev, object::elevation, forest_list, get_config_tile(), GET_MAP_OB, get_tod(), m, real_temperature(), weathermap, and worldmap_to_weathermap().
Referenced by calculate_temperature(), command_weather(), and do_map_precipitation().
|
static |
Process rain.
This should be called from weather_effect().
m | map we are currently processing. |
Definition at line 1780 of file cfweather.cpp.
References above, object::above, object::arch, avoid_weather(), check_replace_match(), d, do_precipitation(), do_weather_insert(), find_archetype(), find_string(), FLAG_IS_FLOOR, freearr_x, freearr_y, GET_MAP_OB, weathermap_t::humid, INS_ABOVE_FLOOR_ONLY, INS_NO_MERGE, INS_NO_WALK_ON, INS_ON_TOP, m, M_LIQUID, archetype::name, weather_replace_t::next, object_free(), object_remove(), OUT_OF_REAL_MAP, QUERY_FLAG, weathermap_t::realtemp, rndm(), weathermap_t::sky, SKY_HAIL, SKY_HEAVY_RAIN, SKY_HURRICANE, SKY_LIGHT_RAIN, SKY_OVERCAST, SKY_RAIN, weather_replace_t::special_snow, sstring, weather_replace_t::tile, weather_evaporate, WEATHER_OVERLAY, weather_replace, weather_snowmelt, weathermap, worldmap_to_weathermap(), weather_settings_t::worldmaptilesizex, weather_settings_t::worldmaptilesizey, and wset.
Referenced by weather_effect().
|
static |
This code simply smooths the pressure map.
It also does clipping to ensure we are within acceptable bounds.
Definition at line 787 of file cfweather.cpp.
References MAX, MIN, weathermap_t::pressure, PRESSURE_MAX, PRESSURE_MIN, PRESSURE_ROUNDING_FACTOR, PRESSURE_ROUNDING_ITER, weathermap, WEATHERMAPTILESX, and WEATHERMAPTILESY.
Referenced by init_pressure(), and perform_pressure().
|
static |
It doesn't really smooth it as such.
The main function of this is to apply the pressuremap to the wind direction and speed, followed by some tree-driven disruption. Then, we run a quick pass to update the windspeed.
Definition at line 712 of file cfweather.cpp.
References find_dir_2(), weathermap_t::forestry, weathermap_t::pressure, PRESSURE_MAX, similar_direction(), weathermap, WEATHERMAPTILESX, WEATHERMAPTILESY, WIND_FACTOR, weathermap_t::winddir, and weathermap_t::windspeed.
Referenced by tick_weather().
|
static |
The world spinning drags the weather with it.
The equator is diagonal, and the poles are 45 degrees from north /south. What the hell, lets spin the planet backwards.
Due to the polar layout, the weather moves from northeast to southwest. This does, however, make storms come from polar-east (in-game northeast). So the world is spinning backwards, even if it looks odd.
Definition at line 1158 of file cfweather.cpp.
References weathermap_t::humid, MIN, weathermap_t::pressure, weathermap_t::sky, weathermap, WEATHERMAPTILESX, and WEATHERMAPTILESY.
Referenced by tick_weather().
|
static |
Calculate temperature of a spot.
x | |
y | weathermap coordinates. |
tod | time of day. |
Now we adjust for the presence of trees. Thick trees create a heat-holding canopy. Sparse trees don't hold so much heat in, and actually work to reduce temperatures.
Definition at line 1028 of file cfweather.cpp.
References EQUATOR_BASE_TEMP, weathermap_t::forestry, MIN, timeofday_t::month, MONTHS_PER_YEAR, POLAR_BASE_TEMP, polar_distance(), weathermap_t::pressure, SEASONAL_ADJUST, weathermap_t::temp, weathermap, WEATHERMAPTILESX, and WEATHERMAPTILESY.
Referenced by init_temperature().
void tick_weather | ( | ) |
Do the weather calculations in order.
Re-ordering these will probably produce unintended side effects.
Definition at line 1444 of file cfweather.cpp.
References weather_settings_t::dynamiclevel, init_temperature(), perform_pressure(), plot_gulfstream(), smooth_wind(), spin_globe(), update_humid(), and wset.
Referenced by weather_clock_listener().
|
static |
Update the humidity for all weathermap tiles.
Calls humid_tile for every weathermap tile. All the fun stuff happens in humid_tile
Definition at line 1290 of file cfweather.cpp.
References get_world_darkness(), weathermap_t::humid, humid_tile(), weathermap, WEATHERMAPTILESX, and WEATHERMAPTILESY.
Referenced by init_humid_elev(), and tick_weather().
|
static |
Global clock event handling for weather.
This is separate from the mapenter listener because I felt like it. They possibly could be merged, it just makes documenting the parameters for the function into a mess.
type | The event type. |
Definition at line 4516 of file cfweather.cpp.
References code, EVENT_CLOCK, Settings::fastclock, perform_weather(), process_rain(), pticks, PTICKS_PER_CLOCK, settings, tick_weather(), is_valid_types_gen::type, write_gulfstreammap(), write_humidmap(), write_pressuremap(), write_rainfallmap(), write_skymap(), write_temperaturemap(), write_weather_images(), write_winddirmap(), and write_windspeedmap().
Referenced by cfweather_init().
|
static |
Perform actual effect of weather.
Should be called from perform_weather(), or when a map is loaded. (player enter map).
This is where things like snow, herbs, earthly rototilling, etc should occur.
Nothing will happen if the map isn't a world map.
m | map to alter. |
Definition at line 2206 of file cfweather.cpp.
References calculate_temperature(), change_the_world(), weather_settings_t::dynamiclevel, let_it_snow(), m, plant_a_garden(), singing_in_the_rain(), worldmap_to_weathermap(), and wset.
Referenced by perform_weather().
|
static |
Global event handling for weather.
type | The event type. |
m | The map being loaded. |
Definition at line 4477 of file cfweather.cpp.
References code, do_map_precipitation(), EVENT_MAPENTER, EVENT_MAPLOAD, EVENT_MAPREADY, m, and is_valid_types_gen::type.
Referenced by cfweather_init().
|
static |
Global object-process handling for weather.
type | The event type. |
op | The object being processed. |
Definition at line 4574 of file cfweather.cpp.
References blocked_link(), object::carrying, code, object::contr, esrv_map_scroll(), EVENT_TIME, FLAG_IS_FLOOR, FOR_INV_FINISH, FOR_INV_PREPARE, freearr_x, freearr_y, get_map_flags(), object::inv, socket_struct::look_position, m, object::map, object::move_type, object_insert_in_map_at(), object_remove(), P_OUT_OF_MAP, PLAYER, QUERY_FLAG, player::socket, object::stats, TRANSPORT, player::transport, is_valid_types_gen::type, object::type, socket_struct::update_look, object::weight, wind_blow_object(), object::x, and object::y.
Referenced by cfweather_init().
|
static |
Return the path of the map in specified direction.
wx | ||
wy | weather map coordinates. | |
[out] | x | |
[out] | y | will contain coordinates in the new map. Mustn't be NULL. |
dir | direction to find map for. Valid values are 2 4 6 8 for the corners. | |
buffer | buffer that will contain the path of map in specified direction. | |
bufsize | length of buffer |
Definition at line 333 of file cfweather.cpp.
References buffer, llevError, LOG(), settings, WEATHERMAPTILESX, WEATHERMAPTILESY, Settings::worldmapstartx, Settings::worldmapstarty, weather_settings_t::worldmaptilesizex, weather_settings_t::worldmaptilesizey, Settings::worldmaptilesx, Settings::worldmaptilesy, and wset.
Referenced by load_humidity_map_part().
|
static |
Calculate the direction to push an object from wind.
m | The map the player is on. |
x,y | The coordinates of the player on the map |
move_type | The movement type the object is attempting to use. |
wt | The total weight the object has (incl. carrying) |
stats | The stat block of the object, or NULL if it is not alive. |
Definition at line 2318 of file cfweather.cpp.
References absdir(), m, MOVE_FLYING, rndm(), stats, weathermap, weathermap_t::windspeed, and worldmap_to_weathermap().
Referenced by weather_object_listener().
|
static |
Convert coordinates from world map to weather tiles.
x | ||
y | coordinates to convert. | |
[out] | wx | |
[out] | wy | weather map coordinates. |
m | map. Should be a world map. |
Definition at line 458 of file cfweather.cpp.
References llevDebug, LOG(), m, MAP_WORLDPARTX, MAP_WORLDPARTY, settings, WEATHERMAPTILESX, WEATHERMAPTILESY, Settings::worldmapstartx, Settings::worldmapstarty, weather_settings_t::worldmaptilesizex, weather_settings_t::worldmaptilesizey, Settings::worldmaptilesx, Settings::worldmaptilesy, and wset.
Referenced by calculate_temperature(), change_the_world(), command_weather(), do_map_precipitation(), let_it_snow(), plant_a_garden(), real_world_temperature(), singing_in_the_rain(), weather_effect(), and wind_blow_object().
|
static |
Save the average elevation information to localdir.
Since this does not change over time, we call this only when we are initalizing humidity.
settings | Pointer to the settings structure. In particular, we want localdir. |
Definition at line 3196 of file cfweather.cpp.
References llevDebug, llevError, Settings::localdir, LOG(), MAX_BUF, of_close(), of_open(), settings, weathermap, WEATHERMAPTILESX, and WEATHERMAPTILESY.
Referenced by read_humidmap().
|
static |
Write the forestry map to the localdir.
Since this doesn't change over time, we can make this static and only call it from humidity initialization.
settings | Pointer to the settings structure. We want the localdir from this. |
Definition at line 3126 of file cfweather.cpp.
References llevDebug, llevError, Settings::localdir, LOG(), MAX_BUF, of_close(), of_open(), settings, weathermap, WEATHERMAPTILESX, and WEATHERMAPTILESY.
Referenced by read_humidmap().
int write_gulfstreammap | ( | const Settings * | settings | ) |
Save the gulf stream to localdir.
settings | The settings structure we are using to find localdir. Pretty sure it's the same one as the global settings, but oh well. |
Definition at line 3331 of file cfweather.cpp.
References gulf_stream_dir, gulf_stream_speed, gulf_stream_start, GULF_STREAM_WIDTH, llevDebug, llevError, Settings::localdir, LOG(), MAX_BUF, of_close(), of_open(), settings, and WEATHERMAPTILESY.
Referenced by read_gulfstreammap(), and weather_clock_listener().
int write_humidmap | ( | const Settings * | settings | ) |
Save humidity information to localdir.
settings | The settings structure to use for finding localdir |
Definition at line 3161 of file cfweather.cpp.
References llevDebug, llevError, Settings::localdir, LOG(), MAX_BUF, of_close(), of_open(), settings, weathermap, WEATHERMAPTILESX, and WEATHERMAPTILESY.
Referenced by read_humidmap(), and weather_clock_listener().
int write_pressuremap | ( | const Settings * | settings | ) |
Save pressure information to localdir.
settings | The settings structure we are using to find localdir. Pretty sure it's the same one as the global settings, but oh well. |
Definition at line 3440 of file cfweather.cpp.
References llevDebug, llevError, Settings::localdir, LOG(), MAX_BUF, of_close(), of_open(), settings, weathermap, WEATHERMAPTILESX, and WEATHERMAPTILESY.
Referenced by read_pressuremap(), and weather_clock_listener().
int write_rainfallmap | ( | const Settings * | settings | ) |
Save rainfall information to localdir.
settings | The current server settings In particular, we want localdir from this |
Definition at line 3298 of file cfweather.cpp.
References llevDebug, llevError, Settings::localdir, LOG(), MAX_BUF, of_close(), of_open(), settings, weathermap, WEATHERMAPTILESX, and WEATHERMAPTILESY.
Referenced by read_rainfallmap(), and weather_clock_listener().
int write_skymap | ( | void | ) |
Write the sky map.
We never read this map, only write it for debugging purposes
Definition at line 3469 of file cfweather.cpp.
References llevDebug, llevError, Settings::localdir, LOG(), MAX_BUF, of_close(), of_open(), settings, weathermap, WEATHERMAPTILESX, and WEATHERMAPTILESY.
Referenced by weather_clock_listener().
int write_temperaturemap | ( | const Settings * | settings | ) |
Save temperature information to localdir.
settings | The settings structure we wish to pull localdir from. It's probably the only one, but oh well. I'm passing it as a function parameter anyway. |
Definition at line 3265 of file cfweather.cpp.
References llevDebug, llevError, Settings::localdir, LOG(), MAX_BUF, of_close(), of_open(), settings, weathermap, WEATHERMAPTILESX, and WEATHERMAPTILESY.
Referenced by read_temperaturemap(), and weather_clock_listener().
|
static |
Save water percent information to localdir.
Since this does not actually change regularly, we can just call this when we initialize humidity.
settings | Pointer to the settings structure. In particular, we want localdir from it. |
Definition at line 3231 of file cfweather.cpp.
References llevDebug, llevError, Settings::localdir, LOG(), MAX_BUF, of_close(), of_open(), settings, weathermap, WEATHERMAPTILESX, and WEATHERMAPTILESY.
Referenced by read_humidmap().
int write_weather_images | ( | ) |
Dump all the weather data as an image.
Does not write to the tod file, since that is already handled elsewhere. (It used to, though, probably because all the saves from within the weather subsytem were synchronized to the time of day. Since I changed that to lighten the load on those ticks, saving the tod is not nearly as relevant.)
The image created is a ppm image, so it is really easy to just write it without a library.
Definition at line 3556 of file cfweather.cpp.
References weathermap_t::avgelev, BLUE, directions, weathermap_t::forestry, get_tod(), GREEN, weathermap_t::humid, llevDebug, llevError, Settings::localdir, LOG(), MAX, MAX_BUF, MIN, of_close(), of_open(), weathermap_t::pressure, PRESSURE_MAX, PRESSURE_MIN, weathermap_t::rainfall, real_temperature(), RED, settings, skies, weathermap_t::sky, speed, weathermap_t::water, weathermap, WEATHERMAPTILESX, WEATHERMAPTILESY, weathermap_t::winddir, and weathermap_t::windspeed.
Referenced by weather_clock_listener().
int write_winddirmap | ( | const Settings * | settings | ) |
Save wind direction to localdir.
settings | The settings structure we are using to find localdir. Pretty sure it's the same one as the global settings, but oh well. |
Definition at line 3407 of file cfweather.cpp.
References llevDebug, llevError, Settings::localdir, LOG(), MAX_BUF, of_close(), of_open(), settings, weathermap, WEATHERMAPTILESX, and WEATHERMAPTILESY.
Referenced by read_winddirmap(), and weather_clock_listener().
int write_windspeedmap | ( | const Settings * | settings | ) |
Save the wind speed to localdir.
settings | The settings structure we are using to find localdir. Pretty sure it's the same one as the global settings, but oh well. |
Definition at line 3374 of file cfweather.cpp.
References llevDebug, llevError, Settings::localdir, LOG(), MAX_BUF, of_close(), of_open(), settings, weathermap, WEATHERMAPTILESX, and WEATHERMAPTILESY.
Referenced by read_winddirmap(), and weather_clock_listener().
int weather_replace_t::arch_or_name |
If set, tile matches the archetype name, else the object's name.
Definition at line 146 of file cfweather.cpp.
Referenced by check_replace_match(), and init_weather_replace().
int32_t weathermap_t::avgelev |
Average elevation.
Definition at line 104 of file cfweather.cpp.
Referenced by init_humid_elev(), read_elevmap(), real_world_temperature(), and write_weather_images().
|
static |
Definition at line 4818 of file cfweather.cpp.
Referenced by cfweather_close(), and cfweather_init().
uint8_t weathermap_t::darkness |
Indicates level of darkness of map.
Definition at line 106 of file cfweather.cpp.
|
static |
Colours used for wind directions.
winddir is the direction wind is coming from. 812 456 7 3 3 7 654 218
Definition at line 3508 of file cfweather.cpp.
Referenced by write_weather_images().
archetype* weather_replace_t::doublestack_arch |
If set, this other archetype will be added atop special_snow.
Definition at line 145 of file cfweather.cpp.
Referenced by init_weather_replace().
uint16_t weather_settings_t::dynamiclevel |
How dynamic is the world?
Definition at line 175 of file cfweather.cpp.
Referenced by cfweather_init(), command_weather(), init_weather_settings(), perform_weather(), tick_weather(), and weather_effect().
int weather_grow_t::elevmax |
Maximum elevation for herb to grow.
Definition at line 164 of file cfweather.cpp.
int weather_grow_t::elevmin |
Minimum elevation for herb to grow.
Definition at line 163 of file cfweather.cpp.
DensityConfig* forest_list = NULL |
Definition at line 185 of file cfweather.cpp.
Referenced by cfweather_close(), cfweather_init(), do_water_elev_calc(), and real_world_temperature().
int8_t weathermap_t::forestry |
Range of forestedness.
100 is full forested. 0 is no trees. /*Dynamic parts
Definition at line 108 of file cfweather.cpp.
Referenced by init_humid_elev(), read_forestrymap(), smooth_wind(), temperature_calc(), and write_weather_images().
|
static |
Definition at line 4814 of file cfweather.cpp.
Referenced by cfweather_close(), and cfweather_init().
|
static |
Definition at line 4813 of file cfweather.cpp.
Referenced by cfweather_close(), and cfweather_init().
|
static |
Definition at line 4816 of file cfweather.cpp.
|
static |
Definition at line 4815 of file cfweather.cpp.
Referenced by cfweather_close(), and cfweather_init().
weather_avoids_t* growth_avoids = NULL |
Definition at line 188 of file cfweather.cpp.
Referenced by avoid_weather(), cfweather_close(), and cfweather_init().
|
static |
Direction of the gulf stream.
Definition at line 202 of file cfweather.cpp.
Referenced by cfweather_init(), init_gulfstreammap(), plot_gulfstream(), read_gulfstreammap(), and write_gulfstreammap().
|
static |
Definition at line 204 of file cfweather.cpp.
Referenced by cfweather_init(), init_gulfstreammap(), and plot_gulfstream().
|
static |
Gulf stream variables.
Speed of the gulf stream.
Definition at line 200 of file cfweather.cpp.
Referenced by init_gulfstreammap(), plot_gulfstream(), read_gulfstreammap(), and write_gulfstreammap().
|
static |
Definition at line 203 of file cfweather.cpp.
Referenced by init_gulfstreammap(), plot_gulfstream(), read_gulfstreammap(), and write_gulfstreammap().
const char* weather_grow_t::herb |
Arch name of item to grow.
Definition at line 154 of file cfweather.cpp.
Referenced by change_the_world(), and plant_a_garden().
int weather_grow_t::humax |
Maximum humidity for herb to grow.
Definition at line 160 of file cfweather.cpp.
int8_t weathermap_t::humid |
Humitidy of this tile.
Definition at line 100 of file cfweather.cpp.
Referenced by humid_tile(), init_humid_elev(), perform_pressure(), read_humidmap(), singing_in_the_rain(), spin_globe(), update_humid(), and write_weather_images().
int weather_grow_t::humin |
Minimum humidity for herb to grow.
Definition at line 159 of file cfweather.cpp.
int DensityConfig::is_obj |
Definition at line 120 of file cfweather.cpp.
Referenced by get_config_tile(), and init_config_vals().
sstring DensityConfig::name |
Definition at line 118 of file cfweather.cpp.
Referenced by cfweather_close(), get_config_tile(), and init_config_vals().
sstring weather_avoids_t::name |
Tile archetype name.
It is always arch name, not object name.
Definition at line 133 of file cfweather.cpp.
Referenced by avoid_weather(), cfweather_close(), and init_weatheravoid().
DensityConfig* DensityConfig::next |
Definition at line 126 of file cfweather.cpp.
Referenced by cfweather_close(), get_config_tile(), and init_config_vals().
weather_avoids_t* weather_avoids_t::next |
The next item in the avoid list.
Definition at line 136 of file cfweather.cpp.
Referenced by avoid_weather(), cfweather_close(), and init_weatheravoid().
weather_replace_t* weather_replace_t::next |
The next item in the replace list.
Definition at line 147 of file cfweather.cpp.
Referenced by cfweather_close(), init_weather_replace(), let_it_snow(), and singing_in_the_rain().
int16_t weathermap_t::pressure |
Barometric pressure (mb).
Definition at line 99 of file cfweather.cpp.
Referenced by init_pressure(), perform_pressure(), read_pressuremap(), smooth_pressure(), smooth_wind(), spin_globe(), temperature_calc(), and write_weather_images().
uint32_t weathermap_t::rainfall |
Cumulative rainfall.
Definition at line 105 of file cfweather.cpp.
Referenced by change_the_world(), init_rainfall(), plant_a_garden(), process_rain(), and write_weather_images().
int weather_grow_t::random |
Random apparition factor.
Min 1, higher = lower chance of appearance.
Definition at line 156 of file cfweather.cpp.
int16_t weathermap_t::realtemp |
Temperature at a given calculation step for this tile.
Definition at line 110 of file cfweather.cpp.
Referenced by calculate_temperature(), change_the_world(), do_map_precipitation(), let_it_snow(), plant_a_garden(), and singing_in_the_rain().
float weather_grow_t::rfmax |
Maximum rainfall for herb to grow (inches/day).
Definition at line 158 of file cfweather.cpp.
float weather_grow_t::rfmin |
Minimum rainfall for herb to grow (inches/day).
Definition at line 157 of file cfweather.cpp.
Referenced by change_the_world(), and plant_a_garden().
int weather_grow_t::season |
|
static |
How to alter the temperature, based on the hour of the day.
This is used exclusively by real_temperature.
Definition at line 874 of file cfweather.cpp.
Referenced by real_temperature().
|
static |
Colours used for weather types.
Definition at line 3522 of file cfweather.cpp.
Referenced by write_weather_images().
int8_t weathermap_t::sky |
Sky conditions.
Definition at line 103 of file cfweather.cpp.
Referenced by change_the_world(), command_weather(), compute_sky(), do_map_precipitation(), let_it_snow(), plant_a_garden(), process_rain(), singing_in_the_rain(), spin_globe(), and write_weather_images().
int weather_avoids_t::snow |
Is this a long-term weather effect, like snow or a puddle? Used for various tests.
Definition at line 134 of file cfweather.cpp.
Referenced by avoid_weather(), and init_weatheravoid().
archetype* weather_replace_t::special_snow |
The archetype name of the tile to place over specified tile.
Definition at line 144 of file cfweather.cpp.
Referenced by init_weather_replace(), and singing_in_the_rain().
int16_t weathermap_t::temp |
Base temperature of this tile (F).
Definition at line 98 of file cfweather.cpp.
Referenced by read_temperaturemap(), real_temperature(), and temperature_calc().
int weather_grow_t::tempmax |
Maximum temperature for herb to grow.
Definition at line 162 of file cfweather.cpp.
int weather_grow_t::tempmin |
Minimum temperature for herb to grow.
Definition at line 161 of file cfweather.cpp.
sstring weather_replace_t::tile |
Tile archetype or object name.
Definition at line 143 of file cfweather.cpp.
Referenced by cfweather_close(), check_replace_match(), init_weather_replace(), and singing_in_the_rain().
const char* weather_grow_t::tile |
Arch tile to grow on, NULL if anything.
Definition at line 155 of file cfweather.cpp.
Referenced by change_the_world(), and plant_a_garden().
unsigned long todtick |
Game world time, in in-game hours.
See PTICKS_PER_CLOCK.
Definition at line 38 of file time.cpp.
Referenced by change_the_world(), get_tod(), init_clocks(), init_rainfall(), plant_a_garden(), tick_the_clock(), and write_todclock().
int DensityConfig::value_density |
Definition at line 122 of file cfweather.cpp.
Referenced by get_config_tile(), and init_config_vals().
int8_t weathermap_t::water |
-100 - 100 percentage of water tiles.
< 0 means it is a droughty spot
Definition at line 107 of file cfweather.cpp.
Referenced by humid_tile(), init_humid_elev(), read_watermap(), real_temperature(), and write_weather_images().
DensityConfig* water_list = NULL |
Definition at line 186 of file cfweather.cpp.
Referenced by cfweather_close(), cfweather_init(), and do_water_elev_calc().
weather_avoids_t* weather_avoids = NULL |
Definition at line 187 of file cfweather.cpp.
Referenced by avoid_weather(), cfweather_close(), and cfweather_init().
weather_replace_t* weather_evaporate = NULL |
Definition at line 190 of file cfweather.cpp.
Referenced by cfweather_close(), cfweather_init(), and singing_in_the_rain().
|
static |
The table below is used to grow things on the map.
See include/tod.h for the meanings of all of the fields.
Definition at line 225 of file cfweather.cpp.
Referenced by plant_a_garden().
weather_replace_t* weather_replace = NULL |
Definition at line 189 of file cfweather.cpp.
Referenced by cfweather_close(), cfweather_init(), let_it_snow(), and singing_in_the_rain().
weather_replace_t* weather_snowmelt = NULL |
Definition at line 191 of file cfweather.cpp.
Referenced by cfweather_close(), cfweather_init(), let_it_snow(), and singing_in_the_rain().
|
static |
The table below uses the same format as the one above.
However this table is used to change the layout of the worldmap itself. The tile parameter is a base tile to lay down underneath the herb tile.
Definition at line 256 of file cfweather.cpp.
Referenced by change_the_world().
weathermap_t** weathermap |
Definition at line 183 of file cfweather.cpp.
Referenced by calculate_temperature(), cfweather_close(), cfweather_init(), change_the_world(), command_weather(), compute_sky(), do_map_precipitation(), humid_tile(), init_humid_elev(), init_pressure(), init_rainfall(), init_wind(), let_it_snow(), perform_pressure(), plant_a_garden(), plot_gulfstream(), process_rain(), read_elevmap(), read_forestrymap(), read_humidmap(), read_pressuremap(), read_rainfallmap(), read_temperaturemap(), read_watermap(), read_winddirmap(), read_windspeedmap(), real_temperature(), real_world_temperature(), singing_in_the_rain(), smooth_pressure(), smooth_wind(), spin_globe(), temperature_calc(), update_humid(), wind_blow_object(), write_elevmap(), write_forestrymap(), write_humidmap(), write_pressuremap(), write_rainfallmap(), write_skymap(), write_temperaturemap(), write_watermap(), write_weather_images(), write_winddirmap(), and write_windspeedmap().
int8_t weathermap_t::winddir |
Direction of wind.
Definition at line 102 of file cfweather.cpp.
Referenced by init_wind(), plot_gulfstream(), read_winddirmap(), smooth_wind(), and write_weather_images().
int8_t weathermap_t::windspeed |
Windspeed of this tile.
Definition at line 101 of file cfweather.cpp.
Referenced by humid_tile(), init_wind(), plot_gulfstream(), read_windspeedmap(), real_temperature(), smooth_wind(), wind_blow_object(), and write_weather_images().
|
static |
Current weather tile position.
Definition at line 207 of file cfweather.cpp.
Referenced by perform_weather(), and read_weatherposition().
|
static |
Current weather tile position.
Definition at line 209 of file cfweather.cpp.
Referenced by perform_weather(), and read_weatherposition().
uint32_t weather_settings_t::worldmaptilesizex |
Number of squares wide in a wm tile.
Definition at line 173 of file cfweather.cpp.
Referenced by calculate_temperature(), cfweather_init(), change_the_world(), init_humid_elev(), init_weather_settings(), let_it_snow(), plant_a_garden(), singing_in_the_rain(), weathermap_to_worldmap_corner(), and worldmap_to_weathermap().
uint32_t weather_settings_t::worldmaptilesizey |
Number of squares high in a wm tile.
Definition at line 174 of file cfweather.cpp.
Referenced by calculate_temperature(), change_the_world(), init_humid_elev(), init_weather_settings(), let_it_snow(), plant_a_garden(), singing_in_the_rain(), weathermap_to_worldmap_corner(), and worldmap_to_weathermap().
|
static |
Definition at line 211 of file cfweather.cpp.
Referenced by calculate_temperature(), cfweather_init(), change_the_world(), command_weather(), init_humid_elev(), init_weather_settings(), let_it_snow(), perform_weather(), plant_a_garden(), singing_in_the_rain(), tick_weather(), weather_effect(), weathermap_to_worldmap_corner(), and worldmap_to_weathermap().