Data Structures | Defines | Functions | Variables

display.c File Reference

#include "hack.h"
#include "region.h"
Include dependency graph for display.c:

Data Structures

struct  tmp_glyph
struct  gbuf_entry

Defines

#define _map_location(x, y, show)
#define DETECTED   2
#define PHYSICALLY_SEEN   1
#define is_worm_tail(mon)   ((mon) && ((x != (mon)->mx) || (y != (mon)->my)))
#define reset_glyph_bbox()
#define more_than_one(x, y, a, b, c)   (((a) && ((b)|(c))) || ((b) && ((a)|(c))) || ((c) && ((a)|(b))))
#define sign(z)   ((z) < 0 ? -1 : ((z) > 0 ? 1 : 0))
#define T_d   0
#define T_l   1
#define T_u   2
#define T_r   3
#define T_stone   0
#define T_tlcorn   1
#define T_trcorn   2
#define T_hwall   3
#define T_tdwall   4
#define C_bl   0
#define C_tl   1
#define C_tr   2
#define C_br   3
#define C_trcorn   0
#define C_brcorn   1
#define C_blcorn   2
#define C_tlwall   3
#define C_tuwall   4
#define C_crwall   5
#define only(sv, bits)   (((sv) & (bits)) && ! ((sv) & ~(bits)))
#define set_corner(idx, lev, which, outer, inner, name)

Functions

STATIC_DCL void FDECL (display_monster,(XCHAR_P, XCHAR_P, struct monst *, int, XCHAR_P))
STATIC_DCL int FDECL (swallow_to_glyph,(int, int))
STATIC_DCL void FDECL (display_warning,(struct monst *))
STATIC_DCL int FDECL (check_pos,(int, int, int))
STATIC_DCL int FDECL (set_twall,(int, int, int, int, int, int, int, int))
STATIC_DCL int FDECL (set_wall,(int, int, int))
STATIC_DCL int FDECL (set_corn,(int, int, int, int, int, int, int, int))
STATIC_DCL int FDECL (set_crosswall,(int, int))
STATIC_DCL void FDECL (set_seenv,(struct rm *, int, int, int, int))
STATIC_DCL void FDECL (t_warn,(struct rm *))
STATIC_DCL int FDECL (wall_angle,(struct rm *))
void magic_map_background (xchar x, xchar y, int show)
void map_background (xchar x, xchar y, int show)
void map_trap (struct trap *trap, int show)
void map_object (struct obj *obj, int show)
void map_invisible (xchar x, xchar y)
void unmap_object (int x, int y)
void map_location (int x, int y, int show)
STATIC_OVL void display_monster (xchar x, xchar y, struct monst *mon, int sightflags, xchar worm_tail)
STATIC_OVL void display_warning (struct monst *mon)
void feel_location (xchar x, xchar y)
void newsym (int x, int y)
void shieldeff (xchar x, xchar y)
void tmp_at (int x, int y)
void swallowed (int first)
void under_water (int mode)
void under_ground (int mode)
void see_monsters ()
void set_mimic_blocking ()
void see_objects ()
void see_traps ()
void curs_on_u ()
int doredraw ()
void docrt ()
void show_glyph (int x, int y, int glyph)
void clear_glyph_buffer ()
void row_refresh (int start, int stop, int y)
void cls ()
void flush_screen (int cursor_on_u)
int back_to_glyph (xchar x, xchar y)
STATIC_OVL int swallow_to_glyph (int mnum, int loc)
int zapdir_to_glyph (int dx, int dy, int beam_type)
int glyph_at (xchar x, xchar y)
STATIC_OVL int check_pos (int x, int y, int which)
STATIC_OVL int set_twall (int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3)
STATIC_OVL int set_wall (int x, int y, int horiz)
STATIC_OVL int set_corn (int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4)
STATIC_OVL int set_crosswall (int x, int y)
void set_wall_state ()
STATIC_OVL void set_seenv (struct rm *lev, int x0, int y0, int x, int y)
STATIC_OVL void t_warn (struct rm *lev)
STATIC_OVL int wall_angle (struct rm *lev)

