#include "hack.h"
Defines | |
#define | sign(z) ((z) < 0 ? -1 : ((z) ? 1 : 0 )) |
#define | v_abs(z) ((z) < 0 ? -(z) : (z)) |
#define | new_angle(lev, sv, row, col) (*sv) |
#define | set_cs(rowp, col) (rowp[col] = COULD_SEE) |
#define | good_row(z) ((z) >= 0 && (z) < ROWNO) |
#define | set_min(z) if (*row_min > (z)) *row_min = (z) |
#define | set_max(z) if (*row_max < (z)) *row_max = (z) |
#define | is_clear(row, col) viz_clear_rows[row][col] |
#define | q1_path(sy, sx, y, x, dummy) result = _q1_path(sy,sx,y,x) |
#define | q2_path(sy, sx, y, x, dummy) result = _q2_path(sy,sx,y,x) |
#define | q3_path(sy, sx, y, x, dummy) result = _q3_path(sy,sx,y,x) |
#define | q4_path(sy, sx, y, x, dummy) result = _q4_path(sy,sx,y,x) |
Functions | |
STATIC_DCL void | FDECL (fill_point,(int, int)) |
STATIC_DCL void | FDECL (dig_point,(int, int)) |
STATIC_DCL void | NDECL (view_init) |
STATIC_DCL void | FDECL (view_from,(int, int, char **, char *, char *, int, void(*)(int, int, genericptr_t), genericptr_t)) |
STATIC_DCL void | FDECL (get_unused_cs,(char ***, char **, char **)) |
void | vision_init () |
int | does_block (int x, int y, struct rm *lev) |
void | vision_reset () |
STATIC_OVL void | get_unused_cs (char ***rows, char **rmin, char **rmax) |
void | vision_recalc (int control) |
void | block_point (int x, int y) |
void | unblock_point (int x, int y) |
STATIC_OVL void | dig_point (int row, int col) |
STATIC_OVL void | fill_point (int row, int col) |
static void | FDECL ((*vis_func),(int, int, genericptr_t)) |
STATIC_DCL int | FDECL (_q1_path,(int, int, int, int)) |
STATIC_DCL int | FDECL (_q2_path,(int, int, int, int)) |
STATIC_DCL int | FDECL (_q3_path,(int, int, int, int)) |
STATIC_DCL int | FDECL (_q4_path,(int, int, int, int)) |
STATIC_OVL int | _q1_path (int srow, int scol, int y2, int x2) |
STATIC_OVL int | _q4_path (int srow, int scol, int y2, int x2) |
STATIC_OVL int | _q2_path (int srow, int scol, int y2, int x2) |
STATIC_OVL int | _q3_path (int srow, int scol, int y2, int x2) |
boolean | clear_path (int col1, int row1, int col2, int row2) |
STATIC_DCL void | FDECL (right_side,(int, int, int, char *)) |
STATIC_DCL void | FDECL (left_side,(int, int, int, char *)) |
STATIC_OVL void | view_init () |
STATIC_OVL void | right_side (int row, int left, int right_mark, char *limits) |
STATIC_OVL void | left_side (int row, int left_mark, int right, char *limits) |
STATIC_OVL void | view_from (void FDECL((*func) int, void FDECL((*func) int, char **loc_cs_rows, char *left_most, char *right_most, void FDECL((*func) int, func, genericptr_t arg) |
void | do_clear_area (void FDECL((*func) int, void FDECL((*func) int, void FDECL((*func) int, func, genericptr_t arg) |
Variables | |
char | circle_data [] |
char | circle_start [] |
char * | viz_rmin |
char * | viz_rmax |
static char | could_see [2][ROWNO][COLNO] |
static char * | cs_rows0 [ROWNO] |
static char * | cs_rows1 [ROWNO] |
static char | cs_rmin0 [ROWNO] |
static char | cs_rmax0 [ROWNO] |
static char | cs_rmin1 [ROWNO] |
static char | cs_rmax1 [ROWNO] |
static char | viz_clear [ROWNO][COLNO] |
static char * | viz_clear_rows [ROWNO] |
static char | left_ptrs [ROWNO][COLNO] |
static char | right_ptrs [ROWNO][COLNO] |
static int | start_row |
static int | start_col |
static int | step |
static char ** | cs_rows |
static char * | cs_left |
static char * | cs_right |
static genericptr_t | varg |
#define good_row | ( | z ) | ((z) >= 0 && (z) < ROWNO) |
Referenced by left_side(), and right_side().
#define is_clear | ( | row, | |
col | |||
) | viz_clear_rows[row][col] |
Referenced by _q1_path(), _q2_path(), _q3_path(), _q4_path(), left_side(), right_side(), and view_from().
#define new_angle | ( | lev, | |
sv, | |||
row, | |||
col | |||
) | (*sv) |
Referenced by vision_recalc().
#define q1_path | ( | sy, | |
sx, | |||
y, | |||
x, | |||
dummy | |||
) | result = _q1_path(sy,sx,y,x) |
Referenced by clear_path(), and right_side().
#define q2_path | ( | sy, | |
sx, | |||
y, | |||
x, | |||
dummy | |||
) | result = _q2_path(sy,sx,y,x) |
Referenced by clear_path(), and left_side().
#define q3_path | ( | sy, | |
sx, | |||
y, | |||
x, | |||
dummy | |||
) | result = _q3_path(sy,sx,y,x) |
Referenced by clear_path(), and left_side().
#define q4_path | ( | sy, | |
sx, | |||
y, | |||
x, | |||
dummy | |||
) | result = _q4_path(sy,sx,y,x) |
Referenced by clear_path(), and right_side().
#define set_cs | ( | rowp, | |
col | |||
) | (rowp[col] = COULD_SEE) |
Referenced by left_side(), right_side(), and view_from().
#define set_max | ( | z ) | if (*row_max < (z)) *row_max = (z) |
Referenced by left_side(), and right_side().
#define set_min | ( | z ) | if (*row_min > (z)) *row_min = (z) |
Referenced by left_side(), and right_side().
#define sign | ( | z ) | ((z) < 0 ? -1 : ((z) ? 1 : 0 )) |
Referenced by vision_recalc().
#define v_abs | ( | z ) | ((z) < 0 ? -(z) : (z)) |
Referenced by do_clear_area(), and vision_recalc().
STATIC_OVL int _q1_path | ( | int | srow, |
int | scol, | ||
int | y2, | ||
int | x2 | ||
) |
References is_clear.
STATIC_OVL int _q2_path | ( | int | srow, |
int | scol, | ||
int | y2, | ||
int | x2 | ||
) |
References is_clear.
STATIC_OVL int _q3_path | ( | int | srow, |
int | scol, | ||
int | y2, | ||
int | x2 | ||
) |
References is_clear.
STATIC_OVL int _q4_path | ( | int | srow, |
int | scol, | ||
int | y2, | ||
int | x2 | ||
) |
References is_clear.
void block_point | ( | int | x, |
int | y | ||
) |
References fill_point(), vision_full_recalc, and viz_array.
Referenced by clear_fcorr(), close_drawbridge(), create_monster(), doclose(), doorlock(), movebubbles(), place_object(), readobjnam(), repair_damage(), set_mimic_blocking(), set_mimic_sym(), still_chewing(), and wallify_vault().
boolean clear_path | ( | int | col1, |
int | row1, | ||
int | col2, | ||
int | row2 | ||
) |
STATIC_OVL void dig_point | ( | int | row, |
int | col | ||
) |
References COLNO, left_ptrs, right_ptrs, and viz_clear.
Referenced by unblock_point().
void do_clear_area | ( | void FDECL((*func) | int, |
void FDECL((*func) | int, | ||
void FDECL((*func) | int, | ||
func | , | ||
genericptr_t | arg | ||
) |
References circle_ptr, COLNO, couldsee, MAX_RADIUS, ROWNO, u, you::ux, you::uy, v_abs, view_from(), vision_full_recalc, and vision_recalc().
Referenced by dog_goal(), dogushforth(), findit(), litroom(), openit(), and seffects().
int does_block | ( | int | x, |
int | y, | ||
struct rm * | lev | ||
) |
References BOULDER, CLOUD, D_CLOSED, D_LOCKED, D_TRAPPED, monst::data, IS_DOOR, IS_ROCK, level, M_AP_FURNITURE, M_AP_OBJECT, monst::m_ap_type, m_at, monst::mappearance, MOAT, mon, mons, dlevel_t::objects, obj::otyp, PM_GIANT_TURTLE, S_hcdoor, S_vcdoor, See_invisible, TREE, Underwater, and WATER.
Referenced by create_monster(), destroy_drawbridge(), dig(), fracture_rock(), seemimic(), and vision_reset().
STATIC_DCL void FDECL | ( | view_from | , |
(int, int, char **, char *, char *, int, void(*)(int, int, genericptr_t), genericptr_t) | |||
) |
STATIC_DCL int FDECL | ( | _q1_path | , |
(int, int, int, int) | |||
) |
STATIC_DCL int FDECL | ( | _q2_path | , |
(int, int, int, int) | |||
) |
STATIC_DCL int FDECL | ( | _q3_path | , |
(int, int, int, int) | |||
) |
STATIC_DCL int FDECL | ( | _q4_path | , |
(int, int, int, int) | |||
) |
STATIC_DCL void FDECL | ( | dig_point | , |
(int, int) | |||
) |
STATIC_DCL void FDECL | ( | get_unused_cs | , |
(char ***, char **, char **) | |||
) |
STATIC_DCL void FDECL | ( | fill_point | , |
(int, int) | |||
) |
STATIC_DCL void FDECL | ( | right_side | , |
(int, int, int, char *) | |||
) |
STATIC_DCL void FDECL | ( | left_side | , |
(int, int, int, char *) | |||
) |
static void FDECL | ( | * | vis_func, |
(int, int, genericptr_t) | |||
) | [static] |
STATIC_OVL void fill_point | ( | int | row, |
int | col | ||
) |
References COLNO, left_ptrs, right_ptrs, and viz_clear.
Referenced by block_point().
STATIC_OVL void get_unused_cs | ( | char *** | rows, |
char ** | rmin, | ||
char ** | rmax | ||
) |
STATIC_OVL void left_side | ( | int | row, |
int | left_mark, | ||
int | right, | ||
char * | limits | ||
) |
STATIC_DCL void NDECL | ( | view_init | ) |
STATIC_OVL void right_side | ( | int | row, |
int | left, | ||
int | right_mark, | ||
char * | limits | ||
) |
void unblock_point | ( | int | x, |
int | y | ||
) |
References dig_point(), vision_full_recalc, and viz_array.
Referenced by destroy_drawbridge(), dig(), do_earthquake(), dokick(), doorlock(), dosearch0(), findone(), fracture_rock(), gd_move(), invault(), launch_obj(), m_move(), mdig_tunnel(), mkcavepos(), mkinvpos(), mon_set_minvis(), moverock(), mpickstuff(), mv_bubble(), open_drawbridge(), openone(), picklock(), poly_obj(), remove_monster(), remove_object(), seemimic(), set_mimic_blocking(), show_map_spot(), still_chewing(), untrap(), use_defensive(), use_stethoscope(), zap_dig(), and zap_over_floor().
STATIC_OVL void view_from | ( | void FDECL((*func) | int, |
void FDECL((*func) | int, | ||
char ** | loc_cs_rows, | ||
char * | left_most, | ||
char * | right_most, | ||
void FDECL((*func) | int, | ||
func | , | ||
genericptr_t | arg | ||
) |
References circle_ptr, COLNO, is_clear, left_ptrs, left_side(), MAX_RADIUS, right_ptrs, right_side(), ROWNO, and set_cs.
Referenced by do_clear_area(), and vision_recalc().
STATIC_OVL void view_init | ( | ) |
void vision_init | ( | ) |
References could_see, cs_rmax0, cs_rmin0, cs_rows0, cs_rows1, ROWNO, view_init(), vision_full_recalc, viz_array, viz_clear, viz_clear_rows, viz_rmax, and viz_rmin.
void vision_recalc | ( | int | control ) |
References Blind, circle_ptr, COLNO, COULD_SEE, do_light_sources(), FDECL, get_unused_cs(), iflags, in_mklev, IN_SIGHT, IS_DOOR, is_pool(), Is_rogue_level, IS_WALL, Is_waterlevel, isok(), levl, max, min, new_angle, newsym(), you::nv_range, sinfo::panicking, program_state, recalc_mapseen(), ROWNO, SDOOR, rm::seenv, seenv_matrix, sign, SVALL, TEMP_LIT, TT_PIT, rm::typ, u, Underwater, you::utrap, you::utraptype, you::ux, you::uy, you::uz, v_abs, view_from(), vision_full_recalc, instance_flags::vision_inited, viz_array, viz_clear, viz_rmax, viz_rmin, and you::xray_range.
Referenced by do_clear_area(), docrt(), domove(), doorlock(), dosave0(), drown(), goto_level(), gulpmu(), hurtle_step(), litroom(), mcalcdistress(), melt_ice(), move_into_trap(), movebubbles(), moveloop(), movemon(), parseoptions(), and teleds().
void vision_reset | ( | ) |
References COLNO, could_see, cs_rmax0, cs_rmin0, cs_rows0, does_block(), iflags, IS_ROCK, left_ptrs, levl, right_ptrs, ROWNO, TRUE, vision_full_recalc, instance_flags::vision_inited, viz_array, viz_clear, viz_rmax, and viz_rmin.
Referenced by dorecover(), goto_level(), and newgame().
char circle_data[] |
{ 1, 1, 2, 2, 1, 3, 3, 2, 1, 4, 4, 4, 3, 2, 5, 5, 5, 4, 3, 2, 6, 6, 6, 5, 5, 4, 2, 7, 7, 7, 6, 6, 5, 4, 2, 8, 8, 8, 7, 7, 6, 6, 4, 2, 9, 9, 9, 9, 8, 8, 7, 6, 5, 3, 10,10,10,10, 9, 9, 8, 7, 6, 5, 3, 11,11,11,11,10,10, 9, 9, 8, 7, 5, 3, 12,12,12,12,11,11,10,10, 9, 8, 7, 5, 3, 13,13,13,13,12,12,12,11,10,10, 9, 7, 6, 3, 14,14,14,14,13,13,13,12,12,11,10, 9, 8, 6, 3, 15,15,15,15,14,14,14,13,13,12,11,10, 9, 8, 6, 3, 16 }
char circle_start[] |
{ 0, 0, 2, 5, 9, 14, 20, 27, 35, 44, 54, 65, 77, 90, 104, 119, }
char could_see[2][ROWNO][COLNO] [static] |
Referenced by vision_init(), and vision_reset().
char* cs_left [static] |
char* cs_right [static] |
char cs_rmax0[ROWNO] |
Referenced by get_unused_cs(), vision_init(), and vision_reset().
char cs_rmax1[ROWNO] |
Referenced by get_unused_cs().
char cs_rmin0[ROWNO] [static] |
Referenced by get_unused_cs(), vision_init(), and vision_reset().
char cs_rmin1[ROWNO] [static] |
Referenced by get_unused_cs().
char** cs_rows [static] |
char* cs_rows0[ROWNO] [static] |
Referenced by get_unused_cs(), vision_init(), and vision_reset().
char * cs_rows1[ROWNO] |
Referenced by get_unused_cs(), and vision_init().
char left_ptrs[ROWNO][COLNO] [static] |
Referenced by dig_point(), fill_point(), left_side(), view_from(), and vision_reset().
char right_ptrs[ROWNO][COLNO] [static] |
Referenced by dig_point(), fill_point(), right_side(), view_from(), and vision_reset().
int start_col [static] |
int start_row [static] |
int step [static] |
Referenced by in_rooms(), left_side(), and right_side().
genericptr_t varg [static] |
Referenced by left_side(), and right_side().
char viz_clear[ROWNO][COLNO] [static] |
Referenced by dig_point(), fill_point(), vision_init(), vision_recalc(), and vision_reset().
char* viz_clear_rows[ROWNO] [static] |
Referenced by vision_init().
char * viz_rmax |
Referenced by vision_init(), vision_recalc(), and vision_reset().
char* viz_rmin |
Referenced by vision_init(), vision_recalc(), and vision_reset().