diff --git a/doc/fixes36.2 b/doc/fixes36.2 index 6d64fb8fd..94986c5b0 100644 --- a/doc/fixes36.2 +++ b/doc/fixes36.2 @@ -229,6 +229,11 @@ stinking cloud placed near water could kill underwater creatures applying--rather than wielding--a cursed polearm or weapon-tool didn't report that it had become welded to hero's hand(s) the message when riding a steed into a pit was composed but not shown +dismount that kills steed because there is no room to put it on map blamed the + hero; change that to only blame hero if dismount was voluntary +to emphasize that it's not a light source, change description of wielded Sting + from "(glowing light blue)" to "(light blue aura)" when sighted and + from "(glowing)" to nothing (not warm enough to feel) when blind Fixes to Post-3.6.1 Problems that Were Exposed Via git Repository @@ -328,6 +333,9 @@ X11: don't reuse perm_invent window for picking an object X11: obey mouse_support and allow toggling it in game X11: obey menu movement keys X11: enable menu [cancel] button for PICK_NONE menus +X11: text popups on OSX wouldn't accept keyboard input unless the 'autofocus' + resource was enabled; most noticeable when trying to dismiss 'things + that are here' while walking over object piles General New Features diff --git a/include/ntconf.h b/include/ntconf.h index 73d421fd8..bf98fec65 100644 --- a/include/ntconf.h +++ b/include/ntconf.h @@ -94,6 +94,15 @@ extern void FDECL(interject, (int)); *=============================================== */ +#ifdef __MINGW32__ +#ifdef strncasecmp +#undef strncasecmp +#endif +#ifdef strcasecmp +#undef strcasecmp +#endif +#endif + #ifdef _MSC_VER #if (_MSC_VER > 1000) /* Visual C 8 warning elimination */ diff --git a/include/winX.h b/include/winX.h index 1a061fa14..a1a560528 100644 --- a/include/winX.h +++ b/include/winX.h @@ -165,6 +165,7 @@ struct menu_info_t { boolean cancelled; /* Menu has been explicitly cancelled. */ boolean counting; /* true when menu_count has a valid value */ boolean permi; + boolean disable_mcolors; /* disable menucolors */ int permi_x, permi_y; /* perm_invent window x,y */ int permi_w, permi_h; /* perm_invent window wid, hei */ diff --git a/include/wincurs.h b/include/wincurs.h index eb07879f4..55e7f1d22 100644 --- a/include/wincurs.h +++ b/include/wincurs.h @@ -7,16 +7,11 @@ /* Global declarations for curses interface */ -int term_rows, term_cols; /* size of underlying terminal */ - -WINDOW *base_term; /* underlying terminal window */ - -WINDOW *mapwin, *statuswin, *messagewin; /* Main windows */ - -int orig_cursor; /* Preserve initial cursor state */ - -boolean counting; /* Count window is active */ - +extern int term_rows, term_cols; /* size of underlying terminal */ +extern int orig_cursor; /* Preserve initial cursor state */ +extern WINDOW *base_term; /* underlying terminal window */ +extern boolean counting; /* Count window is active */ +extern WINDOW *mapwin, *statuswin, *messagewin; /* Main windows */ #define TEXTCOLOR /* Allow color */ #define NHW_END 19 diff --git a/src/mondata.c b/src/mondata.c index 74814bd3d..62dea9a10 100644 --- a/src/mondata.c +++ b/src/mondata.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 mondata.c $NHDT-Date: 1539938825 2018/10/19 08:47:05 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.67 $ */ +/* NetHack 3.6 mondata.c $NHDT-Date: 1543545188 2018/11/30 02:33:08 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.69 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /*-Copyright (c) Robert Patrick Rankin, 2011. */ /* NetHack may be freely redistributed. See license for details. */ @@ -739,6 +739,10 @@ const char *in_str; /* Outdated names */ { "invisible stalker", PM_STALKER }, { "high-elf", PM_ELVENKING }, /* PM_HIGH_ELF is obsolete */ + /* other misspellings or incorrect words */ + { "wood-elf", PM_WOODLAND_ELF }, + { "wood elf", PM_WOODLAND_ELF }, + { "woodland nymph", PM_WOOD_NYMPH }, { "halfling", PM_HOBBIT }, /* potential guess for polyself */ { "genie", PM_DJINNI }, /* potential guess for ^G/#wizgenesis */ /* Hyphenated names -- it would be nice to handle these via diff --git a/src/objnam.c b/src/objnam.c index 3fc3e01d2..af74c3bf0 100644 --- a/src/objnam.c +++ b/src/objnam.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 objnam.c $NHDT-Date: 1539938837 2018/10/19 08:47:17 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.214 $ */ +/* NetHack 3.6 objnam.c $NHDT-Date: 1543544340 2018/11/30 02:19:00 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.226 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /*-Copyright (c) Robert Patrick Rankin, 2011. */ /* NetHack may be freely redistributed. See license for details. */ @@ -1154,11 +1154,11 @@ unsigned doname_flags; (obj->otyp == AKLYS) ? "tethered " : "", hand_s); if (warn_obj_cnt && obj == uwep && (EWarn_of_mon & W_WEP) != 0L) { - /* presumably can be felt when blind */ - Strcat(bp, " (glowing"); + /* this used to be "(glowing )" when sighted or + "(glowing)" when blind (via feeling warmth), but it + isn't a light source so describe something fainter */ if (!Blind) - Sprintf(eos(bp), " %s", glow_color(obj->oartifact)); - Strcat(bp, ")"); + Sprintf(eos(bp), " (%s aura)", glow_color(obj->oartifact)); } } } diff --git a/src/steed.c b/src/steed.c index 91ed935f4..65e5ebbae 100644 --- a/src/steed.c +++ b/src/steed.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 steed.c $NHDT-Date: 1543522486 2018/11/29 20:14:46 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.58 $ */ +/* NetHack 3.6 steed.c $NHDT-Date: 1543543362 2018/11/30 02:02:42 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.59 $ */ /* Copyright (c) Kevin Hugo, 1998-1999. */ /* NetHack may be freely redistributed. See license for details. */ @@ -563,8 +563,17 @@ int reason; /* Player was thrown off etc. */ * be hostile terrain. */ steedcc.x = u.ux, steedcc.y = u.uy; - if (m_at(u.ux, u.uy)) - (void) enexto(&steedcc, u.ux, u.uy, mtmp->data); + if (m_at(u.ux, u.uy)) { + /* hero's spot has a monster in it; hero must have been plucked + from saddle as engulfer moved into his spot--other dismounts + shouldn't run into this situation; find nearest viable spot */ + if (!enexto(&steedcc, u.ux, u.uy, mtmp->data) + /* no spot? must have been engulfed by a lurker-above over + water or lava; try requesting a location for a flyer */ + && !enexto(&steedcc, u.ux, u.uy, &mons[PM_BAT])) + /* still no spot; last resort is any spot within bounds */ + (void) enexto(&steedcc, u.ux, u.uy, &mons[PM_GHOST]); + } if (!m_at(steedcc.x, steedcc.y)) { if (mtmp->mhp < 1) mtmp->mhp = 0; /* make sure it isn't negative */ @@ -576,8 +585,8 @@ int reason; /* Player was thrown off etc. */ } if (!DEADMONSTER(mtmp)) { - /* Set player and steed's position. Try moving the player first - unless we're in the midst of creating a bones file. */ + /* if for bones, there's no reason to place the hero; + we want to make room for potential ghost, so move steed */ if (reason == DISMOUNT_BONES) { /* move the steed to an adjacent square */ if (enexto(&cc, u.ux, u.uy, mtmp->data)) @@ -586,6 +595,8 @@ int reason; /* Player was thrown off etc. */ (void) rloc(mtmp, FALSE); return; } + + /* Set hero's and/or steed's positions. Try moving the hero first. */ if (!u.uswallow && !u.ustuck && have_spot) { struct permonst *mdat = mtmp->data; @@ -639,20 +650,29 @@ int reason; /* Player was thrown off etc. */ if (save_utrap) (void) mintrap(mtmp); } - /* Couldn't... try placing the steed */ + + /* Couldn't move hero... try moving the steed. */ } else if (enexto(&cc, u.ux, u.uy, mtmp->data)) { /* Keep player here, move the steed to cc */ rloc_to(mtmp, cc.x, cc.y); /* Player stays put */ - /* Otherwise, kill the steed */ - } else { - killed(mtmp); - adjalign(-1); - } - } - /* Return the player to the floor */ - if (reason != DISMOUNT_ENGULFED) { + /* Otherwise, kill the steed. */ + } else { + if (reason == DISMOUNT_BYCHOICE) { + /* [un]#ride: hero gets credit/blame for killing steed */ + killed(mtmp); + adjalign(-1); + } else { + /* other dismount: kill former steed with no penalty; + damage type is just "neither AD_DGST nor -AD_RBRE" */ + monkilled(mtmp, "", -AD_PHYS); + } + } + } /* !DEADMONST(mtmp) */ + + /* usually return the hero to the surface */ + if (reason != DISMOUNT_ENGULFED && reason != DISMOUNT_BONES) { in_steed_dismounting = TRUE; (void) float_down(0L, W_SADDLE); in_steed_dismounting = FALSE; diff --git a/sys/share/pcmain.c b/sys/share/pcmain.c index 1c07555cc..20b73f728 100644 --- a/sys/share/pcmain.c +++ b/sys/share/pcmain.c @@ -87,9 +87,12 @@ unsigned _stklen = STKSIZ; * to help MinGW decide which entry point to choose. If both main and * WinMain exist, the resulting executable won't work correctly. */ -#ifndef __MINGW32__ int +#ifndef __MINGW32__ main(argc, argv) +#else +mingw_main(argc, argv) +#endif int argc; char *argv[]; { @@ -115,7 +118,6 @@ char *argv[]; /*NOTREACHED*/ return 0; } -#endif boolean pcmain(argc, argv) diff --git a/sys/vms/Makefile.src b/sys/vms/Makefile.src index d6e1a9a25..a29367655 100644 --- a/sys/vms/Makefile.src +++ b/sys/vms/Makefile.src @@ -1,5 +1,5 @@ # NetHack Makefile (VMS) - for building nethack itself. -# NetHack 3.6 Makefile.src $NHDT-Date: 1542388601 2018/11/16 17:16:41 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.31 $ +# NetHack 3.6 Makefile.src $NHDT-Date: 1543545915 2018/11/30 02:45:15 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.32 $ # Copyright (c) 2011 by Robert Patrick Rankin # NetHack may be freely redistributed. See license for details. @@ -140,9 +140,9 @@ VERSOURCES = $(HACKCSRC) $(SYSSRC) $(WINSRC) $(RANDSRC) $(GENCSRC) HACKINCL = align.h amiconf.h artifact.h artilist.h attrib.h beconf.h color.h \ config.h config1.h context.h coord.h decl.h def_os2.h display.h \ dlb.h dungeon.h engrave.h extern.h flag.h func_tab.h global.h \ - hack.h lev.h macconf.h mextra.h mfndpos.h micro.h \ - mkroom.h monattk.h mondata.h monflag.h monst.h monsym.h obj.h \ - objclass.h os2conf.h patchlevel.h pcconf.h permonst.h prop.h rect.h \ + hack.h lev.h macconf.h mextra.h mfndpos.h micro.h mkroom.h \ + monattk.h mondata.h monflag.h monst.h monsym.h obj.h objclass.h \ + os2conf.h patchlevel.h pcconf.h permonst.h prop.h rect.h \ region.h rm.h sp_lev.h spell.h sys.h system.h tcap.h timeout.h \ tosconf.h tradstdc.h trampoli.h trap.h unixconf.h vision.h \ vmsconf.h wintty.h winX.h winprocs.h wintype.h you.h youprop.h @@ -206,8 +206,8 @@ nethack.opt : $(MAKEFILE) # this file @ write f f$edit("$(HOBJ5)","COLLAPSE") @ write f f$edit("$(HOBJ6)","COLLAPSE") @ write f "sys$library:starlet.olb/Include=(lib$initialize) - @ write f \ - "psect_attr=lib$initialize, Con,Usr,noPic,Rel,Gbl,noShr,noExe,Rd,noWrt,Long" + @ write f "! psect_attributes Usr, noPic, and Long removed" + @ write f "psect_attr=lib$initialize, Con,Rel,Gbl,noShr,noExe,Rd,noWrt" @ write f "iosegment=128" close f @@ -378,7 +378,7 @@ attrib.obj : attrib.c $(HACK_H) ball.obj : ball.c $(HACK_H) bones.obj : bones.c $(HACK_H) $(INC)lev.h botl.obj : botl.c $(HACK_H) -cmd.obj : cmd.c $(HACK_H) $(INC)func_tab.h +cmd.obj : cmd.c $(HACK_H) $(INC)lev.h $(INC)func_tab.h dbridge.obj : dbridge.c $(HACK_H) decl.obj : decl.c $(HACK_H) detect.obj : detect.c $(HACK_H) $(INC)artifact.h diff --git a/sys/winnt/Makefile.gcc b/sys/winnt/Makefile.gcc index e15e22c9c..f71953aec 100644 --- a/sys/winnt/Makefile.gcc +++ b/sys/winnt/Makefile.gcc @@ -91,8 +91,8 @@ TARGET_CPU=x86 # of your PDCurses C files which must already be resident on # your machine. # -#ADD_CURSES=Y -#PDCURSES_TOP=..\..\pdcurses +ADD_CURSES=Y +PDCURSES_TOP=..\..\pdcurses #4b Qt # @@ -207,6 +207,7 @@ endif #ZLIB = zlib.lib # Have windows path styles available for use in commands +W_OBJ =$(subst /,\, $(OBJ)) W_INCL =$(subst /,\, $(INCL)) W_DAT =$(subst /,\, $(DAT)) W_DOC =$(subst /,\, $(DOC)) @@ -455,18 +456,16 @@ DATABASE = $(DAT)/data.base #========================================== # ifeq "$(ADD_CURSES)" "Y" -#CURSESDEF=-D"PDC_DLL_BUILD" -D"CURSES_GRAPHICS" -D"CURSES_BRIEF_INCLUDE" CURSESDEF=-D"CURSES_GRAPHICS" -D"CURSES_BRIEF_INCLUDE" else CURSDEF= CURSESLIB= -CURSESINCL= endif ifneq "$(ADD_CURSES)" "Y" INCLDIR=-I../include -I../sys/winnt else -INCLDIR=-I../include -I../sys/winnt -I$(CURSESINCL) +INCLDIR=-I../include -I../sys/winnt endif #========================================== @@ -494,7 +493,7 @@ cdebug = linkdebug = endif -CFLAGSBASE = -c $(cflags) $(WINPINC) $(cdebug) +CFLAGSBASE = -c $(cflags) $(WINPINC) $(cdebug) $(CURSESDEF) #LFLAGSBASEC = $(linkdebug) #LFLAGSBASEG = $(linkdebug) -mwindows @@ -600,8 +599,8 @@ $(OBJ)/%.o : $(UTIL)/%.c $(OBJ)/%.o : $(WSHR)/%.c $(cc) $(CFLAGS) -o$@ $< -$(INCL)/%.h : $(WSHR)/%.h - @copy $< $@ +#$(INCL)/%.h : $(WSHR)/%.h +# @copy $< $@ #{$(WSHR)}.txt{$(DAT)}.txt: # @copy $< $@ @@ -625,7 +624,7 @@ $(OBJ)/%.o : $(MSWIN)/%.c #========================================== $(OBJ)/%.o : $(WCURSES)/%.c - $(cc) $(CFLAGS) -o$@ $< + $(cc) $(PDCINCL) $(CFLAGS) -o$@ $< #========================================== # Rules for files in PDCurses @@ -666,8 +665,6 @@ YACC= #LEX = lex #LEX = flex LEX= -export YACC -export LEX # # - Specify your flex skeleton file (if needed). @@ -680,6 +677,12 @@ YTABC = y_tab.c YTABH = y_tab.h LEXYYC = lexyy.c +export YACC +export LEX +export FLEXSKEL +export YTABC +export YTABH +export LEXYYC #========================================== # Rules for files in win/Qt4 @@ -810,18 +813,18 @@ $(O)winres.o: $(TILEBMP16) $(MSWIN)/winhack.rc $(MSWIN)/mnsel.bmp \ $(MSWIN)/mnselcnt.bmp $(MSWIN)/mnunsel.bmp \ $(MSWIN)/petmark.bmp $(MSWIN)/pilemark.bmp $(MSWIN)/NetHack.ico $(MSWIN)/rip.bmp \ $(MSWIN)/splash.bmp - @$(rc) -o$@ --include-dir $(MSWIN) -i $(MSWIN)/winhack.rc + $(rc) -o$@ --include-dir $(MSWIN) -i $(MSWIN)/winhack.rc $(O)conres.o: $(MSWSYS)/console.rc $(MSWSYS)/NetHack.ico - @$(rc) -o$@ --include-dir $(MSWSYS) -i $(MSWSYS)/console.rc + $(rc) -o$@ --include-dir $(MSWSYS) -i $(MSWSYS)/console.rc #========================================== # The game targets. #========================================== gamedir.tag: - test -d $(GAMEDIR) || echo creating directory $(GAMEDIR) - test -d $(GAMEDIR) || mkdir $(GAMEDIR) + test -d $(GAMEDIR) || echo creating directory $(W_GAMEDIR) + test -d $(GAMEDIR) || mkdir $(W_GAMEDIR) test -d $(GAMEDIR) && echo directory created > $@ $(GAMEDIR)/NetHack.exe : gamedir.tag $(PDCLIB) $(O)tile.o $(O)nttty.o $(O)guistub.o \ @@ -885,9 +888,9 @@ initialchk: objdir.tag @echo ---- objdir.tag: - test -d $(OBJ) || echo creating directory $(OBJ) - test -d $(OBJ) || mkdir $(OBJ) - test -d $(OBJ) && echo directory created > $@ + @test -d $(OBJ) || echo creating directory $(OBJ) + @test -d $(OBJ) || mkdir $(OBJ) + @test -d $(OBJ) && echo directory created > $@ #========================================== #=========== SECONDARY TARGETS ============ @@ -898,7 +901,7 @@ objdir.tag: #========================================== $(U)makedefs.exe: $(MAKEOBJS) - @$(link) $(LFLAGSU) -o$@ $(MAKEOBJS) + $(link) $(LFLAGSU) -o$@ $(MAKEOBJS) $(O)makedefs.o: $(CONFIG_H) $(INCL)/monattk.h $(INCL)/monflag.h \ $(INCL)/objclass.h $(INCL)/monsym.h $(INCL)/qtext.h \ @@ -955,13 +958,13 @@ $(DAT)/dungeon: utility.tag $(DAT)/dungeon.def #========================================== $(U)uudecode.exe: $(O)uudecode.o - @$(link) $(LFLAGSU) -o$@ $(O)uudecode.o + $(link) $(LFLAGSU) -o$@ $(O)uudecode.o $(O)uudecode.o: $(SSYS)/uudecode.c $(MSWSYS)/NetHack.ico : $(U)uudecode.exe $(MSWSYS)/nhico.uu $(subst /,\,$(U)uudecode.exe $(MSWSYS)/nhico.uu) - copy NetHack.ico $@ + copy NetHack.ico $(W_MSWSYS)\NetHack.ico del NetHack.ico $(MSWIN)/NetHack.ico : $(MSWSYS)/NetHack.ico @@ -1029,7 +1032,7 @@ $(O)lev_main.o: $(U)lev_main.c $(HACK_H) $(SP_LEV_H) $(U)levcomp.exe: $(LEVCOMPOBJS) @echo Linking $@... - @$(link) $(LFLAGSU) -o$@ $(LEVCOMPOBJS) + $(link) $(LFLAGSU) -o$@ $(LEVCOMPOBJS) #========================================== # Dungeon Compiler Stuff @@ -1056,7 +1059,7 @@ $(O)dgn_main.o: $(HACK_H) $(U)dgn_main.c $(U)dgncomp.exe: $(DGNCOMPOBJS) @echo Linking $@... @echo Linking $@... - @$(link) $(LFLAGSU) -o$@ $(DGNCOMPOBJS) + $(link) $(LFLAGSU) -o$@ $(DGNCOMPOBJS) #================================================= # For a couple of devteam utilities @@ -1064,11 +1067,11 @@ $(U)dgncomp.exe: $(DGNCOMPOBJS) $(U)nhsizes.exe: $(O)nhsizes.o @echo Linking $@... - @$(link) $(LFLAGSU) -o$@ $(O)nhsizes.o $(O)panic.o $(O)alloc.o$(U)nhsizes.exe: $(O)nhsizes.o + $(link) $(LFLAGSU) -o$@ $(O)nhsizes.o $(O)panic.o $(O)alloc.o$(U)nhsizes.exe: $(O)nhsizes.o $(U)nhsize2.exe: $(O)nhsizes2.o @echo Linking $@... - @$(link) $(LFLAGSU) -o$@ $(O)nhsizes2.o $(O)panic.o $(O)alloc.o + $(link) $(LFLAGSU) -o$@ $(O)nhsizes2.o $(O)panic.o $(O)alloc.o $(O)nhsizes.o: $(CONFIG_H) nhsizes.c $(cc) $(CFLAGSU) -o$@ nhsizes.c @@ -1086,7 +1089,7 @@ $(O)nhsizes2.o: $(CONFIG_H) nhsizes2.c #========================================== $(U)dlb_main.exe: $(DLBOBJ) $(O)dlb.o - @$(link) $(LFLAGSU) -o$@ $(O)dlb_main.o $(O)dlb.o $(O)alloc.o $(O)panic.o + $(link) $(LFLAGSU) -o$@ $(O)dlb_main.o $(O)dlb.o $(O)alloc.o $(O)panic.o $(O)dlb.o: $(O)dlb_main.o $(O)alloc.o $(O)panic.o $(INCL)/dlb.h @@ -1145,7 +1148,7 @@ $(SRC)/tile.c: $(U)tilemap.exe @$(U)tilemap $(U)tilemap.exe: $(O)tilemap.o - @$(link) $(LFLAGSU) -o$@ $(O)tilemap.o + $(link) $(LFLAGSU) -o$@ $(O)tilemap.o $(O)tilemap.o: $(WSHR)/tilemap.c $(HACK_H) $(cc) $(CFLAGSU) -o$@ $(WSHR)/tilemap.c @@ -1177,16 +1180,16 @@ $(O)tilete32.o: $(WSHR)/tiletext.c $(CONFIG_H) $(TILE_H) $(U)gif2txt.exe: $(GIFREADERS) $(TEXT_IO) @echo Linking $@... - @$(link) $(LFLAGSU) -o$@ $(GIFREADERS) $(TEXT_IO) + $(link) $(LFLAGSU) -o$@ $(GIFREADERS) $(TEXT_IO) $(U)gif2tx32.exe: $(GIFREADERS32) $(TEXT_IO32) @echo Linking $@... - @$(link) $(LFLAGSU) -o$@ $(GIFREADERS32) $(TEXT_IO32) + $(link) $(LFLAGSU) -o$@ $(GIFREADERS32) $(TEXT_IO32) $(U)txt2ppm.exe: $(PPMWRITERS) $(TEXT_IO) @echo Linking $@... - @$(link) $(LFLAGSU) -o$@ $(PPMWRITERS) $(TEXT_IO) + $(link) $(LFLAGSU) -o$@ $(PPMWRITERS) $(TEXT_IO) $(TILEBMP16): $(TILEUTIL16) $(TILEFILES) @@ -1199,11 +1202,11 @@ $(TILEBMP16): $(TILEUTIL16) $(TILEFILES) $(U)tile2bmp.exe: $(O)tile2bmp.o $(TEXT_IO) @echo Linking $@... - @$(link) $(LFLAGSU) -o$@ $(O)tile2bmp.o $(TEXT_IO) + $(link) $(LFLAGSU) -o$@ $(O)tile2bmp.o $(TEXT_IO) $(U)til2bm32.exe: $(O)til2bm32.o $(TEXT_IO32) @echo Linking $@... - @$(link) $(LFLAGSU) -o$@ $(O)til2bm32.o $(TEXT_IO32) + $(link) $(LFLAGSU) -o$@ $(O)til2bm32.o $(TEXT_IO32) $(O)tile2bmp.o: $(WSHR)/tile2bmp.c $(HACK_H) $(TILE_H) $(MSWSYS)/win32api.h $(cc) $(CFLAGS) -mno-ms-bitfields -I$(WSHR) -o$@ $(WSHR)/tile2bmp.c @@ -1223,24 +1226,26 @@ $(O)pdcurses.a : $(PDCLIBOBJS) $(PDCOBJS) #========================================== spotless: clean - if exist initialchk del initialchk -ifneq "$(OBJ)" "" - if exist $(W_OBJ)\* rmdir $(W_OBJ) /s /Q - if exist $(W_GAMEDIR))\nhdefkey.dll del $(W_GAMEDIR))\nhdefkey.dll - if exist $(W_GAMEDIR))\nh340key.dll del $(W_GAMEDIR))\nh340key.dll - if exist $(W_GAMEDIR))\nhraykey.dll del $(W_GAMEDIR))\nhraykey.dll - if exist $(W_GAMEDIR))\NetHack.exe del $(W_GAMEDIR))\NetHack.exe - if exist $(W_GAMEDIR))\NetHack.pdb del $(W_GAMEDIR))\NetHack.pdb - if exist $(W_GAMEDIR))\nhdat del $(W_GAMEDIR))\nhdat + if exist o\* del /Q o\* + -test -d o && rd o + if exist objdir.tag del objdir.tag + if exist gamedir.tag del gamedir.tag +ifneq "$(W_GAMEDIR)" "" + if exist $(W_GAMEDIR)\NetHack.exe del $(W_GAMEDIR)\NetHack.exe + if exist $(W_GAMEDIR)\nhdefkey.dll del $(W_GAMEDIR)\nhdefkey.dll + if exist $(W_GAMEDIR)\nh340key.dll del $(W_GAMEDIR)\nh340key.dll + if exist $(W_GAMEDIR)\nhraykey.dll del $(W_GAMEDIR)\nhraykey.dll + if exist $(W_GAMEDIR)\NetHack.exe del $(W_GAMEDIR)\NetHack.exe + if exist $(W_GAMEDIR)\NetHack.pdb del $(W_GAMEDIR)\NetHack.pdb + if exist $(W_GAMEDIR)\nhdat del $(W_GAMEDIR)\nhdat endif - if exist $(W_INCL)\date.h del $(W_INCL)\date.h - if exist $(W_INCL)\onames.h del $(W_INCL)\onames.h - if exist $(W_INCL)\pm.h del $(W_INCL)\pm.h - if exist $(W_INCL)\vis_tab.h del $(W_INCL)\vis_tab.h +ifneq "$(W_SRC)" "" if exist $(W_SRC)\vis_tab.c del $(W_SRC)\vis_tab.c if exist $(W_SRC)\tile.c del $(W_SRC)\tile.c - if exist $(W_UTIL)\*.lnk del $(W_UTIL)\*.lnk - if exist $(W_UTIL)\*.map del $(W_UTIL)\*.map + if exist $(W_SRC)\vis_tab.c del $(W_SRC)\vis_tab.c + if exist nhdat. del nhdat. +endif +ifneq "$(W_DAT)" "" if exist $(W_DAT)\data del $(W_DAT)\data if exist $(W_DAT)\rumors del $(W_DAT)\rumors if exist $(W_DAT)\engrave del $(W_DAT)\engrave @@ -1282,13 +1287,15 @@ endif if exist $(W_DAT)\wizard?.lev del $(W_DAT)\wizard?.lev if exist $(W_DAT)\dlb.lst del $(W_DAT)\dlb.lst if exist $(W_DAT)\porthelp del $(W_DAT)\porthelp +endif +ifneq "$(W_OBJ)" "" if exist $(W_OBJ)\sp_lev.tag del $(W_OBJ)\sp_lev.tag - if exist $(W_SRC)\vis_tab.c del $(W_SRC)\vis_tab.c - if exist nhdat. del nhdat. if exist $(W_OBJ)\obj.tag del $(W_OBJ)\obj.tag if exist $(W_OBJ)\gamedir.tag del $(W_OBJ)\gamedir.tag if exist $(W_OBJ)\nh*key.lib del $(W_OBJ)\nh*key.lib if exist $(W_OBJ)\nh*key.exp del $(W_OBJ)\nh*key.exp +endif +ifneq "$(W_MSWIN)" "" if exist $(W_MSWIN)\mnsel.bmp del $(W_MSWIN)\mnsel.bmp if exist $(W_MSWIN)\mnselcnt.bmp del $(W_MSWIN)\mnselcnt.bmp if exist $(W_MSWIN)\mnunsel.bmp del $(W_MSWIN)\mnunsel.bmp @@ -1297,23 +1304,52 @@ endif if exist $(W_MSWIN)\rip.bmp del $(W_MSWIN)\rip.bmp if exist $(W_MSWIN)\splash.bmp del $(W_MSWIN)\splash.bmp if exist $(W_MSWIN)\nethack.ico del $(W_MSWIN)\nethack.ico +endif +ifneq "$(W_MSWSYS)" "" if exist $(W_MSWSYS)\nethack.ico del $(W_MSWSYS)\nethack.ico +endif +ifneq "$(W_UTIL)" "" + if exist $(W_UTIL)\*.lnk del $(W_UTIL)\*.lnk + if exist $(W_UTIL)\*.map del $(W_UTIL)\*.map if exist $(W_UTIL)\recover.exe del $(W_UTIL)\recover.exe if exist $(W_UTIL)\tile2bmp.exe del $(W_UTIL)\tile2bmp.exe if exist $(W_UTIL)\tilemap.exe del $(W_UTIL)\tilemap.exe if exist $(W_UTIL)\uudecode.exe del $(W_UTIL)\uudecode.exe if exist $(W_UTIL)\dlb_main.exe del $(W_UTIL)\dlb_main.exe +endif +ifneq "$(W_INCL)" "" + if exist $(W_INCL)\date.h del $(W_INCL)\date.h + if exist $(W_INCL)\onames.h del $(W_INCL)\onames.h + if exist $(W_INCL)\pm.h del $(W_INCL)\pm.h + if exist $(W_INCL)\vis_tab.h del $(W_INCL)\vis_tab.h +endif ifeq "$(ADD_CURSES)" "Y" +ifneq "$(W_OBJ)" "" if exist $(W_OBJ)\pdcurses.lib del $(W_OBJ)\pdcurses.lib endif +endif + if exist $(W_GAMEDIR)\license. del $(W_GAMEDIR)\license. + if exist $(W_GAMEDIR)\nh340key.dll del $(W_GAMEDIR)\nh340key.dll + if exist $(W_GAMEDIR)\nhdefkey.dll del $(W_GAMEDIR)\nhdefkey.dll + if exist $(W_GAMEDIR)\nhraykey.dll del $(W_GAMEDIR)\nhraykey.dll + -test -d ..\binary && rd ..\binary + clean: - if exist $(W_OBJ)\*.o del $(W_OBJ)\*.o - if exist $(W_OBJ)\utility.tag del $(W_OBJ)\utility.tag + if exist initialchk del initialchk + if exist install.tag del install.tag + if exist utility.tag del utility.tag +ifneq "$(W_UTIL)" "" if exist $(W_UTIL)\makedefs.exe del $(W_UTIL)\makedefs.exe if exist $(W_UTIL)\levcomp.exe del $(W_UTIL)\levcomp.exe if exist $(W_UTIL)\dgncomp.exe del $(W_UTIL)\dgncomp.exe +endif +ifneq "$(W_SRC)" "" if exist $(W_SRC)\*.lnk del $(W_SRC)\*.lnk if exist $(W_SRC)\*.map del $(W_SRC)\*.map +endif +ifneq "$(W_OBJ)" "" + if exist $(W_OBJ)\*.o del $(W_OBJ)\*.o + if exist $(W_OBJ)\utility.tag del $(W_OBJ)\utility.tag if exist $(W_OBJ)\install.tag del $(W_OBJ)\install.tag if exist $(W_OBJ)\console.res del $(W_OBJ)\console.res if exist $(W_OBJ)\dgncomp.MAP del $(W_OBJ)\dgncomp.MAP @@ -1346,6 +1382,7 @@ clean: if exist $(W_OBJ)\sp_lev.tag del $(W_OBJ)\sp_lev.tag if exist $(W_OBJ)\uudecode.MAP del $(W_OBJ)\uudecode.MAP if exist $(W_OBJ)\uudecode.PDB del $(W_OBJ)\uudecode.PDB +endif rem rem defer to the steps in ../win/win32/levstuff-mingw32.mak rem @@ -1386,13 +1423,13 @@ $(O)ntsound.o: $(HACK_H) $(MSWSYS)/ntsound.c #include the following stub for proper linkage. $(O)guistub.o: $(HACK_H) $(MSWSYS)/stubs.c - @$(cc) $(CFLAGS) -DGUISTUB -o$@ $(MSWSYS)/stubs.c + $(cc) $(CFLAGS) -DGUISTUB -o$@ $(MSWSYS)/stubs.c #if you aren't linking in the full tty then #include the following stub for proper linkage. $(O)ttystub.o: $(HACK_H) $(MSWSYS)/stubs.c - @$(cc) $(CFLAGS) -DTTYSTUB -o$@ $(MSWSYS)/stubs.c + $(cc) $(CFLAGS) -DTTYSTUB -o$@ $(MSWSYS)/stubs.c $(O)tile.o: $(SRC)/tile.c $(HACK_H) diff --git a/sys/winnt/Makefile.msc b/sys/winnt/Makefile.msc index 926eed8ad..6763be545 100644 --- a/sys/winnt/Makefile.msc +++ b/sys/winnt/Makefile.msc @@ -73,8 +73,8 @@ DEBUGINFO = Y # PDCurses header (.h) files and PDCURSES_C to the location # of your PDCurses C files. # -#ADD_CURSES=Y -#PDCURSES_TOP=..\..\pdcurses +ADD_CURSES=Y +PDCURSES_TOP=..\..\pdcurses # #============================================================================== # This marks the end of the BUILD DECISIONS section. @@ -118,10 +118,6 @@ WSHR = ..\win\share # Tile support files OBJ = o -cc=cl -link=link -rc=Rc - # #========================================== # Exe File Info. @@ -159,93 +155,6 @@ DLBFLG = #ZLIB = zlib.lib -#========================================== -#========================================== -# Setting up the compiler and linker -#========================================== -#========================================== - -# Before we get started, this section is used to determine the version of -# Visual Studio we are using. We set VSVER to 0000 to flag any version that -# is too old or untested. -# -#NMAKE version 1414264330 is distributed with VS 15.7.5 - -#!MESSAGE $(MAKEFLAGS) -#!MESSAGE $(MAKEDIR) -#!MESSAGE $(MAKE) - -MAKEVERSION=$(_NMAKE_VER:.= ) -MAKEVERSION=$(MAKEVERSION: =) -#!MESSAGE $(_NMAKE_VER) -#!MESSAGE $(MAKEVERSION) - -VSNEWEST=2017 -!IF ($(MAKEVERSION) < 1000000000) -VSVER=0000 #untested ancient version -!ELSEIF ($(MAKEVERSION) > 1000000000) && ($(MAKEVERSION) < 1100000000) -VSVER=2010 -!ELSEIF ($(MAKEVERSION) > 1100000000) && ($(MAKEVERSION) < 1200000000) -VSVER=2012 -!ELSEIF ($(MAKEVERSION) > 1200000000) && ($(MAKEVERSION) < 1400000000) -VSVER=2013 -!ELSEIF ($(MAKEVERSION) > 1400000000) && ($(MAKEVERSION) < 1411000000) -VSVER=2015 -!ELSEIF ($(MAKEVERSION) > 1411000000) && ($(MAKEVERSION) < 1414264331) -VSVER=$(VSNEWEST) -!ELSEIF ($(MAKEVERSION) > 1414264330) -VSVER=2999 #untested future version -!ENDIF - -!IF ($(VSVER) >= 2012) -!MESSAGE Autodetected Visual Studio $(VSVER) -!ELSEIF ($(VSVER) == 2999 -!MESSAGE The version of Visual Studio is newer than the most recent at -!MESSAGE the time this Makefile was crafted (Visual Studio $(VSNEWEST)). -!MESSAGE Because it is newer we'll proceed expecting that the -!MESSAGE VS$(VSNEWEST) processing will still work. -!ELSEIF ($(VSVER) == 0000) -!MESSAGE The version of Visual Studio appears to be quite old, older -!MESSAGE than VS2010 which is the oldest supported version by this -!MESSAGE Makefile, so we'll stop now. -!ERROR Untested old Visual Studio version with NMAKE $(_NMAKE_VER). -!ENDIF - -!IF ($(VSVER) == 2010) -# For VS2010 use "setenv /x86" or "setenv /x64" before invoking make process -# DO NOT DELETE THE FOLLOWING LINE -!include -! ENDIF - -#These will be in the environment variables with one of the VS2017 -#developer command prompts. -#VSCMD_ARG_HOST_ARCH=x64 -#VSCMD_ARG_TGT_ARCH=x86 - -!IFDEF VSCMD_ARG_HOST_ARCH -!MESSAGE Host architecture is $(VSCMD_ARG_HOST_ARCH) -!MESSAGE Target architecture is $(VSCMD_ARG_TGT_ARCH) -! IFNDEF TARGET_CPU -! IF "$(VSCMD_ARG_TGT_ARCH)"=="x64" -TARGET_CPU=x64 -! ELSE -TARGET_CPU=x86 -! ENDIF -! ENDIF -!ENDIF - -!IF "$(TARGET_CPU)" == "" -TARGET_CPU=x86 -!ENDIF - -!IF ($(VSVER) == 2010) -CL_RECENT= -!ELSE -! IF ($(VSVER) > 2010) -CL_RECENT=-sdl -! ENDIF -!ENDIF - #========================================== #================ MACROS ================== @@ -399,7 +308,7 @@ PDCLIBOBJS = $(O)addch.o $(O)addchstr.o $(O)addstr.o $(O)attr.o $(O)beep.o PDCOBJS = $(O)pdcclip.o $(O)pdcdisp.o $(O)pdcgetsc.o $(O)pdckbd.o $(O)pdcscrn.o \ $(O)pdcsetsc.o $(O)pdcutil.o -PDCLIB = $(O)\pdcurses.lib +PDCLIB = $(O)pdcurses.lib PDCINCL = /I$(PDCURSES_TOP) /I$(PDCSRC) /I$(PDCWINCON) @@ -444,18 +353,107 @@ TILE_H = ..\win\share\tile.h DATABASE = $(DAT)\data.base +#========================================== +#========================================== +# Setting up the compiler and linker +#========================================== +#========================================== + +cc=cl +link=link +rc=Rc + +# Before we get started, this section is used to determine the version of +# Visual Studio we are using. We set VSVER to 0000 to flag any version that +# is too old or untested. +# +#NMAKE version 1414264330 is distributed with VS 15.7.5 + +#!MESSAGE $(MAKEFLAGS) +#!MESSAGE $(MAKEDIR) +#!MESSAGE $(MAKE) + +MAKEVERSION=$(_NMAKE_VER:.= ) +MAKEVERSION=$(MAKEVERSION: =) +#!MESSAGE $(_NMAKE_VER) +#!MESSAGE $(MAKEVERSION) + +VSNEWEST=2017 +!IF ($(MAKEVERSION) < 1000000000) +VSVER=0000 #untested ancient version +!ELSEIF ($(MAKEVERSION) > 1000000000) && ($(MAKEVERSION) < 1100000000) +VSVER=2010 +!ELSEIF ($(MAKEVERSION) > 1100000000) && ($(MAKEVERSION) < 1200000000) +VSVER=2012 +!ELSEIF ($(MAKEVERSION) > 1200000000) && ($(MAKEVERSION) < 1400000000) +VSVER=2013 +!ELSEIF ($(MAKEVERSION) > 1400000000) && ($(MAKEVERSION) < 1411000000) +VSVER=2015 +!ELSEIF ($(MAKEVERSION) > 1411000000) && ($(MAKEVERSION) < 1414264331) +VSVER=$(VSNEWEST) +!ELSEIF ($(MAKEVERSION) > 1414264330) +VSVER=2999 #untested future version +!ENDIF + +!IF ($(VSVER) >= 2012) +!MESSAGE Autodetected Visual Studio $(VSVER) +!ELSEIF ($(VSVER) == 2999 +!MESSAGE The version of Visual Studio is newer than the most recent at +!MESSAGE the time this Makefile was crafted (Visual Studio $(VSNEWEST)). +!MESSAGE Because it is newer we'll proceed expecting that the +!MESSAGE VS$(VSNEWEST) processing will still work. +!ELSEIF ($(VSVER) == 0000) +!MESSAGE The version of Visual Studio appears to be quite old, older +!MESSAGE than VS2010 which is the oldest supported version by this +!MESSAGE Makefile, so we'll stop now. +!ERROR Untested old Visual Studio version with NMAKE $(_NMAKE_VER). +!ENDIF + +!IF ($(VSVER) == 2010) +# For VS2010 use "setenv /x86" or "setenv /x64" before invoking make process +# DO NOT DELETE THE FOLLOWING LINE +!include +! ENDIF + +#These will be in the environment variables with one of the VS2017 +#developer command prompts. +#VSCMD_ARG_HOST_ARCH=x64 +#VSCMD_ARG_TGT_ARCH=x86 + +!IFDEF VSCMD_ARG_HOST_ARCH +!MESSAGE Host architecture is $(VSCMD_ARG_HOST_ARCH) +!MESSAGE Target architecture is $(VSCMD_ARG_TGT_ARCH) +! IFNDEF TARGET_CPU +! IF "$(VSCMD_ARG_TGT_ARCH)"=="x64" +TARGET_CPU=x64 +! ELSE +TARGET_CPU=x86 +! ENDIF +! ENDIF +!ENDIF + +!IF "$(TARGET_CPU)" == "" +TARGET_CPU=x86 +!ENDIF + +!IF ($(VSVER) == 2010) +CL_RECENT= +!ELSE +! IF ($(VSVER) > 2010) +CL_RECENT=-sdl +! ENDIF +!ENDIF + #========================================== # More compiler setup post-macros #========================================== #---------------------------------------------------------------- !IF "$(ADD_CURSES)" == "Y" -#CURSESDEF=-D"PDC_DLL_BUILD" -D"CURSES_GRAPHICS" -D"CURSES_BRIEF_INCLUDE" CURSESDEF=-D"CURSES_GRAPHICS" -D"CURSES_BRIEF_INCLUDE" !ELSE CURSDEF= CURSESLIB= -CURSESINCL= !ENDIF ccommon= -c -nologo -D"_CONSOLE" -D"_CRT_NONSTDC_NO_DEPRECATE" -D"_CRT_SECURE_NO_DEPRECATE" \ @@ -530,7 +528,7 @@ guilibs = $(winlibs) !IFNDEF ADD_CURSES INCLDIR= /I..\include /I..\sys\winnt !ELSE -INCLDIR= /I..\include /I..\sys\winnt /I$(CURSESINCL) +INCLDIR= /I..\include /I..\sys\winnt !ENDIF #========================================== @@ -1257,16 +1255,19 @@ $(O)tile2bmp.o: $(WSHR)\tile2bmp.c $(HACK_H) $(TILE_H) $(MSWSYS)\win32api.h $(O)til2bm32.o: $(WSHR)\tile2bmp.c $(HACK_H) $(TILE_H) $(MSWSYS)\win32api.h @$(cc) $(cflagsBuild) -I$(WSHR) /DPACKED_FILE /DTILE_X=32 /DTILE_Y=32 /Fo$@ $(WSHR)\tile2bmp.c -#========================================== +#=============================================================================== # PDCurses -#========================================== +#=============================================================================== -$(O)\pdcurses.lib : $(PDCLIBOBJS) $(PDCOBJS) +$(O)pdcurses.lib : $(PDCLIBOBJS) $(PDCOBJS) lib -nologo /out:$@ $(PDCLIBOBJS) $(PDCOBJS) -#========================================== +$(O)pdcscrn.o : $(PDCURSES_HEADERS) $(PDCWINCON)\pdcscrn.c $(MSWSYS)\stub-pdcscrn.c + $(cc) $(PDCINCL) $(cflagsBuild) -Fo$@ $(MSWSYS)\stub-pdcscrn.c + +#=============================================================================== # Housekeeping -#========================================== +#=============================================================================== spotless: clean ! IF ("$(OBJ)"!="") diff --git a/sys/winnt/nttty.c b/sys/winnt/nttty.c index 579125867..b71133af2 100644 --- a/sys/winnt/nttty.c +++ b/sys/winnt/nttty.c @@ -1889,7 +1889,7 @@ void nethack_enter_nttty() error("Unable to load nhraykey.dll"); } } -#endif TTY_GRAPHICS +#endif /* TTY_GRAPHICS */ /* this is used as a printf() replacement when the window * system isn't initialized yet diff --git a/sys/winnt/stub-pdcscrn.c b/sys/winnt/stub-pdcscrn.c new file mode 100644 index 000000000..7588a782b --- /dev/null +++ b/sys/winnt/stub-pdcscrn.c @@ -0,0 +1,15 @@ +/* + * Use this stub to insert a needed pragma prior + * to compiling $(PDCWINCON)\pdcscrn.c in the + * PDCurses distribution. + * + * We don't want to ask NetHack builders to + * modify the PDCurses distribution in any way, + * we only ask that they have the original intact + * PDCurses source tree available during the build. + * + */ + +#pragma warning(disable : 4996) +#include "pdcscrn.c" + diff --git a/sys/winnt/stubs.c b/sys/winnt/stubs.c index bb5ad82e4..3e7fa4c20 100644 --- a/sys/winnt/stubs.c +++ b/sys/winnt/stubs.c @@ -7,7 +7,7 @@ #ifdef GUISTUB #ifdef TTYSTUB -#error You can't compile this with both GUISTUB and TTYSTUB defined. +#error You cannot compile this with both GUISTUB and TTYSTUB defined. #endif int GUILaunched; @@ -29,6 +29,7 @@ mswin_destroy_reg() */ #ifdef __MINGW32__ extern char default_window_sys[]; +extern int mingw_main(int argc, char **argv); int main(argc, argv) @@ -37,10 +38,7 @@ char *argv[]; { boolean resuming; - sys_early_init(); - Strcpy(default_window_sys, "tty"); - resuming = pcmain(argc, argv); - moveloop(resuming); + resuming = mingw_main(argc, argv); nethack_exit(EXIT_SUCCESS); /*NOTREACHED*/ return 0; diff --git a/win/X11/winX.c b/win/X11/winX.c index 7337e6f04..09d5c7a50 100644 --- a/win/X11/winX.c +++ b/win/X11/winX.c @@ -1962,6 +1962,7 @@ boolean complain; wp->title = dupstr(str); wp->menu_information->permi = FALSE; + wp->menu_information->disable_mcolors = TRUE; (void) X11_select_menu(newwin, PICK_NONE, &menu_list); X11_destroy_nhwindow(newwin); } diff --git a/win/X11/winmenu.c b/win/X11/winmenu.c index 04d75e77f..7ac8d2491 100644 --- a/win/X11/winmenu.c +++ b/win/X11/winmenu.c @@ -1162,7 +1162,7 @@ struct menu *curr_menu; XtSetArg(args[num_args], nhStr(XtNborderWidth), 0); num_args++; XtSetArg(args[num_args], nhStr(XtNvertDistance), 0); num_args++; - if (!iflags.use_menu_color + if (!iflags.use_menu_color || wp->menu_information->disable_mcolors || !get_menu_coloring(curr->str, &color, &attr)) attr = curr->attr; diff --git a/win/X11/wintext.c b/win/X11/wintext.c index ada6a398d..1f743766d 100644 --- a/win/X11/wintext.c +++ b/win/X11/wintext.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 wintext.c $NHDT-Date: 1450453309 2015/12/18 15:41:49 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.15 $ */ +/* NetHack 3.6 wintext.c $NHDT-Date: 1543622533 2018/12/01 00:02:13 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.16 $ */ /* Copyright (c) Dean Luick, 1992 */ /* NetHack may be freely redistributed. See license for details. */ @@ -281,11 +281,9 @@ struct xwindow *wp; #endif num_args = 0; - XtSetArg(args[num_args], XtNallowShellResize, True); - num_args++; + XtSetArg(args[num_args], XtNallowShellResize, True), num_args++; XtSetArg(args[num_args], XtNtranslations, - XtParseTranslationTable(text_translations)); - num_args++; + XtParseTranslationTable(text_translations)), num_args++; #ifdef TRANSIENT_TEXT wp->popup = XtCreatePopupShell("text", transientShellWidgetClass, @@ -299,8 +297,9 @@ struct xwindow *wp; XtParseTranslationTable("WM_PROTOCOLS: delete_text()")); num_args = 0; - XtSetArg(args[num_args], XtNallowShellResize, True); - num_args++; + XtSetArg(args[num_args], XtNallowShellResize, True), num_args++; + XtSetArg(args[num_args], XtNtranslations, + XtParseTranslationTable(text_translations)), num_args++; form = XtCreateManagedWidget("form", formWidgetClass, wp->popup, args, num_args); diff --git a/win/curses/cursmain.c b/win/curses/cursmain.c index 8e20a31f8..2412def4b 100644 --- a/win/curses/cursmain.c +++ b/win/curses/cursmain.c @@ -80,6 +80,16 @@ struct window_procs curses_procs = { genl_can_suspend_yes, }; +/* + * Global variables for curses interface + */ + +int term_rows, term_cols; /* size of underlying terminal */ +int orig_cursor; /* Preserve initial cursor state */ +WINDOW *base_term; /* underlying terminal window */ +boolean counting; /* Count window is active */ +WINDOW *mapwin, *statuswin, *messagewin; /* Main windows */ + /* Track if we're performing an update to the permanent window. Needed since we aren't using the normal menu functions to handle the inventory window. */ diff --git a/win/curses/cursmesg.c b/win/curses/cursmesg.c index 69215871a..df45d07b8 100644 --- a/win/curses/cursmesg.c +++ b/win/curses/cursmesg.c @@ -371,12 +371,12 @@ curses_message_win_getline(const char *prompt, char *answer, int buffer) char *tmpstr; /* for free() */ int maxy, maxx; /* linewrap / scroll */ int ch; - WINDOW *win = curses_get_nhwin(MESSAGE_WIN); int border_space = 0; int len = 0; /* of answer string */ boolean border = curses_window_has_border(MESSAGE_WIN); - int orig_cursor = curs_set(0); + + orig_cursor = curs_set(0); curses_get_window_size(MESSAGE_WIN, &height, &width); if (border) {