File src/light.c


Included Files


Preprocessor definitions

#define LSF_SHOW 0x1

#define LSF_NEEDS_FIXUP 0x2

#define mon_is_local( mon )


Typedef light_source

typedef struct ls_t light_source
struct ls_t 
   { 
     struct ls_t* next; 
     xchar x; 
     xchar y; 
     short range; 
     short flags; 
     short type; 
     genericptr_t id; 
   } 

External Variables

circle_data
extern char circle_data[]

circle_start
extern char circle_start[]


Local Variables

light_base
static light_source* light_base
Used in: any_light_source()
  del_light_source()
  do_light_sources()
  maybe_write_ls()
  new_light_source()
  obj_merge_light_sources()
  obj_move_light_source()
  obj_split_light_source()
  relink_light_sources()
  restore_light_sources()
  save_light_sources()
  snuff_light_source()
  wiz_light_sources()

Global Function any_light_source()

boolean any_light_source ( void )
Prototyped in: include/extern.h
References Variables: light_basesrc/light.c

Global Function candle_light_range()

int candle_light_range ( struct obj* obj )
Prototyped in: include/extern.h
Called by: obj_merge_light_sources()src/light.c
  obj_split_light_source()src/light.c

Global Function del_light_source()

void del_light_source ( int type, genericptr_t id )
Prototyped in: include/extern.h
Calls: free(), impossible()
References Variables: light_basesrc/light.c
  vision_full_recalcsrc/decl.c

Global Function do_light_sources()

void do_light_sources ( char** cs_rows )
Prototyped in: include/extern.h
Calls: abs(), clear_path(), get_mon_location(), get_obj_location()
References Variables: light_basesrc/light.c
  usrc/decl.c
  circle_data, circle_start

Global Function find_mid()

struct monst* find_mid ( unsigned nid, unsigned fmflags )
Prototyped in: include/extern.h
Called by: relink_light_sources()src/light.c
References Variables: levelsrc/decl.c
  migrating_monssrc/decl.c
  mydogssrc/decl.c
  youmonstsrc/decl.c

Global Function new_light_source()

void new_light_source ( xchar x, xchar y, int range, int type, genericptr_t id )
Prototyped in: include/extern.h
Calls: alloc()src/alloc.c
  impossible()
References Variables: light_basesrc/light.c
  vision_full_recalcsrc/decl.c

Global Function obj_is_burning()

boolean obj_is_burning ( struct obj* obj )
Prototyped in: include/extern.h
Called by: drop_upon_death()src/bones.c
  obj_sheds_light()src/light.c
  snuff_light_source()src/light.c

Global Function obj_merge_light_sources()

void obj_merge_light_sources ( struct obj* src, struct obj* dest )
Prototyped in: include/extern.h
Calls: candle_light_range()src/light.c
  end_burn()
Called by: merged()src/invent.c
  use_candle()src/apply.c
References Variables: light_basesrc/light.c
  vision_full_recalcsrc/decl.c

Global Function obj_move_light_source()

void obj_move_light_source ( struct obj* src, struct obj* dest )
Prototyped in: include/extern.h
Called by: realloc_obj()src/do_name.c
References Variables: light_basesrc/light.c

Global Function obj_sheds_light()

boolean obj_sheds_light ( struct obj* obj )
Prototyped in: include/extern.h
Calls: obj_is_burning()src/light.c
Called by: throwit()src/dothrow.c

Global Function obj_split_light_source()

void obj_split_light_source ( struct obj* src, struct obj* dest )
Prototyped in: include/extern.h
Calls: alloc()src/alloc.c
  candle_light_range()src/light.c
References Variables: light_basesrc/light.c
  vision_full_recalcsrc/decl.c

Global Function relink_light_sources()

void relink_light_sources ( boolean ghostly )
Prototyped in: include/extern.h
Calls: find_mid()src/light.c
  find_oid(), impossible(), lookup_id_mapping()
References Variables: light_basesrc/light.c

Global Function restore_light_sources()

void restore_light_sources ( int fd )
Prototyped in: include/extern.h
Calls: alloc()src/alloc.c
  mread()
References Variables: light_basesrc/light.c

Global Function save_light_sources()

void save_light_sources ( int fd, int mode, int range )
Prototyped in: include/extern.h
Calls: maybe_write_ls()src/light.c
  panic()src/end.c
  bwrite(), free(), impossible(), obj_is_local()
References Variables: light_basesrc/light.c

Global Function snuff_light_source()

void snuff_light_source ( int x, int y )
Prototyped in: include/extern.h
Calls: obj_is_burning()src/light.c
  end_burn()
References Variables: light_basesrc/light.c

Global Function wiz_light_sources()

int wiz_light_sources ( void )
Prototyped in: include/extern.h
Calls: fmt_ptr()src/alloc.c
  sprintf()
Used in:  src/cmd.c
References Variables: light_basesrc/light.c
  usrc/decl.c
  youmonstsrc/decl.c
  windowprocs

Local Function maybe_write_ls()

static int maybe_write_ls ( int fd, int range, boolean write_it )
Prototyped in: src/light.c
Calls: write_ls()src/light.c
  impossible(), obj_is_local()
Called by: save_light_sources()src/light.c
References Variables: light_basesrc/light.c

Local Function write_ls()

static void write_ls ( int fd, light_source* ls )
Prototyped in: src/light.c
Calls: bwrite(), impossible()
Called by: maybe_write_ls()src/light.c