not PR #1102 - map refresh during #terrain

This fixes the part of pull request #1102 by entrez dealing with the
map refresh side of things.  It was pulled out of a much larger patch
that also deals with terminal window resize for tty.

Using ^R when getpos() is in operation, whether actually picking a
position for something or browsing the map during #terrain or post
detection magic, it was reconstructing the known map and positioning
the cursor on the hero instead redrawing the selected terrain subset
or detected objects/monsters/whatever.  There's already a routine to
redraw the current view of the map without recalculating it, but it
wasn't being used for ^R during getpos operation.
This commit is contained in:
PatR
2023-10-12 01:18:55 -07:00
parent e5c6bf8ec0
commit f70f84aee7
5 changed files with 59 additions and 17 deletions

View File

@@ -1033,6 +1033,14 @@ enum glyph_offsets {
#define MG_FEMALE 0x02000 /* represents a female mon or statue of one */
#define MG_BADXY 0x04000 /* bad coordinates were passed */
/* docrt(): re-draw whole screen; docrt_flags(): docrt() with more control */
enum docrt_flags_bits {
docrtRecalc = 0, /* full docrt(), recalculate what the map should show */
docrtRefresh = 1, /* redraw_map(), draw what we think the map shows */
docrtMapOnly = 2, /* ORed with Recalc or Refresh; draw the map but not
* status or perminv */
};
typedef struct {
xint8 gnew; /* perhaps move this bit into the rm structure. */
glyph_info glyphinfo;

View File

@@ -445,7 +445,8 @@ extern void see_traps(void);
extern void curs_on_u(void);
extern int doredraw(void);
extern void docrt(void);
extern void redraw_map(void);
extern void docrt_flags(int);
extern void redraw_map(boolean);
extern void show_glyph(coordxy, coordxy, int);
extern void clear_glyph_buffer(void);
extern void row_refresh(coordxy, coordxy, coordxy);