Commit Graph

1948 Commits

Author SHA1 Message Date
PatR
62ba302851 Unix 'make clean' and 'make spotless'
Provide a reasonably straightforward way to leave lua alone when
changing git branches (which I precede with 'make spotless').
 make clean-keep-lib
and
 make spotless-keep-lib
are new alternate forms of top level 'make clean' and 'make spotless'
that won't touch lib/lua/.
2021-01-03 11:27:17 -08:00
nhmall
1d94e65e45 finish mapglyph() removal 2021-01-02 09:22:53 -05:00
nhmall
d38a5fedd0 another vision table bit for gcc Makefile for Windows 2020-12-30 12:31:01 -05:00
nhmall
a7c804a965 Xcode updates for vision table removal part 3 2020-12-30 12:17:39 -05:00
PatR
99cc236d4a vis_tab removal for VMS
Get rid of vis_tab.{c,h}, also the commented out remnants of
{dgn_comp,lev_comp}.*, and put back sfstruct.* that erroneously
got removed along with some other stuff way back when.

Untested, and the lua stuff needs to be modularized.
2020-12-30 08:58:15 -08:00
nhmall
b8cb4ec81d Xcode updates for vision table removal part 2 2020-12-30 10:01:08 -05:00
nhmall
4d31563ca1 Xcode updates for vision table removal 2020-12-30 09:56:32 -05:00
nhmall
5f486677d0 Merge branch 'win-novisiontables' into NetHack-3.7 2020-12-29 22:12:59 -05:00
Dean Luick
a4e7646f4c Remove src and unix VISION_TABLES
Remove all references to the unused vision tables in the main source
and unix build.  Leave makedefs able to generate the vision tables.
makdefs will be cleaned up in a different commit, once all ports
are clear of dependencies.
2020-12-29 20:38:37 -06:00
nhmall
1c2c5dae1b remove vision tables from Windows and msdos builds 2020-12-28 22:07:00 -05:00
PatR
31ed7f6896 unix/Makefile.top vs tiles2bmp
Add a missing update to sys/unix/Makefile.top.  Makefile.dat
only requires that tiles2bmp exist, without knowing anything
about whether it needs to be rebuilt.  So force Makefile.top to
make sure that it's up to date, similar to how tiles2x11 gets
handled.
2020-12-27 05:01:39 -08:00
nhmall
0c3b9642e4 pmnames mons gender naming plus a window port interface change
add MALE, FEMALE, and gender-neutral names for individual monster species
to the mons array. The gender-neutral name (NEUTRAL) is mandatory, the
MALE and FEMALE versions are not.

replace code uses of the mname field of permonst with one of the three
potentially-available gender-specific names.

consolidate some separate mons entries that differed only by species into a
single mons entry (caveman, cavewoman and priest,priestess etc.)

consolidate several "* lord" and "* queen/* king" monst entries into
their single species, and allow both genders on some where it makes some
sense (there is probably more work and cleanup to come out of this at some
point, and the chosen gender-neutral name variations are not cast in stone
if someone has better suggestions).

related function or macro additions:
    pmname(pm, gender) to get the gender variation of the permonst name. It
    guards against monsters that haven't got anything except NEUTRAL naming
    and falls back to the NEUTRAL version if FEMALE and MALE versions are
    missing.

    Ugender to obtain the current hero gender.
    Mgender(mtmp) to obtain the gender of a monster

