From eaf2af0b58e9318636bb9a19c3a109032a1fca6d Mon Sep 17 00:00:00 2001 From: PatR Date: Tue, 15 Sep 2020 07:26:42 -0700 Subject: [PATCH] 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. --- doc/fixes37.0 | 3 ++- win/Qt/qt_map.cpp | 68 +++++++++++++++++++++++++---------------------- 2 files changed, 38 insertions(+), 33 deletions(-) diff --git a/doc/fixes37.0 b/doc/fixes37.0 index f03cb4676..4e7535c4d 100644 --- a/doc/fixes37.0 +++ b/doc/fixes37.0 @@ -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" diff --git a/win/Qt/qt_map.cpp b/win/Qt/qt_map.cpp index bb208d243..0bb96d673 100644 --- a/win/Qt/qt_map.cpp +++ b/win/Qt/qt_map.cpp @@ -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