summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/env.h
diff options
context:
space:
mode:
authorRobert Vollmert <rvollmert@gmx.net>2009-10-19 16:12:04 +0200
committerRobert Vollmert <rvollmert@gmx.net>2009-10-21 14:42:01 +0200
commit36ac6df41458d10cf40fb837738b2f752bd05557 (patch)
treeab64c9b2f954ea3426aeafc6dff5068999ca9cab /crawl-ref/source/env.h
parent83d597313c41858a8f7e65bb32534a785cf7ed55 (diff)
downloadcrawl-ref-36ac6df41458d10cf40fb837738b2f752bd05557.tar.gz
crawl-ref-36ac6df41458d10cf40fb837738b2f752bd05557.zip
Split actors and env from externs.h.
Diffstat (limited to 'crawl-ref/source/env.h')
-rw-r--r--crawl-ref/source/env.h79
1 files changed, 79 insertions, 0 deletions
diff --git a/crawl-ref/source/env.h b/crawl-ref/source/env.h
new file mode 100644
index 0000000000..d4c70f74eb
--- /dev/null
+++ b/crawl-ref/source/env.h
@@ -0,0 +1,79 @@
+#ifndef ENV_H
+#define ENV_H
+
+#include "monster.h"
+
+class crawl_exit_hook;
+
+struct crawl_environment
+{
+public:
+ unsigned char rock_colour;
+ unsigned char floor_colour;
+
+ FixedVector< item_def, MAX_ITEMS > item; // item list
+ FixedVector< monsters, MAX_MONSTERS > mons; // monster list
+
+ feature_grid grid; // terrain grid
+ FixedArray< unsigned short, GXM, GYM > mgrid; // monster grid
+ FixedArray< int, GXM, GYM > igrid; // item grid
+ FixedArray< unsigned short, GXM, GYM > cgrid; // cloud grid
+ FixedArray< unsigned short, GXM, GYM > grid_colours; // colour overrides
+
+ FixedArray< map_cell, GXM, GYM > map; // discovered terrain
+
+ // Glyphs of squares that are in LOS.
+ env_show_grid show;
+
+ // What would be visible, if all of the translucent wall were
+ // made opaque.
+ env_show_grid no_trans_show;
+
+ FixedArray<unsigned short, ENV_SHOW_DIAMETER, ENV_SHOW_DIAMETER>
+ show_col; // view window colour
+
+#ifdef USE_TILE
+ // indexed by grid coords
+ FixedArray<tile_fg_store, GXM, GYM> tile_bk_fg;
+ FixedArray<unsigned int, GXM, GYM> tile_bk_bg;
+ FixedArray<tile_flavour, GXM, GYM> tile_flv;
+ // indexed by (show-1) coords
+ FixedArray<unsigned int, ENV_SHOW_DIAMETER, ENV_SHOW_DIAMETER> tile_fg;
+ FixedArray<unsigned int, ENV_SHOW_DIAMETER, ENV_SHOW_DIAMETER> tile_bg;
+ tile_flavour tile_default;
+#endif
+
+ FixedVector< cloud_struct, MAX_CLOUDS > cloud; // cloud list
+ unsigned char cloud_no;
+
+ FixedVector< shop_struct, MAX_SHOPS > shop; // shop list
+ FixedVector< trap_def, MAX_TRAPS > trap; // trap list
+
+ FixedVector< monster_type, 20 > mons_alloc;
+ map_markers markers;
+
+ // Place to associate arbitrary data with a particular level.
+ // Sort of like player::attribute
+ CrawlHashTable properties;
+
+ // Rate at which random monsters spawn, with lower numbers making
+ // them spawn more often (5 or less causes one to spawn about every
+ // 5 turns). Set to 0 to stop random generation.
+ int spawn_random_rate;
+
+ double elapsed_time; // used during level load
+
+ // Number of turns the player has spent on this level.
+ int turns_on_level;
+
+ // Flags for things like preventing teleport control; see
+ // level_flag_type in enum.h
+ unsigned long level_flags;
+
+ coord_def sanctuary_pos;
+ int sanctuary_time;
+};
+
+extern struct crawl_environment env;
+
+#endif