unexplored terrain on Qt map

Qt's map hadn't been updated to draw unexplored locations with
the unexplored glyph so was still using solid stone instead.

Column 0 should be removed but I'll leave that for someone more
adventurous; I did it for curses and for X11 but am going to
pass here.  It's very noticable after magic mapping but is only
"bad" (by wasting space) if clipping is being performed.
This commit is contained in:
PatR
2020-09-15 07:26:42 -07:00
parent 33964801c8
commit eaf2af0b58
2 changed files with 38 additions and 33 deletions

View File

@@ -1,4 +1,4 @@
NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.301 $ $NHDT-Date: 1599778430 2020/09/10 22:53:50 $
NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.302 $ $NHDT-Date: 1600179998 2020/09/15 14:26:38 $
General Fixes and Modified Features
-----------------------------------
@@ -404,6 +404,7 @@ Qt: update message window's last message with player's response if it's a
prompt string for a single-character of input (ynaq or invent letter)
Qt: for line input, display the prompt+response in the message window
Qt: enable the popup_dialog WC option (result is a bit flakey but usable)
Qt: 3.6 catchup - show unexplored locations as unexplored rather than as stone
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"

View File

@@ -31,26 +31,31 @@ namespace nethack_qt_ {
#ifdef TEXTCOLOR
static const QPen& nhcolor_to_pen(int c)
{
static QPen* pen=0;
if ( !pen ) {
pen = new QPen[17];
pen[0] = QColor(64,64,64);
pen[1] = QColor(Qt::red);
pen[2] = QColor(0,191,0);
pen[3] = QColor(127,127,0);
pen[4] = QColor(Qt::blue);
pen[5] = QColor(Qt::magenta);
pen[6] = QColor(Qt::cyan);
pen[7] = QColor(Qt::gray);
pen[8] = QColor(Qt::white); // no color
pen[9] = QColor(255,127,0);
pen[10] = QColor(127,255,127);
pen[11] = QColor(Qt::yellow);
pen[12] = QColor(127,127,255);
pen[13] = QColor(255,127,255);
pen[14] = QColor(127,255,255);
pen[15] = QColor(Qt::white);
pen[16] = QColor(Qt::black);
static QPen *pen = (QPen *) 0;
if (!pen) {
pen = new QPen[17];
//
// FIXME: these are duplicated in qt_menu.cpp
//
pen[ 0] = QColor(64, 64, 64); // black
pen[ 1] = QColor(Qt::red);
pen[ 2] = QColor(0, 191, 0); // green
pen[ 3] = QColor(127, 127, 0); // brownish
pen[ 4] = QColor(Qt::blue);
pen[ 5] = QColor(Qt::magenta);
pen[ 6] = QColor(Qt::cyan);
pen[ 7] = QColor(Qt::gray);
// on tty, "light" variations are "bright" instead; here they're paler
pen[ 8] = QColor(Qt::white); // no color
pen[ 9] = QColor(255, 127, 0); // orange
pen[10] = QColor(127, 255, 127); // light green
pen[11] = QColor(Qt::yellow);
pen[12] = QColor(127, 127, 255); // light blue
pen[13] = QColor(255, 127, 255); // light magenta
pen[14] = QColor(127, 255, 255); // light cyan
pen[15] = QColor(Qt::white);
// ? out of range for 0..15
pen[16] = QColor(Qt::black);
}
return pen[c];
@@ -502,12 +507,13 @@ void NetHackQtMapViewport::clickCursor()
void NetHackQtMapViewport::Clear()
{
unsigned short stone=cmap_to_glyph(S_stone);
for (int j=0; j<ROWNO; j++) {
for (int i=0; i<COLNO; i++) {
Glyph(i,j)=stone;
}
for (int j = 0; j < ROWNO; ++j) {
//
// FIXME: map column 0 should be surpressed from being displayed
//
Glyph(0, j) = GLYPH_NOTHING;
for (int i = 1; i < COLNO; ++i)
Glyph(i, j) = GLYPH_UNEXPLORED;
}
change.clear();
@@ -770,12 +776,10 @@ void NetHackQtMapWindow::Scroll(int dx, int dy)
void NetHackQtMapWindow::Clear()
{
unsigned short stone=cmap_to_glyph(S_stone);
for (int j=0; j<ROWNO; j++) {
for (int i=0; i<COLNO; i++) {
Glyph(i,j)=stone;
}
for (int j = 0; j < ROWNO; ++j) {
Glyph(0, j) = GLYPH_NOTHING;
for (int i = 1; i < COLNO; ++i)
Glyph(i, j) = GLYPH_UNEXPLORED;
}
change.clear();