Commit Graph

11163 Commits

Author SHA1 Message Date
nhmall
d9395dcd23 more integration suggestion adoption 2020-10-11 13:42:12 -04:00
nhmall
6806c30a59 adopt some integration suggestions
sys/lib -> sys/libnh
sys/lib/libnethackmain.c -> sys/libnh/libnhmain.c
libnethack.a -> libnh.a
2020-10-11 13:33:51 -04:00
nhmall
0adb64e384 get this working: "make wasm" 2020-10-11 10:51:46 -04:00
nhmall
d4e97cc650 libnethackmain.c includes date.h 2020-10-11 09:43:15 -04:00
nhmall
eaa8b99eea follow-up bit
remove an unnecessary dependency for top Makefile wasm
2020-10-11 09:16:23 -04:00
nhmall
efdf4f8979 Merge branch 'NetHack-3.7' of https://rodney.nethack.org:20040/git/NHsource into NetHack-3.7 2020-10-11 09:12:02 -04:00
nhmall
75f852f277 cross-compiles need not build host native lua library
Because some Makefile.top dependencies triggered the build
of the host native lua library, the cross-compiles were
building it needlessly.

Make it a make variable so that it can be overridden by
cross-compile recipes in sys/unix/hints/include/cross-*.2020
2020-10-11 09:08:27 -04:00
nhmall
d6719ea0db cron daily Files update 2020-10-10 19:36:36 -04:00
Bart House
c36a823cab Merge branch 'NetHack-3.7' of https://rodney.nethack.org:20040/git/NHsource into NetHack-3.7 2020-10-10 16:28:54 -07:00
Bart House
cc50aa036d Update files heading to reflect that we support VS 2017 and 2019. 2020-10-10 16:28:41 -07:00
nhmall
9599fa27df update win/win32/vs/.gitattributes text 2020-10-10 18:38:25 -04:00
nhw_cron
c5c43ad00a This is cron-daily v1-Jan-20-2020. files updated: Files 2020-10-10 18:31:30 -04:00
Bart House
bb04a9b041 Support both VS 2017 and VS 2019 without making changes to project files.
Renamed 'vs2017' folder to 'vs'.
2020-10-10 15:15:59 -07:00
Bart House
75f3ccd770 Merge branch 'NetHack-3.7' of https://rodney.nethack.org:20040/git/NHsource into NetHack-3.7 2020-10-10 14:18:18 -07:00
Bart House
848f37207d Add text mentioning that LUA sources must be copied into tree. 2020-10-10 14:17:58 -07:00
nhmall
3e66cbd781 more warnings 2020-10-10 16:41:09 -04:00
nhmall
48fa4fa5dd more warning bits 2020-10-10 16:28:17 -04:00
PatR
062152d62e fix github issue #399 - [not] fixing chest lock
Use ansimpleoname() instead of doname() to describe the key or
lock pick or credit card when reporting "You can't fix a chest's
broken lock with a <foo>."  doname() includes BUC status when
known and feedback mentioning a particular bless/curse state on
the tool that can't be used to fix the lock suggests that some
other bless/curse state might be viable.
2020-10-10 11:46:02 -07:00
nhmall
55d1d547a6 silence some util/makdefs.c src/mdlib warnings
In file included from makedefs.c:213:0:
../src/mdlib.c: In function ‘runtime_info_init’:
../src/mdlib.c:808:12: warning: variable ‘timeresult’ set but not used [-Wunused-but-set-variable]
     time_t timeresult;
            ^~~~~~~~~~
makedefs.c: In function ‘do_date’:
makedefs.c:1140:16: warning: unused variable ‘ind’ [-Wunused-variable]
     const char ind[] = "    ";
                ^~~
makedefs.c:1139:9: warning: unused variable ‘steps’ [-Wunused-variable]
     int steps = 0;
         ^~~~~
makedefs.c: In function ‘do_monstr’:
makedefs.c:1934:12: warning: variable ‘j’ set but not used [-Wunused-but-set-variable]
     int i, j;
            ^
2020-10-10 08:55:43 -04:00
Pasi Kallinen
3d6551a70e Lua: Allow matching any wall
A 'w' in a map fragment will match any wall (IS_WALL macro):

   des.replace_terrain({ mapfragment = "w", toterrain = "F" });
2020-10-10 11:31:16 +03:00
PatR
c154dd2609 fix #K2393 - brass lantern hit by water
Don't extinguish a brass lantern when hit by water unless it is
being submerged.
2020-10-09 12:02:26 -07:00
PatR
d20394c4bc unix/Makefile.utl
Replace use of $(LINK) with $(CLINK) or $(CXXLINK) as warranted.
When the Qt interface is enabled, the utility programs were all
(except dlb) being linked with C++ support.  That didn't cause
any problems, just looked wrong.  Link them as C instead of C++.
Two actually do need C++ support (and still have it) but both
are dead:  'tile2beos' because the source file doesn't exist (not
even in 'outdated'), 'tileedit' because it won't build with Qt5.
I didn't bother with QUIETCC support for them.