While the code can safely refer directly to pmnames[NEUTRAL] safely in the
code because it always exists, the other two (pmnames[MALE] and
pmnames[FEMALE] may not exist so use:
    pmname(ptr, gidx)
      where -ptr is a permonst *
            -gidx is an index into the pmnames array field of the
             permonst struct
pmname() checks for a valid index and checks for null-pointers for
pmnames[MALE] and pmnames[FEMALE], and will fall back to pmnames[NEUTRAL] if
the pointer requested if the requested variation is unavailable, or if the
gidx is out-of-range.

Allow code to specify makemon flags to request female or male (via MM_MALE
and MM_FEMALE flags respectively)to makedefs, since the species alone doesn't
distinguish male/female anymore. Specifying MM_MALE or MM_FEMALE won't
override the pm M2_MALE and M2_FEMALE flags on a mons[] entry.

male and female tiles have been added to win/share/monsters.txt.
The majority are duplicated placeholders except for those that were
separate mons entries before. Perhaps someone will contribute artwork in the
future to make the male and female variations visually distinguishable.

tilemapping via has the MALE tile indexes in the glyph2tile[]
array produced at build time. If a window port has information that the
FEMALE tile is required, it just has to increment the index returned
from the glyph2tile[] array by 1.

statues already preserved gender of the monster through STATUE_FEMALE
and STATUE_MALE, so ensure that pmnames takes that into consideration.

I expect some refinement will be required after broad play-testing puts it to
the test.

    consolidate caveman,cavewoman and priest,priestess monst.c entries etc

This commit will require a bump of editlevel in patchlevel.h because it alters
the index numbers of the monsters due to the consolidation of some. Those
index numbers are saved in some other structures, even though the mons[] array
itself is not part of the savefile.

Window Port Interface Change

Also add a parameter to print_glyph to convey additional information beyond
the glyph to the window ports. Every single window port was calling back to
mapglyph for the information anyway, so just included it in the interface and
produce the information right in the display core.

The mapglyph() function uses will be eliminated, although there are still some
in the code yet to be dealt with.

win32, tty, x11, Qt, msdos window ports have all had adjustments done to
utilize the new parameter instead of calling mapglyph, but some of those
window ports have not been thoroughly tested since the changes.

Interface change additional info:

    print_glyph(window, x, y, glyph, bkglyph, *glyphmod)
            -- Print the glyph at (x,y) on the given window.  Glyphs are
               integers at the interface, mapped to whatever the window-
               port wants (symbol, font, color, attributes, ...there's
               a 1-1 map between glyphs and distinct things on the map).
            -- bkglyph is a background glyph for potential use by some
               graphical or tiled environments to allow the depiction
               to fall against a background consistent with the grid
               around x,y. If bkglyph is NO_GLYPH, then the parameter
               should be ignored (do nothing with it).
                -- glyphmod provides extended information about the glyph
               that window ports can use to enhance the display in
               various ways.
                    unsigned int glyphmod[NUM_GLYPHMOD]
               where:
                    glyphmod[GM_TTYCHAR]  is the text characters associated
                                          with the original NetHack display.

                    glyphmod[GM_FLAGS]    are the special flags that denote
                                          additional information that window
                                          ports can use.

                    glyphmod[GM_COLOR] is the text character
                                       color associated with the original
                                       NetHack display.

Support for including the glyphmod info in the display glyph buffer
alongside the glyph itself was added and is the default operation.
That can be turned off by defining UNBUFFERED_GLYPHMOD at compile time.
With UNBUFFERED_GLYPHMOD operation, a call will be placed to map_glyphmod()
immediately prior to every print_glyph() call.
2020-12-26 11:23:23 -05:00
Bart House
a7b47ff071 Modify mingw makefile to allow caller to specify LUA build parameters. 2020-12-15 02:20:11 -08:00
Bart House
b08b47749f Revert "Switch mingw build to use submodules in default path."
This reverts commit e5fb08ae4e.
2020-12-15 01:57:18 -08:00
Bart House
be1432ad74 Revert "Working on getting WinGW building with Azure pipeline."
This reverts commit d88749e419.
2020-12-15 01:55:53 -08:00
Bart House
bc7922908b Revert "Make compiling the lua interpreter optional."
This reverts commit f89005efd7.
2020-12-15 01:54:27 -08:00
Bart House
bad05e2fb4 Reverting recent changes that hard coded use of submodules. 2020-12-15 01:50:01 -08:00
Bart House
9db1aff070 Use LUASRC variable when generating nhlua.h. 2020-12-15 00:46:55 -08:00
Bart House
190f9dc488 Modify expectations of where LUA sources are located.
We want the build to assume the same basic layout as the lua repository.
The sources are immediately at the top of the repository and not in
a subdirectory called 'src'.
2020-12-14 09:56:59 -08:00
nhmall
1b415af302 Makefile.msc update for visual studio 16.8.3 2020-12-14 07:46:23 -05:00
nhmall
6abce574d7 document typo fixes in README.xcode
Closes #424
2020-12-14 07:20:14 -05:00
Bart House
f89005efd7 Make compiling the lua interpreter optional. 2020-12-14 00:24:05 -08:00
Bart House
d88749e419 Working on getting WinGW building with Azure pipeline.
Fix typo recently introduced.  Allow LUATOP to be specified by pipeline.
2020-12-13 20:38:56 -08:00
Bart House
e5fb08ae4e Switch mingw build to use submodules in default path. 2020-12-13 20:31:01 -08:00
nhmall
c1b0f4e47a Xcode updates 2020-12-13 12:24:35 -05:00
nhmall
1a369f1af0 ensure a rebuild of include/nhlua.h after fetching Lua source 2020-12-13 10:40:02 -05:00
nhmall
8c42d306f7 purge trampoli.h 2020-12-13 10:27:49 -05:00
PatR
bc7fb05dcf Makefile vs lua fix
I've been ignoring submodules so far.  For the old method of
dealing with lua, the instructions

You might need to do
  make spotless
  make fetch-lua

aren't adequate.  They should be

When lua version has changed in Makefile.top, before running
setup.sh to put that new Makefile in place, do
  make spotless
then
  sys/unix/setup.sh [hints/...]
  make fetch-lua

otherwise it will try to clean up the not yet fetched new lua
version instead of the old one.
2020-12-12 14:10:18 -08:00
nhmall
affb60dd97 support for build with current Lua version 5.4.2
This may require
    	make spotless
    	make fetch-lua
for some platforms.
2020-12-11 09:20:26 -05:00
Pasi Kallinen
971ea03b9e Remove accidental compile warning flags 2020-12-10 22:14:07 +02:00
Pasi Kallinen
eb1fb93d06 Mark unused parameters 2020-12-10 22:08:32 +02:00
nhmall
efbd92b906 a couple of space-indents to tabs-indents in sys/winnt/Makefile.msc 2020-12-04 08:25:52 -05:00
nhmall
5b3632249f add a couple of optional fetching targets to sys/winnt/Makefile.msc 2020-12-04 08:21:53 -05:00
PatR
f8fcab3400 move 'g.restoring' to 'g.program_state.restoring'
Move the core's global restoring flag (not the same as main()'s
local resuming flag) to a more logical place.  Add a saving flag
in the process, but it isn't being set or cleared anywhere yet.
(Once in use it will probably fix the exception during save that
was just reported, but before that it would be useful to figure
out what specifically caused the event.)

