From 48b1b54aaf8c7ccc2b016158f58cf34385dd5068 Mon Sep 17 00:00:00 2001 From: dshaligram Date: Fri, 17 Aug 2007 22:20:13 +0000 Subject: Fixed map marker crashes. Reduced size of Pan demon bands summoned post-Orb (cbus). git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2010 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/externs.h | 41 +++++++++++++++++++++++++++++++++++++---- 1 file changed, 37 insertions(+), 4 deletions(-) (limited to 'crawl-ref/source/externs.h') diff --git a/crawl-ref/source/externs.h b/crawl-ref/source/externs.h index c1431105f0..fe553974a4 100644 --- a/crawl-ref/source/externs.h +++ b/crawl-ref/source/externs.h @@ -1243,10 +1243,43 @@ struct map_cell bool seen() const; }; -typedef FixedArray feature_grid; class map_marker; -typedef std::multimap dgn_marker_map; -typedef std::pair dgn_pos_marker; +class tagHeader; +class map_markers +{ +public: + map_markers(); + map_markers(const map_markers &); + map_markers &operator = (const map_markers &); + ~map_markers(); + + void activate_all(); + void add(map_marker *marker); + void remove(map_marker *marker); + void remove_markers_at(const coord_def &c, map_marker_type type = MAT_ANY); + map_marker *find(const coord_def &c, map_marker_type type = MAT_ANY); + map_marker *find(map_marker_type type); + void move(const coord_def &from, const coord_def &to); + std::vector get_all(map_marker_type type = MAT_ANY); + std::vector get_markers_at(const coord_def &c); + std::string property_at(const coord_def &c, map_marker_type type, + const std::string &key); + void clear(); + + void write(tagHeader &th) const; + void read(tagHeader &); + +private: + typedef std::multimap dgn_marker_map; + typedef std::pair dgn_pos_marker; + + void init_from(const map_markers &); + +private: + dgn_marker_map markers; +}; + +typedef FixedArray feature_grid; struct crawl_environment { @@ -1277,7 +1310,7 @@ public: FixedVector< trap_struct, MAX_TRAPS > trap; // trap list FixedVector< int, 20 > mons_alloc; - dgn_marker_map markers; + map_markers markers; double elapsed_time; // used during level load -- cgit v1.2.3-54-g00ecf