There were still a couple of references to dgn_comp (for the lint
target; just in the name of a macro, not its value); remove those.
2020-10-09 08:45:03 -07:00
nhmall
017448addf re-enable the MSDOS cross-compile on travis-ci 2020-10-09 09:36:55 -04:00
nhmall
3e39984877 more wasm dependency order tinkering 2020-10-09 09:18:51 -04:00
nhmall
139b138b78 follow-up bit
make variable had changed in PRE but not in POST
2020-10-09 09:05:56 -04:00
nhmall
a09a41f9a3 more wasm build
This issue
https://github.com/NetHack/NetHack/issues/398
reported some issues with the wasm build. Attempt to resolve
some of those.
2020-10-09 08:54:36 -04:00
nhmall
de80dd2437 cross-compile fix-up 2020-10-09 08:52:46 -04:00
PatR
dde561810d Qt prompt highlighting
When qt_yn_function() or qt_more() is asking for a single character
response, typing anything will cause the prompt line in the message
window to stop being highlighted.  If they reject what's been typed,
they beep (--More-- doesn't start beeping until second rejection);
change both of them to also rehighlight the prompt line to give a
visual indication that the question/acknowledgement is still being
asked.
2020-10-08 11:24:11 -07:00
nhmall
5dcc328759 be more consistent with CROSS_TO_target macro names for cross-compiles
-DCROSS_TO_MSDOS	msdos cross-compile (djgpp cross-compiler)
-DCROSS_TO_AMIGA	Amiga cross-compile
-DCROSS_TO_WASM		wasm cross-compile (emscripten)
2020-10-08 13:49:24 -04:00
PatR
342323eb15 Qt menu hack
Prevent a small inventory menu as the first one shown from forcing
all subsequent ones from being the same short height by forcing it
to have room for at least 15 lines.  Temporary hack until someone
figures out why resizing the reused WIN_INVEN isn't working.

Does not affect non-inventory menus which get created on demand and
destroyed when done so don't need to change size to fit different
contents.
2020-10-08 10:18:44 -07:00
nhmall
1b0a9f8e31 follow-up to previous 2020-10-07 09:23:41 -04:00
nhmall
b0e71f68bc small monsters seeping through their shirt
The code is slightly different than in the PR which left out the noncorporeal case.

Closes #397
2020-10-07 09:09:51 -04:00
PatR
eb4288e608 Qt click-to-command
Consolidate some recently added duplicated code.
2020-10-07 04:19:55 -07:00
PatR
da8558e262 Qt status panel as command button
Clicking on the status panel runs ^X to show character and status
information without abbreviations.  The code needed is identical
to what's now used for clicking on the paper doll inventory panel
except for the command to execute.
2020-10-06 15:20:25 -07:00
PatR
e2e9bca3f7 Qt "paperdoll" as command button
Clicking on the paper doll inventory subset window will cause
the '*' command (#seeall) to execute.  They convey the same
information (unless multiple leashes or multiple light sources
are in use; seeall lists all of them instead of just the first
of each) but the doll shows the info with a small grid of map
tiles and seeall shows it with an inventory display of worn and
wielded items plus tools in active use.

Ideally it should show information about a specific item as a
"tool tip" when the mouse hovers over one of the doll slots.
I don't know whether I'll ever attempt to tackle that or even
if that's feasible with Qt.  Perhaps use right click instead.
2020-10-06 09:42:59 -07:00
PatR
52672e8f25 left out of "Qt menus, mostly item counts" 2020-10-06 09:15:32 -07:00
PatR
7277b4a415 Qt menus, mostly item counts
Don't allow the user to construct a count value when operating on
a pick-none menu where counts aren't meaningful.  Unfortunately
that can still be done on pick-one or pick-any menus which don't
happen to have any entries where a count is applicable.

Allow a count to be optionally started with '#'.  Note that if
there is an entry using '#' for the selector letter (probably
inventory that has something in the overflow slot), typing '#'
will select the entry instead of initiating a count.

Flail about a bit trying to get menu size correct--failed on this
front.
2020-10-06 09:09:09 -07:00
nhmall
cb2b710b22 update Cross-compiling document for PR385 Web Assemply and libnethack
Credit: The initial Web Assembly cross compile was found in a pull request:
            https://github.com/NetHack/NetHack/pull/385
        by apowers313. The pull request was merged with some accompanying
        NetHack source tree integration changes in early October 2020.

Cross-compiler used: emscripten
Cross-compiler url: https://emscripten.org/docs/getting_started/downloads.html

    Here's a brief guide to obtaining the cross-compiler sources via git and
    building it on your system.

    For Ubuntu, the build prerequisite packages for building the compiler can
    be easily obtained:

        sudo apt-get install python3 cmake default-jre

    For macOS, you will need to install Xcode, git, cmake, Python 3.5 or new
    (at time of this writing).

    After installing the prerequite packages above, obtain the cross-compiler
    via git and build it from the directory of your choice using steps similar
    to these:

            git clone https://github.com/emscripten-core/emsdk.git
            cd emsdk
            git pull
            ./emsdk install latest
            ./emsdk activate latest
            source ./emsdk_env.sh

    The steps above reflect what was outlined at this url at the time
    of writing:

            https://emscripten.org/docs/getting_started/downloads.html

    That is the definitive source and trumps anything documented here.

    On your linux host, prepare to cross-compile NetHack as follows:

        cd sys/unix ; sh setup.sh hints/linux.2020 ; cd ../..
        make fetch-lua

    On your macOS host, prepare to cross-compile NetHack as follows:

        cd sys/unix ; sh setup.sh hints/macOS.2020 ; cd ../..
        make fetch-lua

    Then, cross-compile to targets/wasm as follows:

        make CROSS_TO_WASM=1

    You can build src/nethacklib.a from pull request 385 as follows:

        make WANT_LIBNH=1

    Do not add any additional windowport interfaces to your build
    (such as WANT_WIN_TTY=1 WANT_WIN_CURSES=1 WANT_WIN_X11=1 or
    WANT_WIN_QT=1) as those aren't applicable to the Web Assembly
    or nethacklib builds. A "shim" pseudo-windowport is included
    from pull request 385.

    Result: As mentioned, the wasm cross-compile will end up in
            targets/wasm and the nethacklib.a will end up
            src.

    The cross-compiler hints additions are enclosed inside ifdef sections
    and shouldn't interfere with the non-cross-compile builds using
    hints/linux.2020 or hints/macOS.2020.
2020-10-06 11:00:33 -04:00
nhmall
724e5fba25 adding ; was inappropriate for BUILDMORE list of dependencies 2020-10-06 02:26:40 -04:00
nhmall
b68f960c59 temporarily turn off the msdos cross-compile on travis 2020-10-06 02:15:25 -04:00
nhmall
a8d31910ec target lua build was missing -c on cross-compile 2020-10-06 02:01:30 -04:00
nhmall
dc47c46314 more wasm cross-compiling follow-up 2020-10-06 01:47:19 -04:00
PatR
d7a52cf0c4 Qt menu search
Remove a 'TODO' for once.  Have the popup that's used to accept the
target string--after clicking on [search] or typing ':' to initiate
menu search+select operation--force keyboard focus to itself.  Menu
searching worked without this, but only if you manually clicked on
the search popup prior to typing the target string.  Failure to do
so resulted in typed characters being used to select menu entries.
2020-10-05 16:26:27 -07:00
Pasi Kallinen
37339abebd Fix dropping const from params 2020-10-05 17:17:07 +03:00
nhmall
43112cec01 clear a -Wshadow warning in options.c
options.c
options.c: In function ‘match_optname’:
options.c:5734:27: warning: declaration of ‘opt_name’ shadows a global declaration [-Wshadow]
 const char *user_string, *opt_name;
                           ^~~~~~~~
In file included from options.c:52:0:
../include/optlist.h:56:1: note: shadowed declaration is here
 opt_##a,
 ^
../include/optlist.h:307:5: note: in expansion of macro ‘NHOPTC’
     NHOPTC(name, PL_NSIZ, opt_in, set_gameview, No, Yes, No, No, NoAlias,
     ^~~~~~
2020-10-05 09:24:42 -04:00
nhmall
ab5c8dff05 cron daily Files update 2020-10-04 21:14:59 -04:00
nhmall
ac493aa455 placement of libnethack targets required adjusting
From -PRE to -POST section
2020-10-04 21:12:03 -04:00
nhmall
d8961b0067 updates for LIBNH build 2020-10-04 20:48:09 -04:00
nhmall
7bf5172f2e unixmain and libnethackmain diverged in the updated PR
put unixmain back the way it was, now that libnethackmain is in the tree after all.
2020-10-04 20:14:45 -04:00
nhmall
c3683eaa9b Merge branch 'libnethack2' into NetHack-3.7 2020-10-04 20:13:35 -04:00