diff --git a/src/coloratt.c b/src/coloratt.c index bb67056ca..10f216ba6 100644 --- a/src/coloratt.c +++ b/src/coloratt.c @@ -76,7 +76,7 @@ const struct nethack_color colortable[] = { { NOC, 8, 0, "nocolor", 0x00, 0x00, 0x00 }, /* NO_COLOR */ { NHC, 9, 0, "orange", 0xFF, 0xA5, 0x00 }, /* CLR_ORANGE */ { NHC, 10, 0, "bright-green", - 0x00, 0x80, 0x00 }, /* CLR_BRIGHT_GREEN */ + 0x00, 0x80, 0x00 }, /* CLR_BRIGHT_GREEN */ { NHC, 11, 0, "yellow", 0xFF, 0xFF, 0x00 }, /* CLR_YELLOW */ { NHC, 12, 0, "bright-blue", 0xAD, 0xD8, 0xE6 }, /* CLR_BRIGHT_BLUE */ { NHC, 13, 0, "bright-magenta", diff --git a/src/options.c b/src/options.c index 736d36286..cfbd1a05d 100644 --- a/src/options.c +++ b/src/options.c @@ -5311,11 +5311,11 @@ optfn_boolean( go.opt_need_redraw = TRUE; break; #ifndef IDLECHECKPOINT - case opt_idlecheckpoint: - pline("There is no underlying support for 'idlecheckpoint'" - " compiled in."); - iflags.idlecheckpoint = FALSE; - give_opt_msg = FALSE; + case opt_idlecheckpoint: + pline("There is no underlying support for 'idlecheckpoint'" + " compiled in."); + iflags.idlecheckpoint = FALSE; + give_opt_msg = FALSE; break; #endif default: diff --git a/win/Qt/qt_bind.cpp b/win/Qt/qt_bind.cpp index b82c899cc..feb716a2d 100644 --- a/win/Qt/qt_bind.cpp +++ b/win/Qt/qt_bind.cpp @@ -238,7 +238,7 @@ static bool have_asked = false; void NetHackQtBind::qt_player_selection() { if ( !have_asked ) - qt_askname(); + qt_askname(); } void NetHackQtBind::qt_askname() @@ -345,38 +345,38 @@ winid NetHackQtBind::qt_create_nhwindow(int type) { winid id; for (id = 0; id < (winid) id_to_window.size(); id++) { - if ( !id_to_window[(int)id] ) - break; + if ( !id_to_window[(int)id] ) + break; } if ( id == (winid) id_to_window.size() ) - id_to_window.resize(id+1); + id_to_window.resize(id+1); NetHackQtWindow* window=0; switch (type) { case NHW_MAP: { - NetHackQtMapWindow2* w=new NetHackQtMapWindow2(clickbuffer); - main->AddMapWindow(w); - window=w; + NetHackQtMapWindow2* w=new NetHackQtMapWindow2(clickbuffer); + main->AddMapWindow(w); + window=w; break; } case NHW_MESSAGE: { - NetHackQtMessageWindow* w=new NetHackQtMessageWindow; - main->AddMessageWindow(w); - window=w; + NetHackQtMessageWindow* w=new NetHackQtMessageWindow; + main->AddMessageWindow(w); + window=w; break; } case NHW_STATUS: { - NetHackQtStatusWindow* w=new NetHackQtStatusWindow; - main->AddStatusWindow(w); - window=w; + NetHackQtStatusWindow* w=new NetHackQtStatusWindow; + main->AddStatusWindow(w); + window=w; break; } case NHW_MENU: - window=new NetHackQtMenuOrTextWindow(mainWidget()); + window=new NetHackQtMenuOrTextWindow(mainWidget()); break; case NHW_TEXT: - window=new NetHackQtTextWindow(mainWidget()); + window=new NetHackQtTextWindow(mainWidget()); break; } @@ -387,11 +387,11 @@ winid NetHackQtBind::qt_create_nhwindow(int type) #if QT_VERSION >= 300 && !main->isHidden() #else - && main->isVisible() + && main->isVisible() #endif - ) { - delete splash; - splash = 0; + ) { + delete splash; + splash = 0; } id_to_window[(int)id] = window; @@ -453,30 +453,30 @@ void NetHackQtBind::qt_display_file(const char *filename, boolean must_exist) bool complain = false; { - dlb *f; - char buf[BUFSZ]; - char *cr; + dlb *f; + char buf[BUFSZ]; + char *cr; - window->Clear(); - f = dlb_fopen(filename, "r"); - if (!f) { - complain = must_exist; - } else { - while (dlb_fgets(buf, BUFSZ, f)) { - if ((cr = strchr(buf, '\n')) != 0) *cr = 0; + window->Clear(); + f = dlb_fopen(filename, "r"); + if (!f) { + complain = must_exist; + } else { + while (dlb_fgets(buf, BUFSZ, f)) { + if ((cr = strchr(buf, '\n')) != 0) *cr = 0; #ifdef MSDOS - if ((cr = strchr(buf, '\r')) != 0) *cr = 0; + if ((cr = strchr(buf, '\r')) != 0) *cr = 0; #endif - window->PutStr(ATR_NONE, tabexpand(buf)); - } - window->Display(false); - (void) dlb_fclose(f); - } + window->PutStr(ATR_NONE, tabexpand(buf)); + } + window->Display(false); + (void) dlb_fclose(f); + } } if (complain) { - QString message = nh_qsprintf("File not found: %s\n",filename); - QMessageBox::warning(NULL, "File Error", message, QMessageBox::Ignore); + QString message = nh_qsprintf("File not found: %s\n",filename); + QMessageBox::warning(NULL, "File Error", message, QMessageBox::Ignore); } } @@ -511,7 +511,7 @@ int NetHackQtBind::qt_select_menu(winid wid, int how, MENU_ITEM_P **menu_list) void NetHackQtBind::qt_update_inventory(int arg UNUSED) { if (main) - main->updateInventory(); // update the paper doll inventory subset + main->updateInventory(); // update the paper doll inventory subset /* doesn't work yet if (program_state.something_worth_saving && iflags.perm_invent) @@ -636,7 +636,7 @@ const QPen NetHackQtBind::nhcolor_to_pen(uint32_t c) int NetHackQtBind::qt_nhgetch() { if (main) - main->fadeHighlighting(true); + main->fadeHighlighting(true); // Process events until a key arrives. // @@ -705,17 +705,17 @@ qt_timer_fire(void) int NetHackQtBind::qt_nh_poskey(coordxy *x, coordxy *y, int *mod) { if (main) - main->fadeHighlighting(true); + main->fadeHighlighting(true); #ifdef IDLECHECKPOINT if (iflags.idlecheckpoint) { if (!qt_input_timer) { qt_input_timer = new QTimer(); - qt_input_timer->setSingleShot(true); - connect(qt_input_timer, &QTimer::timeout, &qt_timer_fire); + qt_input_timer->setSingleShot(true); + connect(qt_input_timer, &QTimer::timeout, &qt_timer_fire); } if (!qt_input_timer->isActive()) - qt_input_timer->start(IDLECHECKPOINT_WAIT_TIME * 1000); + qt_input_timer->start(IDLECHECKPOINT_WAIT_TIME * 1000); } #endif // Process events until a key or map-click arrives. @@ -738,15 +738,15 @@ int NetHackQtBind::qt_nh_poskey(coordxy *x, coordxy *y, int *mod) #endif return keybuffer.GetAscii(); } else { - *x=clickbuffer.NextX(); - *y=clickbuffer.NextY(); - *mod=clickbuffer.NextMod(); - clickbuffer.Get(); + *x=clickbuffer.NextX(); + *y=clickbuffer.NextY(); + *mod=clickbuffer.NextMod(); + clickbuffer.Get(); #ifdef IDLECHECKPOINT if (qt_input_timer->isActive()) qt_input_timer->stop(); #endif - return 0; + return 0; } } @@ -792,10 +792,10 @@ char NetHackQtBind::qt_more() int complain = 0; do { ch = NetHackQtBind::qt_nhgetch(); - if (::program_state.savefile_completed) { - retry = false; - break; - } + if (::program_state.savefile_completed) { + retry = false; + break; + } switch (ch) { case '\0': // hypothetical ch = '\033'; @@ -876,26 +876,26 @@ char NetHackQtBind::qt_yn_function(const char *question_, !::iflags.wc_popup_dialog #endif && WIN_MESSAGE != WIN_ERR) { - // Similar to X11 windowport `slow' feature. + // Similar to X11 windowport `slow' feature. char cbuf[20]; cbuf[0] = '\0'; // add the prompt to the message window - NetHackQtBind::qt_putstr(WIN_MESSAGE, ATR_BOLD, message); + NetHackQtBind::qt_putstr(WIN_MESSAGE, ATR_BOLD, message); - while (result < 0) { + while (result < 0) { cbuf[0] = '\0'; - char ch=NetHackQtBind::qt_nhgetch(); - if (ch=='\033') { - result=yn_esc_map; + char ch=NetHackQtBind::qt_nhgetch(); + if (ch=='\033') { + result=yn_esc_map; Strcpy(cbuf, "ESC"); - } else if (choices && !strchr(choices,ch)) { - if (def && (ch==' ' || ch=='\r' || ch=='\n')) { - result=def; + } else if (choices && !strchr(choices,ch)) { + if (def && (ch==' ' || ch=='\r' || ch=='\n')) { + result=def; Strcpy(cbuf, visctrl(def)); - } else { - NetHackQtBind::qt_nhbell(); + } else { + NetHackQtBind::qt_nhbell(); // typing anything caused the most recent message line // (which happens to our prompt) from having highlighting // be removed; put that back @@ -903,13 +903,13 @@ char NetHackQtBind::qt_yn_function(const char *question_, *mesgwin = main ? main->GetMessageWindow() : NULL; if (mesgwin) mesgwin->RehighlightPrompt(); - // and try again... - } - } else { - result=ch; + // and try again... + } + } else { + result=ch; Strcpy(cbuf, visctrl(ch)); - } - } + } + } // update the prompt message line to include the response if (cbuf[0]) { diff --git a/win/Qt/qt_bind.h b/win/Qt/qt_bind.h index 45336c29f..17dad758c 100644 --- a/win/Qt/qt_bind.h +++ b/win/Qt/qt_bind.h @@ -23,78 +23,78 @@ class NetHackQtClickBuffer; class NetHackQtBind : NetHackQtBindBase { private: - // Single-instance preservation... - NetHackQtBind(int& argc, char** argv); + // Single-instance preservation... + NetHackQtBind(int& argc, char** argv); - static NetHackQtBind* instance; + static NetHackQtBind* instance; - static NetHackQtKeyBuffer keybuffer; - static NetHackQtClickBuffer clickbuffer; + static NetHackQtKeyBuffer keybuffer; + static NetHackQtClickBuffer clickbuffer; - static QFrame* splash; - static NetHackQtMainWindow* main; + static QFrame* splash; + static NetHackQtMainWindow* main; public: static void qt_Splash(); /* window interface */ - static void qt_init_nhwindows(int* argc, char** argv); - static void qt_player_selection(); - static void qt_askname(); - static void qt_get_nh_event(); - static void qt_exit_nhwindows(const char *); - static void qt_suspend_nhwindows(const char *); - static void qt_resume_nhwindows(); - static winid qt_create_nhwindow(int type); - static void qt_clear_nhwindow(winid wid); - static void qt_display_nhwindow(winid wid, boolean block); - static void qt_destroy_nhwindow(winid wid); - static void qt_curs(winid wid, int x, int y); - static void qt_putstr(winid wid, int attr, const char *text); - static void qt_putstr(winid wid, int attr, const std::string& text); - static void qt_putstr(winid wid, int attr, const QString& text); - static void qt_display_file(const char *filename, boolean must_exist); - static void qt_start_menu(winid wid, unsigned long mbehavior); - static void qt_add_menu(winid wid, const glyph_info *glyphinfo, - const ANY_P * identifier, char ch, char gch, int attr, int clr, - const char *str, unsigned int itemflags); + static void qt_init_nhwindows(int* argc, char** argv); + static void qt_player_selection(); + static void qt_askname(); + static void qt_get_nh_event(); + static void qt_exit_nhwindows(const char *); + static void qt_suspend_nhwindows(const char *); + static void qt_resume_nhwindows(); + static winid qt_create_nhwindow(int type); + static void qt_clear_nhwindow(winid wid); + static void qt_display_nhwindow(winid wid, boolean block); + static void qt_destroy_nhwindow(winid wid); + static void qt_curs(winid wid, int x, int y); + static void qt_putstr(winid wid, int attr, const char *text); + static void qt_putstr(winid wid, int attr, const std::string& text); + static void qt_putstr(winid wid, int attr, const QString& text); + static void qt_display_file(const char *filename, boolean must_exist); + static void qt_start_menu(winid wid, unsigned long mbehavior); + static void qt_add_menu(winid wid, const glyph_info *glyphinfo, + const ANY_P * identifier, char ch, char gch, int attr, int clr, + const char *str, unsigned int itemflags); static void qt_end_menu(winid wid, const char *prompt); - static int qt_select_menu(winid wid, int how, MENU_ITEM_P **menu_list); - static void qt_mark_synch(); - static void qt_wait_synch(); + static int qt_select_menu(winid wid, int how, MENU_ITEM_P **menu_list); + static void qt_mark_synch(); + static void qt_wait_synch(); - static void qt_cliparound(int x, int y); - static void qt_cliparound_window(winid wid, int x, int y); + static void qt_cliparound(int x, int y); + static void qt_cliparound_window(winid wid, int x, int y); static void qt_print_glyph(winid wid, coordxy x, coordxy y, const glyph_info *glyphingo, - const glyph_info *bkglyphinfo); - static void qt_raw_print(const char *str); - static void qt_raw_print_bold(const char *str); - static const QPen nhcolor_to_pen(uint32_t c); + const glyph_info *bkglyphinfo); + static void qt_raw_print(const char *str); + static void qt_raw_print_bold(const char *str); + static const QPen nhcolor_to_pen(uint32_t c); static void qt_change_color(int color, long rgb, int reverse UNUSED); static char *qt_get_color_string(void); - static int qt_nhgetch(); - static int qt_nh_poskey(coordxy *x, coordxy *y, int *mod); - static void qt_nhbell(); - static int qt_doprev_message(); + static int qt_nhgetch(); + static int qt_nh_poskey(coordxy *x, coordxy *y, int *mod); + static void qt_nhbell(); + static int qt_doprev_message(); static char qt_more(); static char qt_yn_function(const char *question, const char *choices, char def); - static void qt_getlin(const char *prompt, char *line); - static int qt_get_ext_cmd(); - static void qt_number_pad(int); - static void qt_delay_output(); + static void qt_getlin(const char *prompt, char *line); + static int qt_get_ext_cmd(); + static void qt_number_pad(int); + static void qt_delay_output(); static void qt_preference_update(const char *optname); static char *qt_getmsghistory(boolean init); static void qt_putmsghistory(const char *msg, boolean is_restoring); - static void qt_outrip(winid wid, int how, time_t when); - static int qt_kbhit(); - static void qt_update_inventory(int); + static void qt_outrip(winid wid, int how, time_t when); + static int qt_kbhit(); + static void qt_update_inventory(int); static win_request_info *qt_ctrl_nhwindow(winid, int, win_request_info *); - static QWidget *mainWidget() { return main; } + static QWidget *mainWidget() { return main; } #if defined(SND_LIB_QTSOUND) && !defined(QT_NO_SOUND) /* sound interface */ static void qtsound_init_nhsound(void); @@ -111,7 +111,7 @@ public: #endif private: - virtual bool notify(QObject *receiver, QEvent *event); + virtual bool notify(QObject *receiver, QEvent *event); static QStringList *msgs_strings; static boolean msgs_saved;