-NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.285 $ $NHDT-Date: 1597546107 2020/08/16 02:48:27 $
+NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.286 $ $NHDT-Date: 1597700875 2020/08/17 21:47:55 $
General Fixes and Modified Features
-----------------------------------
two-handed weapon in both the shield and primary weapon slots; show
first active light source in a previously unused slot on lower right;
show first leash-in-use in a previously unused slot on lower left
+Qt: paper doll inventory view was inconsistently updated during Hallucination
Qt+QSX: fix control key
Qt+OSX: rename menu entry "nethack->Preferences..." for invoking nethack's
'O' command to "Game->Run-time options" and entry "Game->Qt settings"
-/* NetHack 3.7 display.h $NHDT-Date: 1596498533 2020/08/03 23:48:53 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.46 $ */
+/* NetHack 3.7 display.h $NHDT-Date: 1597700875 2020/08/17 21:47:55 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.47 $ */
/* Copyright (c) Dean Luick, with acknowledgements to Kevin Darcy */
/* and Dave Cohrs, 1990. */
/* NetHack may be freely redistributed. See license for details. */
/* This has the unfortunate side effect of needing a global variable */
/* to store a result. 'otg_temp' is defined and declared in decl.{ch}. */
-#define random_obj_to_glyph(rng) \
- ((g.otg_temp = random_object(rng)) == CORPSE \
- ? random_monster(rng) + GLYPH_BODY_OFF \
+#define random_obj_to_glyph(rng) \
+ ((g.otg_temp = random_object(rng)) == CORPSE \
+ ? random_monster(rng) + GLYPH_BODY_OFF \
: g.otg_temp + GLYPH_OBJ_OFF)
-#define obj_to_glyph(obj, rng) \
- (((obj)->otyp == STATUE) \
- ? statue_to_glyph(obj, rng) \
- : Hallucination \
- ? random_obj_to_glyph(rng) \
- : ((obj)->otyp == CORPSE) \
- ? (int) (obj)->corpsenm + GLYPH_BODY_OFF \
+#define obj_to_glyph(obj, rng) \
+ (((obj)->otyp == STATUE) \
+ ? statue_to_glyph(obj, rng) \
+ : Hallucination \
+ ? random_obj_to_glyph(rng) \
+ : ((obj)->otyp == CORPSE) \
+ ? (int) (obj)->corpsenm + GLYPH_BODY_OFF \
: (int) (obj)->otyp + GLYPH_OBJ_OFF)
/* MRKR: Statues now have glyphs corresponding to the monster they */
(Hallucination ? random_monster(rng) + GLYPH_MON_OFF \
: (int) (obj)->corpsenm + GLYPH_STATUE_OFF)
+/* briefly used for Qt's "paper doll" inventory which shows map tiles for
+ equipped objects; those vary like floor items during hallucination now
+ so this isn't used anywhere */
+#define obj_to_true_glyph(obj) \
+ (((obj)->otyp == STATUE) \
+ ? ((int) (obj)->corpsenm + GLYPH_STATUE_OFF) \
+ : ((obj)->otyp == CORPSE) \
+ ? ((int) (obj)->corpsenm + GLYPH_BODY_OFF) \
+ : ((int) (obj)->otyp + GLYPH_OBJ_OFF))
+
#define cmap_to_glyph(cmap_idx) ((int) (cmap_idx) + GLYPH_CMAP_OFF)
#define explosion_to_glyph(expltype, idx) \
((((expltype) * MAXEXPCHARS) + ((idx) - S_explode1)) + GLYPH_EXPLODE_OFF)
-/* NetHack 3.7 display.c $NHDT-Date: 1596498156 2020/08/03 23:42:36 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.135 $ */
+/* NetHack 3.7 display.c $NHDT-Date: 1597700875 2020/08/17 21:47:55 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.136 $ */
/* Copyright (c) Dean Luick, with acknowledgements to Kevin Darcy */
/* and Dave Cohrs, 1990. */
/* NetHack may be freely redistributed. See license for details. */
see_objects()
{
register struct obj *obj;
+
for (obj = fobj; obj; obj = obj->nobj)
if (vobj_at(obj->ox, obj->oy) == obj)
newsym(obj->ox, obj->oy);
+
+ /* Qt's "paper doll" subset of persistent inventory shows map tiles
+ for objects which aren't on the floor so not handled by above loop;
+ inventory which includes glyphs should also be affected, so do this
+ for all interfaces in case any feature that for persistent inventory */
+ update_inventory();
}
/*
int x, int y, bool canbe)
{
short int glyph;
- if (nhobj)
- glyph = obj_to_glyph(nhobj, rn2_on_display_rng);
- else if (canbe)
- glyph = cmap_to_glyph(S_room);
- else
- glyph = GLYPH_UNEXPLORED; // was cmap_to_glyph(S_stone)
-
+ if (nhobj) {
+ /* Hallucination doesn't affect inventory */
+ glyph = obj_to_glyph(nhobj, rn2_on_display_rng);
+ } else {
+ glyph = canbe ? cmap_to_glyph(S_room) : GLYPH_UNEXPLORED;
+ }
qt_settings->glyphs().drawCell(painter, glyph, x, y);
}