Merge branch 'NetHack-3.6'
This commit is contained in:
@@ -519,8 +519,6 @@ curses_move_cursor(winid wid, int x, int y)
|
||||
|
||||
if (wid != MAP_WIN) {
|
||||
return;
|
||||
} else {
|
||||
--x; /* map column [0] isn't used, so shift everything over 1 col */
|
||||
}
|
||||
#ifdef PDCURSES
|
||||
/* PDCurses seems to not handle wmove correctly, so we use move and
|
||||
@@ -536,8 +534,9 @@ curses_move_cursor(winid wid, int x, int y)
|
||||
curs_y++;
|
||||
}
|
||||
|
||||
if ((x >= sx) && (x <= ex) && (y >= sy) && (y <= ey)) {
|
||||
curs_x -= sx;
|
||||
if (x >= sx && x <= ex && y >= sy && y <= ey) {
|
||||
/* map column #0 isn't used; shift column #1 to first screen column */
|
||||
curs_x -= (sx + 1);
|
||||
curs_y -= sy;
|
||||
#ifdef PDCURSES
|
||||
move(curs_y, curs_x);
|
||||
|
||||
@@ -624,9 +624,14 @@ curses_draw_map(int sx, int sy, int ex, int ey)
|
||||
vsb_bar.attr = A_NORMAL;
|
||||
|
||||
/* Horizontal scrollbar */
|
||||
if ((sx > 0) || (ex < (COLNO - 1))) {
|
||||
sbsx = (sx * ((long) (ex - sx + 1) / COLNO));
|
||||
sbex = (ex * ((long) (ex - sx + 1) / COLNO));
|
||||
if (sx > 0 || ex < (COLNO - 1)) {
|
||||
sbsx = (int) (((long) sx * (long) (ex - sx + 1)) / (long) COLNO);
|
||||
sbex = (int) (((long) ex * (long) (ex - sx + 1)) / (long) COLNO);
|
||||
|
||||
if (sx > 0 && sbsx == 0)
|
||||
++sbsx;
|
||||
if (ex < ROWNO - 1 && sbex == ROWNO - 1)
|
||||
--sbex;
|
||||
|
||||
for (count = 0; count < sbsx; count++) {
|
||||
write_char(mapwin, count + bspace, ey - sy + 1 + bspace, hsb_back);
|
||||
@@ -642,9 +647,14 @@ curses_draw_map(int sx, int sy, int ex, int ey)
|
||||
}
|
||||
|
||||
/* Vertical scrollbar */
|
||||
if ((sy > 0) || (ey < (ROWNO - 1))) {
|
||||
sbsy = (sy * ((long) (ey - sy + 1) / ROWNO));
|
||||
sbey = (ey * ((long) (ey - sy + 1) / ROWNO));
|
||||
if (sy > 0 || ey < (ROWNO - 1)) {
|
||||
sbsy = (int) (((long) sy * (long) (ey - sy + 1)) / (long) ROWNO);
|
||||
sbey = (int) (((long) ey * (long) (ey - sy + 1)) / (long) ROWNO);
|
||||
|
||||
if (sy > 0 && sbsy == 0)
|
||||
++sbsy;
|
||||
if (ey < ROWNO - 1 && sbey == ROWNO - 1)
|
||||
--sbey;
|
||||
|
||||
for (count = 0; count < sbsy; count++) {
|
||||
write_char(mapwin, ex - sx + 1 + bspace, count + bspace, vsb_back);
|
||||
|
||||
Reference in New Issue
Block a user