be more consistent with coordinates

This commit is contained in:
nhmall
2022-07-02 09:10:03 -04:00
parent 0bd5b3d39e
commit 3004cf2d34
74 changed files with 831 additions and 746 deletions

View File

@@ -586,7 +586,7 @@ QCoreApplication::exec: The event loop is already running
return keybuffer.GetAscii();
}
int NetHackQtBind::qt_nh_poskey(int *x, int *y, int *mod)
int NetHackQtBind::qt_nh_poskey(coordxy *x, coordxy *y, int *mod)
{
if (main)
main->fadeHighlighting(true);

View File

@@ -69,7 +69,7 @@ public:
static void qt_raw_print(const char *str);
static void qt_raw_print_bold(const char *str);
static int qt_nhgetch();
static int qt_nh_poskey(int *x, int *y, int *mod);
static int qt_nh_poskey(coordxy *x, coordxy *y, int *mod);
static void qt_nhbell();
static int qt_doprev_message();
static char qt_more();

View File

@@ -989,7 +989,7 @@ X11_nhgetch(void)
}
int
X11_nh_poskey(int *x, int *y, int *mod)
X11_nh_poskey(coordxy *x, coordxy *y, int *mod)
{
int val = input_event(EXIT_ON_KEY_OR_BUTTON_PRESS);

View File

@@ -42,7 +42,7 @@ void chainin_print_glyph(winid, coordxy, coordxy,
void chainin_raw_print(const char *);
void chainin_raw_print_bold(const char *);
int chainin_nhgetch(void);
int chainin_nh_poskey(int *, int *, int *);
int chainin_nh_poskey(coordxy *, coordxy *, int *);
void chainin_nhbell(void);
int chainin_doprev_message(void);
char chainin_yn_function(const char *, const char *, char);
@@ -377,8 +377,8 @@ chainin_nhgetch(void)
int
chainin_nh_poskey(
int *x,
int *y,
coordxy *x,
coordxy *y,
int *mod)
{
int rv;

View File

@@ -42,7 +42,7 @@ void chainout_print_glyph(void *,winid, coordxy, coordxy,
void chainout_raw_print(void *,const char *);
void chainout_raw_print_bold(void *,const char *);
int chainout_nhgetch(void *);
int chainout_nh_poskey(void *,int *, int *, int *);
int chainout_nh_poskey(void *,coordxy *, coordxy *, int *);
void chainout_nhbell(void *);
int chainout_doprev_message(void *);
char chainout_yn_function(void *,const char *, const char *, char);
@@ -446,8 +446,8 @@ chainout_nhgetch(void *vp)
int
chainout_nh_poskey(
void *vp,
int *x,
int *y,
coordxy *x,
coordxy *y,
int *mod)
{
struct chainout_data *tdp = vp;

View File

@@ -69,7 +69,7 @@ void trace_print_glyph(void *,winid, coordxy, coordxy,
void trace_raw_print(void *,const char *);
void trace_raw_print_bold(void *,const char *);
int trace_nhgetch(void *);
int trace_nh_poskey(void *,int *, int *, int *);
int trace_nh_poskey(void *,coordxy *, coordxy *, int *);
void trace_nhbell(void *);
int trace_doprev_message(void *);
char trace_yn_function(void *,const char *, const char *, char);
@@ -724,8 +724,8 @@ trace_nhgetch(void *vp)
int
trace_nh_poskey(
void *vp,
int *x,
int *y,
coordxy *x,
coordxy *y,
int *mod)
{
struct trace_data *tdp = vp;
@@ -742,7 +742,8 @@ trace_nh_poskey(
} else {
sprintf(buf, "(%d)", rv);
}
fprintf(wc_tracelogf, "%s=> %s (%d, %d, %d)\n", INDENT, buf, *x, *y,
fprintf(wc_tracelogf, "%s=> %s (%d, %d, %d)\n", INDENT, buf,
(int) *x, (int) *y,
*mod);
return rv;

View File

@@ -881,7 +881,7 @@ curses_nhgetch(void)
}
/*
int nh_poskey(int *x, int *y, int *mod)
int nh_poskey(coordxy *x, coordxy *y, int *mod)
-- Returns a single character input from the user or a
a positioning event (perhaps from a mouse). If the
return value is non-zero, a character was typed, else,
@@ -896,7 +896,7 @@ int nh_poskey(int *x, int *y, int *mod)
routine always returns a non-zero character.
*/
int
curses_nh_poskey(int *x, int *y, int *mod)
curses_nh_poskey(coordxy *x, coordxy *y, int *mod)
{
int key = curses_nhgetch();

View File

@@ -974,7 +974,7 @@ event, or the first non-mouse key event in the case of mouse
movement. */
int
curses_get_mouse(int *mousex, int *mousey, int *mod)
curses_get_mouse(coordxy *mousex, coordxy *mousey, int *mod)
{
int key = '\033';

View File

@@ -30,7 +30,7 @@ int curses_convert_attr(int attr);
int curses_read_attrs(const char *attrs);
char *curses_fmt_attrs(char *);
int curses_convert_keys(int key);
int curses_get_mouse(int *mousex, int *mousey, int *mod);
int curses_get_mouse(coordxy *mousex, coordxy *mousey, int *mod);
void curses_mouse_support(int);
#endif /* CURSMISC_H */

View File

@@ -331,7 +331,7 @@ safe_nhgetch(void)
*/
/*ARGSUSED*/
int
safe_nh_poskey(int *x, int *y, int *mod)
safe_nh_poskey(coordxy *x, coordxy *y, int *mod)
{
return '\033';
}

View File

@@ -145,7 +145,7 @@ VDECLCB(shim_print_glyph,(winid w, coordxy x, coordxy y, const glyph_info *glyph
VDECLCB(shim_raw_print,(const char *str), "vs", P2V str)
VDECLCB(shim_raw_print_bold,(const char *str), "vs", P2V str)
DECLCB(int, shim_nhgetch,(void), "i")
DECLCB(int, shim_nh_poskey,(int *x, int *y, int *mod), "iooo", P2V x, P2V y, P2V mod)
DECLCB(int, shim_nh_poskey,(coordxy *x, coordxy *y, int *mod), "iooo", P2V x, P2V y, P2V mod)
VDECLCB(shim_nhbell,(void), "v")
DECLCB(int, shim_doprev_message,(void),"iv")
DECLCB(char, shim_yn_function,(const char *query, const char *resp, char def), "cssi", P2V query, P2V resp, A2P def)

View File

@@ -4376,9 +4376,9 @@ tty_nhgetch(void)
/*ARGSUSED*/
int
#if defined(WIN32CON)
tty_nh_poskey(int *x, int *y, int *mod)
tty_nh_poskey(coordxy *x, coordxy *y, int *mod)
#else
tty_nh_poskey(int *x UNUSED, int *y UNUSED, int *mod UNUSED)
tty_nh_poskey(coordxy *x UNUSED, coordxy *y UNUSED, int *mod UNUSED)
#endif
{
int i;

View File

@@ -1440,7 +1440,7 @@ mswin_nhgetch(void)
}
/*
int nh_poskey(int *x, int *y, int *mod)
int nh_poskey(coordxy *x, coordxy *y, int *mod)
-- Returns a single character input from the user or a
a positioning event (perhaps from a mouse). If the
return value is non-zero, a character was typed, else,
@@ -1455,7 +1455,7 @@ int nh_poskey(int *x, int *y, int *mod)
routine always returns a non-zero character.
*/
int
mswin_nh_poskey(int *x, int *y, int *mod)
mswin_nh_poskey(coordxy *x, coordxy *y, int *mod)
{
PMSNHEvent event;
int key;
@@ -1468,8 +1468,8 @@ mswin_nh_poskey(int *x, int *y, int *mod)
if (event->type == NHEVENT_MOUSE) {
if (iflags.wc_mouse_support) {
*mod = event->ei.ms.mod;
*x = event->ei.ms.x;
*y = event->ei.ms.y;
*x = (coordxy) event->ei.ms.x;
*y = (coordxy) event->ei.ms.y;
}
key = 0;
} else {

View File

@@ -170,7 +170,7 @@ void mswin_raw_print(const char *str);
void mswin_raw_print_bold(const char *str);
void mswin_raw_print_flush();
int mswin_nhgetch(void);
int mswin_nh_poskey(int *x, int *y, int *mod);
int mswin_nh_poskey(coordxy *x, coordxy *y, int *mod);
void mswin_nhbell(void);
int mswin_doprev_message(void);
char mswin_yn_function(const char *question, const char *choices, char def);