Defines | Functions | Variables

light.c File Reference

#include "hack.h"
#include "lev.h"
Include dependency graph for light.c:

Defines

#define LSF_SHOW   0x1
#define LSF_NEEDS_FIXUP   0x2
#define mon_is_local(mon)   ((mon)->mx > 0)

Functions

STATIC_DCL void FDECL (write_ls,(int, light_source *))
STATIC_DCL int FDECL (maybe_write_ls,(int, int, BOOLEAN_P))
void new_light_source (xchar x, xchar y, int range, int type, genericptr_t id)
void del_light_source (int type, genericptr_t id)
void do_light_sources (char **cs_rows)
struct monstfind_mid (unsigned nid, unsigned fmflags)
void save_light_sources (int fd, int mode, int range)
void restore_light_sources (int fd)
void relink_light_sources (boolean ghostly)
STATIC_OVL int maybe_write_ls (int fd, int range, boolean write_it)
STATIC_OVL void write_ls (int fd, light_source *ls)
void obj_move_light_source (struct obj *src, struct obj *dest)
boolean any_light_source ()
void snuff_light_source (int x, int y)
boolean obj_sheds_light (struct obj *obj)
boolean obj_is_burning (struct obj *obj)
void obj_split_light_source (struct obj *src, struct obj *dest)
void obj_merge_light_sources (struct obj *src, struct obj *dest)
int candle_light_range (struct obj *obj)

Variables

static light_sourcelight_base = 0
char circle_data []
char circle_start []

Define Documentation

#define LSF_NEEDS_FIXUP   0x2
#define LSF_SHOW   0x1

Referenced by do_light_sources().

#define mon_is_local (   mon )    ((mon)->mx > 0)

Function Documentation

boolean any_light_source (  )

Referenced by movemon().

Here is the caller graph for this function:

int candle_light_range ( struct obj obj )

References CANDELABRUM_OF_INVOCATION, Is_candle, and obj::quan.

Referenced by begin_burn(), obj_merge_light_sources(), and obj_split_light_source().

Here is the caller graph for this function:

void del_light_source ( int  type,
genericptr_t  id 
)

References LS_MONSTER, LS_OBJECT, LSF_NEEDS_FIXUP, ls_t::next, and vision_full_recalc.

Referenced by cleanup_burn(), dealloc_obj(), end_burn(), m_detach(), newcham(), polyself(), rehumanize(), and replmon().

Here is the caller graph for this function:

void do_light_sources ( char **  cs_rows )

References circle_ptr, clear_path(), COLNO, COULD_SEE, ls_t::flags, get_mon_location(), get_obj_location(), ls_t::id, LS_MONSTER, LS_OBJECT, LSF_SHOW, ls_t::next, ls_t::range, ROWNO, TEMP_LIT, ls_t::type, u, you::ux, you::uy, ls_t::x, and ls_t::y.

Referenced by vision_recalc().

Here is the call graph for this function:

Here is the caller graph for this function:

STATIC_DCL int FDECL ( maybe_write_ls  ,
(int, int, BOOLEAN_P)   
)
STATIC_DCL void FDECL ( write_ls  ,
(int, light_source *)   
)
struct monst* find_mid ( unsigned  nid,
unsigned  fmflags 
) [read]

References DEADMONSTER, FM_FMON, FM_MIGRATE, FM_MYDOGS, fmon, monst::m_id, migrating_mons, mydogs, monst::nmon, and youmonst.

Referenced by relink_light_sources(), revive(), run_regions(), and write_ls().

Here is the caller graph for this function:

STATIC_OVL int maybe_write_ls ( int  fd,
int  range,
boolean  write_it 
)

References ls_t::id, LS_MONSTER, LS_OBJECT, mon_is_local, ls_t::next, obj_is_local(), RANGE_LEVEL, ls_t::type, and write_ls().

Referenced by save_light_sources().

Here is the call graph for this function:

Here is the caller graph for this function:

void new_light_source ( xchar  x,
xchar  y,
int  range,
int  type,
genericptr_t  id 
)

References ls_t::flags, ls_t::id, light_base, MAX_RADIUS, ls_t::next, ls_t::range, ls_t::type, vision_full_recalc, ls_t::x, and ls_t::y.

Referenced by begin_burn(), clone_mon(), makemon(), newcham(), polyself(), and replmon().

Here is the caller graph for this function:

boolean obj_is_burning ( struct obj obj )

References artifact_light(), ignitable, and MAGIC_LAMP.

Referenced by drop_upon_death(), in_container(), obj_sheds_light(), and snuff_light_source().

Here is the call graph for this function:

Here is the caller graph for this function:

void obj_merge_light_sources ( struct obj src,
struct obj dest 
)

References candle_light_range(), end_burn(), ls_t::id, LS_OBJECT, ls_t::next, ls_t::range, TRUE, ls_t::type, and vision_full_recalc.

Referenced by merged(), and use_candle().

Here is the call graph for this function:

Here is the caller graph for this function:

void obj_move_light_source ( struct obj src,
struct obj dest 
)

References ls_t::id, LS_OBJECT, ls_t::next, and ls_t::type.

Referenced by realloc_obj().

Here is the caller graph for this function:

boolean obj_sheds_light ( struct obj obj )

References obj_is_burning().

Referenced by dealloc_obj(), mpickobj(), splitobj(), and throwit().

Here is the call graph for this function:

Here is the caller graph for this function:

void obj_split_light_source ( struct obj src,
struct obj dest 
)

References candle_light_range(), ls_t::id, Is_candle, light_base, LS_OBJECT, ls_t::next, ls_t::range, ls_t::type, and vision_full_recalc.

Referenced by splitobj().

Here is the call graph for this function:

Here is the caller graph for this function:

void relink_light_sources ( boolean  ghostly )

References find_mid(), find_oid(), ls_t::flags, FM_EVERYWHERE, ls_t::id, if(), lookup_id_mapping(), LS_MONSTER, LS_OBJECT, LSF_NEEDS_FIXUP, ls_t::next, and ls_t::type.

Referenced by getlev(), and restgamestate().

Here is the call graph for this function:

Here is the caller graph for this function:

void restore_light_sources ( int  fd )

References light_base, and mread().

Referenced by getlev(), and restgamestate().

Here is the call graph for this function:

Here is the caller graph for this function:

void save_light_sources ( int  fd,
int  mode,
int  range 
)

References bwrite(), FALSE, ls_t::id, LS_MONSTER, LS_OBJECT, maybe_write_ls(), mon_is_local, ls_t::next, obj_is_local(), perform_bwrite, RANGE_LEVEL, release_data, TRUE, and ls_t::type.

Referenced by savegamestate(), and savelev().

Here is the call graph for this function:

Here is the caller graph for this function:

void snuff_light_source ( int  x,
int  y 
)

References artifact_light(), end_burn(), ls_t::id, if(), LS_OBJECT, MAGIC_LAMP, ls_t::next, obj_is_burning(), obj::otyp, ls_t::type, ls_t::x, and ls_t::y.

Referenced by mpickobj(), and set_lit().

Here is the call graph for this function:

Here is the caller graph for this function:

STATIC_OVL void write_ls ( int  fd,
light_source ls 
)

References bwrite(), find_mid(), find_oid(), ls_t::flags, FM_EVERYWHERE, LS_MONSTER, LS_OBJECT, LSF_NEEDS_FIXUP, monst::m_id, obj::o_id, otmp, and ls_t::type.

Referenced by maybe_write_ls().

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

char circle_data[]
char circle_start[]
light_source* light_base = 0 [static]