Variables

static struct tmp_glyph tgfirst
static gbuf_entry gbuf [ROWNO][COLNO]
static char gbuf_start [ROWNO]
static char gbuf_stop [ROWNO]
static gbuf_entry nul_gbuf = { 0, cmap_to_glyph(S_stone) }
unsigned char seenv_matrix [3][3]
static const int wall_matrix [4][5]
static const int cross_matrix [4][6]

Define Documentation

#define _map_location (   x,
  y,
  show 
)
Value:
{                                                                       \
    register struct obj   *obj;                                         \
    register struct trap  *trap;                                        \
                                                                        \
    if ((obj = vobj_at(x,y)) && !covers_objects(x,y))                   \
        map_object(obj,show);                                           \
    else if ((trap = t_at(x,y)) && trap->tseen && !covers_traps(x,y))   \
        map_trap(trap,show);                                            \
    else                                                                \
        map_background(x,y,show);                                       \
}

Referenced by feel_location(), map_location(), and newsym().

#define C_bl   0

Referenced by wall_angle().

#define C_blcorn   2

Referenced by wall_angle().

#define C_br   3

Referenced by wall_angle().

#define C_brcorn   1

Referenced by wall_angle().

#define C_crwall   5

Referenced by wall_angle().

#define C_tl   1

Referenced by wall_angle().

#define C_tlwall   3

Referenced by wall_angle().

#define C_tr   2

Referenced by wall_angle().

#define C_trcorn   0

Referenced by wall_angle().

#define C_tuwall   4

Referenced by wall_angle().

#define DETECTED   2
#define is_worm_tail (   mon )    ((mon) && ((x != (mon)->mx) || (y != (mon)->my)))

Referenced by feel_location(), and newsym().

#define more_than_one (   x,
  y,
  a,
  b,
 
)    (((a) && ((b)|(c))) || ((b) && ((a)|(c))) || ((c) && ((a)|(b))))

Referenced by dip(), set_twall(), and set_wall().

#define only (   sv,
  bits 
)    (((sv) & (bits)) && ! ((sv) & ~(bits)))

Referenced by wall_angle().

#define PHYSICALLY_SEEN   1
#define reset_glyph_bbox (  )
Value:
{                                               \
        int i;                                  \
                                                \
        for (i = 0; i < ROWNO; i++) {           \
            gbuf_start[i] = COLNO-1;            \
            gbuf_stop[i]  = 0;                  \
        }                                       \
    }

Referenced by clear_glyph_buffer(), and flush_screen().

#define set_corner (   idx,
  lev,
  which,
  outer,
  inner,
  name 
)
Value:
switch ((lev)->wall_info & WM_MASK) {                               \
        case 0:          idx = which; break;                                \
        case WM_C_OUTER: idx = seenv &  (outer) ? which : S_stone; break;   \
        case WM_C_INNER: idx = seenv & ~(inner) ? which : S_stone; break;   \
        default:                                                            \
            impossible("wall_angle: unknown %s mode %d", name,              \
                (lev)->wall_info & WM_MASK);                                \
            idx = S_stone;                                                  \
            break;                                                          \
    }

Referenced by wall_angle().

#define sign (   z )    ((z) < 0 ? -1 : ((z) > 0 ? 1 : 0))

Referenced by set_seenv().

#define T_d   0

Referenced by wall_angle().

#define T_hwall   3

Referenced by wall_angle().

#define T_l   1

Referenced by wall_angle().

#define T_r   3

Referenced by wall_angle().

#define T_stone   0

Referenced by wall_angle().

#define T_tdwall   4

Referenced by wall_angle().

#define T_tlcorn   1

Referenced by wall_angle().

#define T_trcorn   2

Referenced by wall_angle().

#define T_u   2

Referenced by wall_angle().


Function Documentation