The program_state struct really ought to be standalone rather
than part of struct g but I haven't made that change.

Removing an unused variable for wishing and some reformatting
that whent along with it got mixed in.  Removes some trailing
whitespace in sfstruct.c too.

Only lightly tested...
2020-11-30 11:40:21 -08:00
nhmall
cb5bda40e2 update an old msdos file 2020-11-25 07:53:24 -05:00
nhmall
d5d75a9e38 move an outdated file: sys/unix/README.linux 2020-11-25 07:27:25 -05:00
nhmall
9ea45d7a1f remove some trailing whitespace 2020-11-25 07:23:23 -05:00
nhmall
c2e20ff263 Makefile autodetects Visual Studio 16.8.2 2020-11-22 12:49:55 -05:00
nhmall
75c66d2881 Merge branch 'wasm-bug-fixes-2' of https://github.com/apowers313/NetHack into wasm-bug-fixes-2 2020-11-18 08:18:16 -05:00
Adam Powers
37361001f4 pre-fix @PatR 'SHELLERS on VMS' change 2020-11-17 23:58:12 -08:00
Adam Powers
c021293983 remove unnecesssary JavaScript code 2020-11-17 21:10:27 -08:00
Adam Powers
8c06dccd92 allow repeated running 2020-11-17 21:06:58 -08:00
PatR
5c291bc540 honor sysconf SHELLERS on VMS
I was looking into adding a confirmation prompt for '!' and it
isn't very promising due to sequencing issues.  (The check for
whether '!' is allowed should happen before the prompt about
running it but the latter should take place in the core rather
than in the port code.)  In the mean time, I noticed that VMS was
ignoring the SHELLERS value from SYSCF.

Untested implementation of a SHELLERS check on VMS.  Even if it
works, it should not be using $USER as the user name to verify.

Tweaks the Unix implementation of check_user_string() but doesn't
switch the testing loop to the simpler version used by VMS which
is derived from the generic users test used by Qt.
2020-11-15 18:28:20 -08:00
nhmall
f965d187b8 support for build with current Lua version 5.4.1
This may require
	make spotless
	make fetch-lua
for some platforms.
2020-11-15 11:08:10 -05:00
Adam Powers
beb189e6cb delinting 2020-11-07 16:13:14 -08:00
Adam Powers
9fa0c9cfd2 bump version 2020-11-01 16:41:38 -08:00
Adam Powers
9275fc2428 return string for msg history 2020-11-01 16:35:44 -08:00
nhmall
6c62b991c2 Merge branch 'wasm-bug-fixes' of https://github.com/apowers313/NetHack into wasm-pr403 2020-10-31 09:22:55 -04:00
Bart House
362fd6ffbf Add stopping in the debugger when nhassert() is hit in the windows port.
When stopping in the debugger after having called impossible, the windowing
state will have been modified since the assertion was hit.  This made
examining state that caused the nhassert to fire no longer possible.
To avoid this issue, we now detect the debugger and stop in the debugger
prior to impossible.
2020-10-19 15:56:49 -07:00
Bart House
93ce6857d3 Tweaks to nhassert implementation. Change to warnings on MSC build. 2020-10-19 15:55:32 -07:00