display.h reformatting
A couple of macros with comments in the midst of their expansions got badly mangled by the automated reformat and one ended up with a line that was over 150 characters wide.
This commit is contained in:
+26
-25
@@ -1,4 +1,4 @@
|
|||||||
/* NetHack 3.6 display.h $NHDT-Date: 1432512777 2015/05/25 00:12:57 $ $NHDT-Branch: master $:$NHDT-Revision: 1.24 $ */
|
/* NetHack 3.6 display.h $NHDT-Date: 1447729027 2015/11/17 02:57:07 $ $NHDT-Branch: master $:$NHDT-Revision: 1.26 $ */
|
||||||
/* Copyright (c) Dean Luick, with acknowledgements to Kevin Darcy */
|
/* Copyright (c) Dean Luick, with acknowledgements to Kevin Darcy */
|
||||||
/* and Dave Cohrs, 1990. */
|
/* and Dave Cohrs, 1990. */
|
||||||
/* NetHack may be freely redistributed. See license for details. */
|
/* NetHack may be freely redistributed. See license for details. */
|
||||||
@@ -29,11 +29,13 @@
|
|||||||
*/
|
*/
|
||||||
#define tp_sensemon(mon) \
|
#define tp_sensemon(mon) \
|
||||||
(/* The hero can always sense a monster IF: */ \
|
(/* The hero can always sense a monster IF: */ \
|
||||||
(!mindless(mon->data)) && /* 1. the monster has a brain to sense AND */ \
|
/* 1. the monster has a brain to sense */ \
|
||||||
((Blind && Blind_telepat) \
|
(!mindless(mon->data)) \
|
||||||
|| /* 2a. hero is blind and telepathic OR */ /* 2b. hero is using a \
|
/* AND 2a. hero is blind and telepathic */ \
|
||||||
telepathy inducing */ /* object and in range */ \
|
&& ((Blind && Blind_telepat) \
|
||||||
(Unblind_telepat \
|
/* OR 2b. hero is using a telepathy inducing */ \
|
||||||
|
/* object and in range */ \
|
||||||
|
|| (Unblind_telepat \
|
||||||
&& (distu(mon->mx, mon->my) <= (BOLT_LIM * BOLT_LIM)))))
|
&& (distu(mon->mx, mon->my) <= (BOLT_LIM * BOLT_LIM)))))
|
||||||
|
|
||||||
#define sensemon(mon) \
|
#define sensemon(mon) \
|
||||||
@@ -57,11 +59,10 @@
|
|||||||
* Infravision is not taken into account.
|
* Infravision is not taken into account.
|
||||||
*/
|
*/
|
||||||
#define mon_visible(mon) \
|
#define mon_visible(mon) \
|
||||||
(/* The hero can see the monster */ /* IF the monster */ \
|
(/* The hero can see the monster IF the monster */ \
|
||||||
(!mon->minvis || See_invisible) && /* 1. is not invisible AND */ \
|
(!mon->minvis || See_invisible) /* 1. is not invisible */ \
|
||||||
(!mon->mundetected) && /* 2. not an undetected hider */ \
|
&& !mon->mundetected /* AND 2. not an undetected hider */ \
|
||||||
(!(mon->mburied || u.uburied)) /* 3. neither you or it is buried */ \
|
&& !(mon->mburied || u.uburied)) /* AND 3. neither you nor it is buried */
|
||||||
)
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* see_with_infrared()
|
* see_with_infrared()
|
||||||
@@ -179,8 +180,7 @@
|
|||||||
#define DISP_BEAM (-1) /* Keep all glyphs showing & clean up at end. */
|
#define DISP_BEAM (-1) /* Keep all glyphs showing & clean up at end. */
|
||||||
#define DISP_ALL (-2) /* Like beam, but still displayed if not visible. */
|
#define DISP_ALL (-2) /* Like beam, but still displayed if not visible. */
|
||||||
#define DISP_FLASH (-3) /* Clean up each glyph before displaying new one. */
|
#define DISP_FLASH (-3) /* Clean up each glyph before displaying new one. */
|
||||||
#define DISP_ALWAYS (-4) /* Like flash, but still displayed if not visible. \
|
#define DISP_ALWAYS (-4) /* Like flash, but still displayed if not visible. */
|
||||||
*/
|
|
||||||
#define DISP_CHANGE (-5) /* Change glyph. */
|
#define DISP_CHANGE (-5) /* Change glyph. */
|
||||||
#define DISP_END (-6) /* Clean up. */
|
#define DISP_END (-6) /* Clean up. */
|
||||||
#define DISP_FREEMEM (-7) /* Free all memory during exit only. */
|
#define DISP_FREEMEM (-7) /* Free all memory during exit only. */
|
||||||
@@ -200,15 +200,14 @@
|
|||||||
|
|
||||||
#define display_self() \
|
#define display_self() \
|
||||||
show_glyph(u.ux, u.uy, \
|
show_glyph(u.ux, u.uy, \
|
||||||
maybe_display_usteed( \
|
maybe_display_usteed((youmonst.m_ap_type == M_AP_NOTHING) \
|
||||||
youmonst.m_ap_type == M_AP_NOTHING \
|
|
||||||
? hero_glyph \
|
? hero_glyph \
|
||||||
: youmonst.m_ap_type == M_AP_FURNITURE \
|
: (youmonst.m_ap_type == M_AP_FURNITURE) \
|
||||||
? cmap_to_glyph(youmonst.mappearance) \
|
? cmap_to_glyph(youmonst.mappearance) \
|
||||||
: youmonst.m_ap_type == M_AP_OBJECT \
|
: (youmonst.m_ap_type == M_AP_OBJECT) \
|
||||||
? objnum_to_glyph(youmonst.mappearance) \
|
? objnum_to_glyph(youmonst.mappearance) \
|
||||||
: /* else M_AP_MONSTER */ \
|
/* else M_AP_MONSTER */ \
|
||||||
monnum_to_glyph(youmonst.mappearance)))
|
: monnum_to_glyph(youmonst.mappearance)))
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* A glyph is an abstraction that represents a _unique_ monster, object,
|
* A glyph is an abstraction that represents a _unique_ monster, object,
|
||||||
@@ -276,7 +275,6 @@
|
|||||||
#define MAX_GLYPH (NUMMONS + GLYPH_STATUE_OFF)
|
#define MAX_GLYPH (NUMMONS + GLYPH_STATUE_OFF)
|
||||||
|
|
||||||
#define NO_GLYPH MAX_GLYPH
|
#define NO_GLYPH MAX_GLYPH
|
||||||
|
|
||||||
#define GLYPH_INVISIBLE GLYPH_INVIS_OFF
|
#define GLYPH_INVISIBLE GLYPH_INVIS_OFF
|
||||||
|
|
||||||
#define warning_to_glyph(mwarnlev) ((mwarnlev) + GLYPH_WARNING_OFF)
|
#define warning_to_glyph(mwarnlev) ((mwarnlev) + GLYPH_WARNING_OFF)
|
||||||
@@ -297,15 +295,16 @@
|
|||||||
: otg_temp + GLYPH_OBJ_OFF)
|
: otg_temp + GLYPH_OBJ_OFF)
|
||||||
|
|
||||||
#define obj_to_glyph(obj) \
|
#define obj_to_glyph(obj) \
|
||||||
((obj)->otyp == STATUE \
|
(((obj)->otyp == STATUE) \
|
||||||
? statue_to_glyph(obj) \
|
? statue_to_glyph(obj) \
|
||||||
: Hallucination ? random_obj_to_glyph() \
|
: Hallucination \
|
||||||
: (obj)->otyp == CORPSE \
|
? random_obj_to_glyph() \
|
||||||
|
: ((obj)->otyp == CORPSE) \
|
||||||
? (int) (obj)->corpsenm + GLYPH_BODY_OFF \
|
? (int) (obj)->corpsenm + GLYPH_BODY_OFF \
|
||||||
: (int) (obj)->otyp + GLYPH_OBJ_OFF)
|
: (int) (obj)->otyp + GLYPH_OBJ_OFF)
|
||||||
|
|
||||||
/* MRKR: Statues now have glyphs corresponding to the monster they */
|
/* MRKR: Statues now have glyphs corresponding to the monster they */
|
||||||
/* brepresent and look like monsters when you are hallucinating. */
|
/* represent and look like monsters when you are hallucinating. */
|
||||||
|
|
||||||
#define statue_to_glyph(obj) \
|
#define statue_to_glyph(obj) \
|
||||||
(Hallucination ? random_monster() + GLYPH_MON_OFF \
|
(Hallucination ? random_monster() + GLYPH_MON_OFF \
|
||||||
@@ -360,7 +359,9 @@
|
|||||||
? ((glyph) - GLYPH_STATUE_OFF) \
|
? ((glyph) - GLYPH_STATUE_OFF) \
|
||||||
: NO_GLYPH)
|
: NO_GLYPH)
|
||||||
#define glyph_to_obj(glyph) \
|
#define glyph_to_obj(glyph) \
|
||||||
(glyph_is_body(glyph) ? CORPSE : glyph_is_statue(glyph) \
|
(glyph_is_body(glyph) \
|
||||||
|
? CORPSE \
|
||||||
|
: glyph_is_statue(glyph) \
|
||||||
? STATUE \
|
? STATUE \
|
||||||
: glyph_is_normal_object(glyph) \
|
: glyph_is_normal_object(glyph) \
|
||||||
? ((glyph) - GLYPH_OBJ_OFF) \
|
? ((glyph) - GLYPH_OBJ_OFF) \
|
||||||
|
|||||||
Reference in New Issue
Block a user