int back_to_glyph ( xchar  x,
xchar  y 
)
STATIC_OVL int check_pos ( int  x,
int  y,
int  which 
)

References CORR, IS_ROCK, isok(), levl, and SCORR.

Referenced by set_corn(), set_crosswall(), set_twall(), and set_wall().

Here is the call graph for this function:

Here is the caller graph for this function:

void clear_glyph_buffer (  )

References COLNO, nul_gbuf, reset_glyph_bbox, and ROWNO.

Referenced by cls(), and display_gamewindows().

Here is the caller graph for this function:

void cls (  )

References flag::botlx, clear_glyph_buffer(), clear_nhwindow, display_nhwindow, FALSE, flags, WIN_MAP, and WIN_MESSAGE.

Referenced by docrt(), find_trap(), food_detect(), gold_detect(), monster_detect(), object_detect(), swallowed(), trap_detect(), under_ground(), under_water(), and you_aggravate().

Here is the call graph for this function:

Here is the caller graph for this function:

void curs_on_u (  )

References flush_screen().

Referenced by cpostfx(), domove(), done1(), done2(), explode(), launch_obj(), and savelife().

Here is the call graph for this function:

Here is the caller graph for this function:

STATIC_OVL void display_monster ( xchar  x,
xchar  y,
struct monst mon,
int  sightflags,
xchar  worm_tail 
)
STATIC_OVL void display_warning ( struct monst mon )

References Hallucination, mon_to_glyph, mon_warning, monst::mx, rn1, show_glyph(), WARNCOUNT, and warning_to_glyph.

Referenced by newsym().

Here is the call graph for this function:

Here is the caller graph for this function:

void docrt (  )
int doredraw (  )

References docrt().

Referenced by dosave(), and doset().

Here is the call graph for this function:

Here is the caller graph for this function:

STATIC_DCL int FDECL ( swallow_to_glyph  ,
(int, int)   
)
STATIC_DCL int FDECL ( set_crosswall  ,
(int, int)   
)
STATIC_DCL int FDECL ( check_pos  ,
(int, int, int)   
)
STATIC_DCL void FDECL ( set_seenv  ,
(struct rm *, int, int, int, int)   
)
STATIC_DCL void FDECL ( display_monster  ,
(XCHAR_P, XCHAR_P, struct monst *, int, XCHAR_P)   
)
STATIC_DCL int FDECL ( set_twall  ,
(int, int, int, int, int, int, int, int)   
)
STATIC_DCL void FDECL ( t_warn  ,
(struct rm *)   
)
STATIC_DCL int FDECL ( wall_angle  ,
(struct rm *)   
)
STATIC_DCL void FDECL ( display_warning  ,
(struct monst *)   
)
STATIC_DCL int FDECL ( set_wall  ,
(int, int, int)   
)
STATIC_DCL int FDECL ( set_corn  ,
(int, int, int, int, int, int, int, int)   
)
void feel_location ( xchar  x,
xchar  y 
)
void flush_screen ( int  cursor_on_u )
int glyph_at ( xchar  x,
xchar  y 
)

References cmap_to_glyph, gbuf_entry::glyph, and S_room.

Referenced by attack_checks(), check_map_spot(), check_tutorial_farlook(), do_look(), getpos(), lookat(), maybe_tutorial(), and see_traps().

Here is the caller graph for this function:

void magic_map_background ( xchar  x,
xchar  y,
int  show 
)

References back_to_glyph(), cansee, cmap_to_glyph, CORR, dlevel_t::flags, rm::glyph, level, levl, ROOM, S_corr, S_darkroom, S_litcorr, S_room, show_glyph(), and rm::typ.

Referenced by findone(), and show_map_spot().

Here is the call graph for this function:

Here is the caller graph for this function:

void map_background ( xchar  x,
xchar  y,
int  show 
)

References back_to_glyph(), dlevel_t::flags, rm::glyph, level, levl, and show_glyph().

Referenced by feel_location(), flooreffects(), sokoban_detect(), and unmap_object().

