Main Page | Modules | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

src/light.c File Reference


Detailed Description

Functions for line-of-sight and light sources.

The functions in this file are speed-critical, and get optimized accordingly. Don't put anything big in here, and keep the functions fast.

Definition in file light.c.

#include "crogue.h"

Go to the source code of this file.

Defines

#define MAX_LIGHT_RADIUS   15
#define MAX_LIGHT_RADIUS_SQUARED   225

Functions

void calc_light_tile (int x, int y)
void calc_light (void)
ushort tracevision (sshort x1, sshort y1, sshort x2, sshort y2)
void illuminate (sint x, sint y, sint radiussquared)


Define Documentation

#define MAX_LIGHT_RADIUS   15
 

Definition at line 29 of file light.c.

Referenced by calc_light().

#define MAX_LIGHT_RADIUS_SQUARED   225
 

Definition at line 30 of file light.c.

Referenced by calc_light_tile().


Function Documentation

void calc_light void   ) 
 

Definition at line 35 of file light.c.

References calc_light_tile(), MAPSIZE_X, MAPSIZE_Y, MAX_LIGHT_RADIUS, world::plr, w, player::x, and player::y.

Referenced by enter_map(), manip_door(), monstmoveto(), plr_moveto(), plr_walk(), and update_player().

void calc_light_tile int  x,
int  y
[static]
 

Definition at line 62 of file light.c.

References distancesquare, draw_tile(), player::extrinsic, tile::flags, MAX_LIGHT_RADIUS_SQUARED, world::plr, STAT_LIGHTRADIUS, world::t, TFLAG_EXPLORED, TFLAG_INTRINSIC_LIGHT, TFLAG_LIT, TILEDESC, tracevision(), w, player::x, and player::y.

Referenced by calc_light().

void illuminate sint  x,
sint  y,
sint  radiussquared
 

Definition at line 183 of file light.c.

References tile::flags, MAPSIZE_X, MAPSIZE_Y, world::t, TFLAG_INTRINSIC_LIGHT, tracevision(), and w.

Referenced by light_room().

ushort tracevision sshort  x1,
sshort  y1,
sshort  x2,
sshort  y2
 

Definition at line 134 of file light.c.

References sshort, world::t, world::tiledescs, tiledesc::transparent, tile::type, ushort, and w.

Referenced by calc_light_tile(), illuminate(), and monst_is_aligned_with_plr().


Generated on Thu May 20 13:12:13 2004 for CalcRogue by doxygen 1.3.6