diff options
author | zelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-05-30 01:17:30 +0000 |
---|---|---|
committer | zelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-05-30 01:17:30 +0000 |
commit | 96a64a6214f7c68b0aa6b94836e77cdf6984d728 (patch) | |
tree | 285c4414e8f6e1692b698eb4b833bd796f74826d /crawl-ref/source/view.h | |
parent | c7d7127e04437181a909dc4c7bbbc5e408e7f798 (diff) | |
download | crawl-ref-96a64a6214f7c68b0aa6b94836e77cdf6984d728.tar.gz crawl-ref-96a64a6214f7c68b0aa6b94836e77cdf6984d728.zip |
When using gcc (the Linux/UNIX compiler) static class members must be
initialized outside of the class declaration or they won't by defined in
any of the object files, leading to "undefined reference" errors when
linking.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5336 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/view.h')
-rw-r--r-- | crawl-ref/source/view.h | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/crawl-ref/source/view.h b/crawl-ref/source/view.h index b2251d13cf..02280e573e 100644 --- a/crawl-ref/source/view.h +++ b/crawl-ref/source/view.h @@ -244,6 +244,8 @@ unsigned short dos_brand( unsigned short colour, unsigned brand = CHATTR_REVERSE); #endif +#define _monster_los_LSIZE (2 * LOS_RADIUS + 1) + // This class can be used to fill the entire surroundings (los_range) // of a monster or other position with seen/unseen values, so as to be able // to compare several positions within this range. @@ -273,11 +275,11 @@ protected: void check_los_beam(int dx, int dy); // The (fixed) size of the array. - static const int LSIZE = 2 * LOS_RADIUS + 1; + static const int LSIZE; - static const int L_VISIBLE = 1; - static const int L_UNKNOWN = 0; - static const int L_BLOCKED = -1; + static const int L_VISIBLE; + static const int L_UNKNOWN; + static const int L_BLOCKED; // The centre of our los field. int gridx, gridy; @@ -292,7 +294,7 @@ protected: int range; // The array to store the LOS values. - int los_field[LSIZE][LSIZE]; + int los_field[_monster_los_LSIZE][_monster_los_LSIZE]; }; #endif |