Here is the call graph for this function:

Here is the caller graph for this function:

void map_invisible ( xchar  x,
xchar  y 
)
void map_location ( int  x,
int  y,
int  show 
)

References _map_location.

Referenced by clear_fcorr(), and start_engulf().

Here is the caller graph for this function:

void map_object ( struct obj obj,
int  show 
)

References dlevel_t::flags, rm::glyph, level, levl, obj_to_glyph, and show_glyph().

Referenced by display_monster(), dropy(), feel_location(), food_detect(), gold_detect(), move_bc(), object_detect(), sense_trap(), and sokoban_detect().

Here is the call graph for this function:

Here is the caller graph for this function:

void map_trap ( struct trap trap,
int  show 
)

References dlevel_t::flags, rm::glyph, level, levl, show_glyph(), and trap_to_glyph.

Referenced by find_trap(), sense_trap(), sokoban_detect(), and unmap_object().

Here is the call graph for this function:

Here is the caller graph for this function:

void newsym ( int  x,
int  y 
)

References _map_location, ACCESSIBLE, BEAR_TRAP, cansee, cmap_to_glyph, CORR, instance_flags::dark_room, Detect_monsters, DETECTED, display_monster(), display_self, display_warning(), feel_location(), rm::glyph, glyph_is_invisible, iflags, in_mklev, is_pool(), Is_waterlevel, is_worm_tail, levl, m_at, map_invisible(), mon, mon_visible, mon_warning, NO_TRAP, PHYSICALLY_SEEN, PIT, ROOM, S_corr, S_darkroom, S_litcorr, S_room, See_invisible, see_with_infrared, senseself, show_glyph(), show_region(), SPIKED_PIT, t_at(), tp_sensemon, TRUE, rm::typ, u, Underwater, you::ux, you::uy, you::uz, visible_region_at(), and WEB.

Referenced by abuse_dog(), activate_statue_trap(), add_region(), arti_invoke(), attack_checks(), bhit(), bhitm(), bhito(), boulder_hits_pool(), burn_object(), bury_objs(), buzz(), charm_snakes(), clear_bypasses(), Cloak_off(), Cloak_on(), clone_mon(), clonewiz(), close_drawbridge(), cnv_trap_obj(), cpostfx(), deferred_goto(), del_sokoprize(), delobj(), demon_talk(), destroy_drawbridge(), dig(), dig_up_grave(), digactualhole(), dipfountain(), disarm_holdingtrap(), disarm_squeaky_board(), do_earthquake(), do_flood(), dochug(), doclose(), dofindgem(), dog_eat(), dog_invent(), dog_move(), dohide(), dokick(), domove(), doorlock(), dosacrifice(), dosearch0(), dosit(), dospinweb(), dotele(), dotrap(), drag_ball(), drinkfountain(), drop_ball(), drop_boulder_on_monster(), drop_boulder_on_player(), dropy(), dryup(), eataccessory(), eatmdone(), end_engulf(), expels(), explode(), fig_transform(), find_trap(), findone(), float_down(), flooreffects(), food_detect(), fracture_rock(), gd_move(), gold_detect(), grddead(), grow_up(), gulpmm(), gulpmu(), gush(), hatch_egg(), hitmu(), hurtle_step(), invault(), keepdogs(), kick_monster(), kick_object(), kickdmg(), launch_obj(), level_tele_trap(), m_detach(), m_lose_armor(), m_move(), make_corpse(), make_familiar(), makemon(), mattackm(), mattacku(), mdig_tunnel(), meatmetal(), meatobj(), melt_ice(), mhurtle_step(), migrate_to_level(), mintrap(), mkcavearea(), mkcavepos(), mkinvokearea(), mkinvpos(), mkroll_launch(), mon_set_minvis(), monstone(), move_bc(), move_gold(), move_into_trap(), move_special(), movebubbles(), moverock(), movobj(), mpickgold(), mpickstuff(), mv_bubble(), new_were(), newcham(), nh_timeout(), object_detect(), open_drawbridge(), openone(), peffects(), pick_obj(), picklock(), pickup(), place_worm_tail_randomly(), polyman(), polymon(), possibly_unwield(), punish(), readobjnam(), relobj(), remove_region(), remove_worm(), repair_damage(), reset_hostility(), restartcham(), revive(), Ring_off_or_gone(), Ring_on(), rloc_to(), rloco(), rot_corpse(), savebones(), scatter(), see_monsters(), see_objects(), see_traps(), see_wsegs(), seemimic(), seetrap(), set_bc(), set_trap(), shieldeff(), ship_object(), show_map_spot(), stealgold(), still_chewing(), stock_room(), tamedog(), tele_trap(), teleds(), thitm(), throw_gold(), throwit(), tmp_at(), toss_wsegs(), trap_detect(), under_ground(), under_water(), undo_flood(), unearth_objs(), unplacebc(), unpunish(), untrap(), update_mon_intrinsics(), use_defensive(), use_grapple(), use_misc(), use_stethoscope(), vision_recalc(), wakeup(), wallify_vault(), wary_dog(), worm_move(), xkilled(), you_aggravate(), zap_dig(), zap_over_floor(), zap_updown(), and zapyourself().

Here is the call graph for this function:

Here is the caller graph for this function:

void row_refresh ( int  start,
int  stop,
int  y 
)
void see_monsters (  )
void see_objects (  )

References fobj, newsym(), obj::nobj, obj::ox, obj::oy, and vobj_at.

Referenced by make_hallucinated(), moveloop(), Ring_off_or_gone(), and Ring_on().

Here is the call graph for this function:

Here is the caller graph for this function:

void see_traps (  )

References ftrap, glyph_at(), glyph_is_trap, newsym(), trap::ntrap, trap::tx, and trap::ty.

Referenced by make_hallucinated(), and moveloop().

Here is the call graph for this function:

Here is the caller graph for this function:

STATIC_OVL int set_corn ( int  x1,
int  y1,
int  x2,
int  y2,
int  x3,
int  y3,
int  x4,
int  y4 
)

References check_pos(), WM_C_INNER, and WM_C_OUTER.

Referenced by set_wall_state().

Here is the call graph for this function:

Here is the caller graph for this function:

STATIC_OVL int set_crosswall ( int  x,
int  y 
)

References check_pos(), WM_X_BL, WM_X_BLTR, WM_X_BR, WM_X_TL, WM_X_TLBR, and WM_X_TR.

Referenced by set_wall_state().

Here is the call graph for this function:

Here is the caller graph for this function:

void set_mimic_blocking (  )

References block_point(), BOULDER, DEADMONSTER, fmon, M_AP_FURNITURE, M_AP_OBJECT, monst::m_ap_type, monst::mappearance, mon, monst::mx, monst::my, monst::nmon, S_hcdoor, S_vcdoor, See_invisible, and unblock_point().

Referenced by eataccessory(), nh_timeout(), peffects(), Ring_off_or_gone(), and Ring_on().

Here is the call graph for this function:

Here is the caller graph for this function:

STATIC_OVL void set_seenv ( struct rm lev,
int  x0,
int  y0,
int  x,
int  y 
)

References rm::seenv, and sign.

Referenced by feel_location().

Here is the caller graph for this function:

STATIC_OVL int set_twall ( int  x0,
int  y0,
int  x1,
int  y1,
int  x2,
int  y2,
int  x3,
int  y3 
)

References check_pos(), more_than_one, WM_T_BL, WM_T_BR, and WM_T_LONG.

Referenced by set_wall_state().

Here is the call graph for this function:

Here is the caller graph for this function:

STATIC_OVL int set_wall ( int  x,
int  y,
int  horiz 
)

References check_pos(), more_than_one, WM_W_BOTTOM, WM_W_LEFT, WM_W_RIGHT, and WM_W_TOP.

Referenced by set_wall_state().

Here is the call graph for this function:

Here is the caller graph for this function:

void set_wall_state (  )

References BLCORNER, BRCORNER, COLNO, CROSSWALL, HWALL, levl, MAX_TYPE, pline(), ROWNO, SDOOR, set_corn(), set_crosswall(), set_twall(), set_wall(), TDWALL, TLCORNER, TLWALL, TRCORNER, TRWALL, TUWALL, rm::typ, VWALL, and WM_MASK.

Referenced by mklev().

Here is the call graph for this function:

Here is the caller graph for this function:

void shieldeff ( xchar  x,
xchar  y 
)
void show_glyph ( int  x,
int  y,
int  glyph 
)
STATIC_OVL int swallow_to_glyph ( int  mnum,
int  loc 
)

References GLYPH_SWALLOW_OFF, S_sw_br, S_sw_tl, and what_mon.

Referenced by swallowed().

Here is the caller graph for this function:

void swallowed ( int  first )

References cls(), cmap_to_glyph, monst::data, display_self, isok(), monsndx(), S_stone, S_sw_bc, S_sw_bl, S_sw_br, S_sw_ml, S_sw_mr, S_sw_tc, S_sw_tl, S_sw_tr, show_glyph(), swallow_to_glyph(), u, you::ustuck, you::ux, and you::uy.

Referenced by docrt(), gulpmu(), m_move(), make_hallucinated(), moveloop(), and newcham().

Here is the call graph for this function:

Here is the caller graph for this function:

STATIC_OVL void t_warn ( struct rm lev )

References TDWALL, TLWALL, TRWALL, TUWALL, and WM_MASK.

Referenced by wall_angle().

Here is the caller graph for this function:

void tmp_at ( int  x,
int  y 
)
void under_ground ( int  mode )

References cls(), FALSE, newsym(), TRUE, u, you::ux, and you::uy.

Referenced by docrt(), food_detect(), gold_detect(), monster_detect(), moveloop(), object_detect(), and trap_detect().

Here is the call graph for this function:

Here is the caller graph for this function:

void under_water ( int  mode )

References Blind, cls(), cmap_to_glyph, FALSE, is_pool(), Is_waterlevel, isok(), newsym(), S_stone, show_glyph(), TRUE, u, you::ux, you::uy, and you::uz.

Referenced by docrt(), drown(), food_detect(), gold_detect(), monster_detect(), moveloop(), object_detect(), and trap_detect().

Here is the call graph for this function:

Here is the caller graph for this function:

void unmap_object ( int  x,
int  y 
)

References cmap_to_glyph, covers_traps, dlevel_t::flags, rm::glyph, level, levl, map_background(), map_trap(), ROOM, S_darkroom, S_room, S_stone, t_at(), and rm::typ.

Referenced by bhit(), buzz(), clear_stale_map(), dokick(), domove(), dosearch0(), explode(), findone(), kick_monster(), monstone(), moverock(), peffects(), and use_stethoscope().

Here is the call graph for this function:

Here is the caller graph for this function:

STATIC_OVL int wall_angle ( struct rm lev )
int zapdir_to_glyph ( int  dx,
int  dy,
int  beam_type 
)

References GLYPH_ZAP_OFF, and NUM_ZAP.

Referenced by buzz().

Here is the caller graph for this function:


Variable Documentation

const int cross_matrix[4][6] [static]
gbuf_entry gbuf[ROWNO][COLNO] [static]
char gbuf_start[ROWNO] [static]
char gbuf_stop[ROWNO] [static]
gbuf_entry nul_gbuf = { 0, cmap_to_glyph(S_stone) } [static]

Referenced by clear_glyph_buffer().

unsigned char seenv_matrix[3][3]
Initial value:
 { {SV2,   SV1, SV0},
                                     {SV3, SVALL, SV7},
                                     {SV4,   SV5, SV6} }

Referenced by vision_recalc().

struct tmp_glyph tgfirst [static]

Referenced by tmp_at().

const int wall_matrix[4][5] [static]