From 96a64a6214f7c68b0aa6b94836e77cdf6984d728 Mon Sep 17 00:00:00 2001 From: zelgadis Date: Fri, 30 May 2008 01:17:30 +0000 Subject: 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 --- crawl-ref/source/view.h | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'crawl-ref/source/view.h') 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 -- cgit v1.2.3-54-g00ecf