ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/common/los.C
(Generate patch)

Comparing deliantra/server/common/los.C (file contents):
Revision 1.54 by root, Sat Dec 27 07:50:05 2008 UTC vs.
Revision 1.56 by root, Thu Jan 8 19:23:44 2009 UTC

22 */ 22 */
23 23
24#include <global.h> 24#include <global.h>
25#include <cmath> 25#include <cmath>
26 26
27#define SEE_IN_DARK_RADIUS 3 27#define SEE_IN_DARK_RADIUS 2
28 28
29// los flags 29// los flags
30enum { 30enum {
31 FLG_XI = 0x01, // we have an x-parent 31 FLG_XI = 0x01, // we have an x-parent
32 FLG_YI = 0x02, // we have an y-parent 32 FLG_YI = 0x02, // we have an y-parent
266 if (dx <= 0) enqueue (dx - 1, dy, FLG_XI); 266 if (dx <= 0) enqueue (dx - 1, dy, FLG_XI);
267 if (dy >= 0) enqueue (dx, dy + 1, FLG_YI); 267 if (dy >= 0) enqueue (dx, dy + 1, FLG_YI);
268 if (dy <= 0) enqueue (dx, dy - 1, FLG_YI); 268 if (dy <= 0) enqueue (dx, dy - 1, FLG_YI);
269 } 269 }
270 } 270 }
271}
272
273/* returns true if op carries one or more lights
274 * This is a trivial function now days, but it used to
275 * be a bit longer. Probably better for callers to just
276 * check the op->glow_radius instead of calling this.
277 */
278int
279has_carried_lights (const object *op)
280{
281 /* op may glow! */
282 if (op->glow_radius > 0)
283 return 1;
284
285 return 0;
286} 271}
287 272
288/* radius, distance => lightness adjust */ 273/* radius, distance => lightness adjust */
289static sint8 light_atten[MAX_LIGHT_RADIUS * 2 + 1][MAX_LIGHT_RADIUS * 3 / 2 + 1]; 274static sint8 light_atten[MAX_LIGHT_RADIUS * 2 + 1][MAX_LIGHT_RADIUS * 3 / 2 + 1];
290static sint8 vision_atten[MAX_DARKNESS + SEE_IN_DARK_RADIUS + 1][(MAX_DARKNESS + SEE_IN_DARK_RADIUS) * 3 / 2 + 1]; 275static sint8 vision_atten[MAX_DARKNESS + SEE_IN_DARK_RADIUS + 1][(MAX_DARKNESS + SEE_IN_DARK_RADIUS) * 3 / 2 + 1];

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines