Merge branch 'NetHack-3.7'

This commit is contained in:
nhmall
2019-12-13 17:41:03 -05:00
133 changed files with 8267 additions and 18459 deletions
+1 -2
View File
@@ -378,8 +378,7 @@ Using the cross-compiler, build the following targets:
src/priest.c, src/quest.c, src/questpgr.c, src/priest.c, src/quest.c, src/questpgr.c,
src/random.c, src/read.c, src/rect.c, src/region.c, src/random.c, src/read.c, src/rect.c, src/region.c,
src/restore.c, src/rip.c, src/rnd.c, src/role.c, src/restore.c, src/rip.c, src/rnd.c, src/role.c,
src/rumors.c, src/save.c, src/sfbase.c, src/rumors.c, src/save.c, src/sfstruct.c,
src/sfdata.c, src/sflendian.c, src/sfstruct.c,
src/shk.c, src/shknam.c, src/sit.c, src/sounds.c, src/shk.c, src/shknam.c, src/sit.c, src/sounds.c,
src/sp_lev.c, src/spell.c, src/steal.c, src/steed.c, src/sp_lev.c, src/spell.c, src/steal.c, src/steed.c,
src/sys.c, src/teleport.c, src/tile.c, src/sys.c, src/teleport.c, src/tile.c,
+20 -21
View File
@@ -307,25 +307,24 @@ dlb_main.c makedefs.c mdgrep.h mdgrep.pl panic.c readtags.c
recover.c recover.c
win/Qt: win/Qt:
(files for the Qt 4 or 5 widget library - X11, Windows, Mac OS X)
qt_bind.cpp qt_bind.h qt_click.cpp qt_click.h qt_clust.cpp
qt_clust.h qt_delay.cpp qt_delay.h qt_glyph.cpp qt_glyph.h
qt_icon.cpp qt_icon.h qt_inv.cpp qt_inv.h qt_kde0.h
qt_key.cpp qt_key.h qt_line.cpp qt_line.h qt_main.cpp
qt_main.h qt_map.cpp qt_map.h qt_menu.cpp qt_menu.h
qt_msg.cpp qt_msg.h qt_plsel.cpp qt_plsel.h qt_rip.cpp
qt_rip.h qt_set.cpp qt_set.h qt_stat.cpp qt_stat.h
qt_str.cpp qt_str.h qt_streq.cpp qt_streq.h qt_svsel.cpp
qt_svsel.h qt_win.cpp qt_win.h qt_xcmd.cpp qt_xcmd.h
qt_yndlg.cpp qt_yndlg.h
win/Qt3:
(files for the Qt 3 widget library - X11, Windows, Mac OS X, or Qtopia) (files for the Qt 3 widget library - X11, Windows, Mac OS X, or Qtopia)
Info.plist Install.Qt knethack.lnk Info.plist Install.Qt knethack.lnk
knh-mini.xpm knh.xpm nhicns.uu knh-mini.xpm knh.xpm qpe-nethack.control
nhsplash.xpm qpe-nethack.control qt_clust.cpp qt_clust.cpp qt_win.cpp qttableview.cpp
qt_win.cpp qttableview.cpp tileedit.cpp tileedit.cpp tileedit.h
tileedit.h
win/Qt4:
(files for the Qt 4 widget library - X11, Windows, Mac OS X)
qt4bind.cpp qt4bind.h qt4click.cpp qt4click.h qt4clust.cpp
qt4clust.h qt4delay.cpp qt4delay.h qt4glyph.cpp qt4glyph.h
qt4icon.cpp qt4icon.h qt4inv.cpp qt4inv.h qt4kde0.h
qt4key.cpp qt4key.h qt4line.cpp qt4line.h qt4main.cpp
qt4main.h qt4map.cpp qt4map.h qt4menu.cpp qt4menu.h
qt4msg.cpp qt4msg.h qt4plsel.cpp qt4plsel.h qt4rip.cpp
qt4rip.h qt4set.cpp qt4set.h qt4stat.cpp qt4stat.h
qt4str.cpp qt4str.h qt4streq.cpp qt4streq.h qt4svsel.cpp
qt4svsel.h qt4win.cpp qt4win.h qt4xcmd.cpp qt4xcmd.h
qt4yndlg.cpp qt4yndlg.h
win/X11: win/X11:
(files for X versions) (files for X versions)
@@ -366,10 +365,10 @@ NetHackTerm.applescript recover.pl
win/share: win/share:
(files for versions using optional tiles) (files for versions using optional tiles)
bmptiles.c gifread.c giftiles.c monsters.txt objects.txt bmptiles.c gifread.c giftiles.c monsters.txt nhicns.uu
other.txt ppmwrite.c renumtiles.pl safeproc.c thintile.c nhsplash.xpm objects.txt other.txt ppmwrite.c renumtiles.pl
tile.doc tile.h tile2bmp.c tilemap.c tileset.c safeproc.c thintile.c tile.doc tile.h tile2bmp.c
tiletext.c tilemap.c tileset.c tiletext.c
win/tty: win/tty:
(files for tty versions) (files for tty versions)
+9 -2
View File
@@ -1,4 +1,4 @@
$NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.17 $ $NHDT-Date: 1575542023 2019/12/05 10:33:43 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.19 $ $NHDT-Date: 1575755075 2019/12/07 21:44:35 $
General Fixes and Modified Features General Fixes and Modified Features
----------------------------------- -----------------------------------
@@ -13,6 +13,9 @@ improvements to pronoun usage when hallucinating
message "your knapsack can't accomodate any more items" when picking stuff up message "your knapsack can't accomodate any more items" when picking stuff up
or removing such from container was inaccurate if there was some gold or removing such from container was inaccurate if there was some gold
pending; vary the message rather than add more convoluted pickup code pending; vary the message rather than add more convoluted pickup code
function calls made from mapglyph based on dungeon level are now called once
per level
allow teleporting onto the vibrating square
Fixes to Pre-3.7.0 Problems that Were Exposed Via git Repository Fixes to Pre-3.7.0 Problems that Were Exposed Via git Repository
@@ -39,7 +42,8 @@ split off some of the functionality that was in makedefs (compiled-in options
build date/time, etc) so that it can be built by a cross-compiler build date/time, etc) so that it can be built by a cross-compiler
and accessed on the target platform and accessed on the target platform
replace quest.txt and associated conversion to quest.dat via makedefs with replace quest.txt and associated conversion to quest.dat via makedefs with
lua quest texts loaded at runtime lua quest texts loaded at runtime
some altars are displayed in different colors (for tty and curses at least)
Platform- and/or Interface-Specific New Features Platform- and/or Interface-Specific New Features
@@ -55,4 +59,7 @@ Code Cleanup and Reorganization
move majority of global variables into instance_globals struct g move majority of global variables into instance_globals struct g
move zeroobj, zeromonst, zeroany into const_globals struct cg move zeroobj, zeromonst, zeroany into const_globals struct cg
remove STATIC_DCL, STATIC_OVL, STATIC_VAR, STATIC_PTR remove STATIC_DCL, STATIC_OVL, STATIC_VAR, STATIC_PTR
old Qt moved from win/Qt to win/Qt3
more current Qt for Qt version 4 and 5 moved from win/Qt4 to win/Qt; qt4
moniker changed to qt_
+2 -1
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 context.h $NHDT-Date: 1455907260 2016/02/19 18:41:00 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.30 $ */ /* NetHack 3.6 context.h $NHDT-Date: 1575775592 2019/12/08 03:26:32 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.35 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Michael Allison, 2006. */ /*-Copyright (c) Michael Allison, 2006. */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -115,6 +115,7 @@ struct context_info {
int current_fruit; /* fruit->fid corresponding to g.pl_fruit[] */ int current_fruit; /* fruit->fid corresponding to g.pl_fruit[] */
int warnlevel; int warnlevel;
int rndencode; /* randomized escape sequence introducer */ int rndencode; /* randomized escape sequence introducer */
int mysteryforce;
long next_attrib_check; /* next attribute check */ long next_attrib_check; /* next attribute check */
long stethoscope_move; long stethoscope_move;
short stethoscope_movement; short stethoscope_movement;
+3
View File
@@ -1260,6 +1260,9 @@ struct instance_globals {
char lua_ver[LUA_VER_BUFSIZ]; char lua_ver[LUA_VER_BUFSIZ];
char lua_copyright[LUA_COPYRIGHT_BUFSIZ]; char lua_copyright[LUA_COPYRIGHT_BUFSIZ];
/* per-level glyph mapping flags */
long glyphmap_perlevel_flags;
unsigned long magic; /* validate that structure layout is preserved */ unsigned long magic; /* validate that structure layout is preserved */
}; };
+13 -1
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 extern.h $NHDT-Date: 1574648937 2019/11/25 02:28:57 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.760 $ */ /* NetHack 3.6 extern.h $NHDT-Date: 1575830178 2019/12/08 18:36:18 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.767 $ */
/* Copyright (c) Steve Creps, 1988. */ /* Copyright (c) Steve Creps, 1988. */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -1671,6 +1671,11 @@ E struct selectionvar *FDECL(l_selection_check, (lua_State *, int));
E int FDECL(l_selection_register, (lua_State *)); E int FDECL(l_selection_register, (lua_State *));
#endif #endif
/* ### nhlobj.c ### */
#if !defined(CROSSCOMPILE) || defined(CROSSCOMPILE_TARGET)
E int FDECL(l_obj_register, (lua_State *));
#endif
/* ### nhlua.c ### */ /* ### nhlua.c ### */
#if !defined(CROSSCOMPILE) || defined(CROSSCOMPILE_TARGET) #if !defined(CROSSCOMPILE) || defined(CROSSCOMPILE_TARGET)
@@ -1681,6 +1686,9 @@ E void FDECL(nhl_error, (lua_State *, const char *)) NORETURN;
E void FDECL(lcheck_param_table, (lua_State *)); E void FDECL(lcheck_param_table, (lua_State *));
E schar FDECL(get_table_mapchr, (lua_State *, const char *)); E schar FDECL(get_table_mapchr, (lua_State *, const char *));
E schar FDECL(get_table_mapchr_opt, (lua_State *, const char *, SCHAR_P)); E schar FDECL(get_table_mapchr_opt, (lua_State *, const char *, SCHAR_P));
E void FDECL(nhl_add_table_entry_int, (lua_State *, const char *, int));
E void FDECL(nhl_add_table_entry_char, (lua_State *, const char *, CHAR_P));
E void FDECL(nhl_add_table_entry_str, (lua_State *, const char *, const char *));
E schar FDECL(splev_chr2typ, (CHAR_P)); E schar FDECL(splev_chr2typ, (CHAR_P));
E schar FDECL(check_mapchr, (const char *)); E schar FDECL(check_mapchr, (const char *));
E int FDECL(get_table_int, (lua_State *, const char *)); E int FDECL(get_table_int, (lua_State *, const char *));
@@ -1796,6 +1804,9 @@ E const char *FDECL(suit_simple_name, (struct obj *));
E const char *FDECL(cloak_simple_name, (struct obj *)); E const char *FDECL(cloak_simple_name, (struct obj *));
E const char *FDECL(helm_simple_name, (struct obj *)); E const char *FDECL(helm_simple_name, (struct obj *));
E const char *FDECL(gloves_simple_name, (struct obj *)); E const char *FDECL(gloves_simple_name, (struct obj *));
E const char *FDECL(boots_simple_name, (struct obj *));
E const char *FDECL(shield_simple_name, (struct obj *));
E const char *FDECL(shirt_simple_name, (struct obj *));
E const char *FDECL(mimic_obj_name, (struct monst *)); E const char *FDECL(mimic_obj_name, (struct monst *));
E char *FDECL(safe_qbuf, (char *, const char *, const char *, struct obj *, E char *FDECL(safe_qbuf, (char *, const char *, const char *, struct obj *,
char *(*)(OBJ_P), char *(*)(OBJ_P), const char *)); char *(*)(OBJ_P), char *(*)(OBJ_P), const char *));
@@ -2042,6 +2053,7 @@ E boolean FDECL(can_pray, (BOOLEAN_P));
E int NDECL(dopray); E int NDECL(dopray);
E const char *NDECL(u_gname); E const char *NDECL(u_gname);
E int NDECL(doturn); E int NDECL(doturn);
E int FDECL(altarmask_at, (int, int));
E const char *NDECL(a_gname); E const char *NDECL(a_gname);
E const char *FDECL(a_gname_at, (XCHAR_P x, XCHAR_P y)); E const char *FDECL(a_gname_at, (XCHAR_P x, XCHAR_P y));
E const char *FDECL(align_gname, (ALIGNTYP_P)); E const char *FDECL(align_gname, (ALIGNTYP_P));
+2 -2
View File
@@ -1,4 +1,4 @@
/* NetHack 3.7 patchlevel.h $NHDT-Date: 1574982020 2019/11/28 23:00:20 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.134 $ */ /* NetHack 3.7 patchlevel.h $NHDT-Date: 1575775596 2019/12/08 03:26:36 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.136 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Michael Allison, 2012. */ /*-Copyright (c) Michael Allison, 2012. */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -14,7 +14,7 @@
* Incrementing EDITLEVEL can be used to force invalidation of old bones * Incrementing EDITLEVEL can be used to force invalidation of old bones
* and save files. * and save files.
*/ */
#define EDITLEVEL 1 #define EDITLEVEL 3
#define COPYRIGHT_BANNER_A "NetHack, Copyright 1985-2019" #define COPYRIGHT_BANNER_A "NetHack, Copyright 1985-2019"
#define COPYRIGHT_BANNER_B \ #define COPYRIGHT_BANNER_B \
-192
View File
@@ -1,192 +0,0 @@
/* NetHack 3.6 sfprocs.h Tue Nov 6 19:38:48 2018 */
/* Copyright (c) NetHack Development Team 2018. */
/* NetHack may be freely redistributed. See license for details. */
#ifndef SFPROCS_H
#define SFPROCS_H
#include "hack.h"
#include "integer.h"
#include "wintype.h"
#define E extern
/* output routines */
E void FDECL(ascii_sfo_aligntyp, (NHFILE *, aligntyp *, const char *, const char *, int));
E void FDECL(ascii_sfo_any, (NHFILE *, union any *d_any, const char *, const char *, int));
E void FDECL(ascii_sfo_bitfield, (NHFILE *, uint8_t *, const char *, const char *, int));
E void FDECL(ascii_sfo_boolean, (NHFILE *, boolean *, const char *, const char *, int));
E void FDECL(ascii_sfo_char, (NHFILE *, char *, const char *, const char *, int));
E void FDECL(ascii_sfo_genericptr, (NHFILE *, genericptr_t *, const char *, const char *, int));
E void FDECL(ascii_sfo_int, (NHFILE *, int *, const char *, const char *, int));
E void FDECL(ascii_sfo_long, (NHFILE *, long *, const char *, const char *, int));
E void FDECL(ascii_sfo_schar, (NHFILE *, schar *, const char *, const char *, int));
E void FDECL(ascii_sfo_short, (NHFILE *, short *, const char *, const char *, int));
E void FDECL(ascii_sfo_size_t, (NHFILE *, size_t *, const char *, const char *, int));
E void FDECL(ascii_sfo_time_t, (NHFILE *, time_t *, const char *, const char *, int));
E void FDECL(ascii_sfo_unsigned, (NHFILE *, unsigned *, const char *, const char *, int));
E void FDECL(ascii_sfo_uchar, (NHFILE *, unsigned char *, const char *, const char *, int));
E void FDECL(ascii_sfo_uint, (NHFILE *, unsigned int *, const char *, const char *, int));
E void FDECL(ascii_sfo_ulong, (NHFILE *, unsigned long *, const char *, const char *, int));
E void FDECL(ascii_sfo_ushort, (NHFILE *, unsigned short *, const char *, const char *, int));
E void FDECL(ascii_sfo_xchar, (NHFILE *, xchar *, const char *, const char *, int));
E void FDECL(ascii_sfo_str, (NHFILE *, char *, const char *, const char *, int));
E void FDECL(ascii_sfo_addinfo, (NHFILE *, const char *, const char *, const char *, int));
/* input routines */
E void FDECL(ascii_sfi_aligntyp, (NHFILE *, aligntyp *, const char *, const char *, int));
E void FDECL(ascii_sfi_any, (NHFILE *, union any *d_any, const char *, const char *, int));
E void FDECL(ascii_sfi_bitfield, (NHFILE *, uint8_t *, const char *, const char *, int));
E void FDECL(ascii_sfi_boolean, (NHFILE *, boolean *, const char *, const char *, int));
E void FDECL(ascii_sfi_char, (NHFILE *, char *, const char *, const char *, int));
E void FDECL(ascii_sfi_genericptr, (NHFILE *, genericptr_t *, const char *, const char *, int));
E void FDECL(ascii_sfi_int, (NHFILE *, int *, const char *, const char *, int));
E void FDECL(ascii_sfi_long, (NHFILE *, long *, const char *, const char *, int));
E void FDECL(ascii_sfi_schar, (NHFILE *, schar *, const char *, const char *, int));
E void FDECL(ascii_sfi_short, (NHFILE *, short *, const char *, const char *, int));
E void FDECL(ascii_sfi_size_t, (NHFILE *, size_t *, const char *, const char *, int));
E void FDECL(ascii_sfi_time_t, (NHFILE *, time_t *, const char *, const char *, int));
E void FDECL(ascii_sfi_unsigned, (NHFILE *, unsigned *, const char *, const char *, int));
E void FDECL(ascii_sfi_uchar, (NHFILE *, unsigned char *, const char *, const char *, int));
E void FDECL(ascii_sfi_uint, (NHFILE *, unsigned int *, const char *, const char *, int));
E void FDECL(ascii_sfi_ulong, (NHFILE *, unsigned long *, const char *, const char *, int));
E void FDECL(ascii_sfi_ushort, (NHFILE *, unsigned short *, const char *, const char *, int));
E void FDECL(ascii_sfi_xchar, (NHFILE *, xchar *, const char *, const char *, int));
E void FDECL(ascii_sfi_str, (NHFILE *, char *, const char *, const char *, int));
E void FDECL(ascii_sfi_addinfo, (NHFILE *, const char *, const char *, const char *, int));
/* output routines */
E void FDECL(lendian_sfo_aligntyp, (NHFILE *, aligntyp *, const char *, const char *, int));
E void FDECL(lendian_sfo_any, (NHFILE *, union any *d_any, const char *, const char *, int));
E void FDECL(lendian_sfo_bitfield, (NHFILE *, uint8_t *, const char *, const char *, int));
E void FDECL(lendian_sfo_boolean, (NHFILE *, boolean *, const char *, const char *, int));
E void FDECL(lendian_sfo_char, (NHFILE *, char *, const char *, const char *, int));
E void FDECL(lendian_sfo_genericptr, (NHFILE *, genericptr_t *, const char *, const char *, int));
E void FDECL(lendian_sfo_int, (NHFILE *, int *, const char *, const char *, int));
E void FDECL(lendian_sfo_long, (NHFILE *, long *, const char *, const char *, int));
E void FDECL(lendian_sfo_schar, (NHFILE *, schar *, const char *, const char *, int));
E void FDECL(lendian_sfo_short, (NHFILE *, short *, const char *, const char *, int));
E void FDECL(lendian_sfo_size_t, (NHFILE *, size_t *, const char *, const char *, int));
E void FDECL(lendian_sfo_time_t, (NHFILE *, time_t *, const char *, const char *, int));
E void FDECL(lendian_sfo_unsigned, (NHFILE *, unsigned *, const char *, const char *, int));
E void FDECL(lendian_sfo_uchar, (NHFILE *, unsigned char *, const char *, const char *, int));
E void FDECL(lendian_sfo_uint, (NHFILE *, unsigned int *, const char *, const char *, int));
E void FDECL(lendian_sfo_ulong, (NHFILE *, unsigned long *, const char *, const char *, int));
E void FDECL(lendian_sfo_ushort, (NHFILE *, unsigned short *, const char *, const char *, int));
E void FDECL(lendian_sfo_xchar, (NHFILE *, xchar *, const char *, const char *, int));
E void FDECL(lendian_sfo_str, (NHFILE *, char *, const char *, const char *, int));
E void FDECL(lendian_sfo_addinfo, (NHFILE *, const char *, const char *, const char *, int));
/* input routines */
E void FDECL(lendian_sfi_aligntyp, (NHFILE *, aligntyp *, const char *, const char *, int));
E void FDECL(lendian_sfi_any, (NHFILE *, union any *d_any, const char *, const char *, int));
E void FDECL(lendian_sfi_bitfield, (NHFILE *, uint8_t *, const char *, const char *, int));
E void FDECL(lendian_sfi_boolean, (NHFILE *, boolean *, const char *, const char *, int));
E void FDECL(lendian_sfi_char, (NHFILE *, char *, const char *, const char *, int));
E void FDECL(lendian_sfi_genericptr, (NHFILE *, genericptr_t *, const char *, const char *, int));
E void FDECL(lendian_sfi_int, (NHFILE *, int *, const char *, const char *, int));
E void FDECL(lendian_sfi_long, (NHFILE *, long *, const char *, const char *, int));
E void FDECL(lendian_sfi_schar, (NHFILE *, schar *, const char *, const char *, int));
E void FDECL(lendian_sfi_short, (NHFILE *, short *, const char *, const char *, int));
E void FDECL(lendian_sfi_size_t, (NHFILE *, size_t *, const char *, const char *, int));
E void FDECL(lendian_sfi_time_t, (NHFILE *, time_t *, const char *, const char *, int));
E void FDECL(lendian_sfi_unsigned, (NHFILE *, unsigned *, const char *, const char *, int));
E void FDECL(lendian_sfi_uchar, (NHFILE *, unsigned char *, const char *, const char *, int));
E void FDECL(lendian_sfi_uint, (NHFILE *, unsigned int *, const char *, const char *, int));
E void FDECL(lendian_sfi_ulong, (NHFILE *, unsigned long *, const char *, const char *, int));
E void FDECL(lendian_sfi_ushort, (NHFILE *, unsigned short *, const char *, const char *, int));
E void FDECL(lendian_sfi_xchar, (NHFILE *, xchar *, const char *, const char *, int));
E void FDECL(lendian_sfi_str, (NHFILE *, char *, const char *, const char *, int));
E void FDECL(lendian_sfi_addinfo, (NHFILE *, const char *, const char *, const char *, int));
#ifdef JSON_SUPPORT
/* output routines */
E void FDECL(json_sfo_aligntyp, (NHFILE *, aligntype *, const char *, const char *, int));
E void FDECL(json_sfo_any, (NHFILE *, union any *d_any, const char *, const char *, int));
E void FDECL(json_sfo_bitfield, (NHFILE *, uint8_t *, const char *, const char *, int));
E void FDECL(json_sfo_boolean, (NHFILE *, boolean *, const char *, const char *, int));
E void FDECL(json_sfo_char, (NHFILE *, char *, const char *, const char *, int));
E void FDECL(json_sfo_genericptr, (NHFILE *, genericptr_t *, const char *, const char *, int));
E void FDECL(json_sfo_int, (NHFILE *, int *, const char *, const char *, int));
E void FDECL(json_sfo_long, (NHFILE *, long *, const char *, const char *, int));
E void FDECL(json_sfo_schar, (NHFILE *, schar *, const char *, const char *, int));
E void FDECL(json_sfo_short, (NHFILE *, short *, const char *, const char *, int));
E void FDECL(json_sfo_size_t, (NHFILE *, size_t *, const char *, const char *, int));
E void FDECL(json_sfo_time_t, (NHFILE *, time_t *, const char *, const char *, int));
E void FDECL(json_sfo_unsigned, (NHFILE *, unsigned *, const char *, const char *, int));
E void FDECL(json_sfo_uchar, (NHFILE *, unsigned char *, const char *, const char *, int));
E void FDECL(json_sfo_uint, (NHFILE *, unsigned int *, const char *, const char *, int));
E void FDECL(json_sfo_ulong, (NHFILE *, unsigned long *, const char *, const char *, int));
E void FDECL(json_sfo_ushort, (NHFILE *, unsigned short *, const char *, const char *, int));
E void FDECL(json_sfo_xchar, (NHFILE *, xchar *, const char *, const char *, int));
E void FDECL(json_sfo_str, (NHFILE *, char *, const char *, const char *, int));
E void FDECL(json_sfo_addinfo), (NHFILE *, const char *, const char *, const char *, int));
/* input routines */
E void FDECL(json_sfi_aligntyp, (NHFILE *, aligntype *, const char *, const char *, int));
E void FDECL(json_sfi_any, (NHFILE *, union any *d_any, const char *, const char *, int));
E void FDECL(json_sfi_bitfield, (NHFILE *, uint8_t *, const char *, const char *, int));
E void FDECL(json_sfi_boolean, (NHFILE *, boolean *, const char *, const char *, int));
E void FDECL(json_sfi_char, (NHFILE *, char *, const char *, const char *, int));
E void FDECL(json_sfi_genericptr, (NHFILE *, genericptr_t *, const char *, const char *, int));
E void FDECL(json_sfi_int, (NHFILE *, int *, const char *, const char *, int));
E void FDECL(json_sfi_long, (NHFILE *, long *, const char *, const char *, int));
E void FDECL(json_sfi_schar, (NHFILE *, schar *, const char *, const char *, int));
E void FDECL(json_sfi_short, (NHFILE *, short *, const char *, const char *, int));
E void FDECL(json_sfi_size_t, (NHFILE *, size_t *, const char *, const char *, int));
E void FDECL(json_sfi_time_t, (NHFILE *, time_t *, const char *, const char *, int));
E void FDECL(json_sfi_unsigned, (NHFILE *, unsigned *, const char *, const char *, int));
E void FDECL(json_sfi_uchar, (NHFILE *, unsigned char *, const char *, const char *, int));
E void FDECL(json_sfi_uint, (NHFILE *, unsigned int *, const char *, const char *, int));
E void FDECL(json_sfi_ulong, (NHFILE *, unsigned long *, const char *, const char *, int));
E void FDECL(json_sfi_ushort, (NHFILE *, unsigned short *, const char *, const char *, int));
E void FDECL(json_sfi_xchar, (NHFILE *, xchar *, const char *, const char *, int));
E void FDECL(json_sfi_str, (NHFILE *, char *, const char *, const char *, int));
E void FDECL(json_sfi_addinfo), (NHFILE *, const char *, const char *, const char *, int));
#endif /* JSON_SUPPORT */
struct fieldlevel_procs {
void FDECL((*sf_aligntyp), (NHFILE *, aligntyp *, const char *, const char *, int));
void FDECL((*sf_any), (NHFILE *, union any *d_any, const char *, const char *, int));
void FDECL((*sf_bitfield), (NHFILE *, uint8_t *, const char *, const char *, int));
void FDECL((*sf_boolean), (NHFILE *, boolean *, const char *, const char *, int));
void FDECL((*sf_char), (NHFILE *, char *, const char *, const char *, int));
void FDECL((*sf_genericptr), (NHFILE *, genericptr_t *, const char *, const char *, int));
void FDECL((*sf_int), (NHFILE *, int *, const char *, const char *, int));
void FDECL((*sf_long), (NHFILE *, long *, const char *, const char *, int));
void FDECL((*sf_schar), (NHFILE *, schar *, const char *, const char *, int));
void FDECL((*sf_short), (NHFILE *, short *, const char *, const char *, int));
void FDECL((*sf_size_t), (NHFILE *, size_t *, const char *, const char *, int));
void FDECL((*sf_time_t), (NHFILE *, time_t *, const char *, const char *, int));
void FDECL((*sf_unsigned), (NHFILE *, unsigned *, const char *, const char *, int));
void FDECL((*sf_uchar), (NHFILE *, unsigned char *, const char *, const char *, int));
void FDECL((*sf_uint), (NHFILE *, unsigned int *, const char *, const char *, int));
void FDECL((*sf_ulong), (NHFILE *, unsigned long *, const char *, const char *, int));
void FDECL((*sf_ushort), (NHFILE *, unsigned short *, const char *, const char *, int));
void FDECL((*sf_xchar), (NHFILE *, xchar *, const char *, const char *, int));
void FDECL((*sf_str), (NHFILE *, char *, const char *, const char *, int));
void FDECL((*sf_addinfo), (NHFILE *, const char *, const char *, const char *, int));
};
struct sf_procs {
const char *ext;
struct fieldlevel_procs fn;
};
E void NDECL(sf_init);
E struct sf_procs sfoprocs[4], sfiprocs[4];
E struct sf_procs ascii_sfo_procs;
E struct sf_procs ascii_sfi_procs;
E struct sf_procs lendian_sfo_procs;
E struct sf_procs lendian_sfi_procs;
E struct sf_procs stub_sfo_procs;
E struct sf_procs stub_sfi_procs;
#ifdef JSON_SUPPORT
E struct sf_procs json_sfo_procs;
E struct sf_procs json_sfi_procs;
#endif
#undef E
#endif /* SFPROCS_H */
-201
View File
@@ -1,201 +0,0 @@
/* NetHack 3.7 sfproto.h */
/* Copyright (c) NetHack Development Team 2019. */
/* NetHack may be freely redistributed. See license for details. */
/* THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE! */
#ifndef SFPROTO_H
#define SFPROTO_H
#include "hack.h"
#include "integer.h"
#include "wintype.h"
#define E extern
E int NDECL(critical_members_count);
/* sfbase.c output functions */
E void FDECL(sfo_addinfo, (NHFILE *, const char *, const char *, const char *, int));
E void FDECL(sfo_aligntyp, (NHFILE *, aligntyp *, const char *, const char *, int));
E void FDECL(sfo_any, (NHFILE *, anything *, const char *, const char *, int));
E void FDECL(sfo_bitfield, (NHFILE *, uint8_t *, const char *, const char *, int));
E void FDECL(sfo_boolean, (NHFILE *, boolean *, const char *, const char *, int));
E void FDECL(sfo_char, (NHFILE *, const char *, const char *, const char *, int));
E void FDECL(sfo_genericptr, (NHFILE *, genericptr_t *, const char *, const char *, int));
E void FDECL(sfo_int, (NHFILE *, int *, const char *, const char *, int));
E void FDECL(sfo_long, (NHFILE *, long *, const char *, const char *, int));
E void FDECL(sfo_schar, (NHFILE *, schar *, const char *, const char *, int));
E void FDECL(sfo_short, (NHFILE *, short *, const char *, const char *, int));
E void FDECL(sfo_size_t, (NHFILE *, size_t *, const char *, const char *, int));
E void FDECL(sfo_time_t, (NHFILE *, time_t *, const char *, const char *, int));
E void FDECL(sfo_uchar, (NHFILE *, uchar *, const char *, const char *, int));
E void FDECL(sfo_unsigned, (NHFILE *, unsigned *, const char *, const char *, int));
E void FDECL(sfo_uchar, (NHFILE *, unsigned char *, const char *, const char *, int));
E void FDECL(sfo_uint, (NHFILE *, unsigned int *, const char *, const char *, int));
E void FDECL(sfo_ulong, (NHFILE *, unsigned long *, const char *, const char *, int));
E void FDECL(sfo_ushort, (NHFILE *, unsigned short *, const char *, const char *, int));
E void FDECL(sfo_xchar, (NHFILE *, xchar *, const char *, const char *, int));
E void FDECL(sfo_str, (NHFILE *, const char *, const char *, const char *, int));
/* sfbase.c input functions */
E void FDECL(sfi_addinfo, (NHFILE *, const char *, const char *, const char *, int));
E void FDECL(sfi_aligntyp, (NHFILE *, aligntyp *, const char *, const char *, int));
E void FDECL(sfi_any, (NHFILE *, anything *, const char *, const char *, int));
E void FDECL(sfi_bitfield, (NHFILE *, uint8_t *, const char *, const char *, int));
E void FDECL(sfi_boolean, (NHFILE *, boolean *, const char *, const char *, int));
E void FDECL(sfi_char, (NHFILE *, const char *, const char *, const char *, int));
E void FDECL(sfi_genericptr, (NHFILE *, genericptr_t *, const char *, const char *, int));
E void FDECL(sfi_int, (NHFILE *, int *, const char *, const char *, int));
E void FDECL(sfi_long, (NHFILE *, long *, const char *, const char *, int));
E void FDECL(sfi_schar, (NHFILE *, schar *, const char *, const char *, int));
E void FDECL(sfi_short, (NHFILE *, short *, const char *, const char *, int));
E void FDECL(sfi_size_t, (NHFILE *, size_t *, const char *, const char *, int));
E void FDECL(sfi_time_t, (NHFILE *, time_t *, const char *, const char *, int));
E void FDECL(sfi_uchar, (NHFILE *, uchar *, const char *, const char *, int));
E void FDECL(sfi_unsigned, (NHFILE *, unsigned *, const char *, const char *, int));
E void FDECL(sfi_uchar, (NHFILE *, unsigned char *, const char *, const char *, int));
E void FDECL(sfi_uint, (NHFILE *, unsigned int *, const char *, const char *, int));
E void FDECL(sfi_ulong, (NHFILE *, unsigned long *, const char *, const char *, int));
E void FDECL(sfi_ushort, (NHFILE *, unsigned short *, const char *, const char *, int));
E void FDECL(sfi_xchar, (NHFILE *, xchar *, const char *, const char *, int));
E void FDECL(sfi_str, (NHFILE *, const char *, const char *, const char *, int));
/* generated output functions */
E void FDECL(sfo_align, (NHFILE *, struct align *, const char *, const char *, int));
E void FDECL(sfo_attribs, (NHFILE *, struct attribs *, const char *, const char *, int));
E void FDECL(sfo_bill_x, (NHFILE *, struct bill_x *, const char *, const char *, int));
E void FDECL(sfo_book_info, (NHFILE *, struct book_info *, const char *, const char *, int));
E void FDECL(sfo_branch, (NHFILE *, struct branch *, const char *, const char *, int));
E void FDECL(sfo_bubble, (NHFILE *, struct bubble *, const char *, const char *, int));
E void FDECL(sfo_cemetery, (NHFILE *, struct cemetery *, const char *, const char *, int));
E void FDECL(sfo_context_info, (NHFILE *, struct context_info *, const char *, const char *, int));
E void FDECL(sfo_d_flags, (NHFILE *, struct d_flags *, const char *, const char *, int));
E void FDECL(sfo_d_level, (NHFILE *, struct d_level *, const char *, const char *, int));
E void FDECL(sfo_damage, (NHFILE *, struct damage *, const char *, const char *, int));
E void FDECL(sfo_dest_area, (NHFILE *, struct dest_area *, const char *, const char *, int));
E void FDECL(sfo_dgn_topology, (NHFILE *, struct dgn_topology *, const char *, const char *, int));
E void FDECL(sfo_dig_info, (NHFILE *, struct dig_info *, const char *, const char *, int));
E void FDECL(sfo_dungeon, (NHFILE *, struct dungeon *, const char *, const char *, int));
E void FDECL(sfo_edog, (NHFILE *, struct edog *, const char *, const char *, int));
E void FDECL(sfo_egd, (NHFILE *, struct egd *, const char *, const char *, int));
E void FDECL(sfo_emin, (NHFILE *, struct emin *, const char *, const char *, int));
E void FDECL(sfo_engr, (NHFILE *, struct engr *, const char *, const char *, int));
E void FDECL(sfo_epri, (NHFILE *, struct epri *, const char *, const char *, int));
E void FDECL(sfo_eshk, (NHFILE *, struct eshk *, const char *, const char *, int));
E void FDECL(sfo_fakecorridor, (NHFILE *, struct fakecorridor *, const char *, const char *, int));
E void FDECL(sfo_fe, (NHFILE *, struct fe *, const char *, const char *, int));
E void FDECL(sfo_flag, (NHFILE *, struct flag *, const char *, const char *, int));
E void FDECL(sfo_fruit, (NHFILE *, struct fruit *, const char *, const char *, int));
E void FDECL(sfo_kinfo, (NHFILE *, struct kinfo *, const char *, const char *, int));
E void FDECL(sfo_levelflags, (NHFILE *, struct levelflags *, const char *, const char *, int));
E void FDECL(sfo_linfo, (NHFILE *, struct linfo *, const char *, const char *, int));
E void FDECL(sfo_ls_t, (NHFILE *, struct ls_t *, const char *, const char *, int));
E void FDECL(sfo_mapseen_feat, (NHFILE *, struct mapseen_feat *, const char *, const char *, int));
E void FDECL(sfo_mapseen_flags, (NHFILE *, struct mapseen_flags *, const char *, const char *, int));
E void FDECL(sfo_mapseen_rooms, (NHFILE *, struct mapseen_rooms *, const char *, const char *, int));
E void FDECL(sfo_mapseen, (NHFILE *, struct mapseen *, const char *, const char *, int));
E void FDECL(sfo_mextra, (NHFILE *, struct mextra *, const char *, const char *, int));
E void FDECL(sfo_mkroom, (NHFILE *, struct mkroom *, const char *, const char *, int));
E void FDECL(sfo_monst, (NHFILE *, struct monst *, const char *, const char *, int));
E void FDECL(sfo_mvitals, (NHFILE *, struct mvitals *, const char *, const char *, int));
E void FDECL(sfo_nhcoord, (NHFILE *, struct nhcoord *, const char *, const char *, int));
E void FDECL(sfo_nhrect, (NHFILE *, struct nhrect *, const char *, const char *, int));
E void FDECL(sfo_novel_tracking, (NHFILE *, struct novel_tracking *, const char *, const char *, int));
E void FDECL(sfo_obj, (NHFILE *, struct obj *, const char *, const char *, int));
E void FDECL(sfo_objclass, (NHFILE *, struct objclass *, const char *, const char *, int));
E void FDECL(sfo_obj_split, (NHFILE *, struct obj_split *, const char *, const char *, int));
E void FDECL(sfo_oextra, (NHFILE *, struct oextra *, const char *, const char *, int));
E void FDECL(sfo_polearm_info, (NHFILE *, struct polearm_info *, const char *, const char *, int));
E void FDECL(sfo_prop, (NHFILE *, struct prop *, const char *, const char *, int));
E void FDECL(sfo_q_score, (NHFILE *, struct q_score *, const char *, const char *, int));
E void FDECL(sfo_rm, (NHFILE *, struct rm *, const char *, const char *, int));
E void FDECL(sfo_s_level, (NHFILE *, struct s_level *, const char *, const char *, int));
E void FDECL(sfo_savefile_info, (NHFILE *, struct savefile_info *, const char *, const char *, int));
E void FDECL(sfo_skills, (NHFILE *, struct skills *, const char *, const char *, int));
E void FDECL(sfo_spell, (NHFILE *, struct spell *, const char *, const char *, int));
E void FDECL(sfo_stairway, (NHFILE *, struct stairway *, const char *, const char *, int));
E void FDECL(sfo_takeoff_info, (NHFILE *, struct takeoff_info *, const char *, const char *, int));
E void FDECL(sfo_tin_info, (NHFILE *, struct tin_info *, const char *, const char *, int));
E void FDECL(sfo_trap, (NHFILE *, struct trap *, const char *, const char *, int));
E void FDECL(sfo_tribute_info, (NHFILE *, struct tribute_info *, const char *, const char *, int));
E void FDECL(sfo_u_achieve, (NHFILE *, struct u_achieve *, const char *, const char *, int));
E void FDECL(sfo_u_conduct, (NHFILE *, struct u_conduct *, const char *, const char *, int));
E void FDECL(sfo_u_event, (NHFILE *, struct u_event *, const char *, const char *, int));
E void FDECL(sfo_u_have, (NHFILE *, struct u_have *, const char *, const char *, int));
E void FDECL(sfo_u_realtime, (NHFILE *, struct u_realtime *, const char *, const char *, int));
E void FDECL(sfo_u_roleplay, (NHFILE *, struct u_roleplay *, const char *, const char *, int));
E void FDECL(sfo_version_info, (NHFILE *, struct version_info *, const char *, const char *, int));
E void FDECL(sfo_victual_info, (NHFILE *, struct victual_info *, const char *, const char *, int));
E void FDECL(sfo_vlaunchinfo, (NHFILE *, union vlaunchinfo *, const char *, const char *, int));
E void FDECL(sfo_vptrs, (NHFILE *, union vptrs *, const char *, const char *, int));
E void FDECL(sfo_warntype_info, (NHFILE *, struct warntype_info *, const char *, const char *, int));
E void FDECL(sfo_you, (NHFILE *, struct you *, const char *, const char *, int));
/* generated input functions */
E void FDECL(sfi_align, (NHFILE *, struct align *, const char *, const char *, int));
E void FDECL(sfi_attribs, (NHFILE *, struct attribs *, const char *, const char *, int));
E void FDECL(sfi_bill_x, (NHFILE *, struct bill_x *, const char *, const char *, int));
E void FDECL(sfi_book_info, (NHFILE *, struct book_info *, const char *, const char *, int));
E void FDECL(sfi_branch, (NHFILE *, struct branch *, const char *, const char *, int));
E void FDECL(sfi_bubble, (NHFILE *, struct bubble *, const char *, const char *, int));
E void FDECL(sfi_cemetery, (NHFILE *, struct cemetery *, const char *, const char *, int));
E void FDECL(sfi_context_info, (NHFILE *, struct context_info *, const char *, const char *, int));
E void FDECL(sfi_d_flags, (NHFILE *, struct d_flags *, const char *, const char *, int));
E void FDECL(sfi_d_level, (NHFILE *, struct d_level *, const char *, const char *, int));
E void FDECL(sfi_damage, (NHFILE *, struct damage *, const char *, const char *, int));
E void FDECL(sfi_dest_area, (NHFILE *, struct dest_area *, const char *, const char *, int));
E void FDECL(sfi_dgn_topology, (NHFILE *, struct dgn_topology *, const char *, const char *, int));
E void FDECL(sfi_dig_info, (NHFILE *, struct dig_info *, const char *, const char *, int));
E void FDECL(sfi_dungeon, (NHFILE *, struct dungeon *, const char *, const char *, int));
E void FDECL(sfi_edog, (NHFILE *, struct edog *, const char *, const char *, int));
E void FDECL(sfi_egd, (NHFILE *, struct egd *, const char *, const char *, int));
E void FDECL(sfi_emin, (NHFILE *, struct emin *, const char *, const char *, int));
E void FDECL(sfi_engr, (NHFILE *, struct engr *, const char *, const char *, int));
E void FDECL(sfi_epri, (NHFILE *, struct epri *, const char *, const char *, int));
E void FDECL(sfi_eshk, (NHFILE *, struct eshk *, const char *, const char *, int));
E void FDECL(sfi_fakecorridor, (NHFILE *, struct fakecorridor *, const char *, const char *, int));
E void FDECL(sfi_fe, (NHFILE *, struct fe *, const char *, const char *, int));
E void FDECL(sfi_flag, (NHFILE *, struct flag *, const char *, const char *, int));
E void FDECL(sfi_fruit, (NHFILE *, struct fruit *, const char *, const char *, int));
E void FDECL(sfi_kinfo, (NHFILE *, struct kinfo *, const char *, const char *, int));
E void FDECL(sfi_levelflags, (NHFILE *, struct levelflags *, const char *, const char *, int));
E void FDECL(sfi_linfo, (NHFILE *, struct linfo *, const char *, const char *, int));
E void FDECL(sfi_ls_t, (NHFILE *, struct ls_t *, const char *, const char *, int));
E void FDECL(sfi_mapseen_feat, (NHFILE *, struct mapseen_feat *, const char *, const char *, int));
E void FDECL(sfi_mapseen_flags, (NHFILE *, struct mapseen_flags *, const char *, const char *, int));
E void FDECL(sfi_mapseen_rooms, (NHFILE *, struct mapseen_rooms *, const char *, const char *, int));
E void FDECL(sfi_mapseen, (NHFILE *, struct mapseen *, const char *, const char *, int));
E void FDECL(sfi_mextra, (NHFILE *, struct mextra *, const char *, const char *, int));
E void FDECL(sfi_mkroom, (NHFILE *, struct mkroom *, const char *, const char *, int));
E void FDECL(sfi_monst, (NHFILE *, struct monst *, const char *, const char *, int));
E void FDECL(sfi_mvitals, (NHFILE *, struct mvitals *, const char *, const char *, int));
E void FDECL(sfi_nhcoord, (NHFILE *, struct nhcoord *, const char *, const char *, int));
E void FDECL(sfi_nhrect, (NHFILE *, struct nhrect *, const char *, const char *, int));
E void FDECL(sfi_novel_tracking, (NHFILE *, struct novel_tracking *, const char *, const char *, int));
E void FDECL(sfi_obj, (NHFILE *, struct obj *, const char *, const char *, int));
E void FDECL(sfi_objclass, (NHFILE *, struct objclass *, const char *, const char *, int));
E void FDECL(sfi_obj_split, (NHFILE *, struct obj_split *, const char *, const char *, int));
E void FDECL(sfi_oextra, (NHFILE *, struct oextra *, const char *, const char *, int));
E void FDECL(sfi_polearm_info, (NHFILE *, struct polearm_info *, const char *, const char *, int));
E void FDECL(sfi_prop, (NHFILE *, struct prop *, const char *, const char *, int));
E void FDECL(sfi_q_score, (NHFILE *, struct q_score *, const char *, const char *, int));
E void FDECL(sfi_rm, (NHFILE *, struct rm *, const char *, const char *, int));
E void FDECL(sfi_s_level, (NHFILE *, struct s_level *, const char *, const char *, int));
E void FDECL(sfi_savefile_info, (NHFILE *, struct savefile_info *, const char *, const char *, int));
E void FDECL(sfi_skills, (NHFILE *, struct skills *, const char *, const char *, int));
E void FDECL(sfi_spell, (NHFILE *, struct spell *, const char *, const char *, int));
E void FDECL(sfi_stairway, (NHFILE *, struct stairway *, const char *, const char *, int));
E void FDECL(sfi_takeoff_info, (NHFILE *, struct takeoff_info *, const char *, const char *, int));
E void FDECL(sfi_tin_info, (NHFILE *, struct tin_info *, const char *, const char *, int));
E void FDECL(sfi_trap, (NHFILE *, struct trap *, const char *, const char *, int));
E void FDECL(sfi_tribute_info, (NHFILE *, struct tribute_info *, const char *, const char *, int));
E void FDECL(sfi_u_achieve, (NHFILE *, struct u_achieve *, const char *, const char *, int));
E void FDECL(sfi_u_conduct, (NHFILE *, struct u_conduct *, const char *, const char *, int));
E void FDECL(sfi_u_event, (NHFILE *, struct u_event *, const char *, const char *, int));
E void FDECL(sfi_u_have, (NHFILE *, struct u_have *, const char *, const char *, int));
E void FDECL(sfi_u_realtime, (NHFILE *, struct u_realtime *, const char *, const char *, int));
E void FDECL(sfi_u_roleplay, (NHFILE *, struct u_roleplay *, const char *, const char *, int));
E void FDECL(sfi_version_info, (NHFILE *, struct version_info *, const char *, const char *, int));
E void FDECL(sfi_victual_info, (NHFILE *, struct victual_info *, const char *, const char *, int));
E void FDECL(sfi_vlaunchinfo, (NHFILE *, union vlaunchinfo *, const char *, const char *, int));
E void FDECL(sfi_vptrs, (NHFILE *, union vptrs *, const char *, const char *, int));
E void FDECL(sfi_warntype_info, (NHFILE *, struct warntype_info *, const char *, const char *, int));
E void FDECL(sfi_you, (NHFILE *, struct you *, const char *, const char *, int));
#endif /* SFPROTO_H */
-20
View File
@@ -6,8 +6,6 @@
#include "hack.h" #include "hack.h"
#include "artifact.h" #include "artifact.h"
#include "artilist.h" #include "artilist.h"
#include "sfproto.h"
/* /*
* Note: both artilist[] and artiexist[] have a dummy element #0, * Note: both artilist[] and artiexist[] have a dummy element #0,
@@ -85,15 +83,6 @@ NHFILE *nhfp;
bwrite(nhfp->fd, (genericptr_t) g.artiexist, sizeof g.artiexist); bwrite(nhfp->fd, (genericptr_t) g.artiexist, sizeof g.artiexist);
bwrite(nhfp->fd, (genericptr_t) g.artidisco, sizeof g.artidisco); bwrite(nhfp->fd, (genericptr_t) g.artidisco, sizeof g.artidisco);
} }
if (nhfp->fieldlevel) {
int i;
for (i = 0; i < (1 + NROFARTIFACTS + 1); ++i)
sfo_boolean(nhfp, &g.artiexist[i], "artifacts", "g.artiexist", 1);
for (i = 0; i < NROFARTIFACTS; ++i)
sfo_xchar(nhfp, &g.artidisco[i], "artifacts", "g.artidisco", 1);
}
} }
void void
@@ -104,15 +93,6 @@ NHFILE *nhfp;
mread(nhfp->fd, (genericptr_t) g.artiexist, sizeof g.artiexist); mread(nhfp->fd, (genericptr_t) g.artiexist, sizeof g.artiexist);
mread(nhfp->fd, (genericptr_t) g.artidisco, sizeof g.artidisco); mread(nhfp->fd, (genericptr_t) g.artidisco, sizeof g.artidisco);
} }
if (nhfp->fieldlevel) {
int i;
for (i = 0; i < (1 + NROFARTIFACTS + 1); ++i)
sfi_boolean(nhfp, &g.artiexist[i], "artifacts", "g.artiexist", 1);
for (i = 0; i < NROFARTIFACTS; ++i)
sfi_xchar(nhfp, &g.artidisco[i], "artifacts", "g.artidisco", 1);
}
hack_artifacts(); /* redo non-saved special cases */ hack_artifacts(); /* redo non-saved special cases */
} }
-15
View File
@@ -5,7 +5,6 @@
#include "hack.h" #include "hack.h"
#include "lev.h" #include "lev.h"
#include "sfproto.h"
#ifdef MFLOPPY #ifdef MFLOPPY
@@ -555,10 +554,6 @@ struct obj *corpse;
bwrite(nhfp->fd, (genericptr_t) &c, sizeof c); bwrite(nhfp->fd, (genericptr_t) &c, sizeof c);
bwrite(nhfp->fd, (genericptr_t) bonesid, (unsigned) c); /* DD.nnn */ bwrite(nhfp->fd, (genericptr_t) bonesid, (unsigned) c); /* DD.nnn */
} }
if (nhfp->fieldlevel) {
sfo_char(nhfp, &c, "bones", "bones_count", 1);
sfo_char(nhfp, bonesid, "bones", "bonesid", (int) c);
}
savefruitchn(nhfp); savefruitchn(nhfp);
if (nhfp->structlevel) if (nhfp->structlevel)
bflush(nhfp->fd); bflush(nhfp->fd);
@@ -582,11 +577,6 @@ struct obj *corpse;
bwrite(nhfp->fd, (genericptr_t) bonesid, (unsigned) c); /* DD.nnn */ bwrite(nhfp->fd, (genericptr_t) bonesid, (unsigned) c); /* DD.nnn */
savefruitchn(nhfp); savefruitchn(nhfp);
} }
if (nhfp->fieldlevel) {
sfo_char(nhfp, &c, "bones", "bones_count", 1);
sfo_char(nhfp, bonesid, "bones", "bonesid", (int) c); /* DD.nnn */
savefruitchn(nhfp);
}
update_mlstmv(); /* update monsters for eventual restoration */ update_mlstmv(); /* update monsters for eventual restoration */
savelev(nhfp, ledger_no(&u.uz)); savelev(nhfp, ledger_no(&u.uz));
close_nhfile(nhfp); close_nhfile(nhfp);
@@ -640,11 +630,6 @@ getbones()
mread(nhfp->fd, (genericptr_t) &c, sizeof c); /* length incl. '\0' */ mread(nhfp->fd, (genericptr_t) &c, sizeof c); /* length incl. '\0' */
mread(nhfp->fd, (genericptr_t) oldbonesid, (unsigned) c); /* DD.nnn */ mread(nhfp->fd, (genericptr_t) oldbonesid, (unsigned) c); /* DD.nnn */
} }
if (nhfp->fieldlevel) {
sfi_char(nhfp, &c, "bones", "bones_count", 1); /* length incl. '\0' */
for (i = 0; i < (int) c; ++i)
sfi_char(nhfp, &oldbonesid[i], "bones", "bonesid", 1);
}
if (strcmp(bonesid, oldbonesid) != 0 if (strcmp(bonesid, oldbonesid) != 0
/* from 3.3.0 through 3.6.0, bones in the quest branch stored /* from 3.3.0 through 3.6.0, bones in the quest branch stored
a bogus bonesid in the file; 3.6.1 fixed that, but for a bogus bonesid in the file; 3.6.1 fixed that, but for
+4 -1
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 cmd.c $NHDT-Date: 1575245052 2019/12/02 00:04:12 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.350 $ */ /* NetHack 3.6 cmd.c $NHDT-Date: 1576201761 2019/12/13 01:49:21 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.383 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2013. */ /*-Copyright (c) Robert Patrick Rankin, 2013. */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -946,6 +946,8 @@ wiz_load_lua(VOID_ARGS)
{ {
if (wizard) { if (wizard) {
char buf[BUFSZ]; char buf[BUFSZ];
buf[0] = '\0';
getlin("Load which lua file?", buf); getlin("Load which lua file?", buf);
if (buf[0] == '\033' || buf[0] == '\0') if (buf[0] == '\033' || buf[0] == '\0')
return 0; return 0;
@@ -965,6 +967,7 @@ wiz_load_splua(VOID_ARGS)
char buf[BUFSZ]; char buf[BUFSZ];
int ridx; int ridx;
buf[0] = '\0';
getlin("Load which des lua file?", buf); getlin("Load which des lua file?", buf);
if (buf[0] == '\033' || buf[0] == '\0') if (buf[0] == '\033' || buf[0] == '\0')
return 0; return 0;
+3
View File
@@ -695,6 +695,9 @@ const struct instance_globals g_init = {
DUMMY, /* lua_ver[LUA_VER_BUFSIZ] */ DUMMY, /* lua_ver[LUA_VER_BUFSIZ] */
DUMMY, /* lua_copyright[LUA_COPYRIGHT_BUFSIZ] */ DUMMY, /* lua_copyright[LUA_COPYRIGHT_BUFSIZ] */
/* per-level glyph mapping flags */
0L, /* glyphmap_perlevel_flags */
IVMAGIC /* used to validate that structure layout has been preserved */ IVMAGIC /* used to validate that structure layout has been preserved */
}; };
+19 -6
View File
@@ -1279,15 +1279,22 @@ boolean at_stairs, falling, portal;
* -1 11.46 12.50 12.5 * -1 11.46 12.50 12.5
* -2 5.21 4.17 0.0 * -2 5.21 4.17 0.0
* -3 2.08 0.0 0.0 * -3 2.08 0.0 0.0
*
* 3.7.0: the chance for the "mysterious force" to kick in goes down
* as it kicks in, starting at 25% per climb attempt and dropping off
* gradually but substantially. The drop off is greater when hero is
* sent down farther so benefits lawfuls more than chaotics this time.
*/ */
if (Inhell && up && u.uhave.amulet && !newdungeon && !portal if (Inhell && up && u.uhave.amulet && !newdungeon && !portal
&& (dunlev(&u.uz) < dunlevs_in_dungeon(&u.uz) - 3)) { && (dunlev(&u.uz) < dunlevs_in_dungeon(&u.uz) - 3)) {
if (!rn2(4)) { if (!rn2(4 + g.context.mysteryforce)) {
int odds = 3 + (int) u.ualign.type, /* 2..4 */ int odds = 3 + (int) u.ualign.type, /* 2..4 */
diff = odds <= 1 ? 0 : rn2(odds); /* paranoia */ diff = (odds <= 1) ? 0 : rn2(odds); /* paranoia */
if (diff != 0) { if (diff != 0) {
assign_rnd_level(newlevel, &u.uz, diff); assign_rnd_level(newlevel, &u.uz, diff);
/* assign_rnd_level() may have used a value less than diff */
diff = u.uz.dlevel - newlevel->dlevel; /* actual descent */
/* if inside the tower, stay inside */ /* if inside the tower, stay inside */
if (was_in_W_tower && !On_W_tower_level(newlevel)) if (was_in_W_tower && !On_W_tower_level(newlevel))
diff = 0; diff = 0;
@@ -1295,15 +1302,20 @@ boolean at_stairs, falling, portal;
if (diff == 0) if (diff == 0)
assign_level(newlevel, &u.uz); assign_level(newlevel, &u.uz);
new_ledger = ledger_no(newlevel);
pline("A mysterious force momentarily surrounds you..."); pline("A mysterious force momentarily surrounds you...");
/* each time it kicks in, the chance of doing so again may drop;
that drops faster, on average, when being sent down farther so
while the impact is reduced for everybody compared to earlier
versions, it is reduced least for chaotics, most for lawfuls */
g.context.mysteryforce += rn2(diff + 2); /* L:0-4, N:0-3, C:0-2 */
if (on_level(newlevel, &u.uz)) { if (on_level(newlevel, &u.uz)) {
(void) safe_teleds(FALSE); (void) safe_teleds(FALSE);
(void) next_to_u(); (void) next_to_u();
return; return;
} else }
at_stairs = g.at_ladder = FALSE; new_ledger = ledger_no(newlevel);
at_stairs = g.at_ladder = FALSE;
} }
} }
@@ -1578,6 +1590,7 @@ boolean at_stairs, falling, portal;
/* Reset the screen. */ /* Reset the screen. */
vision_reset(); /* reset the blockages */ vision_reset(); /* reset the blockages */
g.glyphmap_perlevel_flags = 0L; /* force per-level mapglyph() changes */
docrt(); /* does a full vision recalc */ docrt(); /* does a full vision recalc */
flush_screen(-1); flush_screen(-1);
+57 -51
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 do_wear.c $NHDT-Date: 1575214670 2019/12/01 15:37:50 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.116 $ */ /* NetHack 3.6 do_wear.c $NHDT-Date: 1575768410 2019/12/08 01:26:50 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.126 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2012. */ /*-Copyright (c) Robert Patrick Rankin, 2012. */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -1464,11 +1464,11 @@ struct obj *obj;
return 0; return 0;
} }
reset_remarm(); /* clear g.context.takeoff.mask and g.context.takeoff.what */ reset_remarm(); /* clear context.takeoff.mask and context.takeoff.what */
(void) select_off(obj); (void) select_off(obj);
if (!g.context.takeoff.mask) if (!g.context.takeoff.mask)
return 0; return 0;
/* none of armoroff()/Ring_/Amulet/Blindf_off() use g.context.takeoff.mask */ /* none of armoroff()/Ring_/Amulet/Blindf_off() use context.takeoff.mask */
reset_remarm(); reset_remarm();
if (obj->owornmask & W_ARMOR) { if (obj->owornmask & W_ARMOR) {
@@ -1584,70 +1584,76 @@ struct obj *otmp;
if (delay) { if (delay) {
nomul(delay); nomul(delay);
g.multi_reason = "disrobing"; g.multi_reason = "disrobing";
if (is_helmet(otmp)) { switch (objects[otmp->otyp].oc_armcat) {
what = helm_simple_name(otmp); case ARM_SUIT:
g.afternmv = Helmet_off;
} else if (is_gloves(otmp)) {
what = gloves_simple_name(otmp);
g.afternmv = Gloves_off;
} else if (is_boots(otmp)) {
what = c_boots;
g.afternmv = Boots_off;
} else if (is_suit(otmp)) {
what = suit_simple_name(otmp); what = suit_simple_name(otmp);
g.afternmv = Armor_off; g.afternmv = Armor_off;
} else if (is_cloak(otmp)) { break;
case ARM_SHIELD:
what = shield_simple_name(otmp);
g.afternmv = Shield_off;
break;
case ARM_HELM:
what = helm_simple_name(otmp);
g.afternmv = Helmet_off;
break;
case ARM_GLOVES:
what = gloves_simple_name(otmp);
g.afternmv = Gloves_off;
break;
case ARM_BOOTS:
what = boots_simple_name(otmp);
g.afternmv = Boots_off;
break;
case ARM_CLOAK:
what = cloak_simple_name(otmp); what = cloak_simple_name(otmp);
g.afternmv = Cloak_off; g.afternmv = Cloak_off;
} else if (is_shield(otmp)) { break;
what = c_shield; case ARM_SHIRT:
g.afternmv = Shield_off; what = shirt_simple_name(otmp);
} else if (is_shirt(otmp)) {
what = c_shirt;
g.afternmv = Shirt_off; g.afternmv = Shirt_off;
} else { break;
default:
impossible("Taking off unknown armor (%d: %d), delay %d", impossible("Taking off unknown armor (%d: %d), delay %d",
otmp->otyp, objects[otmp->otyp].oc_armcat, delay); otmp->otyp, objects[otmp->otyp].oc_armcat, delay);
break;
} }
if (what) { if (what) {
/* sizeof offdelaybuf == 60; increase it if this becomes longer */
Sprintf(offdelaybuf, "You finish taking off your %s.", what); Sprintf(offdelaybuf, "You finish taking off your %s.", what);
g.nomovemsg = offdelaybuf; g.nomovemsg = offdelaybuf;
} }
} else { } else {
/* Be warned! We want off_msg after removing the item to /* no delay so no '(*afternmv)()' or 'nomovemsg' */
* avoid "You were wearing ____ (being worn)." However, an switch (objects[otmp->otyp].oc_armcat) {
* item which grants fire resistance might cause some trouble case ARM_SUIT:
* if removed in Hell and lifesaving puts it back on; in this
* case the message will be printed at the wrong time (after
* the messages saying you died and were lifesaved). Luckily,
* no cloak, shield, or fast-removable armor grants fire
* resistance, so we can safely do the off_msg afterwards.
* Rings do grant fire resistance, but for rings we want the
* off_msg before removal anyway so there's no problem. Take
* care in adding armors granting fire resistance; this code
* might need modification.
* 3.2 (actually 3.1 even): that comment is obsolete since
* fire resistance is not required for Gehennom so setworn()
* doesn't force the resistance granting item to be re-worn
* after being lifesaved anymore.
*/
if (is_cloak(otmp))
(void) Cloak_off();
else if (is_shield(otmp))
(void) Shield_off();
else if (is_helmet(otmp))
(void) Helmet_off();
else if (is_gloves(otmp))
(void) Gloves_off();
else if (is_boots(otmp))
(void) Boots_off();
else if (is_shirt(otmp))
(void) Shirt_off();
else if (is_suit(otmp))
(void) Armor_off(); (void) Armor_off();
else break;
case ARM_SHIELD:
(void) Shield_off();
break;
case ARM_HELM:
(void) Helmet_off();
break;
case ARM_GLOVES:
(void) Gloves_off();
break;
case ARM_BOOTS:
(void) Boots_off();
break;
case ARM_CLOAK:
(void) Cloak_off();
break;
case ARM_SHIRT:
(void) Shirt_off();
break;
default:
impossible("Taking off unknown armor (%d: %d), no delay", impossible("Taking off unknown armor (%d: %d), no delay",
otmp->otyp, objects[otmp->otyp].oc_armcat); otmp->otyp, objects[otmp->otyp].oc_armcat);
break;
}
/* We want off_msg() after removing the item to
avoid "You were wearing ____ (being worn)." */
off_msg(otmp); off_msg(otmp);
} }
g.context.takeoff.mask = g.context.takeoff.what = 0L; g.context.takeoff.mask = g.context.takeoff.what = 0L;
-75
View File
@@ -7,8 +7,6 @@
#include "dgn_file.h" #include "dgn_file.h"
#include "dlb.h" #include "dlb.h"
#include "lev.h" #include "lev.h"
#include "sfproto.h"
#define DUNGEON_FILE "dungeon.lua" #define DUNGEON_FILE "dungeon.lua"
@@ -149,26 +147,14 @@ boolean perform_write, free_data;
bwrite(nhfp->fd, (genericptr_t) &g.dungeon_topology, sizeof g.dungeon_topology); bwrite(nhfp->fd, (genericptr_t) &g.dungeon_topology, sizeof g.dungeon_topology);
bwrite(nhfp->fd, (genericptr_t) g.tune, sizeof tune); bwrite(nhfp->fd, (genericptr_t) g.tune, sizeof tune);
} }
if (nhfp->fieldlevel) {
sfo_int(nhfp, &g.n_dgns, "dungeon", "dungeon_count", 1);
for (i = 0; i < g.n_dgns; ++i)
sfo_dungeon(nhfp, &g.dungeons[i], "dungeon", "dungeon", 1);
sfo_dgn_topology(nhfp, &g.dungeon_topology, "dungeon", "g.dungeon_topology", 1);
for (i = 0; i < (int) sizeof tune; ++i)
sfo_char(nhfp, &g.tune[i], "dungeon", "tune", 1);
}
for (count = 0, curr = g.branches; curr; curr = curr->next) for (count = 0, curr = g.branches; curr; curr = curr->next)
count++; count++;
if (nhfp->structlevel) if (nhfp->structlevel)
bwrite(nhfp->fd, (genericptr_t) &count, sizeof(count)); bwrite(nhfp->fd, (genericptr_t) &count, sizeof(count));
if (nhfp->fieldlevel)
sfo_int(nhfp, &count, "dungeon", "branch_count", 1);
for (curr = g.branches; curr; curr = curr->next) { for (curr = g.branches; curr; curr = curr->next) {
if (nhfp->structlevel) if (nhfp->structlevel)
bwrite(nhfp->fd, (genericptr_t) curr, sizeof(branch)); bwrite(nhfp->fd, (genericptr_t) curr, sizeof(branch));
if (nhfp->fieldlevel)
sfo_branch(nhfp, curr, "dungeon", "branch", 1);
} }
count = maxledgerno(); count = maxledgerno();
if (nhfp->structlevel) { if (nhfp->structlevel) {
@@ -177,20 +163,12 @@ boolean perform_write, free_data;
(unsigned) count * sizeof(struct linfo)); (unsigned) count * sizeof(struct linfo));
bwrite(nhfp->fd, (genericptr_t) &g.inv_pos, sizeof g.inv_pos); bwrite(nhfp->fd, (genericptr_t) &g.inv_pos, sizeof g.inv_pos);
} }
if (nhfp->fieldlevel) {
sfo_int(nhfp, &count, "dungeon", "level_info_count", 1);
for (i = 0; i < count; ++i)
sfo_linfo(nhfp, &g.level_info[i], "dungeon", "g.level_info", 1);
sfo_nhcoord(nhfp, &g.inv_pos, "dungeon", "g.inv_pos", 1);
}
for (count = 0, curr_ms = g.mapseenchn; curr_ms; for (count = 0, curr_ms = g.mapseenchn; curr_ms;
curr_ms = curr_ms->next) curr_ms = curr_ms->next)
count++; count++;
if (nhfp->structlevel) if (nhfp->structlevel)
bwrite(nhfp->fd, (genericptr_t) &count, sizeof(count)); bwrite(nhfp->fd, (genericptr_t) &count, sizeof(count));
if (nhfp->fieldlevel)
sfo_int(nhfp, &count, "dungeon", "mapseen_count", 1);
for (curr_ms = g.mapseenchn; curr_ms; curr_ms = curr_ms->next) { for (curr_ms = g.mapseenchn; curr_ms; curr_ms = curr_ms->next) {
save_mapseen(nhfp, curr_ms); save_mapseen(nhfp, curr_ms);
@@ -230,27 +208,15 @@ NHFILE *nhfp;
mread(nhfp->fd, (genericptr_t) &g.dungeon_topology, sizeof g.dungeon_topology); mread(nhfp->fd, (genericptr_t) &g.dungeon_topology, sizeof g.dungeon_topology);
mread(nhfp->fd, (genericptr_t) g.tune, sizeof tune); mread(nhfp->fd, (genericptr_t) g.tune, sizeof tune);
} }
if (nhfp->fieldlevel) {
sfi_int(nhfp, &g.n_dgns, "dungeon", "dungeon_count", 1);
for (i = 0; i < g.n_dgns; ++i)
sfi_dungeon(nhfp, &g.dungeons[i], "dungeon", "dungeon", 1);
sfi_dgn_topology(nhfp, &g.dungeon_topology, "dungeon", "g.dungeon_topology", 1);
for (i = 0; i < (int) sizeof tune; ++i)
sfi_char(nhfp, &g.tune[i], "dungeon", "tune", 1);
}
last = g.branches = (branch *) 0; last = g.branches = (branch *) 0;
if (nhfp->structlevel) if (nhfp->structlevel)
mread(nhfp->fd, (genericptr_t) &count, sizeof(count)); mread(nhfp->fd, (genericptr_t) &count, sizeof(count));
if (nhfp->fieldlevel)
sfi_int(nhfp, &count, "dungeon", "branch_count", 1);
for (i = 0; i < count; i++) { for (i = 0; i < count; i++) {
curr = (branch *) alloc(sizeof(branch)); curr = (branch *) alloc(sizeof(branch));
if (nhfp->structlevel) if (nhfp->structlevel)
mread(nhfp->fd, (genericptr_t) curr, sizeof(branch)); mread(nhfp->fd, (genericptr_t) curr, sizeof(branch));
if (nhfp->fieldlevel)
sfi_branch(nhfp, curr, "dungeon", "branch", 1);
curr->next = (branch *) 0; curr->next = (branch *) 0;
if (last) if (last)
last->next = curr; last->next = curr;
@@ -261,8 +227,6 @@ NHFILE *nhfp;
if (nhfp->structlevel) if (nhfp->structlevel)
mread(nhfp->fd, (genericptr_t) &count, sizeof(count)); mread(nhfp->fd, (genericptr_t) &count, sizeof(count));
if (nhfp->fieldlevel)
sfi_int(nhfp, &count, "dungeon", "level_info_count", 1);
if (count >= MAXLINFO) if (count >= MAXLINFO)
panic("level information count larger (%d) than allocated size", panic("level information count larger (%d) than allocated size",
@@ -270,18 +234,11 @@ NHFILE *nhfp;
if (nhfp->structlevel) if (nhfp->structlevel)
mread(nhfp->fd, (genericptr_t) g.level_info, mread(nhfp->fd, (genericptr_t) g.level_info,
(unsigned) count * sizeof(struct linfo)); (unsigned) count * sizeof(struct linfo));
if (nhfp->fieldlevel)
for (i = 0; i < count; ++i)
sfi_linfo(nhfp, &g.level_info[i], "dungeon", "g.level_info", 1);
if (nhfp->structlevel) { if (nhfp->structlevel) {
mread(nhfp->fd, (genericptr_t) &g.inv_pos, sizeof g.inv_pos); mread(nhfp->fd, (genericptr_t) &g.inv_pos, sizeof g.inv_pos);
mread(nhfp->fd, (genericptr_t) &count, sizeof(count)); mread(nhfp->fd, (genericptr_t) &count, sizeof(count));
} }
if (nhfp->fieldlevel) {
sfi_nhcoord(nhfp, &g.inv_pos, "dungeon", "inv_pos", 1);
sfi_int(nhfp, &count, "dungeon", "mapseen_count", 1);
}
last_ms = (mapseen *) 0; last_ms = (mapseen *) 0;
for (i = 0; i < count; i++) { for (i = 0; i < count; i++) {
@@ -2446,8 +2403,6 @@ mapseen *mptr;
break; break;
if (nhfp->structlevel) if (nhfp->structlevel)
bwrite(nhfp->fd, (genericptr_t) &brindx, sizeof brindx); bwrite(nhfp->fd, (genericptr_t) &brindx, sizeof brindx);
if (nhfp->fieldlevel)
sfo_int(nhfp, &brindx, "mapseen", "branch_index", 1);
if (nhfp->structlevel) { if (nhfp->structlevel) {
bwrite(nhfp->fd, (genericptr_t) &mptr->lev, sizeof mptr->lev); bwrite(nhfp->fd, (genericptr_t) &mptr->lev, sizeof mptr->lev);
@@ -2455,29 +2410,15 @@ mapseen *mptr;
bwrite(nhfp->fd, (genericptr_t) &mptr->flags, sizeof mptr->flags); bwrite(nhfp->fd, (genericptr_t) &mptr->flags, sizeof mptr->flags);
bwrite(nhfp->fd, (genericptr_t) &mptr->custom_lth, sizeof mptr->custom_lth); bwrite(nhfp->fd, (genericptr_t) &mptr->custom_lth, sizeof mptr->custom_lth);
} }
if (nhfp->fieldlevel) {
sfo_d_level(nhfp, &mptr->lev, "mapseen", "d_level", 1);
sfo_mapseen_feat(nhfp, &mptr->feat, "mapseen", "feat", 1);
sfo_mapseen_flags(nhfp, &mptr->flags, "mapseen", "flags", 1);
sfo_unsigned(nhfp, &mptr->custom_lth, "mapseen", "custom_lth", 1);
}
if (mptr->custom_lth) { if (mptr->custom_lth) {
if (nhfp->structlevel) { if (nhfp->structlevel) {
bwrite(nhfp->fd, (genericptr_t) mptr->custom, mptr->custom_lth); bwrite(nhfp->fd, (genericptr_t) mptr->custom, mptr->custom_lth);
} }
if (nhfp->fieldlevel) {
for (i = 0; i < (int) mptr->custom_lth; ++i)
sfo_char(nhfp, &mptr->custom[i], "mapseen", "custom", 1);
}
} }
if (nhfp->structlevel) { if (nhfp->structlevel) {
bwrite(nhfp->fd, (genericptr_t) &mptr->msrooms, sizeof mptr->msrooms); bwrite(nhfp->fd, (genericptr_t) &mptr->msrooms, sizeof mptr->msrooms);
} }
if (nhfp->fieldlevel) {
for (i = 0; i < ((MAXNROFROOMS + 1) * 2); ++i)
sfo_mapseen_rooms(nhfp, &mptr->msrooms[i], "mapseen", "msrooms", 1);
}
savecemetery(nhfp, &mptr->final_resting_place); savecemetery(nhfp, &mptr->final_resting_place);
} }
@@ -2493,8 +2434,6 @@ NHFILE *nhfp;
if (nhfp->structlevel) if (nhfp->structlevel)
mread(nhfp->fd, (genericptr_t) &branchnum, sizeof branchnum); mread(nhfp->fd, (genericptr_t) &branchnum, sizeof branchnum);
if (nhfp->fieldlevel)
sfi_int(nhfp, &branchnum, "mapseen", "branch_index", 1);
for (brindx = 0, curr = g.branches; curr; curr = curr->next, ++brindx) for (brindx = 0, curr = g.branches; curr; curr = curr->next, ++brindx)
if (brindx == branchnum) if (brindx == branchnum)
break; break;
@@ -2506,12 +2445,6 @@ NHFILE *nhfp;
mread(nhfp->fd, (genericptr_t) &load->flags, sizeof load->flags); mread(nhfp->fd, (genericptr_t) &load->flags, sizeof load->flags);
mread(nhfp->fd, (genericptr_t) &load->custom_lth, sizeof load->custom_lth); mread(nhfp->fd, (genericptr_t) &load->custom_lth, sizeof load->custom_lth);
} }
if (nhfp->fieldlevel) {
sfi_d_level(nhfp, &load->lev, "mapseen", "d_level", 1);
sfi_mapseen_feat(nhfp, &load->feat, "mapseen", "feat", 1);
sfi_mapseen_flags(nhfp, &load->flags, "mapseen", "flags", 1);
sfi_unsigned(nhfp, &load->custom_lth, "mapseen", "custom_lth", 1);
}
if (load->custom_lth) { if (load->custom_lth) {
/* length doesn't include terminator (which isn't saved & restored) */ /* length doesn't include terminator (which isn't saved & restored) */
@@ -2519,20 +2452,12 @@ NHFILE *nhfp;
if (nhfp->structlevel) { if (nhfp->structlevel) {
mread(nhfp->fd, (genericptr_t) load->custom, load->custom_lth); mread(nhfp->fd, (genericptr_t) load->custom, load->custom_lth);
} }
if (nhfp->fieldlevel) {
for (i = 0; i < (int) load->custom_lth; ++i)
sfi_char(nhfp, &load->custom[i], "mapseen", "custom", 1);
}
load->custom[load->custom_lth] = '\0'; load->custom[load->custom_lth] = '\0';
} else } else
load->custom = 0; load->custom = 0;
if (nhfp->structlevel) { if (nhfp->structlevel) {
mread(nhfp->fd, (genericptr_t) &load->msrooms, sizeof load->msrooms); mread(nhfp->fd, (genericptr_t) &load->msrooms, sizeof load->msrooms);
} }
if (nhfp->fieldlevel) {
for (i = 0; i < ((MAXNROFROOMS + 1) * 2); ++i)
sfi_mapseen_rooms(nhfp, &load->msrooms[i], "mapseen", "msrooms", 1);
}
restcemetery(nhfp, &load->final_resting_place); restcemetery(nhfp, &load->final_resting_place);
return load; return load;
} }
-5
View File
@@ -15,7 +15,6 @@
#include <limits.h> #include <limits.h>
#endif #endif
#include "dlb.h" #include "dlb.h"
#include "sfproto.h"
/* add b to long a, convert wraparound to max value */ /* add b to long a, convert wraparound to max value */
@@ -2153,8 +2152,6 @@ NHFILE *nhfp;
for (kptr = &g.killer; kptr != (struct kinfo *) 0; kptr = kptr->next) { for (kptr = &g.killer; kptr != (struct kinfo *) 0; kptr = kptr->next) {
if (nhfp->structlevel) if (nhfp->structlevel)
bwrite(nhfp->fd, (genericptr_t)kptr, sizeof(struct kinfo)); bwrite(nhfp->fd, (genericptr_t)kptr, sizeof(struct kinfo));
if (nhfp->fieldlevel)
sfo_kinfo(nhfp, kptr, "killers", "kinfo", 1);
} }
} }
if (release_data(nhfp)) { if (release_data(nhfp)) {
@@ -2175,8 +2172,6 @@ NHFILE *nhfp;
for (kptr = &g.killer; kptr != (struct kinfo *) 0; kptr = kptr->next) { for (kptr = &g.killer; kptr != (struct kinfo *) 0; kptr = kptr->next) {
if (nhfp->structlevel) if (nhfp->structlevel)
mread(nhfp->fd, (genericptr_t)kptr, sizeof(struct kinfo)); mread(nhfp->fd, (genericptr_t)kptr, sizeof(struct kinfo));
if (nhfp->fieldlevel)
sfi_kinfo(nhfp, kptr, "killers", "kinfo", 1);
if (kptr->next) { if (kptr->next) {
kptr->next = (struct kinfo *) alloc(sizeof (struct kinfo)); kptr->next = (struct kinfo *) alloc(sizeof (struct kinfo));
} }
-16
View File
@@ -5,8 +5,6 @@
#include "hack.h" #include "hack.h"
#include "lev.h" #include "lev.h"
#include "sfproto.h"
static NEARDATA struct engr *head_engr; static NEARDATA struct engr *head_engr;
static const char *NDECL(blengr); static const char *NDECL(blengr);
@@ -1194,11 +1192,6 @@ NHFILE *nhfp;
bwrite(nhfp->fd, (genericptr_t)&(ep->engr_lth), sizeof(ep->engr_lth)); bwrite(nhfp->fd, (genericptr_t)&(ep->engr_lth), sizeof(ep->engr_lth));
bwrite(nhfp->fd, (genericptr_t)ep, sizeof(struct engr) + ep->engr_lth); bwrite(nhfp->fd, (genericptr_t)ep, sizeof(struct engr) + ep->engr_lth);
} }
if (nhfp->fieldlevel) {
sfo_unsigned(nhfp, &(ep->engr_lth), "engravings", "engr_lth", 1);
sfo_engr(nhfp, ep, "engravings", "engr", 1);
sfo_str(nhfp, ep->engr_txt, "engravings", "engr_txt", ep->engr_lth);
}
} }
if (release_data(nhfp)) if (release_data(nhfp))
dealloc_engr(ep); dealloc_engr(ep);
@@ -1206,8 +1199,6 @@ NHFILE *nhfp;
if (perform_bwrite(nhfp)) { if (perform_bwrite(nhfp)) {
if (nhfp->structlevel) if (nhfp->structlevel)
bwrite(nhfp->fd, (genericptr_t)&no_more_engr, sizeof no_more_engr); bwrite(nhfp->fd, (genericptr_t)&no_more_engr, sizeof no_more_engr);
if (nhfp->fieldlevel)
sfo_unsigned(nhfp, &no_more_engr, "engravings", "engr_lth", 1);
} }
if (release_data(nhfp)) if (release_data(nhfp))
head_engr = 0; head_engr = 0;
@@ -1224,8 +1215,6 @@ NHFILE *nhfp;
while (1) { while (1) {
if (nhfp->structlevel) if (nhfp->structlevel)
mread(nhfp->fd, (genericptr_t) &lth, sizeof(unsigned)); mread(nhfp->fd, (genericptr_t) &lth, sizeof(unsigned));
if (nhfp->fieldlevel)
sfi_unsigned(nhfp, &lth, "engravings", "engr_lth", 1);
if (lth == 0) if (lth == 0)
return; return;
@@ -1233,11 +1222,6 @@ NHFILE *nhfp;
if (nhfp->structlevel) { if (nhfp->structlevel) {
mread(nhfp->fd, (genericptr_t) ep, sizeof(struct engr) + lth); mread(nhfp->fd, (genericptr_t) ep, sizeof(struct engr) + lth);
} }
if (nhfp->fieldlevel) {
sfi_engr(nhfp, ep, "engravings", "engr", 1);
ep->engr_txt = (char *) (ep + 1);
sfi_str(nhfp, ep->engr_txt, "engravings", "engr_txt", lth);
}
ep->nxt_engr = head_engr; ep->nxt_engr = head_engr;
head_engr = ep; head_engr = ep;
ep->engr_txt = (char *) (ep + 1); /* Andreas Bormann */ ep->engr_txt = (char *) (ep + 1); /* Andreas Bormann */
+7 -184
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 files.c $NHDT-Date: 1574116097 2019/11/18 22:28:17 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.272 $ */ /* NetHack 3.6 files.c $NHDT-Date: 1576096997 2019/12/11 20:43:17 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.301 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Derek S. Ray, 2015. */ /*-Copyright (c) Derek S. Ray, 2015. */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -8,8 +8,6 @@
#include "hack.h" #include "hack.h"
#include "dlb.h" #include "dlb.h"
#include <ctype.h> #include <ctype.h>
#include "sfproto.h"
#include "sfprocs.h"
#include "lev.h" #include "lev.h"
#ifdef TTY_GRAPHICS #ifdef TTY_GRAPHICS
@@ -451,18 +449,6 @@ NHFILE *nhfp;
if (nhfp) { if (nhfp) {
if (nhfp->structlevel && nhfp->fd != -1) if (nhfp->structlevel && nhfp->fd != -1)
(void) nhclose(nhfp->fd), nhfp->fd = -1; (void) nhclose(nhfp->fd), nhfp->fd = -1;
if (nhfp->fieldlevel) {
if (nhfp->fpdef) {
(void) fclose(nhfp->fpdef);
nhfp->fpdef = (FILE *) 0;
}
}
if (nhfp->fplog)
(void) fprintf(nhfp->fplog, "# closing\n");
if (nhfp->fplog)
(void) fclose(nhfp->fplog);
if (nhfp->fpdebug)
(void) fclose(nhfp->fpdebug);
zero_nhfile(nhfp); zero_nhfile(nhfp);
free_nhfile(nhfp); free_nhfile(nhfp);
} }
@@ -479,13 +465,6 @@ NHFILE *nhfp;
(void) lseek(nhfp->fd, (off_t) 0, 0); (void) lseek(nhfp->fd, (off_t) 0, 0);
#endif #endif
} }
if (nhfp->fieldlevel) {
if (nhfp->fpdef) {
rewind(nhfp->fpdef);
nhfp->count = 0L;
nhfp->eof = FALSE;
}
}
} }
static static
@@ -497,25 +476,10 @@ NHFILE *nhfp;
the pointer to the nethack file descriptor */ the pointer to the nethack file descriptor */
if (nhfp) { if (nhfp) {
/* check for no open file at all, /* check for no open file at all,
* not a structlevel legacy file, * not a structlevel legacy file
* nor a fieldlevel file.
*/ */
if (((nhfp->fd == -1) && !nhfp->fpdef) if (nhfp->structlevel && nhfp->fd < 0) {
|| (nhfp->structlevel && nhfp->fd < 0)
|| (nhfp->fieldlevel && !nhfp->fpdef)) {
/* not viable, start the cleanup */ /* not viable, start the cleanup */
if (nhfp->fieldlevel) {
if (nhfp->fpdef) {
(void) fclose(nhfp->fpdef);
nhfp->fpdef = (FILE *) 0;
}
if (nhfp->fplog) {
(void) fprintf(nhfp->fplog, "# closing, not viable\n");
(void) fclose(nhfp->fplog);
}
if (nhfp->fpdebug)
(void) fclose(nhfp->fpdebug);
}
zero_nhfile(nhfp); zero_nhfile(nhfp);
free_nhfile(nhfp); free_nhfile(nhfp);
nhfp = (NHFILE *) 0; nhfp = (NHFILE *) 0;
@@ -795,8 +759,6 @@ d_level *lev;
Sprintf(eos(dptr), ".%d", lev->dlevel); Sprintf(eos(dptr), ".%d", lev->dlevel);
#ifdef SYSCF #ifdef SYSCF
idx = sysopt.bonesformat[0]; idx = sysopt.bonesformat[0];
if (idx > historical && idx <= ascii)
Strcat(dptr, sfoprocs[idx].ext);
#endif #endif
#ifdef VMS #ifdef VMS
Strcat(dptr, ";1"); Strcat(dptr, ";1");
@@ -847,26 +809,6 @@ char errbuf[];
nhfp->fieldlevel = FALSE; nhfp->fieldlevel = FALSE;
nhfp->ftype = NHF_BONESFILE; nhfp->ftype = NHF_BONESFILE;
nhfp->mode = WRITING; nhfp->mode = WRITING;
#ifdef SYSCF
if (sysopt.bonesformat[0] > historical &&
sysopt.bonesformat[0] <= ascii) {
nhfp->structlevel = FALSE;
nhfp->fieldlevel = TRUE;
nhfp->addinfo = TRUE;
nhfp->style.deflt = TRUE;
nhfp->style.binary = (sysopt.bonesformat[0] != ascii);
nhfp->fnidx = sysopt.bonesformat[0];
nhfp->fd = -1;
nhfp->fpdef = fopen(file, nhfp->style.binary ? WRBMODE : WRTMODE);
if (nhfp->fpdef) {
#ifdef SAVEFILE_DEBUGGING
nhfp->fpdebug = fopen("create_bonesfile-debug.log", "a");
#endif
} else {
failed = errno;
}
}
#endif /* SYSCF */
if (nhfp->structlevel) { if (nhfp->structlevel) {
#if defined(MICRO) || defined(WIN32) #if defined(MICRO) || defined(WIN32)
/* Use O_TRUNC to force the file to be shortened if it already /* Use O_TRUNC to force the file to be shortened if it already
@@ -962,26 +904,6 @@ char **bonesid;
nhfp->fieldlevel = FALSE; nhfp->fieldlevel = FALSE;
nhfp->ftype = NHF_BONESFILE; nhfp->ftype = NHF_BONESFILE;
nhfp->mode = READING; nhfp->mode = READING;
#ifdef SYSCF
if (sysopt.bonesformat[0] > historical &&
sysopt.bonesformat[0] <= ascii) {
nhfp->structlevel = FALSE;
nhfp->fieldlevel = TRUE;
nhfp->addinfo = TRUE;
nhfp->style.deflt = TRUE;
nhfp->style.binary = (sysopt.bonesformat[0] != ascii);
nhfp->fnidx = sysopt.bonesformat[0];
nhfp->fd = -1;
nhfp->fpdef = fopen(fq_bones, nhfp->style.binary ? RDBMODE : RDTMODE);
if (nhfp->fpdef) {
#ifdef SAVEFILE_DEBUGGING
nhfp->fpdebug = fopen("open_bonesfile-debug.log", "a");
#endif
} else {
failed = errno;
}
}
#endif /* SYSCF */
if (nhfp->structlevel) { if (nhfp->structlevel) {
#ifdef MAC #ifdef MAC
nhfp->fd = macopen(fq_bones, O_RDONLY | O_BINARY, BONE_TYPE); nhfp->fd = macopen(fq_bones, O_RDONLY | O_BINARY, BONE_TYPE);
@@ -1022,16 +944,11 @@ void
set_savefile_name(regularize_it) set_savefile_name(regularize_it)
boolean regularize_it; boolean regularize_it;
{ {
int idx = 0, regoffset = 0, overflow = 0, int idx = historical, regoffset = 0, overflow = 0,
indicator_spot = 0; /* 0=no indicator, 1=before ext, 2=after ext */ indicator_spot = 0; /* 0=no indicator, 1=before ext, 2=after ext */
const char *postappend = (const char *) 0, const char *postappend = (const char *) 0,
*sfindicator = (const char *) 0; *sfindicator = (const char *) 0;
#ifdef SYSCF
idx = sysopt.saveformat[0];
if (idx > historical && idx <= ascii)
sfindicator = sfoprocs[idx].ext;
#endif
if (g.program_state.in_self_recover) { if (g.program_state.in_self_recover) {
/* self_recover needs to be done as historical /* self_recover needs to be done as historical
structlevel content until that process is structlevel content until that process is
@@ -1041,7 +958,6 @@ boolean regularize_it;
place it into the save file. place it into the save file.
*/ */
idx = historical; idx = historical;
sfindicator = sfoprocs[idx].ext;
} }
#ifdef VMS #ifdef VMS
Sprintf(g.SAVEF, "[.save]%d%s", getuid(), g.plname); Sprintf(g.SAVEF, "[.save]%d%s", getuid(), g.plname);
@@ -1112,15 +1028,7 @@ boolean regularize_it;
if (strlen(g.SAVEF) + strlen(SAVE_EXTENSION) < (SAVESIZE - 1)) { if (strlen(g.SAVEF) + strlen(SAVE_EXTENSION) < (SAVESIZE - 1)) {
Strcat(g.SAVEF, SAVE_EXTENSION); Strcat(g.SAVEF, SAVE_EXTENSION);
#ifdef MSDOS #ifdef MSDOS
#ifdef SYSCF sfindicator = "";
if (idx >= historical && idx <= ascii) {
/* we did leave room for the extra char in SAVE_EXTENSION */
g.SAVEF[strlen(g.SAVEF)-1] =
(idx == lendian) ? 'l' :
(idx == ascii) ? 'a' : '\0';
}
sfindicator = (g.program_state.in_self_recover) ? "" : sfoprocs[idx].ext;
#endif
#endif #endif
} else } else
overflow = 3; overflow = 3;
@@ -1140,8 +1048,8 @@ boolean regularize_it;
} }
#if (NH_DEVEL_STATUS != NH_STATUS_RELEASED) #if (NH_DEVEL_STATUS != NH_STATUS_RELEASED)
if (overflow) if (overflow)
impossible("set_savefile_name() couldn't complete without overlow %d", impossible("set_savefile_name() couldn't complete without overflow %d",
overflow); overflow);
#endif #endif
} }
@@ -1152,8 +1060,6 @@ NHFILE *nhfp;
{ {
if (nhfp->structlevel) if (nhfp->structlevel)
(void) write(nhfp->fd, (genericptr_t) g.SAVEF, sizeof(g.SAVEF)); (void) write(nhfp->fd, (genericptr_t) g.SAVEF, sizeof(g.SAVEF));
if (nhfp->fieldlevel)
sfo_str(nhfp, g.SAVEF, "savefile_name", "g.savef", sizeof(g.SAVEF));
} }
#endif #endif
@@ -1212,23 +1118,6 @@ create_savefile()
nhfp->fd = -1; nhfp->fd = -1;
nhfp->fpdef = (FILE *) 0; nhfp->fpdef = (FILE *) 0;
} }
if (!do_historical) {
nhfp->structlevel = FALSE;
nhfp->fieldlevel = TRUE;
nhfp->addinfo = TRUE;
nhfp->style.deflt = TRUE;
nhfp->style.binary = (sysopt.saveformat[0] != ascii);
nhfp->fnidx = sysopt.saveformat[0];
nhfp->fd = -1;
nhfp->fpdef = fopen(fq_save, nhfp->style.binary ? WRBMODE : WRTMODE);
if (nhfp->fpdef) {
#ifdef SAVEFILE_DEBUGGING
nhfp->fpdebug = fopen("create_savefile-debug.log", "a");
#endif
} else {
failed = errno;
}
}
if (nhfp->structlevel) { if (nhfp->structlevel) {
#if defined(MICRO) || defined(WIN32) #if defined(MICRO) || defined(WIN32)
nhfp->fd = open(fq_save, O_WRONLY | O_BINARY | O_CREAT | O_TRUNC, FCMASK); nhfp->fd = open(fq_save, O_WRONLY | O_BINARY | O_CREAT | O_TRUNC, FCMASK);
@@ -1274,11 +1163,6 @@ open_savefile()
nhfp->fieldlevel = FALSE; nhfp->fieldlevel = FALSE;
nhfp->ftype = NHF_SAVEFILE; nhfp->ftype = NHF_SAVEFILE;
nhfp->mode = READING; nhfp->mode = READING;
#ifdef SYSCF
if (sysopt.saveformat[0] > historical &&
sysopt.saveformat[0] <= ascii)
do_historical = FALSE;
#endif /* SYSCF */
if (g.program_state.in_self_recover) { if (g.program_state.in_self_recover) {
do_historical = TRUE; /* force it */ do_historical = TRUE; /* force it */
nhfp->structlevel = TRUE; nhfp->structlevel = TRUE;
@@ -1290,23 +1174,6 @@ open_savefile()
nhfp->fd = -1; nhfp->fd = -1;
nhfp->fpdef = (FILE *) 0; nhfp->fpdef = (FILE *) 0;
} }
if (!do_historical) {
nhfp->structlevel = FALSE;
nhfp->fieldlevel = TRUE;
nhfp->addinfo = TRUE;
nhfp->style.deflt = TRUE;
nhfp->style.binary = (sysopt.saveformat[0] < ascii);
nhfp->fnidx = sysopt.saveformat[0];
nhfp->fd = -1;
nhfp->fpdef = fopen(fq_save, nhfp->style.binary ? RDBMODE : RDTMODE);
if (nhfp->fpdef) {
#ifdef SAVEFILE_DEBUGGING
nhfp->fpdebug = fopen("open_savefile-debug.log", "a");
#endif
} else {
failed = errno;
}
}
if (nhfp->structlevel) { if (nhfp->structlevel) {
#ifdef MAC #ifdef MAC
nhfp->fd = macopen(fq_save, O_RDONLY | O_BINARY, SAVE_TYPE); nhfp->fd = macopen(fq_save, O_RDONLY | O_BINARY, SAVE_TYPE);
@@ -1345,10 +1212,6 @@ restore_saved_game()
nh_uncompress(fq_save); nh_uncompress(fq_save);
if ((nhfp = open_savefile()) != 0) { if ((nhfp = open_savefile()) != 0) {
if (nhfp && nhfp->fieldlevel && nhfp->fplog)
(void) fprintf(nhfp->fplog, "# just opened\n");
if (nhfp->fieldlevel && nhfp->addinfo)
sfi_addinfo(nhfp, "NetHack", "start", "savefile", 0);
if (validate(nhfp, fq_save) != 0) { if (validate(nhfp, fq_save) != 0) {
close_nhfile(nhfp); close_nhfile(nhfp);
nhfp = (NHFILE *)0; nhfp = (NHFILE *)0;
@@ -4051,15 +3914,6 @@ recover_savefile()
*/ */
/* /*
* Things are different now. We could be in a situation
* where the default save file format is not structlevel.
* self-recover is currently written to use copy_bytes()
* to move content from the level files into the savefile.
* Until the code is updated to use something other than
* copy_bytes, what we need to do is force the recovery
* save to be structlevel, finish creating it, then read
* it back in. The save after that can be fieldlevel again.
*
* Set a flag for the savefile routines to know the * Set a flag for the savefile routines to know the
* circumstances and act accordingly: * circumstances and act accordingly:
* g.program_state.in_self_recover * g.program_state.in_self_recover
@@ -4088,29 +3942,11 @@ recover_savefile()
*/ */
/*store_formatindicator(snhfp); */ /*store_formatindicator(snhfp); */
store_version(snhfp); store_version(snhfp);
#if 0
if (snhfp->structlevel) {
if (write(snhfp->fd, (genericptr_t) &version_data, sizeof version_data)
!= sizeof version_data)
savewrite_failure = "version_info";
}
if (snhfp->fieldlevel) {
sfo_version_info(snhfp, (struct version_info *) &version_data,
"version", "version_info", 1);
savewrite_failure = (const char *) 0;
}
if (savewrite_failure)
goto cleanup;
#endif
if (snhfp->structlevel) { if (snhfp->structlevel) {
if (write(snhfp->fd, (genericptr_t) &sfi, sizeof sfi) != sizeof sfi) if (write(snhfp->fd, (genericptr_t) &sfi, sizeof sfi) != sizeof sfi)
savewrite_failure = "savefileinfo"; savewrite_failure = "savefileinfo";
} }
if (snhfp->fieldlevel) {
sfo_savefile_info(snhfp, &sfsaveinfo, "savefileinfo", "savefile_info", 1);
savewrite_failure = (const char *) 0;
}
if (savewrite_failure) if (savewrite_failure)
goto cleanup; goto cleanup;
@@ -4119,10 +3955,6 @@ recover_savefile()
!= sizeof pltmpsiz) != sizeof pltmpsiz)
savewrite_failure = "player name size"; savewrite_failure = "player name size";
} }
if (snhfp->fieldlevel) {
sfo_int(snhfp, &pltmpsiz, "plname", "plname_size", 1);
savewrite_failure = (const char *) 0;
}
if (savewrite_failure) if (savewrite_failure)
goto cleanup; goto cleanup;
@@ -4130,18 +3962,9 @@ recover_savefile()
if (write(snhfp->fd, (genericptr_t) &tmpplbuf, pltmpsiz) != pltmpsiz) if (write(snhfp->fd, (genericptr_t) &tmpplbuf, pltmpsiz) != pltmpsiz)
savewrite_failure = "player name"; savewrite_failure = "player name";
} }
if (snhfp->fieldlevel) {
sfo_str(snhfp, tmpplbuf, "plname", "tmpplbuf", pltmpsiz);
savewrite_failure = (const char *) 0;
}
if (savewrite_failure) if (savewrite_failure)
goto cleanup; goto cleanup;
/*
* copy_bytes isn't good enough anymore.
* We could be reading from a structlevel file but
* writing into a fieldlevel save file. Yikes!
*/
if (!copy_bytes(lnhfp->fd, snhfp->fd)) { if (!copy_bytes(lnhfp->fd, snhfp->fd)) {
close_nhfile(gnhfp); close_nhfile(gnhfp);
close_nhfile(snhfp); close_nhfile(snhfp);
-13
View File
@@ -4,8 +4,6 @@
#include "hack.h" #include "hack.h"
#include "lev.h" /* for checking save modes */ #include "lev.h" /* for checking save modes */
#include "sfproto.h"
/* /*
* Mobile light sources. * Mobile light sources.
@@ -326,9 +324,6 @@ int range;
if (nhfp->structlevel) { if (nhfp->structlevel) {
bwrite(nhfp->fd, (genericptr_t) &count, sizeof count); bwrite(nhfp->fd, (genericptr_t) &count, sizeof count);
} }
if (nhfp->fieldlevel) {
sfo_int(nhfp, &count, "lightsources", "lightsource_count", 1);
}
actual = maybe_write_ls(nhfp, range, TRUE); actual = maybe_write_ls(nhfp, range, TRUE);
if (actual != count) if (actual != count)
panic("counted %d light sources, wrote %d! [range=%d]", count, panic("counted %d light sources, wrote %d! [range=%d]", count,
@@ -379,15 +374,11 @@ NHFILE *nhfp;
/* restore elements */ /* restore elements */
if (nhfp->structlevel) if (nhfp->structlevel)
mread(nhfp->fd, (genericptr_t) &count, sizeof count); mread(nhfp->fd, (genericptr_t) &count, sizeof count);
if (nhfp->fieldlevel)
sfi_int(nhfp, &count, "lightsources", "lightsource_count", 1);
while (count-- > 0) { while (count-- > 0) {
ls = (light_source *) alloc(sizeof(light_source)); ls = (light_source *) alloc(sizeof(light_source));
if (nhfp->structlevel) if (nhfp->structlevel)
mread(nhfp->fd, (genericptr_t) ls, sizeof(light_source)); mread(nhfp->fd, (genericptr_t) ls, sizeof(light_source));
if (nhfp->fieldlevel)
sfi_ls_t(nhfp, ls, "lightsources", "lightsource", 1);
ls->next = g.light_base; ls->next = g.light_base;
g.light_base = ls; g.light_base = ls;
} }
@@ -529,8 +520,6 @@ light_source *ls;
if (ls->flags & LSF_NEEDS_FIXUP) { if (ls->flags & LSF_NEEDS_FIXUP) {
if (nhfp->structlevel) if (nhfp->structlevel)
bwrite(nhfp->fd, (genericptr_t) ls, sizeof(light_source)); bwrite(nhfp->fd, (genericptr_t) ls, sizeof(light_source));
if (nhfp->fieldlevel)
sfo_ls_t(nhfp, ls, "lightsources", "lightsource", 1);
} else { } else {
/* replace object pointer with id for write, then put back */ /* replace object pointer with id for write, then put back */
arg_save = ls->id; arg_save = ls->id;
@@ -552,8 +541,6 @@ light_source *ls;
ls->flags |= LSF_NEEDS_FIXUP; ls->flags |= LSF_NEEDS_FIXUP;
if (nhfp->structlevel) if (nhfp->structlevel)
bwrite(nhfp->fd, (genericptr_t) ls, sizeof(light_source)); bwrite(nhfp->fd, (genericptr_t) ls, sizeof(light_source));
if (nhfp->fieldlevel)
sfo_ls_t(nhfp, ls, "lightsources", "lightsource", 1);
ls->id = arg_save; ls->id = arg_save;
ls->flags &= ~LSF_NEEDS_FIXUP; ls->flags &= ~LSF_NEEDS_FIXUP;
} }
+77 -7
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 mapglyph.c $NHDT-Date: 1573943501 2019/11/16 22:31:41 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.51 $ */ /* NetHack 3.6 mapglyph.c $NHDT-Date: 1575830186 2019/12/08 18:36:26 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.60 $ */
/* Copyright (c) David Cohrs, 1991 */ /* Copyright (c) David Cohrs, 1991 */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -9,9 +9,11 @@
#include "color.h" #include "color.h"
#define HI_DOMESTIC CLR_WHITE /* monst.c */ #define HI_DOMESTIC CLR_WHITE /* monst.c */
#if 0
#if !defined(TTY_GRAPHICS) #if !defined(TTY_GRAPHICS)
#define has_color(n) TRUE #define has_color(n) TRUE
#endif #endif
#endif
#ifdef TEXTCOLOR #ifdef TEXTCOLOR
static const int explcolors[] = { static const int explcolors[] = {
@@ -57,6 +59,10 @@ static const int explcolors[] = {
#define is_objpile(x,y) (!Hallucination && g.level.objects[(x)][(y)] \ #define is_objpile(x,y) (!Hallucination && g.level.objects[(x)][(y)] \
&& g.level.objects[(x)][(y)]->nexthere) && g.level.objects[(x)][(y)]->nexthere)
#define GMAP_SET 0x00000001
#define GMAP_ROGUELEVEL 0x00000002
#define GMAP_ALTARCOLOR 0x00000004
/*ARGSUSED*/ /*ARGSUSED*/
int int
mapglyph(glyph, ochar, ocolor, ospecial, x, y, mgflags) mapglyph(glyph, ochar, ocolor, ospecial, x, y, mgflags)
@@ -75,6 +81,21 @@ unsigned mgflags;
has_rogue_color = (has_rogue_ibm_graphics has_rogue_color = (has_rogue_ibm_graphics
&& g.symset[g.currentgraphics].nocolor == 0); && g.symset[g.currentgraphics].nocolor == 0);
if (!g.glyphmap_perlevel_flags) {
/*
* GMAP_SET 0x00000001
* GMAP_ROGUELEVEL 0x00000002
* GMAP_ALTARCOLOR 0x00000004
*/
g.glyphmap_perlevel_flags |= GMAP_SET;
if (Is_rogue_level(&u.uz)) {
g.glyphmap_perlevel_flags |= GMAP_ROGUELEVEL;
} else if ((Is_astralevel(&u.uz) || Is_sanctum(&u.uz))) {
g.glyphmap_perlevel_flags |= GMAP_ALTARCOLOR;
}
}
/* /*
* Map the glyph back to a character and color. * Map the glyph back to a character and color.
* *
@@ -138,8 +159,54 @@ unsigned mgflags;
if they use the same symbol and color is disabled */ if they use the same symbol and color is disabled */
} else if (!iflags.use_color && offset == S_lava } else if (!iflags.use_color && offset == S_lava
&& (g.showsyms[idx] == g.showsyms[S_pool + SYM_OFF_P] && (g.showsyms[idx] == g.showsyms[S_pool + SYM_OFF_P]
|| g.showsyms[idx] == g.showsyms[S_water + SYM_OFF_P])) { || g.showsyms[idx]
== g.showsyms[S_water + SYM_OFF_P])) {
special |= MG_BW_LAVA; special |= MG_BW_LAVA;
} else if (offset == S_altar && iflags.use_color) {
int amsk = altarmask_at(x, y); /* might be a mimic */
if ((g.glyphmap_perlevel_flags & GMAP_ALTARCOLOR)
&& (amsk & AM_SHRINE) != 0) {
/* high altar */
color = CLR_BRIGHT_MAGENTA;
} else {
switch (amsk & AM_MASK) {
#if 0 /*
* On OSX with TERM=xterm-color256 these render as
* white -> tty: gray, curses: ok
* gray -> both tty and curses: black
* black -> both tty and curses: blue
* red -> both tty and curses: ok.
* Since the colors have specific associations (with the
* unicorns matched with each alignment), we shouldn't use
* scrambled colors and we don't have sufficient information
* to handle platform-specific color variations.
*/
case AM_LAWFUL: /* 4 */
color = CLR_WHITE;
break;
case AM_NEUTRAL: /* 2 */
color = CLR_GRAY;
break;
case AM_CHAOTIC: /* 1 */
color = CLR_BLACK;
break;
#else /* !0: TEMP? */
case AM_LAWFUL: /* 4 */
case AM_NEUTRAL: /* 2 */
case AM_CHAOTIC: /* 1 */
cmap_color(S_altar); /* gray */
break;
#endif /* 0 */
case AM_NONE: /* 0 */
color = CLR_RED;
break;
default: /* 3, 5..7 -- shouldn't happen but 3 was possible
* prior to 3.6.3 (due to faulty sink polymorph) */
color = NO_COLOR;
break;
}
}
} else { } else {
cmap_color(offset); cmap_color(offset);
} }
@@ -229,14 +296,16 @@ unsigned mgflags;
if ((special & MG_PET) != 0) { if ((special & MG_PET) != 0) {
ovidx = SYM_PET_OVERRIDE + SYM_OFF_X; ovidx = SYM_PET_OVERRIDE + SYM_OFF_X;
if (Is_rogue_level(&u.uz) ? g.ov_rogue_syms[ovidx] if ((g.glyphmap_perlevel_flags & GMAP_ROGUELEVEL)
: g.ov_primary_syms[ovidx]) ? g.ov_rogue_syms[ovidx]
: g.ov_primary_syms[ovidx])
idx = ovidx; idx = ovidx;
} }
if (is_you) { if (is_you) {
ovidx = SYM_HERO_OVERRIDE + SYM_OFF_X; ovidx = SYM_HERO_OVERRIDE + SYM_OFF_X;
if (Is_rogue_level(&u.uz) ? g.ov_rogue_syms[ovidx] if ((g.glyphmap_perlevel_flags & GMAP_ROGUELEVEL)
: g.ov_primary_syms[ovidx]) ? g.ov_rogue_syms[ovidx]
: g.ov_primary_syms[ovidx])
idx = ovidx; idx = ovidx;
} }
} }
@@ -244,7 +313,8 @@ unsigned mgflags;
ch = g.showsyms[idx]; ch = g.showsyms[idx];
#ifdef TEXTCOLOR #ifdef TEXTCOLOR
/* Turn off color if no color defined, or rogue level w/o PC graphics. */ /* Turn off color if no color defined, or rogue level w/o PC graphics. */
if (!has_color(color) || (Is_rogue_level(&u.uz) && !has_rogue_color)) if (!has_color(color) ||
((g.glyphmap_perlevel_flags & GMAP_ROGUELEVEL) && !has_rogue_color))
#endif #endif
color = NO_COLOR; color = NO_COLOR;
*ochar = (int) ch; *ochar = (int) ch;
-20
View File
@@ -6,8 +6,6 @@
#include "hack.h" #include "hack.h"
#include "sp_lev.h" #include "sp_lev.h"
#include "lev.h" /* save & restore info */ #include "lev.h" /* save & restore info */
#include "sfproto.h"
static int FDECL(iswall, (int, int)); static int FDECL(iswall, (int, int));
static int FDECL(iswall_or_stone, (int, int)); static int FDECL(iswall_or_stone, (int, int));
@@ -1579,18 +1577,9 @@ NHFILE *nhfp;
bwrite(nhfp->fd, (genericptr_t) &g.xmax, sizeof(int)); bwrite(nhfp->fd, (genericptr_t) &g.xmax, sizeof(int));
bwrite(nhfp->fd, (genericptr_t) &g.ymax, sizeof(int)); bwrite(nhfp->fd, (genericptr_t) &g.ymax, sizeof(int));
} }
if (nhfp->fieldlevel) {
sfo_int(nhfp, &n, "waterlevel", "bubble_count", 1);
sfo_int(nhfp, &g.xmin, "waterlevel", "g.xmin", 1);
sfo_int(nhfp, &g.ymin, "waterlevel", "g.ymin", 1);
sfo_int(nhfp, &g.xmax, "waterlevel", "g.xmax", 1);
sfo_int(nhfp, &g.ymax, "waterlevel", "g.ymax", 1);
}
for (b = g.bbubbles; b; b = b->next) { for (b = g.bbubbles; b; b = b->next) {
if (nhfp->structlevel) if (nhfp->structlevel)
bwrite(nhfp->fd, (genericptr_t) b, sizeof(struct bubble)); bwrite(nhfp->fd, (genericptr_t) b, sizeof(struct bubble));
if (nhfp->fieldlevel)
sfo_bubble(nhfp, b, "waterlevel", "bubble", 1);
} }
} }
if (release_data(nhfp)) if (release_data(nhfp))
@@ -1623,20 +1612,11 @@ NHFILE *nhfp;
mread(nhfp->fd,(genericptr_t)&g.xmax,sizeof(int)); mread(nhfp->fd,(genericptr_t)&g.xmax,sizeof(int));
mread(nhfp->fd,(genericptr_t)&g.ymax,sizeof(int)); mread(nhfp->fd,(genericptr_t)&g.ymax,sizeof(int));
} }
if (nhfp->fieldlevel) {
sfi_int(nhfp, &n, "waterlevel", "bubble_count", 1);
sfi_int(nhfp, &g.xmin, "waterlevel", "g.xmin", 1);
sfi_int(nhfp, &g.ymin, "waterlevel", "g.ymin", 1);
sfi_int(nhfp, &g.xmax, "waterlevel", "g.xmax", 1);
sfi_int(nhfp, &g.ymax, "waterlevel", "g.ymax", 1);
}
for (i = 0; i < n; i++) { for (i = 0; i < n; i++) {
btmp = b; btmp = b;
b = (struct bubble *) alloc(sizeof(struct bubble)); b = (struct bubble *) alloc(sizeof(struct bubble));
if (nhfp->structlevel) if (nhfp->structlevel)
mread(nhfp->fd,(genericptr_t) b, sizeof(struct bubble)); mread(nhfp->fd,(genericptr_t) b, sizeof(struct bubble));
if (nhfp->fieldlevel)
sfi_bubble(nhfp, b, "waterlevel", "bubble", 1);
if (g.bbubbles) { if (g.bbubbles) {
btmp->next = b; btmp->next = b;
b->prev = btmp; b->prev = btmp;
-10
View File
@@ -16,8 +16,6 @@
*/ */
#include "hack.h" #include "hack.h"
#include "sfproto.h"
static boolean FDECL(isbig, (struct mkroom *)); static boolean FDECL(isbig, (struct mkroom *));
static struct mkroom *FDECL(pick_room, (BOOLEAN_P)); static struct mkroom *FDECL(pick_room, (BOOLEAN_P));
@@ -811,8 +809,6 @@ struct mkroom *r;
*/ */
if (nhfp->structlevel) if (nhfp->structlevel)
bwrite(nhfp->fd, (genericptr_t) r, sizeof (struct mkroom)); bwrite(nhfp->fd, (genericptr_t) r, sizeof (struct mkroom));
if (nhfp->fieldlevel)
sfo_mkroom(nhfp, r, "room", "mkroom", 1);
for (i = 0; i < r->nsubrooms; i++) { for (i = 0; i < r->nsubrooms; i++) {
save_room(nhfp, r->sbrooms[i]); save_room(nhfp, r->sbrooms[i]);
} }
@@ -830,8 +826,6 @@ NHFILE *nhfp;
/* First, write the number of rooms */ /* First, write the number of rooms */
if (nhfp->structlevel) if (nhfp->structlevel)
bwrite(nhfp->fd, (genericptr_t) &g.nroom, sizeof(g.nroom)); bwrite(nhfp->fd, (genericptr_t) &g.nroom, sizeof(g.nroom));
if (nhfp->fieldlevel)
sfo_int(nhfp, &g.nroom, "room", "g.nroom", 1);
for (i = 0; i < g.nroom; i++) for (i = 0; i < g.nroom; i++)
save_room(nhfp, &g.rooms[i]); save_room(nhfp, &g.rooms[i]);
} }
@@ -845,8 +839,6 @@ struct mkroom *r;
if (nhfp->structlevel) if (nhfp->structlevel)
mread(nhfp->fd, (genericptr_t) r, sizeof(struct mkroom)); mread(nhfp->fd, (genericptr_t) r, sizeof(struct mkroom));
if (nhfp->fieldlevel)
sfi_mkroom(nhfp, r, "room", "mkroom", 1);
for (i = 0; i < r->nsubrooms; i++) { for (i = 0; i < r->nsubrooms; i++) {
r->sbrooms[i] = &g.subrooms[g.nsubroom]; r->sbrooms[i] = &g.subrooms[g.nsubroom];
@@ -867,8 +859,6 @@ NHFILE *nhfp;
if (nhfp->structlevel) if (nhfp->structlevel)
mread(nhfp->fd, (genericptr_t) &g.nroom, sizeof(g.nroom)); mread(nhfp->fd, (genericptr_t) &g.nroom, sizeof(g.nroom));
if (nhfp->fieldlevel)
sfi_int(nhfp, &g.nroom, "room", "g.nroom", 1);
g.nsubroom = 0; g.nsubroom = 0;
for (i = 0; i < g.nroom; i++) { for (i = 0; i < g.nroom; i++) {
+440
View File
@@ -0,0 +1,440 @@
/* NetHack 3.7 nhlobj.c $NHDT-Date: 1576097301 2019/12/11 20:48:21 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.0 $ */
/* Copyright (c) 2019 by Pasi Kallinen */
/* NetHack may be freely redistributed. See license for details. */
#include "hack.h"
#include "sp_lev.h"
struct _lua_obj {
int state; /* UNUSED */
struct obj *obj;
};
struct _lua_obj *
l_obj_check(L, index)
lua_State *L;
int index;
{
struct _lua_obj *lo;
luaL_checktype(L, index, LUA_TUSERDATA);
lo = (struct _lua_obj *)luaL_checkudata(L, index, "obj");
if (!lo)
nhl_error(L, "Obj error");
return lo;
}
static int
l_obj_gc(L)
lua_State *L;
{
struct _lua_obj *lo = l_obj_check(L, 1);
if (lo && lo->obj) {
/* free-floating objects are deallocated */
if (lo->obj->where == OBJ_FREE) {
if (Has_contents(lo->obj)) {
struct obj *otmp;
while ((otmp = lo->obj->cobj) != 0) {
obj_extract_self(otmp);
dealloc_obj(otmp);
}
}
dealloc_obj(lo->obj);
}
lo->obj = NULL;
}
return 0;
}
static struct _lua_obj *
l_obj_push(L, otmp)
lua_State *L;
struct obj *otmp;
{
struct _lua_obj *lo = (struct _lua_obj *)lua_newuserdata(L, sizeof(struct _lua_obj));
luaL_getmetatable(L, "obj");
lua_setmetatable(L, -2);
lo->state = 0;
lo->obj = otmp;
return lo;
}
/* local o = obj.new("large chest");
local cobj = o:contents(); */
static int
l_obj_getcontents(L)
lua_State *L;
{
struct _lua_obj *lo = l_obj_check(L, 1);
struct obj *obj = lo->obj;
if (!obj)
nhl_error(L, "l_obj_getcontents: no obj");
if (!obj->cobj)
nhl_error(L, "l_obj_getcontents: no cobj");
(void) l_obj_push(L, obj->cobj);
return 1;
}
/* local box = obj.new("large chest");
box.addcontent(obj.new("rock"));
*/
static int
l_obj_add_to_container(L)
lua_State *L;
{
struct _lua_obj *lobox = l_obj_check(L, 1);
struct _lua_obj *lo = l_obj_check(L, 2);
struct obj *otmp;
if (!lo->obj || !lobox->obj)
nhl_error(L, "l_obj_add_to_container: no obj");
if (!Is_container(lobox->obj))
nhl_error(L, "l_obj_add_to_container: not a container");
otmp = add_to_container(lobox->obj, lo->obj);
/* was lo->obj merged? FIXME: causes problems if both lo->obj and
the one it merged with are handled by lua. Use lo->state? */
if (otmp != lo->obj)
lo->obj = otmp;
return 0;
}
/* Get a table of object class data. */
/* local odata = obj.class(otbl.otyp); */
/* local odata = obj.class(obj.new("rock")); */
static int
l_obj_objects_to_table(L)
lua_State *L;
{
int argc = lua_gettop(L);
int otyp = -1;
struct objclass *o;
if (argc != 1) {
nhl_error(L, "l_obj_objects_to_table: Wrong args");
return 0;
}
if (lua_type(L, 1) == LUA_TNUMBER) {
otyp = luaL_checkinteger(L, 1);
} else if (lua_type(L, 1) == LUA_TUSERDATA) {
struct _lua_obj *lo = l_obj_check(L, 1);
if (lo && lo->obj)
otyp = lo->obj->otyp;
}
lua_pop(L, 1);
if (otyp == -1) {
nhl_error(L, "l_obj_objects_to_table: Wrong args");
return 0;
}
o = &objects[otyp];
lua_newtable(L);
if (OBJ_NAME(objects[otyp]))
nhl_add_table_entry_str(L, "name", OBJ_NAME(objects[otyp]));
if (OBJ_DESCR(objects[otyp]))
nhl_add_table_entry_str(L, "descr",
OBJ_DESCR(objects[otyp]));
if (o->oc_uname)
nhl_add_table_entry_str(L, "uname", o->oc_uname);
nhl_add_table_entry_int(L, "name_known", o->oc_name_known);
nhl_add_table_entry_int(L, "merge", o->oc_merge);
nhl_add_table_entry_int(L, "uses_known", o->oc_uses_known);
nhl_add_table_entry_int(L, "pre_discovered", o->oc_pre_discovered);
nhl_add_table_entry_int(L, "magic", o->oc_magic);
nhl_add_table_entry_int(L, "charged", o->oc_charged);
nhl_add_table_entry_int(L, "unique", o->oc_unique);
nhl_add_table_entry_int(L, "nowish", o->oc_nowish);
nhl_add_table_entry_int(L, "big", o->oc_big);
/* TODO: oc_bimanual, oc_bulky */
nhl_add_table_entry_int(L, "tough", o->oc_tough);
nhl_add_table_entry_int(L, "dir", o->oc_dir); /* TODO: convert to text */
nhl_add_table_entry_int(L, "material", o->oc_material); /* TODO: convert to text */
/* TODO: oc_subtyp, oc_skill, oc_armcat */
nhl_add_table_entry_int(L, "oprop", o->oc_oprop);
nhl_add_table_entry_char(L, "class",
def_oc_syms[(uchar) o->oc_class].sym);
nhl_add_table_entry_int(L, "delay", o->oc_delay);
nhl_add_table_entry_int(L, "color", o->oc_color); /* TODO: text? */
nhl_add_table_entry_int(L, "prob", o->oc_prob);
nhl_add_table_entry_int(L, "weight", o->oc_weight);
nhl_add_table_entry_int(L, "cost", o->oc_cost);
nhl_add_table_entry_int(L, "damage_small", o->oc_wsdam);
nhl_add_table_entry_int(L, "damage_large", o->oc_wldam);
/* TODO: oc_oc1, oc_oc2, oc_hitbon, a_ac, a_can, oc_level */
nhl_add_table_entry_int(L, "nutrition", o->oc_nutrition);
return 1;
}
/* Create a lua table representation of the object, unpacking all the
object fields.
local o = obj.new("rock");
local otbl = o:totable(); */
static int
l_obj_to_table(L)
lua_State *L;
{
struct _lua_obj *lo = l_obj_check(L, 1);
struct obj *obj = lo->obj;
lua_newtable(L);
if (!obj) {
nhl_add_table_entry_int(L, "NO_OBJ", 1);
return 1;
}
nhl_add_table_entry_int(L, "has_contents", Has_contents(obj));
nhl_add_table_entry_int(L, "is_container", Is_container(obj));
nhl_add_table_entry_int(L, "o_id", obj->o_id);
nhl_add_table_entry_int(L, "ox", obj->ox);
nhl_add_table_entry_int(L, "oy", obj->oy);
nhl_add_table_entry_int(L, "otyp", obj->otyp);
if (OBJ_NAME(objects[obj->otyp]))
nhl_add_table_entry_str(L, "otyp_name", OBJ_NAME(objects[obj->otyp]));
if (OBJ_DESCR(objects[obj->otyp]))
nhl_add_table_entry_str(L, "otyp_descr",
OBJ_DESCR(objects[obj->otyp]));
nhl_add_table_entry_int(L, "owt", obj->owt);
nhl_add_table_entry_int(L, "quan", obj->quan);
nhl_add_table_entry_int(L, "spe", obj->spe);
if (obj->otyp == STATUE) {
nhl_add_table_entry_int(L, "historic", (obj->spe & STATUE_HISTORIC));
nhl_add_table_entry_int(L, "statue_male", (obj->spe & STATUE_MALE));
nhl_add_table_entry_int(L, "statue_female", (obj->spe & STATUE_FEMALE));
}
nhl_add_table_entry_char(L, "oclass",
def_oc_syms[(uchar) obj->oclass].sym);
nhl_add_table_entry_char(L, "invlet", obj->invlet);
/* TODO: nhl_add_table_entry_char(L, "oartifact", obj->oartifact);*/
nhl_add_table_entry_int(L, "where", obj->where);
/* TODO: nhl_add_table_entry_int(L, "timed", obj->timed); */
nhl_add_table_entry_int(L, "cursed", obj->cursed);
nhl_add_table_entry_int(L, "blessed", obj->blessed);
nhl_add_table_entry_int(L, "unpaid", obj->unpaid);
nhl_add_table_entry_int(L, "no_charge", obj->no_charge);
nhl_add_table_entry_int(L, "known", obj->known);
nhl_add_table_entry_int(L, "dknown", obj->dknown);
nhl_add_table_entry_int(L, "bknown", obj->bknown);
nhl_add_table_entry_int(L, "rknown", obj->rknown);
if (obj->oclass == POTION_CLASS)
nhl_add_table_entry_int(L, "odiluted", obj->odiluted);
else
nhl_add_table_entry_int(L, "oeroded", obj->oeroded);
nhl_add_table_entry_int(L, "oeroded2", obj->oeroded2);
/* TODO: orotten, norevive */
nhl_add_table_entry_int(L, "oerodeproof", obj->oerodeproof);
nhl_add_table_entry_int(L, "olocked", obj->olocked);
nhl_add_table_entry_int(L, "obroken", obj->obroken);
if (is_poisonable(obj))
nhl_add_table_entry_int(L, "opoisoned", obj->opoisoned);
else
nhl_add_table_entry_int(L, "otrapped", obj->otrapped);
/* TODO: degraded_horn */
nhl_add_table_entry_int(L, "recharged", obj->recharged);
/* TODO: on_ice */
nhl_add_table_entry_int(L, "lamplit", obj->lamplit);
nhl_add_table_entry_int(L, "globby", obj->globby);
nhl_add_table_entry_int(L, "greased", obj->greased);
nhl_add_table_entry_int(L, "nomerge", obj->nomerge);
nhl_add_table_entry_int(L, "was_thrown", obj->was_thrown);
nhl_add_table_entry_int(L, "in_use", obj->in_use);
nhl_add_table_entry_int(L, "bypass", obj->bypass);
nhl_add_table_entry_int(L, "cknown", obj->cknown);
nhl_add_table_entry_int(L, "lknown", obj->lknown);
nhl_add_table_entry_int(L, "corpsenm", obj->corpsenm);
if (obj->corpsenm != NON_PM
&& (obj->otyp == TIN || obj->otyp == CORPSE || obj->otyp == EGG
|| obj->otyp == FIGURINE || obj->otyp == STATUE))
nhl_add_table_entry_str(L, "corpsenm_name", mons[obj->corpsenm].mname);
/* TODO: leashmon, fromsink, novelidx, record_achieve_special */
nhl_add_table_entry_int(L, "usecount", obj->usecount);
/* TODO: spestudied */
nhl_add_table_entry_int(L, "oeaten", obj->oeaten);
nhl_add_table_entry_int(L, "age", obj->age);
nhl_add_table_entry_int(L, "owornmask", obj->owornmask);
/* TODO: more of oextra */
nhl_add_table_entry_int(L, "has_oname", has_oname(obj));
if (has_oname(obj))
nhl_add_table_entry_str(L, "oname", ONAME(obj));
return 1;
}
/* create a new object via wishing routine */
/* local o = obj.new("rock"); */
static int
l_obj_new_readobjnam(L)
lua_State *L;
{
int argc = lua_gettop(L);
if (argc == 1) {
char buf[BUFSZ];
struct obj *otmp;
Sprintf(buf, "%s", luaL_checkstring(L, 1));
lua_pop(L, 1);
otmp = readobjnam(buf, NULL);
(void) l_obj_push(L, otmp);
return 1;
} else
nhl_error(L, "l_obj_new_readobjname: Wrong args");
return 0;
}
/* Get the topmost object on the map at x,y */
/* local o = obj.at(x, y); */
static int
l_obj_at(L)
lua_State *L;
{
int argc = lua_gettop(L);
if (argc == 2) {
int x, y;
x = luaL_checkinteger(L, 1);
y = luaL_checkinteger(L, 2);
lua_pop(L, 2);
(void) l_obj_push(L, g.level.objects[x][y]);
return 1;
} else
nhl_error(L, "l_obj_at: Wrong args");
return 0;
}
/* Place an object on the map at (x,y).
local o = obj.new("rock");
o:placeobj(u.ux, u.uy); */
static int
l_obj_placeobj(L)
lua_State *L;
{
int argc = lua_gettop(L);
struct _lua_obj *lo = l_obj_check(L, 1);
if (argc != 3)
nhl_error(L, "l_obj_placeobj: Wrong args");
if (lo && lo->obj) {
int x, y;
x = luaL_checkinteger(L, 2);
y = luaL_checkinteger(L, 3);
lua_pop(L, 3);
place_object(lo->obj, x, y);
} else
nhl_error(L, "l_obj_placeobj: Wrong args");
return 0;
}
/* Get the next object in the object chain */
/* local o = obj.at(x, y);
local o2 = o:next();
*/
static int
l_obj_nextobj(L)
lua_State *L;
{
struct _lua_obj *lo = l_obj_check(L, 1);
if (lo && lo->obj)
(void) l_obj_push(L, lo->obj->where == OBJ_FLOOR ? lo->obj->nexthere : lo->obj->nobj);
return 1;
}
/* Get the container object is in */
/* local box = o:container(); */
static int
l_obj_container(L)
lua_State *L;
{
struct _lua_obj *lo = l_obj_check(L, 1);
if (lo && lo->obj && lo->obj->where == OBJ_CONTAINED) {
(void) l_obj_push(L, lo->obj->ocontainer);
return 1;
}
(void) l_obj_push(L, NULL);
return 1;
}
/* Is the object a null? */
/* local badobj = o:isnull(); */
static int
l_obj_isnull(L)
lua_State *L;
{
struct _lua_obj *lo = l_obj_check(L, 1);
lua_pushboolean(L, lo && lo->obj);
return 1;
}
static const struct luaL_Reg l_obj_methods[] = {
{ "new", l_obj_new_readobjnam },
{ "isnull", l_obj_isnull },
{ "at", l_obj_at },
{ "next", l_obj_nextobj },
{ "totable", l_obj_to_table },
{ "class", l_obj_objects_to_table },
{ "placeobj", l_obj_placeobj },
{ "container", l_obj_container },
{ "contents", l_obj_getcontents },
{ "addcontent", l_obj_add_to_container },
{ NULL, NULL }
};
static const luaL_Reg l_obj_meta[] = {
{ "__gc", l_obj_gc },
{ NULL, NULL }
};
int
l_obj_register(L)
lua_State *L;
{
int lib_id, meta_id;
/* newclass = {} */
lua_createtable(L, 0, 0);
lib_id = lua_gettop(L);
/* metatable = {} */
luaL_newmetatable(L, "obj");
meta_id = lua_gettop(L);
luaL_setfuncs(L, l_obj_meta, 0);
/* metatable.__index = _methods */
luaL_newlib(L, l_obj_methods);
lua_setfield(L, meta_id, "__index");
/* metatable.__metatable = _meta */
luaL_newlib(L, l_obj_meta);
lua_setfield(L, meta_id, "__metatable");
/* class.__metatable = metatable */
lua_setmetatable(L, lib_id);
/* _G["obj"] = newclass */
lua_setglobal(L, "obj");
return 0;
}
+15
View File
@@ -114,6 +114,19 @@ int value;
lua_rawset(L, -3); lua_rawset(L, -3);
} }
void
nhl_add_table_entry_char(L, name, value)
lua_State *L;
const char *name;
char value;
{
char buf[2];
Sprintf(buf, "%c", value);
lua_pushstring(L, name);
lua_pushstring(L, buf);
lua_rawset(L, -3);
}
void void
nhl_add_table_entry_str(L, name, value) nhl_add_table_entry_str(L, name, value)
lua_State *L; lua_State *L;
@@ -874,6 +887,8 @@ nhl_init()
l_selection_register(L); l_selection_register(L);
l_register_des(L); l_register_des(L);
l_obj_register(L);
if (!nhl_loadlua(L, "nhlib.lua")) { if (!nhl_loadlua(L, "nhlib.lua")) {
lua_close(L); lua_close(L);
return (lua_State *) 0; return (lua_State *) 0;
-31
View File
@@ -5,8 +5,6 @@
#include "hack.h" #include "hack.h"
#include "lev.h" /* save & restore info */ #include "lev.h" /* save & restore info */
#include "sfproto.h"
static void FDECL(setgemprobs, (d_level *)); static void FDECL(setgemprobs, (d_level *));
static void FDECL(shuffle, (int, int, BOOLEAN_P)); static void FDECL(shuffle, (int, int, BOOLEAN_P));
@@ -301,14 +299,6 @@ NHFILE *nhfp;
bwrite(nhfp->fd, (genericptr_t)objects, bwrite(nhfp->fd, (genericptr_t)objects,
sizeof(struct objclass) * NUM_OBJECTS); sizeof(struct objclass) * NUM_OBJECTS);
} }
if (nhfp->fieldlevel) {
for (i = 0; i < MAXOCLASSES; ++i)
sfo_int(nhfp, &g.bases[i], "names", "g.bases", 1);
for (i = 0; i < NUM_OBJECTS; ++i)
sfo_short(nhfp, &g.disco[i], "names", "g.disco", 1);
for (i = 0; i < NUM_OBJECTS; ++i)
sfo_objclass(nhfp, &objects[i], "names", "objclass", 1);
}
} }
/* as long as we use only one version of Hack we /* as long as we use only one version of Hack we
need not save oc_name and oc_descr, but we must save need not save oc_name and oc_descr, but we must save
@@ -321,11 +311,6 @@ NHFILE *nhfp;
bwrite(nhfp->fd, (genericptr_t)&len, sizeof len); bwrite(nhfp->fd, (genericptr_t)&len, sizeof len);
bwrite(nhfp->fd, (genericptr_t)objects[i].oc_uname, len); bwrite(nhfp->fd, (genericptr_t)objects[i].oc_uname, len);
} }
if (nhfp->fieldlevel) {
sfo_unsigned(nhfp, &len, "names", "len", 1);
for (j = 0; (unsigned) j < len; ++j)
sfo_char(nhfp, &objects[i].oc_uname[j], "names", "oc_uname", 1);
}
} }
if (release_data(nhfp)) { if (release_data(nhfp)) {
free((genericptr_t) objects[i].oc_uname); free((genericptr_t) objects[i].oc_uname);
@@ -347,31 +332,15 @@ NHFILE *nhfp;
mread(nhfp->fd, (genericptr_t) objects, mread(nhfp->fd, (genericptr_t) objects,
sizeof(struct objclass) * NUM_OBJECTS); sizeof(struct objclass) * NUM_OBJECTS);
} }
if (nhfp->fieldlevel) {
for (i = 0; i < MAXOCLASSES; ++i)
sfi_int(nhfp, &g.bases[i], "names", "g.bases", 1);
for (i = 0; i < NUM_OBJECTS; ++i)
sfi_short(nhfp, &g.disco[i], "names", "g.disco", 1);
for (i = 0; i < NUM_OBJECTS; ++i)
sfi_objclass(nhfp, &objects[i], "names", "objclass", 1);
}
for (i = 0; i < NUM_OBJECTS; i++) { for (i = 0; i < NUM_OBJECTS; i++) {
if (objects[i].oc_uname) { if (objects[i].oc_uname) {
if (nhfp->structlevel) { if (nhfp->structlevel) {
mread(nhfp->fd, (genericptr_t) &len, sizeof len); mread(nhfp->fd, (genericptr_t) &len, sizeof len);
} }
if (nhfp->fieldlevel) {
sfi_unsigned(nhfp, &len, "names", "len", 1);
}
objects[i].oc_uname = (char *) alloc(len); objects[i].oc_uname = (char *) alloc(len);
if (nhfp->structlevel) { if (nhfp->structlevel) {
mread(nhfp->fd, (genericptr_t)objects[i].oc_uname, len); mread(nhfp->fd, (genericptr_t)objects[i].oc_uname, len);
} }
if (nhfp->fieldlevel) {
for (j = 0; (unsigned) j < len; ++j)
sfi_char(nhfp, &objects[i].oc_uname[j],
"names", "oc_uname", 1);
}
} }
} }
#ifdef USE_TILES #ifdef USE_TILES
+60 -1
View File
@@ -1,4 +1,4 @@
/* NetHack 3.7 objnam.c $NHDT-Date: 1575245076 2019/12/02 00:04:36 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.255 $ */ /* NetHack 3.7 objnam.c $NHDT-Date: 1575768412 2019/12/08 01:26:52 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.273 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2011. */ /*-Copyright (c) Robert Patrick Rankin, 2011. */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -4241,6 +4241,65 @@ struct obj *gloves;
return "gloves"; return "gloves";
} }
/* boots vs shoes; depends upon discovery state */
const char *
boots_simple_name(boots)
struct obj *boots;
{
static const char shoes[] = "shoes";
if (boots && boots->dknown) {
int otyp = boots->otyp;
struct objclass *ocl = &objects[otyp];
const char *actualn = OBJ_NAME(*ocl),
*descrpn = OBJ_DESCR(*ocl);
if (strstri(descrpn, shoes)
|| (objects[otyp].oc_name_known && strstri(actualn, shoes)))
return shoes;
}
return "boots";
}
/* simplified shield for messages */
const char *
shield_simple_name(shield)
struct obj *shield;
{
if (shield) {
/* xname() describes unknown (unseen) reflection as smooth */
if (shield->otyp == SHIELD_OF_REFLECTION)
return shield->dknown ? "silver shield" : "smooth shield";
/*
* We might distinguish between wooden vs metallic or
* light vs heavy to give small benefit to spell casters.
* Fighter types probably care more about the former for
* vulnerability to fire or rust.
*
* We could do that both ways: light wooden shield, light
* metallic shield (there aren't any), heavy wooden shield,
* and heavy metallic shield but that's getting away from
* "simple name" which is intended to be shorter as well
* as less detailed than xname().
*/
#if 0
/* spellcasting uses a division like this */
return (weight(shield) > (int) objects[SMALL_SHIELD].oc_weight)
? "heavy shield"
: "light shield";
#endif
}
return "shield";
}
/* for completness */
const char *
shirt_simple_name(shirt)
struct obj *shirt UNUSED;
{
return "shirt";
}
const char * const char *
mimic_obj_name(mtmp) mimic_obj_name(mtmp)
struct monst *mtmp; struct monst *mtmp;
-3
View File
@@ -18,7 +18,6 @@ NEARDATA struct instance_flags iflags; /* provide linkage */
#include "tcap.h" #include "tcap.h"
#include <ctype.h> #include <ctype.h>
#endif #endif
#include "sfprocs.h"
#define BACKWARD_COMPAT #define BACKWARD_COMPAT
@@ -698,8 +697,6 @@ initoptions_init()
if (boolopt[i].addr) if (boolopt[i].addr)
*(boolopt[i].addr) = boolopt[i].initvalue; *(boolopt[i].addr) = boolopt[i].initvalue;
} }
/* initialize the function pointers for fieldlevel saves */
sf_init();
#ifdef SYSFLAGS #ifdef SYSFLAGS
Strcpy(sysflags.sysflagsid, "sysflags"); Strcpy(sysflags.sysflagsid, "sysflags");
+3 -6
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 pager.c $NHDT-Date: 1574722864 2019/11/25 23:01:04 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.162 $ */ /* NetHack 3.6 pager.c $NHDT-Date: 1575830188 2019/12/08 18:36:28 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.175 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2018. */ /*-Copyright (c) Robert Patrick Rankin, 2018. */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -483,11 +483,8 @@ char *buf, *monbuf;
switch (glyph_to_cmap(glyph)) { switch (glyph_to_cmap(glyph)) {
case S_altar: case S_altar:
amsk = ((mtmp = m_at(x, y)) != 0 && has_mcorpsenm(mtmp) amsk = altarmask_at(x, y);
&& M_AP_TYPE(mtmp) == M_AP_FURNITURE algn = Amask2align(amsk & AM_MASK);
&& mtmp->mappearance == S_altar) ? MCORPSENM(mtmp)
: levl[x][y].altarmask;
algn = Amask2align(amsk & ~AM_SHRINE);
Sprintf(buf, "%s %saltar", Sprintf(buf, "%s %saltar",
/* like endgame high priests, endgame high altars /* like endgame high priests, endgame high altars
are only recognizable when immediately adjacent */ are only recognizable when immediately adjacent */
+27 -7
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 pray.c $NHDT-Date: 1573346192 2019/11/10 00:36:32 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.118 $ */ /* NetHack 3.6 pray.c $NHDT-Date: 1575830189 2019/12/08 18:36:29 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.134 $ */
/* Copyright (c) Benson I. Margulies, Mike Stephenson, Steve Linhart, 1989. */ /* Copyright (c) Benson I. Margulies, Mike Stephenson, Steve Linhart, 1989. */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -1384,6 +1384,7 @@ dosacrifice()
/* curse the lawful/neutral altar */ /* curse the lawful/neutral altar */
pline_The("altar is stained with %s blood.", g.urace.adj); pline_The("altar is stained with %s blood.", g.urace.adj);
levl[u.ux][u.uy].altarmask = AM_CHAOTIC; levl[u.ux][u.uy].altarmask = AM_CHAOTIC;
newsym(u.ux, u.uy); /* in case Invisible to self */
angry_priest(); angry_priest();
} else { } else {
struct monst *dmon; struct monst *dmon;
@@ -1640,15 +1641,16 @@ dosacrifice()
a_gname()); a_gname());
if (rn2(8 + u.ulevel) > 5) { if (rn2(8 + u.ulevel) > 5) {
struct monst *pri; struct monst *pri;
boolean shrine;
You_feel("the power of %s increase.", u_gname()); You_feel("the power of %s increase.", u_gname());
exercise(A_WIS, TRUE); exercise(A_WIS, TRUE);
change_luck(1); change_luck(1);
/* Yes, this is supposed to be &=, not |= */ shrine = on_shrine();
levl[u.ux][u.uy].altarmask &= AM_SHRINE; levl[u.ux][u.uy].altarmask = Align2amask(u.ualign.type);
/* the following accommodates stupid compilers */ if (shrine)
levl[u.ux][u.uy].altarmask = levl[u.ux][u.uy].altarmask |= AM_SHRINE;
levl[u.ux][u.uy].altarmask newsym(u.ux, u.uy); /* in case Invisible to self */
| (Align2amask(u.ualign.type));
if (!Blind) if (!Blind)
pline_The("altar glows %s.", pline_The("altar glows %s.",
hcolor((u.ualign.type == A_LAWFUL) hcolor((u.ualign.type == A_LAWFUL)
@@ -2075,6 +2077,24 @@ doturn()
return 1; return 1;
} }
int
altarmask_at(x, y)
int x, y;
{
int res = 0;
if (isok(x, y)) {
struct monst *mon = m_at(x, y);
if (mon && M_AP_TYPE(mon) == M_AP_FURNITURE
&& mon->mappearance == S_altar)
res = has_mcorpsenm(mon) ? MCORPSENM(mon) : 0;
else if (IS_ALTAR(levl[x][y].typ))
res = levl[x][y].altarmask;
}
return res;
}
const char * const char *
a_gname() a_gname()
{ {
+6 -3
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 questpgr.c $NHDT-Date: 1574634383 2019/11/24 22:26:23 $ $NHDT-Branch: paxed-quest-lua $:$NHDT-Revision: 1.63 $ */ /* NetHack 3.6 questpgr.c $NHDT-Date: 1575830005 2019/12/08 18:33:25 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.67 $ */
/* Copyright 1991, M. Stephenson */ /* Copyright 1991, M. Stephenson */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -489,7 +489,9 @@ const char *msgid;
nelems = (int) lua_tointeger(L, -1); nelems = (int) lua_tointeger(L, -1);
lua_pop(L, 1); lua_pop(L, 1);
if (nelems < 2) { if (nelems < 2) {
impossible("com_pager: questtext[%s][%s] in %s in not an array of strings", section, msgid, QTEXT_FILE); impossible(
"com_pager: questtext[%s][%s] in %s in not an array of strings",
section, msgid, QTEXT_FILE);
lua_close(L); lua_close(L);
return FALSE; return FALSE;
} }
@@ -511,12 +513,13 @@ const char *msgid;
if (synopsis) { if (synopsis) {
char in_line[BUFSZ], out_line[BUFSZ]; char in_line[BUFSZ], out_line[BUFSZ];
Strcpy(in_line, synopsis); Strcpy(in_line, synopsis);
convert_line(in_line, out_line); convert_line(in_line, out_line);
putmsghistory(out_line, FALSE); putmsghistory(out_line, FALSE);
free(synopsis);
} }
free(synopsis);
free(text); free(text);
lua_close(L); lua_close(L);
return TRUE; return TRUE;
+1 -91
View File
@@ -4,8 +4,6 @@
#include "hack.h" #include "hack.h"
#include "lev.h" #include "lev.h"
#include "sfproto.h"
/* /*
* This should really go into the level structure, but * This should really go into the level structure, but
@@ -641,64 +639,40 @@ NHFILE *nhfp;
bwrite(nhfp->fd, (genericptr_t) &g.moves, sizeof (g.moves)); /* timestamp */ bwrite(nhfp->fd, (genericptr_t) &g.moves, sizeof (g.moves)); /* timestamp */
bwrite(nhfp->fd, (genericptr_t) &g.n_regions, sizeof (g.n_regions)); bwrite(nhfp->fd, (genericptr_t) &g.n_regions, sizeof (g.n_regions));
} }
if (nhfp->fieldlevel) {
sfo_long(nhfp, &g.moves, "regions", "tmstamp", 1);
sfo_int(nhfp, &g.n_regions, "regions", "region_count", 1);
}
for (i = 0; i < g.n_regions; i++) { for (i = 0; i < g.n_regions; i++) {
if (nhfp->structlevel) { if (nhfp->structlevel) {
bwrite(nhfp->fd, (genericptr_t) &g.regions[i]->bounding_box, sizeof (NhRect)); bwrite(nhfp->fd, (genericptr_t) &g.regions[i]->bounding_box, sizeof (NhRect));
bwrite(nhfp->fd, (genericptr_t) &g.regions[i]->nrects, sizeof (short)); bwrite(nhfp->fd, (genericptr_t) &g.regions[i]->nrects, sizeof (short));
} }
if (nhfp->fieldlevel) {
sfo_nhrect(nhfp, &g.regions[i]->bounding_box, "g.regions", "bounding_box", 1);
sfo_short(nhfp, &g.regions[i]->nrects, "g.regions", "nrects", 1);
}
for (j = 0; j < g.regions[i]->nrects; j++) { for (j = 0; j < g.regions[i]->nrects; j++) {
if (nhfp->structlevel) if (nhfp->structlevel)
bwrite(nhfp->fd, (genericptr_t) &g.regions[i]->rects[j], sizeof (NhRect)); bwrite(nhfp->fd, (genericptr_t) &g.regions[i]->rects[j], sizeof (NhRect));
if (nhfp->fieldlevel)
sfo_nhrect(nhfp, &g.regions[i]->rects[j], "g.regions", "rect", 1);
} }
if (nhfp->structlevel) if (nhfp->structlevel)
bwrite(nhfp->fd, (genericptr_t) &g.regions[i]->attach_2_u, sizeof (boolean)); bwrite(nhfp->fd, (genericptr_t) &g.regions[i]->attach_2_u, sizeof (boolean));
if (nhfp->fieldlevel)
sfo_boolean(nhfp, &g.regions[i]->attach_2_u, "g.regions", "attach_2_u", 1);
n = 0; n = 0;
if (nhfp->structlevel) if (nhfp->structlevel)
bwrite(nhfp->fd, (genericptr_t) &g.regions[i]->attach_2_m, sizeof (unsigned)); bwrite(nhfp->fd, (genericptr_t) &g.regions[i]->attach_2_m, sizeof (unsigned));
if (nhfp->fieldlevel)
sfo_unsigned(nhfp, &g.regions[i]->attach_2_m, "g.regions", "attach_2_m", 1);
n = g.regions[i]->enter_msg != (const char *)0 ? n = g.regions[i]->enter_msg != (const char *)0 ?
strlen(g.regions[i]->enter_msg) : 0; strlen(g.regions[i]->enter_msg) : 0;
if (nhfp->structlevel) if (nhfp->structlevel)
bwrite(nhfp->fd, (genericptr_t) &n, sizeof n); bwrite(nhfp->fd, (genericptr_t) &n, sizeof n);
if (nhfp->fieldlevel)
sfo_unsigned(nhfp, &n, "g.regions", "enter_msg_length", 1);
if (n > 0) { if (n > 0) {
if (nhfp->structlevel) if (nhfp->structlevel)
bwrite(nhfp->fd, (genericptr_t) g.regions[i]->enter_msg, n); bwrite(nhfp->fd, (genericptr_t) g.regions[i]->enter_msg, n);
if (nhfp->fieldlevel)
sfo_char(nhfp, g.regions[i]->enter_msg, "g.regions", "enter_msg", 1);
} }
n = g.regions[i]->leave_msg != (const char *)0 ? n = g.regions[i]->leave_msg != (const char *)0 ?
strlen(g.regions[i]->leave_msg) : 0; strlen(g.regions[i]->leave_msg) : 0;
if (nhfp->structlevel) if (nhfp->structlevel)
bwrite(nhfp->fd, (genericptr_t) &n, sizeof n); bwrite(nhfp->fd, (genericptr_t) &n, sizeof n);
if (nhfp->fieldlevel)
sfo_unsigned(nhfp, &n, "g.regions", "leave_msg_length", 1);
if (n > 0) { if (n > 0) {
if (nhfp->structlevel) { if (nhfp->structlevel) {
bwrite(nhfp->fd, (genericptr_t) g.regions[i]->leave_msg, n); bwrite(nhfp->fd, (genericptr_t) g.regions[i]->leave_msg, n);
} }
if (nhfp->fieldlevel) {
for (j = 0; j < (int) n; ++j)
sfo_char(nhfp, &g.regions[i]->leave_msg[j], "g.regions", "leave_msg", 1);
}
} }
if (nhfp->structlevel) { if (nhfp->structlevel) {
bwrite(nhfp->fd, (genericptr_t) &g.regions[i]->ttl, sizeof (long)); bwrite(nhfp->fd, (genericptr_t) &g.regions[i]->ttl, sizeof (long));
@@ -711,34 +685,16 @@ NHFILE *nhfp;
bwrite(nhfp->fd, (genericptr_t) &g.regions[i]->player_flags, sizeof (unsigned int)); bwrite(nhfp->fd, (genericptr_t) &g.regions[i]->player_flags, sizeof (unsigned int));
bwrite(nhfp->fd, (genericptr_t) &g.regions[i]->n_monst, sizeof (short)); bwrite(nhfp->fd, (genericptr_t) &g.regions[i]->n_monst, sizeof (short));
} }
if (nhfp->fieldlevel) {
sfo_long(nhfp, &g.regions[i]->ttl, "g.regions", "ttl", 1);
sfo_short(nhfp, &g.regions[i]->expire_f, "g.regions", "expire_f", 1);
sfo_short(nhfp, &g.regions[i]->can_enter_f, "g.regions", "can_enter_f", 1);
sfo_short(nhfp, &g.regions[i]->enter_f, "g.regions", "enter_f", 1);
sfo_short(nhfp, &g.regions[i]->can_leave_f, "g.regions", "can_leave_f", 1);
sfo_short(nhfp, &g.regions[i]->leave_f, "g.regions", "leave_f", 1);
sfo_short(nhfp, &g.regions[i]->inside_f, "g.regions", "inside_f", 1);
sfo_unsigned(nhfp, &g.regions[i]->player_flags, "g.regions", "player_flags", 1);
sfo_short(nhfp, &g.regions[i]->n_monst, "g.regions", "monster_count", 1);
}
for (j = 0; j < g.regions[i]->n_monst; j++) { for (j = 0; j < g.regions[i]->n_monst; j++) {
if (nhfp->structlevel) if (nhfp->structlevel)
bwrite(nhfp->fd, (genericptr_t) &g.regions[i]->monsters[j], bwrite(nhfp->fd, (genericptr_t) &g.regions[i]->monsters[j],
sizeof (unsigned)); sizeof (unsigned));
if (nhfp->fieldlevel)
sfo_unsigned(nhfp, &g.regions[i]->monsters[j], "g.regions", "monster", 1);
} }
if (nhfp->structlevel) { if (nhfp->structlevel) {
bwrite(nhfp->fd, (genericptr_t) &g.regions[i]->visible, sizeof (boolean)); bwrite(nhfp->fd, (genericptr_t) &g.regions[i]->visible, sizeof (boolean));
bwrite(nhfp->fd, (genericptr_t) &g.regions[i]->glyph, sizeof (int)); bwrite(nhfp->fd, (genericptr_t) &g.regions[i]->glyph, sizeof (int));
bwrite(nhfp->fd, (genericptr_t) &g.regions[i]->arg, sizeof (anything)); bwrite(nhfp->fd, (genericptr_t) &g.regions[i]->arg, sizeof (anything));
} }
if (nhfp->fieldlevel) {
sfo_boolean(nhfp, &g.regions[i]->visible, "g.regions", "visible", 1);
sfo_int(nhfp, &g.regions[i]->glyph, "g.regions", "glyph", 1);
sfo_any(nhfp, &g.regions[i]->arg, "g.regions", "arg", 1);
}
} }
skip_lots: skip_lots:
@@ -759,8 +715,6 @@ boolean ghostly; /* If a bones file restore */
clear_regions(); /* Just for security */ clear_regions(); /* Just for security */
if (nhfp->structlevel) if (nhfp->structlevel)
mread(nhfp->fd, (genericptr_t) &tmstamp, sizeof (tmstamp)); mread(nhfp->fd, (genericptr_t) &tmstamp, sizeof (tmstamp));
if (nhfp->fieldlevel)
sfi_long(nhfp, &tmstamp, "regions", "tmstamp", 1);
if (ghostly) if (ghostly)
tmstamp = 0; tmstamp = 0;
else else
@@ -768,8 +722,6 @@ boolean ghostly; /* If a bones file restore */
if (nhfp->structlevel) if (nhfp->structlevel)
mread(nhfp->fd, (genericptr_t) &g.n_regions, sizeof (g.n_regions)); mread(nhfp->fd, (genericptr_t) &g.n_regions, sizeof (g.n_regions));
if (nhfp->fieldlevel)
sfi_int(nhfp, &g.n_regions, "regions", "region_count", 1);
g.max_regions = g.n_regions; g.max_regions = g.n_regions;
if (g.n_regions > 0) if (g.n_regions > 0)
@@ -780,41 +732,25 @@ boolean ghostly; /* If a bones file restore */
mread(nhfp->fd, (genericptr_t) &g.regions[i]->bounding_box, sizeof (NhRect)); mread(nhfp->fd, (genericptr_t) &g.regions[i]->bounding_box, sizeof (NhRect));
mread(nhfp->fd, (genericptr_t) &g.regions[i]->nrects, sizeof (short)); mread(nhfp->fd, (genericptr_t) &g.regions[i]->nrects, sizeof (short));
} }
if (nhfp->fieldlevel) {
sfi_nhrect(nhfp, &g.regions[i]->bounding_box, "g.regions", "bounding box", 1);
sfi_short(nhfp, &g.regions[i]->nrects, "g.regions", "nrects", 1);
}
if (g.regions[i]->nrects > 0) if (g.regions[i]->nrects > 0)
g.regions[i]->rects = (NhRect *) g.regions[i]->rects = (NhRect *)
alloc(sizeof (NhRect) * g.regions[i]->nrects); alloc(sizeof (NhRect) * g.regions[i]->nrects);
for (j = 0; j < g.regions[i]->nrects; j++) { for (j = 0; j < g.regions[i]->nrects; j++) {
if (nhfp->structlevel) if (nhfp->structlevel)
mread(nhfp->fd, (genericptr_t) &g.regions[i]->rects[j], sizeof (NhRect)); mread(nhfp->fd, (genericptr_t) &g.regions[i]->rects[j], sizeof (NhRect));
if (nhfp->fieldlevel)
sfi_nhrect(nhfp, &g.regions[i]->rects[j], "g.regions", "rect", 1);
} }
if (nhfp->structlevel) { if (nhfp->structlevel) {
mread(nhfp->fd, (genericptr_t) &g.regions[i]->attach_2_u, sizeof (boolean)); mread(nhfp->fd, (genericptr_t) &g.regions[i]->attach_2_u, sizeof (boolean));
mread(nhfp->fd, (genericptr_t) &g.regions[i]->attach_2_m, sizeof (unsigned)); mread(nhfp->fd, (genericptr_t) &g.regions[i]->attach_2_m, sizeof (unsigned));
} }
if (nhfp->fieldlevel) {
sfi_boolean(nhfp, &g.regions[i]->attach_2_u, "g.regions", "attach_2_u", 1);
sfi_unsigned(nhfp, &g.regions[i]->attach_2_m, "g.regions", "attach_2_m", 1);
}
if (nhfp->structlevel) if (nhfp->structlevel)
mread(nhfp->fd, (genericptr_t) &n, sizeof n); mread(nhfp->fd, (genericptr_t) &n, sizeof n);
if (nhfp->fieldlevel)
sfi_unsigned(nhfp, &n, "g.regions", "enter_msg_length", 1);
if (n > 0) { if (n > 0) {
msg_buf = (char *) alloc(n + 1); msg_buf = (char *) alloc(n + 1);
if (nhfp->structlevel) { if (nhfp->structlevel) {
mread(nhfp->fd, (genericptr_t) msg_buf, n); mread(nhfp->fd, (genericptr_t) msg_buf, n);
} }
if (nhfp->fieldlevel) {
for (j = 0; (unsigned) j < n; ++j)
sfi_char(nhfp, &msg_buf[j], "g.regions", "enter_msg", 1);
}
msg_buf[n] = '\0'; msg_buf[n] = '\0';
g.regions[i]->enter_msg = (const char *) msg_buf; g.regions[i]->enter_msg = (const char *) msg_buf;
} else } else
@@ -822,17 +758,11 @@ boolean ghostly; /* If a bones file restore */
if (nhfp->structlevel) if (nhfp->structlevel)
mread(nhfp->fd, (genericptr_t) &n, sizeof n); mread(nhfp->fd, (genericptr_t) &n, sizeof n);
if (nhfp->fieldlevel) if (n > 0) {
sfi_unsigned(nhfp, &n, "g.regions", "leave_msg_length", 1);
if (n > 0) {
msg_buf = (char *) alloc(n + 1); msg_buf = (char *) alloc(n + 1);
if (nhfp->structlevel) { if (nhfp->structlevel) {
mread(nhfp->fd, (genericptr_t) msg_buf, n); mread(nhfp->fd, (genericptr_t) msg_buf, n);
} }
if (nhfp->fieldlevel) {
for (j = 0; (unsigned) j < n; ++j)
sfi_char(nhfp, &msg_buf[j], "g.regions", "leave_msg", 1);
}
msg_buf[n] = '\0'; msg_buf[n] = '\0';
g.regions[i]->leave_msg = (const char *) msg_buf; g.regions[i]->leave_msg = (const char *) msg_buf;
} else } else
@@ -840,8 +770,6 @@ boolean ghostly; /* If a bones file restore */
if (nhfp->structlevel) if (nhfp->structlevel)
mread(nhfp->fd, (genericptr_t) &g.regions[i]->ttl, sizeof (long)); mread(nhfp->fd, (genericptr_t) &g.regions[i]->ttl, sizeof (long));
if (nhfp->fieldlevel)
sfi_long(nhfp, &g.regions[i]->ttl, "g.regions", "ttl", 1);
/* check for expired region */ /* check for expired region */
if (g.regions[i]->ttl >= 0L) if (g.regions[i]->ttl >= 0L)
g.regions[i]->ttl = g.regions[i]->ttl =
@@ -862,23 +790,12 @@ boolean ghostly; /* If a bones file restore */
mread(nhfp->fd, (genericptr_t) &g.regions[i]->player_flags, mread(nhfp->fd, (genericptr_t) &g.regions[i]->player_flags,
sizeof (unsigned int)); sizeof (unsigned int));
} }
if (nhfp->fieldlevel) {
sfi_short(nhfp, &g.regions[i]->expire_f, "g.regions", "expire_f", 1);
sfi_short(nhfp, &g.regions[i]->can_enter_f, "g.regions", "can_enter_f", 1);
sfi_short(nhfp, &g.regions[i]->enter_f, "g.regions", "enter_f", 1);
sfi_short(nhfp, &g.regions[i]->can_leave_f, "g.regions", "can_leave_f", 1);
sfi_short(nhfp, &g.regions[i]->leave_f, "g.regions", "leave_f", 1);
sfi_short(nhfp, &g.regions[i]->inside_f, "g.regions", "inside_f", 1);
sfi_unsigned(nhfp, &g.regions[i]->player_flags, "g.regions", "player_flags", 1);
}
if (ghostly) { /* settings pertained to old player */ if (ghostly) { /* settings pertained to old player */
clear_hero_inside(g.regions[i]); clear_hero_inside(g.regions[i]);
clear_heros_fault(g.regions[i]); clear_heros_fault(g.regions[i]);
} }
if (nhfp->structlevel) if (nhfp->structlevel)
mread(nhfp->fd, (genericptr_t) &g.regions[i]->n_monst, sizeof (short)); mread(nhfp->fd, (genericptr_t) &g.regions[i]->n_monst, sizeof (short));
if (nhfp->fieldlevel)
sfi_short(nhfp, &g.regions[i]->n_monst, "g.regions", "monster_count", 1);
if (g.regions[i]->n_monst > 0) if (g.regions[i]->n_monst > 0)
g.regions[i]->monsters = g.regions[i]->monsters =
(unsigned *) alloc(sizeof (unsigned) * g.regions[i]->n_monst); (unsigned *) alloc(sizeof (unsigned) * g.regions[i]->n_monst);
@@ -889,19 +806,12 @@ boolean ghostly; /* If a bones file restore */
if (nhfp->structlevel) if (nhfp->structlevel)
mread(nhfp->fd, (genericptr_t) &g.regions[i]->monsters[j], mread(nhfp->fd, (genericptr_t) &g.regions[i]->monsters[j],
sizeof (unsigned)); sizeof (unsigned));
if (nhfp->fieldlevel)
sfi_unsigned(nhfp, &g.regions[i]->monsters[j], "g.regions", "monster", 1);
} }
if (nhfp->structlevel) { if (nhfp->structlevel) {
mread(nhfp->fd, (genericptr_t) &g.regions[i]->visible, sizeof (boolean)); mread(nhfp->fd, (genericptr_t) &g.regions[i]->visible, sizeof (boolean));
mread(nhfp->fd, (genericptr_t) &g.regions[i]->glyph, sizeof (int)); mread(nhfp->fd, (genericptr_t) &g.regions[i]->glyph, sizeof (int));
mread(nhfp->fd, (genericptr_t) &g.regions[i]->arg, sizeof (anything)); mread(nhfp->fd, (genericptr_t) &g.regions[i]->arg, sizeof (anything));
} }
if (nhfp->fieldlevel) {
sfi_boolean(nhfp, &g.regions[i]->visible, "g.regions", "visible", 1);
sfi_int(nhfp, &g.regions[i]->glyph, "g.regions", "glyph", 1);
sfi_any(nhfp, &g.regions[i]->arg, "g.regions", "arg", 1);
}
} }
/* remove expired regions, do not trigger the expire_f callback (yet!); /* remove expired regions, do not trigger the expire_f callback (yet!);
also update monster lists if this data is coming from a bones file */ also update monster lists if this data is coming from a bones file */
-184
View File
@@ -6,9 +6,6 @@
#include "hack.h" #include "hack.h"
#include "lev.h" #include "lev.h"
#include "tcap.h" /* for TERMLIB and ASCIIGRAPH */ #include "tcap.h" /* for TERMLIB and ASCIIGRAPH */
#include "sfproto.h"
#if defined(MICRO) #if defined(MICRO)
extern int dotcnt; /* shared with save */ extern int dotcnt; /* shared with save */
@@ -128,15 +125,11 @@ NHFILE *nhfp;
g.sp_levchn = (s_level *) 0; g.sp_levchn = (s_level *) 0;
if (nhfp->structlevel) if (nhfp->structlevel)
mread(nhfp->fd, (genericptr_t) &cnt, sizeof(int)); mread(nhfp->fd, (genericptr_t) &cnt, sizeof(int));
if (nhfp->fieldlevel)
sfi_int(nhfp, &cnt, "levchn", "lev_count", 1);
for (; cnt > 0; cnt--) { for (; cnt > 0; cnt--) {
tmplev = (s_level *) alloc(sizeof(s_level)); tmplev = (s_level *) alloc(sizeof(s_level));
if (nhfp->structlevel) if (nhfp->structlevel)
mread(nhfp->fd, (genericptr_t) tmplev, sizeof(s_level)); mread(nhfp->fd, (genericptr_t) tmplev, sizeof(s_level));
if (nhfp->fieldlevel)
sfi_s_level(nhfp, tmplev, "levchn", "s_level", 1);
if (!g.sp_levchn) if (!g.sp_levchn)
g.sp_levchn = tmplev; g.sp_levchn = tmplev;
@@ -160,8 +153,6 @@ boolean ghostly;
if (nhfp->structlevel) if (nhfp->structlevel)
mread(nhfp->fd, (genericptr_t) &dmgcount, sizeof(dmgcount)); mread(nhfp->fd, (genericptr_t) &dmgcount, sizeof(dmgcount));
if (nhfp->fieldlevel)
sfi_unsigned(nhfp, &dmgcount, "damage", "damage_count", 1);
counter = (int) dmgcount; counter = (int) dmgcount;
if (!counter) if (!counter)
@@ -172,8 +163,6 @@ boolean ghostly;
if (nhfp->structlevel) if (nhfp->structlevel)
mread(nhfp->fd, (genericptr_t) tmp_dam, sizeof(*tmp_dam)); mread(nhfp->fd, (genericptr_t) tmp_dam, sizeof(*tmp_dam));
if (nhfp->fieldlevel)
sfi_damage(nhfp, tmp_dam, "damage", "damage", 1);
if (ghostly) if (ghostly)
tmp_dam->when += (g.monstermoves - g.omoves); tmp_dam->when += (g.monstermoves - g.omoves);
@@ -212,8 +201,6 @@ struct obj *otmp;
if (nhfp->structlevel) if (nhfp->structlevel)
mread(nhfp->fd, (genericptr_t) otmp, sizeof(struct obj)); mread(nhfp->fd, (genericptr_t) otmp, sizeof(struct obj));
if (nhfp->fieldlevel)
sfi_obj(nhfp, otmp, "obj", "obj", 1);
/* next object pointers are invalid; otmp->cobj needs to be left /* next object pointers are invalid; otmp->cobj needs to be left
as is--being non-null is key to restoring container contents */ as is--being non-null is key to restoring container contents */
@@ -225,22 +212,16 @@ struct obj *otmp;
/* oname - object's name */ /* oname - object's name */
if (nhfp->structlevel) if (nhfp->structlevel)
mread(nhfp->fd, (genericptr_t) &buflen, sizeof(buflen)); mread(nhfp->fd, (genericptr_t) &buflen, sizeof(buflen));
if (nhfp->fieldlevel)
sfi_int(nhfp, &buflen, "obj", "oname_length", 1);
if (buflen > 0) { /* includes terminating '\0' */ if (buflen > 0) { /* includes terminating '\0' */
new_oname(otmp, buflen); new_oname(otmp, buflen);
if (nhfp->structlevel) if (nhfp->structlevel)
mread(nhfp->fd, (genericptr_t) ONAME(otmp), buflen); mread(nhfp->fd, (genericptr_t) ONAME(otmp), buflen);
if (nhfp->fieldlevel)
sfi_str(nhfp, ONAME(otmp), "obj", "oname", buflen);
} }
/* omonst - corpse or statue might retain full monster details */ /* omonst - corpse or statue might retain full monster details */
if (nhfp->structlevel) if (nhfp->structlevel)
mread(nhfp->fd, (genericptr_t) &buflen, sizeof(buflen)); mread(nhfp->fd, (genericptr_t) &buflen, sizeof(buflen));
if (nhfp->fieldlevel)
sfi_int(nhfp, &buflen, "obj", "omonst_length", 1);
if (buflen > 0) { if (buflen > 0) {
newomonst(otmp); newomonst(otmp);
/* this is actually a monst struct, so we /* this is actually a monst struct, so we
@@ -251,42 +232,30 @@ struct obj *otmp;
/* omid - monster id number, connecting corpse to ghost */ /* omid - monster id number, connecting corpse to ghost */
if (nhfp->structlevel) if (nhfp->structlevel)
mread(nhfp->fd, (genericptr_t) &buflen, sizeof(buflen)); mread(nhfp->fd, (genericptr_t) &buflen, sizeof(buflen));
if (nhfp->fieldlevel)
sfi_int(nhfp, &buflen, "obj", "omid_length", 1);
if (buflen > 0) { if (buflen > 0) {
newomid(otmp); newomid(otmp);
if (nhfp->structlevel) if (nhfp->structlevel)
mread(nhfp->fd, (genericptr_t) OMID(otmp), buflen); mread(nhfp->fd, (genericptr_t) OMID(otmp), buflen);
if (nhfp->fieldlevel)
sfi_unsigned(nhfp, OMID(otmp), "obj", "omid", 1);
} }
/* olong - temporary gold */ /* olong - temporary gold */
if (nhfp->structlevel) if (nhfp->structlevel)
mread(nhfp->fd, (genericptr_t) &buflen, sizeof(buflen)); mread(nhfp->fd, (genericptr_t) &buflen, sizeof(buflen));
if (nhfp->fieldlevel)
sfi_int(nhfp, &buflen, "obj", "olong_length", 1);
if (buflen > 0) { if (buflen > 0) {
newolong(otmp); newolong(otmp);
if (nhfp->structlevel) if (nhfp->structlevel)
mread(nhfp->fd, (genericptr_t) OLONG(otmp), buflen); mread(nhfp->fd, (genericptr_t) OLONG(otmp), buflen);
if (nhfp->fieldlevel)
sfi_long(nhfp, OLONG(otmp), "obj", "olong", 1);
} }
/* omailcmd - feedback mechanism for scroll of mail */ /* omailcmd - feedback mechanism for scroll of mail */
if (nhfp->structlevel) if (nhfp->structlevel)
mread(nhfp->fd, (genericptr_t) &buflen, sizeof(buflen)); mread(nhfp->fd, (genericptr_t) &buflen, sizeof(buflen));
if (nhfp->fieldlevel)
sfi_int(nhfp, &buflen, "obj", "omailcmd_length", 1);
if (buflen > 0) { if (buflen > 0) {
char *omailcmd = (char *) alloc(buflen); char *omailcmd = (char *) alloc(buflen);
if (nhfp->structlevel) if (nhfp->structlevel)
mread(nhfp->fd, (genericptr_t) omailcmd, buflen); mread(nhfp->fd, (genericptr_t) omailcmd, buflen);
if (nhfp->fieldlevel)
sfi_str(nhfp, omailcmd, "obj", "omailcmd", buflen);
new_omailcmd(otmp, omailcmd); new_omailcmd(otmp, omailcmd);
free((genericptr_t) omailcmd); free((genericptr_t) omailcmd);
} }
@@ -305,8 +274,6 @@ boolean ghostly, frozen;
while (1) { while (1) {
if (nhfp->structlevel) if (nhfp->structlevel)
mread(nhfp->fd, (genericptr_t) &buflen, sizeof buflen); mread(nhfp->fd, (genericptr_t) &buflen, sizeof buflen);
if (nhfp->fieldlevel)
sfi_int(nhfp, &buflen, "obj", "obj_length", 1);
if (buflen == -1) if (buflen == -1)
break; break;
@@ -393,8 +360,6 @@ struct monst *mtmp;
if (nhfp->structlevel) if (nhfp->structlevel)
mread(nhfp->fd, (genericptr_t) mtmp, sizeof(struct monst)); mread(nhfp->fd, (genericptr_t) mtmp, sizeof(struct monst));
if (nhfp->fieldlevel)
sfi_monst(nhfp, mtmp, "mon", "monst_length", 1);
/* next monster pointer is invalid */ /* next monster pointer is invalid */
mtmp->nmon = (struct monst *) 0; mtmp->nmon = (struct monst *) 0;
@@ -405,82 +370,56 @@ struct monst *mtmp;
/* mname - monster's name */ /* mname - monster's name */
if (nhfp->structlevel) if (nhfp->structlevel)
mread(nhfp->fd, (genericptr_t) &buflen, sizeof(buflen)); mread(nhfp->fd, (genericptr_t) &buflen, sizeof(buflen));
if (nhfp->fieldlevel)
sfi_int(nhfp, &buflen, "mon", "mname_length", 1);
if (buflen > 0) { /* includes terminating '\0' */ if (buflen > 0) { /* includes terminating '\0' */
new_mname(mtmp, buflen); new_mname(mtmp, buflen);
if (nhfp->structlevel) if (nhfp->structlevel)
mread(nhfp->fd, (genericptr_t) MNAME(mtmp), buflen); mread(nhfp->fd, (genericptr_t) MNAME(mtmp), buflen);
if (nhfp->fieldlevel)
sfi_str(nhfp, MNAME(mtmp), "mon", "mname", buflen);
} }
/* egd - vault guard */ /* egd - vault guard */
if (nhfp->structlevel) if (nhfp->structlevel)
mread(nhfp->fd, (genericptr_t) &buflen, sizeof(buflen)); mread(nhfp->fd, (genericptr_t) &buflen, sizeof(buflen));
if (nhfp->fieldlevel)
sfi_int(nhfp, &buflen, "mon", "egd_length", 1);
if (buflen > 0) { if (buflen > 0) {
newegd(mtmp); newegd(mtmp);
if (nhfp->structlevel) if (nhfp->structlevel)
mread(nhfp->fd, (genericptr_t) EGD(mtmp), sizeof(struct egd)); mread(nhfp->fd, (genericptr_t) EGD(mtmp), sizeof(struct egd));
if (nhfp->fieldlevel)
sfi_egd(nhfp, EGD(mtmp), "mon", "egd", 1);
} }
/* epri - temple priest */ /* epri - temple priest */
if (nhfp->structlevel) if (nhfp->structlevel)
mread(nhfp->fd, (genericptr_t) &buflen, sizeof(buflen)); mread(nhfp->fd, (genericptr_t) &buflen, sizeof(buflen));
if (nhfp->fieldlevel)
sfi_int(nhfp, &buflen, "mon", "epri_length", 1);
if (buflen > 0) { if (buflen > 0) {
newepri(mtmp); newepri(mtmp);
if (nhfp->structlevel) if (nhfp->structlevel)
mread(nhfp->fd, (genericptr_t) EPRI(mtmp), sizeof(struct epri)); mread(nhfp->fd, (genericptr_t) EPRI(mtmp), sizeof(struct epri));
if (nhfp->fieldlevel)
sfi_epri(nhfp, EPRI(mtmp), "mon", "epri", 1);
} }
/* eshk - shopkeeper */ /* eshk - shopkeeper */
if (nhfp->structlevel) if (nhfp->structlevel)
mread(nhfp->fd, (genericptr_t) &buflen, sizeof(buflen)); mread(nhfp->fd, (genericptr_t) &buflen, sizeof(buflen));
if (nhfp->fieldlevel)
sfi_int(nhfp, &buflen, "mon", "eshk_length", 1);
if (buflen > 0) { if (buflen > 0) {
neweshk(mtmp); neweshk(mtmp);
if (nhfp->structlevel) if (nhfp->structlevel)
mread(nhfp->fd, (genericptr_t) ESHK(mtmp), sizeof(struct eshk)); mread(nhfp->fd, (genericptr_t) ESHK(mtmp), sizeof(struct eshk));
if (nhfp->fieldlevel)
sfi_eshk(nhfp, ESHK(mtmp), "mon", "eshk", 1);
} }
/* emin - minion */ /* emin - minion */
if (nhfp->structlevel) if (nhfp->structlevel)
mread(nhfp->fd, (genericptr_t) &buflen, sizeof(buflen)); mread(nhfp->fd, (genericptr_t) &buflen, sizeof(buflen));
if (nhfp->fieldlevel)
sfi_int(nhfp, &buflen, "mon", "emin_length", 1);
if (buflen > 0) { if (buflen > 0) {
newemin(mtmp); newemin(mtmp);
if (nhfp->structlevel) if (nhfp->structlevel)
mread(nhfp->fd, (genericptr_t) EMIN(mtmp), sizeof(struct emin)); mread(nhfp->fd, (genericptr_t) EMIN(mtmp), sizeof(struct emin));
if (nhfp->fieldlevel)
sfi_emin(nhfp, EMIN(mtmp), "mon", "emin", 1);
} }
/* edog - pet */ /* edog - pet */
if (nhfp->structlevel) if (nhfp->structlevel)
mread(nhfp->fd, (genericptr_t) &buflen, sizeof(buflen)); mread(nhfp->fd, (genericptr_t) &buflen, sizeof(buflen));
if (nhfp->fieldlevel)
sfi_int(nhfp, &buflen, "mon", "edog_length", 1);
if (buflen > 0) { if (buflen > 0) {
newedog(mtmp); newedog(mtmp);
if (nhfp->structlevel) if (nhfp->structlevel)
mread(nhfp->fd, (genericptr_t) EDOG(mtmp), sizeof(struct edog)); mread(nhfp->fd, (genericptr_t) EDOG(mtmp), sizeof(struct edog));
if (nhfp->fieldlevel)
sfi_edog(nhfp, EDOG(mtmp), "mon", "edog", 1);
} }
/* mcorpsenm - obj->corpsenm for mimic posing as corpse or /* mcorpsenm - obj->corpsenm for mimic posing as corpse or
statue (inline int rather than pointer to something) */ statue (inline int rather than pointer to something) */
if (nhfp->structlevel) if (nhfp->structlevel)
mread(nhfp->fd, (genericptr_t) &MCORPSENM(mtmp), sizeof MCORPSENM(mtmp)); mread(nhfp->fd, (genericptr_t) &MCORPSENM(mtmp), sizeof MCORPSENM(mtmp));
if (nhfp->fieldlevel)
sfi_int(nhfp, &MCORPSENM(mtmp), "mon", "mcorpsenm", 1);
} /* mextra */ } /* mextra */
} }
@@ -496,8 +435,6 @@ boolean ghostly;
while (1) { while (1) {
if (nhfp->structlevel) if (nhfp->structlevel)
mread(nhfp->fd, (genericptr_t) &buflen, sizeof(buflen)); mread(nhfp->fd, (genericptr_t) &buflen, sizeof(buflen));
if (nhfp->fieldlevel)
sfi_int(nhfp, &buflen, "mon", "monst_length", 1);
if (buflen == -1) if (buflen == -1)
break; break;
@@ -572,8 +509,6 @@ NHFILE *nhfp;
fnext = newfruit(); fnext = newfruit();
if (nhfp->structlevel) if (nhfp->structlevel)
mread(nhfp->fd, (genericptr_t)fnext, sizeof *fnext); mread(nhfp->fd, (genericptr_t)fnext, sizeof *fnext);
if (nhfp->fieldlevel)
sfi_fruit(nhfp, fnext, "fruit", "fruit", 1);
if (fnext->fid != 0) { if (fnext->fid != 0) {
fnext->nextf = flist; fnext->nextf = flist;
flist = fnext; flist = fnext;
@@ -636,13 +571,8 @@ unsigned int *stuckid, *steedid;
unsigned long uid = 0; unsigned long uid = 0;
boolean defer_perm_invent; boolean defer_perm_invent;
if (nhfp->fieldlevel && nhfp->addinfo)
sfi_addinfo(nhfp, "gamestate", "start", "", 0);
if (nhfp->structlevel) if (nhfp->structlevel)
mread(nhfp->fd, (genericptr_t) &uid, sizeof uid); mread(nhfp->fd, (genericptr_t) &uid, sizeof uid);
if (nhfp->fieldlevel)
sfi_ulong(nhfp, &uid, "gamestate", "uid", 1);
if (SYSOPT_CHECK_SAVE_UID if (SYSOPT_CHECK_SAVE_UID
&& uid != (unsigned long) getuid()) { /* strange ... */ && uid != (unsigned long) getuid()) { /* strange ... */
@@ -656,8 +586,6 @@ unsigned int *stuckid, *steedid;
newgamecontext = g.context; /* copy statically init'd context */ newgamecontext = g.context; /* copy statically init'd context */
if (nhfp->structlevel) if (nhfp->structlevel)
mread(nhfp->fd, (genericptr_t) &g.context, sizeof (struct context_info)); mread(nhfp->fd, (genericptr_t) &g.context, sizeof (struct context_info));
if (nhfp->fieldlevel)
sfi_context_info(nhfp, &g.context, "gamestate", "g.context", 1);
g.context.warntype.species = (g.context.warntype.speciesidx >= LOW_PM) g.context.warntype.species = (g.context.warntype.speciesidx >= LOW_PM)
? &mons[g.context.warntype.speciesidx] ? &mons[g.context.warntype.speciesidx]
: (struct permonst *) 0; : (struct permonst *) 0;
@@ -671,8 +599,6 @@ unsigned int *stuckid, *steedid;
newgameflags = flags; newgameflags = flags;
if (nhfp->structlevel) if (nhfp->structlevel)
mread(nhfp->fd, (genericptr_t) &flags, sizeof (struct flag)); mread(nhfp->fd, (genericptr_t) &flags, sizeof (struct flag));
if (nhfp->fieldlevel)
sfi_flag(nhfp, &flags, "gamestate", "flags", 1);
/* avoid keeping permanent inventory window up to date during restore /* avoid keeping permanent inventory window up to date during restore
(setworn() calls update_inventory); attempting to include the cost (setworn() calls update_inventory); attempting to include the cost
@@ -699,9 +625,6 @@ unsigned int *stuckid, *steedid;
newgamesysflags = sysflags; newgamesysflags = sysflags;
if (nhfp->structlevel) if (nhfp->structlevel)
mread(nhfp->fd, (genericptr_t) &sysflags, sizeof(struct sysflag)); mread(nhfp->fd, (genericptr_t) &sysflags, sizeof(struct sysflag));
if (nhfp->fieldlevel)
sfi_sysflag(nhfp, &sysflags, "gamestate", "sysflags", 1);
mread(fd, (genericptr_t) &sysflags, sizeof(struct sysflag));
#endif #endif
role_init(); /* Reset the initial role, race, gender, and alignment */ role_init(); /* Reset the initial role, race, gender, and alignment */
@@ -710,25 +633,17 @@ unsigned int *stuckid, *steedid;
#endif #endif
if (nhfp->structlevel) if (nhfp->structlevel)
mread(nhfp->fd, (genericptr_t) &u, sizeof(struct you)); mread(nhfp->fd, (genericptr_t) &u, sizeof(struct you));
if (nhfp->fieldlevel)
sfi_you(nhfp, &u, "gamestate", "you", 1);
g.youmonst.cham = u.mcham; g.youmonst.cham = u.mcham;
if (nhfp->structlevel) if (nhfp->structlevel)
mread(nhfp->fd, (genericptr_t) timebuf, 14); mread(nhfp->fd, (genericptr_t) timebuf, 14);
if (nhfp->fieldlevel)
sfi_str(nhfp, timebuf, "gamestate", "ubirthday", 14);
timebuf[14] = '\0'; timebuf[14] = '\0';
ubirthday = time_from_yyyymmddhhmmss(timebuf); ubirthday = time_from_yyyymmddhhmmss(timebuf);
if (nhfp->structlevel) if (nhfp->structlevel)
mread(nhfp->fd, &urealtime.realtime, sizeof urealtime.realtime); mread(nhfp->fd, &urealtime.realtime, sizeof urealtime.realtime);
if (nhfp->fieldlevel)
sfi_long(nhfp, &urealtime.realtime, "gamestate", "realtime", 1);
if (nhfp->structlevel) if (nhfp->structlevel)
mread(nhfp->fd, (genericptr_t) timebuf, 14); mread(nhfp->fd, (genericptr_t) timebuf, 14);
if (nhfp->fieldlevel)
sfi_str(nhfp, timebuf, "gamestate", "start_timing", 14);
timebuf[14] = '\0'; timebuf[14] = '\0';
urealtime.start_timing = time_from_yyyymmddhhmmss(timebuf); urealtime.start_timing = time_from_yyyymmddhhmmss(timebuf);
@@ -767,8 +682,6 @@ unsigned int *stuckid, *steedid;
restore_timers(nhfp, RANGE_GLOBAL, FALSE, 0L); restore_timers(nhfp, RANGE_GLOBAL, FALSE, 0L);
restore_light_sources(nhfp); restore_light_sources(nhfp);
if (nhfp->fieldlevel && nhfp->addinfo)
sfi_addinfo(nhfp, "objchain", "start", "invent", 0);
g.invent = restobjchn(nhfp, FALSE, FALSE); g.invent = restobjchn(nhfp, FALSE, FALSE);
/* restore dangling (not on floor or in inventory) ball and/or chain */ /* restore dangling (not on floor or in inventory) ball and/or chain */
@@ -787,12 +700,6 @@ unsigned int *stuckid, *steedid;
if (nhfp->structlevel) { if (nhfp->structlevel) {
mread(nhfp->fd, (genericptr_t) g.mvitals, sizeof g.mvitals); mread(nhfp->fd, (genericptr_t) g.mvitals, sizeof g.mvitals);
} }
if (nhfp->fieldlevel) {
int i;
for (i = 0; i < NUMMONS; ++i)
sfi_mvitals(nhfp, &g.mvitals[i], "gamestate", "g.mvitals", 1);
}
/* /*
* There are some things after this that can have unintended display * There are some things after this that can have unintended display
@@ -824,41 +731,20 @@ unsigned int *stuckid, *steedid;
mread(nhfp->fd, (genericptr_t) &g.quest_status, sizeof (struct q_score)); mread(nhfp->fd, (genericptr_t) &g.quest_status, sizeof (struct q_score));
mread(nhfp->fd, (genericptr_t) g.spl_book, (MAXSPELL + 1) * sizeof (struct spell)); mread(nhfp->fd, (genericptr_t) g.spl_book, (MAXSPELL + 1) * sizeof (struct spell));
} }
if (nhfp->fieldlevel) {
int i;
struct spell *sptmp;
sfi_long(nhfp, &g.moves, "gamestate", "g.moves", 1);
sfi_long(nhfp, &g.monstermoves, "gamestate", "g.monstermoves", 1);
sfi_q_score(nhfp, &g.quest_status, "gamestate", "g.quest_status", 1);
sptmp = g.spl_book;
for (i = 0; i < (MAXSPELL + 1); ++i)
sfi_spell(nhfp, sptmp++, "gamestate", "g.spl_book", 1);
}
restore_artifacts(nhfp); restore_artifacts(nhfp);
restore_oracles(nhfp); restore_oracles(nhfp);
if (u.ustuck) { if (u.ustuck) {
if (nhfp->structlevel) if (nhfp->structlevel)
mread(nhfp->fd, (genericptr_t) stuckid, sizeof *stuckid); mread(nhfp->fd, (genericptr_t) stuckid, sizeof *stuckid);
if (nhfp->fieldlevel)
sfi_unsigned(nhfp, stuckid, "gamestate", "ustuck_id", 1);
} }
if (u.usteed) { if (u.usteed) {
if (nhfp->structlevel) if (nhfp->structlevel)
mread(nhfp->fd, (genericptr_t) steedid, sizeof *steedid); mread(nhfp->fd, (genericptr_t) steedid, sizeof *steedid);
if (nhfp->fieldlevel)
sfi_unsigned(nhfp, steedid, "gamestate", "usteed_id", 1);
} }
if (nhfp->structlevel) { if (nhfp->structlevel) {
mread(nhfp->fd, (genericptr_t) g.pl_character, sizeof g.pl_character); mread(nhfp->fd, (genericptr_t) g.pl_character, sizeof g.pl_character);
mread(nhfp->fd, (genericptr_t) g.pl_fruit, sizeof g.pl_fruit); mread(nhfp->fd, (genericptr_t) g.pl_fruit, sizeof g.pl_fruit);
} }
if (nhfp->fieldlevel) {
sfi_char(nhfp, g.pl_character, "gamestate", "g.pl_character",
sizeof g.pl_character);
sfi_char(nhfp, g.pl_fruit, "gamestate", "g.pl_fruit",
sizeof g.pl_fruit);
}
freefruitchn(g.ffruit); /* clean up fruit(s) made by initoptions() */ freefruitchn(g.ffruit); /* clean up fruit(s) made by initoptions() */
g.ffruit = loadfruitchn(nhfp); g.ffruit = loadfruitchn(nhfp);
@@ -1039,11 +925,6 @@ NHFILE *nhfp;
if (restoreinfo.mread_flags == -1) if (restoreinfo.mread_flags == -1)
break; break;
} }
if (nhfp->fieldlevel) {
sfi_xchar(nhfp, &ltmp, "gamestate", "level_number", 1);
if (nhfp->eof)
break;
}
getlev(nhfp, 0, ltmp, FALSE); getlev(nhfp, 0, ltmp, FALSE);
#ifdef MICRO #ifdef MICRO
curs(WIN_MAP, 1 + dotcnt++, dotrow); curs(WIN_MAP, 1 + dotcnt++, dotrow);
@@ -1061,9 +942,6 @@ NHFILE *nhfp;
return rtmp; /* dorecover called recursively */ return rtmp; /* dorecover called recursively */
} }
restoreinfo.mread_flags = 0; restoreinfo.mread_flags = 0;
if (nhfp->fieldlevel && nhfp->addinfo)
sfi_addinfo(nhfp, "NetHack", "end", "savefile", 0);
rewind_nhfile(nhfp); /* return to beginning of file */ rewind_nhfile(nhfp); /* return to beginning of file */
(void) validate(nhfp, (char *) 0); (void) validate(nhfp, (char *) 0);
get_plname_from_file(nhfp, g.plname); get_plname_from_file(nhfp, g.plname);
@@ -1130,16 +1008,12 @@ struct cemetery **cemeteryaddr;
if (nhfp->structlevel) if (nhfp->structlevel)
mread(nhfp->fd, (genericptr_t) &cflag, sizeof cflag); mread(nhfp->fd, (genericptr_t) &cflag, sizeof cflag);
if (nhfp->fieldlevel)
sfi_int(nhfp, &cflag, "cemetery", "cemetery_flag", 1);
if (cflag == 0) { if (cflag == 0) {
bonesaddr = cemeteryaddr; bonesaddr = cemeteryaddr;
do { do {
bonesinfo = (struct cemetery *) alloc(sizeof *bonesinfo); bonesinfo = (struct cemetery *) alloc(sizeof *bonesinfo);
if (nhfp->structlevel) if (nhfp->structlevel)
mread(nhfp->fd, (genericptr_t) bonesinfo, sizeof *bonesinfo); mread(nhfp->fd, (genericptr_t) bonesinfo, sizeof *bonesinfo);
if (nhfp->fieldlevel)
sfi_cemetery(nhfp, bonesinfo, "bones", "bonesinfo", 1);
*bonesaddr = bonesinfo; *bonesaddr = bonesinfo;
bonesaddr = &(*bonesaddr)->next; bonesaddr = &(*bonesaddr)->next;
} while (*bonesaddr); } while (*bonesaddr);
@@ -1175,10 +1049,6 @@ boolean rlecomp;
mread(nhfp->fd, (genericptr_t) &len, sizeof(uchar)); mread(nhfp->fd, (genericptr_t) &len, sizeof(uchar));
mread(nhfp->fd, (genericptr_t) &r, sizeof(struct rm)); mread(nhfp->fd, (genericptr_t) &r, sizeof(struct rm));
} }
if (nhfp->fieldlevel) {
sfi_uchar(nhfp, &len, "room", "levl", 1);
sfi_rm(nhfp, &r, "room", "rm", 1);
}
} }
} }
j = 0; j = 0;
@@ -1192,13 +1062,6 @@ boolean rlecomp;
if (nhfp->structlevel) { if (nhfp->structlevel) {
mread(nhfp->fd, (genericptr_t) levl, sizeof levl); mread(nhfp->fd, (genericptr_t) levl, sizeof levl);
} }
if (nhfp->fieldlevel) {
int c, r;
for (c = 0; c < COLNO; ++c)
for (r = 0; r < ROWNO; ++r)
sfi_rm(nhfp, &levl[c][r], "room", "levl", 1);
}
} }
void void
@@ -1246,21 +1109,15 @@ boolean ghostly;
/* First some sanity checks */ /* First some sanity checks */
if (nhfp->structlevel) if (nhfp->structlevel)
mread(nhfp->fd, (genericptr_t) &hpid, sizeof(hpid)); mread(nhfp->fd, (genericptr_t) &hpid, sizeof(hpid));
if (nhfp->fieldlevel)
sfi_int(nhfp, &hpid, "gamestate", "g.hackpid", 1);
/* CHECK: This may prevent restoration */ /* CHECK: This may prevent restoration */
#ifdef TOS #ifdef TOS
if (nhfp->structlevel) if (nhfp->structlevel)
mread(nhfp->fd, (genericptr_t) &tlev, sizeof(tlev)); mread(nhfp->fd, (genericptr_t) &tlev, sizeof(tlev));
if (nhfp->fieldlevel)
sfi_short(nhfp, &tlev, "gamestate", "tlev", 1);
dlvl = tlev & 0x00ff; dlvl = tlev & 0x00ff;
#else #else
if (nhfp->structlevel) if (nhfp->structlevel)
mread(nhfp->fd, (genericptr_t) &dlvl, sizeof(dlvl)); mread(nhfp->fd, (genericptr_t) &dlvl, sizeof(dlvl));
if (nhfp->fieldlevel)
sfi_xchar(nhfp, &dlvl, "gamestate", "dlvl", 1);
#endif #endif
if ((pid && pid != hpid) || (lev && dlvl != lev)) { if ((pid && pid != hpid) || (lev && dlvl != lev)) {
char trickbuf[BUFSZ]; char trickbuf[BUFSZ];
@@ -1281,16 +1138,6 @@ boolean ghostly;
mread(nhfp->fd, (genericptr_t) g.lastseentyp, sizeof(g.lastseentyp)); mread(nhfp->fd, (genericptr_t) g.lastseentyp, sizeof(g.lastseentyp));
mread(nhfp->fd, (genericptr_t) &g.omoves, sizeof(g.omoves)); mread(nhfp->fd, (genericptr_t) &g.omoves, sizeof(g.omoves));
} }
if (nhfp->fieldlevel) {
int c, r;
for (c = 0; c < COLNO; ++c)
for (r = 0; r < ROWNO; ++r)
sfi_schar(nhfp, &g.lastseentyp[c][r],
"lev", "g.lastseentyp", 1);
sfi_long(nhfp, &g.omoves, "lev", "timestmp", 1);
}
elapsed = g.monstermoves - g.omoves; elapsed = g.monstermoves - g.omoves;
if (nhfp->structlevel) { if (nhfp->structlevel) {
@@ -1304,20 +1151,6 @@ boolean ghostly;
mread(nhfp->fd, (genericptr_t)&g.level.flags, sizeof(g.level.flags)); mread(nhfp->fd, (genericptr_t)&g.level.flags, sizeof(g.level.flags));
mread(nhfp->fd, (genericptr_t)g.doors, sizeof(g.doors)); mread(nhfp->fd, (genericptr_t)g.doors, sizeof(g.doors));
} }
if (nhfp->fieldlevel) {
int i;
sfi_stairway(nhfp, &g.upstair, "lev", "g.upstair", 1);
sfi_stairway(nhfp, &g.dnstair, "lev", "g.dnstair", 1);
sfi_stairway(nhfp, &g.upladder, "lev", "g.upladder", 1);
sfi_stairway(nhfp, &g.dnladder, "lev", "g.dnladder", 1);
sfi_stairway(nhfp, &g.sstairs, "lev", "g.sstairs", 1);
sfi_dest_area(nhfp, &g.updest, "lev", "g.updest", 1);
sfi_dest_area(nhfp, &g.dndest, "lev", "g.dndest", 1);
sfi_levelflags(nhfp, &g.level.flags, "lev", "g.level.flags", 1);
for (i = 0; i < DOORMAX; ++i)
sfi_nhcoord(nhfp, &g.doors[i], "lev", "g.doors", 1);
}
rest_rooms(nhfp); /* No joke :-) */ rest_rooms(nhfp); /* No joke :-) */
if (g.nroom) if (g.nroom)
g.doorindex = g.rooms[g.nroom - 1].fdoor + g.rooms[g.nroom - 1].doorct; g.doorindex = g.rooms[g.nroom - 1].fdoor + g.rooms[g.nroom - 1].doorct;
@@ -1336,8 +1169,6 @@ boolean ghostly;
trap = newtrap(); trap = newtrap();
if (nhfp->structlevel) if (nhfp->structlevel)
mread(nhfp->fd, (genericptr_t)trap, sizeof(struct trap)); mread(nhfp->fd, (genericptr_t)trap, sizeof(struct trap));
if (nhfp->fieldlevel)
sfi_trap(nhfp, trap, "trap", "trap", 1);
if (trap->tx != 0) { if (trap->tx != 0) {
trap->ntrap = g.ftrap; trap->ntrap = g.ftrap;
g.ftrap = trap; g.ftrap = trap;
@@ -1461,10 +1292,6 @@ char *plbuf;
(void) read(nhfp->fd, (genericptr_t) &pltmpsiz, sizeof(pltmpsiz)); (void) read(nhfp->fd, (genericptr_t) &pltmpsiz, sizeof(pltmpsiz));
(void) read(nhfp->fd, (genericptr_t) plbuf, pltmpsiz); (void) read(nhfp->fd, (genericptr_t) plbuf, pltmpsiz);
} }
if (nhfp->fieldlevel) {
sfi_int(nhfp, &pltmpsiz, "plname", "plname_size", 1);
sfi_str(nhfp, plbuf, "plname", "g.plname", pltmpsiz);
}
return; return;
} }
@@ -1478,16 +1305,12 @@ NHFILE *nhfp;
while (1) { while (1) {
if (nhfp->structlevel) if (nhfp->structlevel)
mread(nhfp->fd, (genericptr_t) &msgsize, sizeof(msgsize)); mread(nhfp->fd, (genericptr_t) &msgsize, sizeof(msgsize));
if (nhfp->fieldlevel)
sfi_int(nhfp, &msgsize, "msghistory", "msghistory_length", 1);
if (msgsize == -1) if (msgsize == -1)
break; break;
if (msgsize > (BUFSZ - 1)) if (msgsize > (BUFSZ - 1))
panic("restore_msghistory: msg too big (%d)", msgsize); panic("restore_msghistory: msg too big (%d)", msgsize);
if (nhfp->structlevel) if (nhfp->structlevel)
mread(nhfp->fd, (genericptr_t) msg, msgsize); mread(nhfp->fd, (genericptr_t) msg, msgsize);
if (nhfp->fieldlevel)
sfi_str(nhfp, msg, "msghistory", "msg", msgsize);
msg[msgsize] = '\0'; msg[msgsize] = '\0';
putmsghistory(msg, TRUE); putmsghistory(msg, TRUE);
++msgcount; ++msgcount;
@@ -1671,21 +1494,14 @@ const char *name;
if (nhfp->structlevel) if (nhfp->structlevel)
utdflags |= UTD_CHECKSIZES; utdflags |= UTD_CHECKSIZES;
if (nhfp->fieldlevel)
utdflags |= UTD_CHECKFIELDCOUNTS |
UTD_SKIP_SANITY1 | UTD_SKIP_SAVEFILEINFO;
if (!(reslt = uptodate(nhfp, name, utdflags))) return 1; if (!(reslt = uptodate(nhfp, name, utdflags))) return 1;
if ((nhfp->mode & WRITING) == 0) { if ((nhfp->mode & WRITING) == 0) {
if (nhfp->structlevel) if (nhfp->structlevel)
rlen = read(nhfp->fd, (genericptr_t) &sfi, sizeof sfi); rlen = read(nhfp->fd, (genericptr_t) &sfi, sizeof sfi);
if (nhfp->fieldlevel)
sfi_savefile_info(nhfp, &sfi, "savefileinfo", "savefile_info", 1);
} else { } else {
if (nhfp->structlevel) if (nhfp->structlevel)
rlen = read(nhfp->fd, (genericptr_t) &sfi, sizeof sfi); rlen = read(nhfp->fd, (genericptr_t) &sfi, sizeof sfi);
if (nhfp->fieldlevel)
sfi_savefile_info(nhfp, &sfi, "savefileinfo", "savefile_info", 1);
minit(); /* ZEROCOMP */ minit(); /* ZEROCOMP */
if (rlen == 0) { if (rlen == 0) {
if (verbose) { if (verbose) {
-14
View File
@@ -6,8 +6,6 @@
#include "hack.h" #include "hack.h"
#include "lev.h" #include "lev.h"
#include "dlb.h" #include "dlb.h"
#include "sfproto.h"
/* [note: this comment is fairly old, but still accurate for 3.1] /* [note: this comment is fairly old, but still accurate for 3.1]
* Rumors have been entirely rewritten to speed up the access. This is * Rumors have been entirely rewritten to speed up the access. This is
@@ -393,16 +391,10 @@ NHFILE *nhfp;
if (perform_bwrite(nhfp)) { if (perform_bwrite(nhfp)) {
if (nhfp->structlevel) if (nhfp->structlevel)
bwrite(nhfp->fd, (genericptr_t) &g.oracle_cnt, sizeof g.oracle_cnt); bwrite(nhfp->fd, (genericptr_t) &g.oracle_cnt, sizeof g.oracle_cnt);
if (nhfp->fieldlevel)
sfo_unsigned(nhfp, &g.oracle_cnt, "oracles", "g.oracle_cnt", 1);
if (g.oracle_cnt) { if (g.oracle_cnt) {
if (nhfp->structlevel) { if (nhfp->structlevel) {
bwrite(nhfp->fd, (genericptr_t)g.oracle_loc, g.oracle_cnt * sizeof (long)); bwrite(nhfp->fd, (genericptr_t)g.oracle_loc, g.oracle_cnt * sizeof (long));
} }
if (nhfp->fieldlevel) {
for (i = 0; (unsigned) i < g.oracle_cnt; ++i)
sfo_ulong(nhfp, &g.oracle_loc[i], "oracles", "oracle loc", 1);
}
} }
} }
if (release_data(nhfp)) { if (release_data(nhfp)) {
@@ -420,18 +412,12 @@ NHFILE *nhfp;
int i; int i;
if (nhfp->structlevel) if (nhfp->structlevel)
mread(nhfp->fd, (genericptr_t) &g.oracle_cnt, sizeof g.oracle_cnt); mread(nhfp->fd, (genericptr_t) &g.oracle_cnt, sizeof g.oracle_cnt);
if (nhfp->fieldlevel)
sfi_unsigned(nhfp, &g.oracle_cnt, "oracles", "g.oracle_cnt", 1);
if (g.oracle_cnt) { if (g.oracle_cnt) {
g.oracle_loc = (unsigned long *) alloc(g.oracle_cnt * sizeof(long)); g.oracle_loc = (unsigned long *) alloc(g.oracle_cnt * sizeof(long));
if (nhfp->structlevel) { if (nhfp->structlevel) {
mread(nhfp->fd, (genericptr_t) g.oracle_loc, g.oracle_cnt * sizeof (long)); mread(nhfp->fd, (genericptr_t) g.oracle_loc, g.oracle_cnt * sizeof (long));
} }
if (nhfp->fieldlevel) {
for (i = 0; (unsigned) i < g.oracle_cnt; ++i)
sfi_ulong(nhfp, &g.oracle_loc[i], "oracles", "g.oracle_loc", 1);
}
g.oracle_flg = 1; /* no need to call init_oracles() */ g.oracle_flg = 1; /* no need to call init_oracles() */
} }
} }
-182
View File
@@ -5,8 +5,6 @@
#include "hack.h" #include "hack.h"
#include "lev.h" #include "lev.h"
#include "sfproto.h"
#ifndef NO_SIGNAL #ifndef NO_SIGNAL
#include <signal.h> #include <signal.h>
@@ -149,10 +147,6 @@ dosave0()
(void) delete_savefile(); /* ab@unido */ (void) delete_savefile(); /* ab@unido */
return 0; return 0;
} }
#ifdef SAVEFILE_DEBUGGING
if (nhfp && nhfp->fieldlevel && nhfp->fplog)
(void) fprintf(nhfp->fplog, "# just opened\n");
#endif
vision_recalc(2); /* shut down vision to prevent problems vision_recalc(2); /* shut down vision to prevent problems
in the event of an impossible() call */ in the event of an impossible() call */
@@ -202,9 +196,6 @@ dosave0()
} }
#endif /* MFLOPPY */ #endif /* MFLOPPY */
if (nhfp->fieldlevel && nhfp->addinfo && (nhfp->mode & WRITING))
sfo_addinfo(nhfp, "NetHack", "start", "savefile", 0);
nhfp->mode = WRITING | FREEING; nhfp->mode = WRITING | FREEING;
store_version(nhfp); store_version(nhfp);
store_savefileinfo(nhfp); store_savefileinfo(nhfp);
@@ -259,8 +250,6 @@ dosave0()
close_nhfile(onhfp); close_nhfile(onhfp);
if (nhfp->structlevel) if (nhfp->structlevel)
bwrite(nhfp->fd, (genericptr_t) &ltmp, sizeof ltmp); /* level number*/ bwrite(nhfp->fd, (genericptr_t) &ltmp, sizeof ltmp); /* level number*/
if (nhfp->fieldlevel)
sfo_xchar(nhfp, &ltmp, "gamestate", "level_number", 1); /* xchar */
savelev(nhfp, ltmp); /* actual level*/ savelev(nhfp, ltmp); /* actual level*/
delete_levelfile(ltmp); delete_levelfile(ltmp);
} }
@@ -294,14 +283,6 @@ NHFILE *nhfp;
bwrite(nhfp->fd, (genericptr_t) &flags, sizeof flags); bwrite(nhfp->fd, (genericptr_t) &flags, sizeof flags);
#ifdef SYSFLAGS #ifdef SYSFLAGS
bwrite(nhfp->fd, (genericptr_t) &sysflags, sysflags); bwrite(nhfp->fd, (genericptr_t) &sysflags, sysflags);
#endif
}
if (nhfp->fieldlevel) {
sfo_ulong(nhfp, &uid, "gamestate", "uid", 1);
sfo_context_info(nhfp, &g.context, "gamestate", "g.context", 1);
sfo_flag(nhfp, &flags, "gamestate" , "flags", 1);
#ifdef SYSFLAGS
sfo_flag(nhfp, &sysflags, "gamestate" , "sysflags", 1);
#endif #endif
} }
urealtime.finish_time = getnow(); urealtime.finish_time = getnow();
@@ -318,12 +299,6 @@ NHFILE *nhfp;
sizeof urealtime.realtime); sizeof urealtime.realtime);
bwrite(nhfp->fd, yyyymmddhhmmss(urealtime.start_timing), 14); bwrite(nhfp->fd, yyyymmddhhmmss(urealtime.start_timing), 14);
} }
if (nhfp->fieldlevel) {
sfo_you(nhfp, &u, "gamestate", "you", 1);
sfo_str(nhfp, yyyymmddhhmmss(ubirthday), "gamestate", "ubirthday", 14);
sfo_long(nhfp, &urealtime.realtime, "gamestate", "realtime", 1);
sfo_str(nhfp, yyyymmddhhmmss(urealtime.start_timing), "gamestate", "start_timing", 14);
}
/* this is the value to use for the next update of urealtime.realtime */ /* this is the value to use for the next update of urealtime.realtime */
urealtime.start_timing = urealtime.finish_time; urealtime.start_timing = urealtime.finish_time;
save_killers(nhfp); save_killers(nhfp);
@@ -355,12 +330,6 @@ NHFILE *nhfp;
} }
if (nhfp->structlevel) if (nhfp->structlevel)
bwrite(nhfp->fd, (genericptr_t) g.mvitals, sizeof g.mvitals); bwrite(nhfp->fd, (genericptr_t) g.mvitals, sizeof g.mvitals);
if (nhfp->fieldlevel) {
int i;
for (i = 0; i < NUMMONS; ++i)
sfo_mvitals(nhfp, &g.mvitals[i], "gamestate", "g.mvitals", 1);
}
save_dungeon(nhfp, (boolean) !!perform_bwrite(nhfp), save_dungeon(nhfp, (boolean) !!perform_bwrite(nhfp),
(boolean) !!release_data(nhfp)); (boolean) !!release_data(nhfp));
savelevchn(nhfp); savelevchn(nhfp);
@@ -371,39 +340,20 @@ NHFILE *nhfp;
bwrite(nhfp->fd, (genericptr_t) g.spl_book, bwrite(nhfp->fd, (genericptr_t) g.spl_book,
sizeof (struct spell) * (MAXSPELL + 1)); sizeof (struct spell) * (MAXSPELL + 1));
} }
if (nhfp->fieldlevel) {
int i;
struct spell *sptmp;
sfo_long(nhfp, &g.moves, "gamestate", "g.moves", 1);
sfo_long(nhfp, &g.monstermoves, "gamestate", "g.monstermoves", 1);
sfo_q_score(nhfp, &g.quest_status, "gamestate", "g.quest_status", 1);
sptmp = g.spl_book;
for (i = 0; i < (MAXSPELL + 1); ++i)
sfo_spell(nhfp, sptmp++, "gamestate", "g.spl_book", 1);
}
save_artifacts(nhfp); save_artifacts(nhfp);
save_oracles(nhfp); save_oracles(nhfp);
if (g.ustuck_id) { if (g.ustuck_id) {
if (nhfp->structlevel) if (nhfp->structlevel)
bwrite(nhfp->fd, (genericptr_t) &g.ustuck_id, sizeof g.ustuck_id); bwrite(nhfp->fd, (genericptr_t) &g.ustuck_id, sizeof g.ustuck_id);
if (nhfp->fieldlevel)
sfo_unsigned(nhfp, &g.ustuck_id, "gamestate", "g.ustuck_id", 1);
} }
if (g.usteed_id) { if (g.usteed_id) {
if (nhfp->structlevel) if (nhfp->structlevel)
bwrite(nhfp->fd, (genericptr_t) &g.usteed_id, sizeof g.usteed_id); bwrite(nhfp->fd, (genericptr_t) &g.usteed_id, sizeof g.usteed_id);
if (nhfp->fieldlevel)
sfo_unsigned(nhfp, &g.usteed_id, "gamestate", "g.usteed_id", 1);
} }
if (nhfp->structlevel) { if (nhfp->structlevel) {
bwrite(nhfp->fd, (genericptr_t) g.pl_character, sizeof g.pl_character); bwrite(nhfp->fd, (genericptr_t) g.pl_character, sizeof g.pl_character);
bwrite(nhfp->fd, (genericptr_t) g.pl_fruit, sizeof g.pl_fruit); bwrite(nhfp->fd, (genericptr_t) g.pl_fruit, sizeof g.pl_fruit);
} }
if (nhfp->fieldlevel) {
sfo_char(nhfp, g.pl_character, "gamestate", "g.pl_character", sizeof g.pl_character);
sfo_char(nhfp, g.pl_fruit, "gamestate", "g.pl_fruit", sizeof g.pl_fruit);
}
savefruitchn(nhfp); savefruitchn(nhfp);
savenames(nhfp); savenames(nhfp);
save_waterlevel(nhfp); save_waterlevel(nhfp);
@@ -478,15 +428,11 @@ savestateinlock()
nhfp->mode = WRITING; nhfp->mode = WRITING;
if (nhfp->structlevel) if (nhfp->structlevel)
(void) write(nhfp->fd, (genericptr_t) &g.hackpid, sizeof g.hackpid); (void) write(nhfp->fd, (genericptr_t) &g.hackpid, sizeof g.hackpid);
if (nhfp->fieldlevel)
sfo_int(nhfp, &g.hackpid, "gamestate", "g.hackpid", 1);
if (flags.ins_chkpt) { if (flags.ins_chkpt) {
int currlev = ledger_no(&u.uz); int currlev = ledger_no(&u.uz);
if (nhfp->structlevel) if (nhfp->structlevel)
(void) write(nhfp->fd, (genericptr_t) &currlev, sizeof currlev); (void) write(nhfp->fd, (genericptr_t) &currlev, sizeof currlev);
if (nhfp->fieldlevel)
sfo_int(nhfp, &currlev, "gamestate", "savestateinlock", 1);
save_savefile_name(nhfp); save_savefile_name(nhfp);
store_version(nhfp); store_version(nhfp);
store_savefileinfo(nhfp); store_savefileinfo(nhfp);
@@ -582,20 +528,14 @@ xchar lev;
g.level_info[lev].flags |= VISITED; g.level_info[lev].flags |= VISITED;
if (nhfp->structlevel) if (nhfp->structlevel)
bwrite(nhfp->fd, (genericptr_t) &g.hackpid, sizeof g.hackpid); bwrite(nhfp->fd, (genericptr_t) &g.hackpid, sizeof g.hackpid);
if (nhfp->fieldlevel)
sfo_int(nhfp, &g.hackpid, "gamestate", "g.hackpid", 1);
#ifdef TOS #ifdef TOS
tlev = lev; tlev = lev;
tlev &= 0x00ff; tlev &= 0x00ff;
if (nhfp->structlevel) if (nhfp->structlevel)
bwrite(nhfp->fd, (genericptr_t) &tlev, sizeof tlev); bwrite(nhfp->fd, (genericptr_t) &tlev, sizeof tlev);
if (nhfp->fieldlevel)
sfo_short(nhfp, &tlev, "gamestate", "tlev", 1);
#else #else
if (nhfp->structlevel) if (nhfp->structlevel)
bwrite(nhfp->fd, (genericptr_t) &lev, sizeof lev); bwrite(nhfp->fd, (genericptr_t) &lev, sizeof lev);
if (nhfp->fieldlevel)
sfo_xchar(nhfp, &lev, "gamestate", "dlvl", 1);
#endif #endif
} }
@@ -623,24 +563,6 @@ xchar lev;
bwrite(nhfp->fd, (genericptr_t) &g.level.flags, sizeof g.level.flags); bwrite(nhfp->fd, (genericptr_t) &g.level.flags, sizeof g.level.flags);
bwrite(nhfp->fd, (genericptr_t) g.doors, sizeof g.doors); bwrite(nhfp->fd, (genericptr_t) g.doors, sizeof g.doors);
} }
if (nhfp->fieldlevel) {
int i, c, r;
for (c = 0; c < COLNO; ++c)
for (r = 0; r < ROWNO; ++r)
sfo_schar(nhfp, &g.lastseentyp[c][r], "lev", "g.lastseentyp", 1);
sfo_long(nhfp, &g.monstermoves, "lev", "timestmp", 1);
sfo_stairway(nhfp, &g.upstair, "lev", "g.upstair", 1);
sfo_stairway(nhfp, &g.dnstair, "lev", "g.dnstair", 1);
sfo_stairway(nhfp, &g.upladder, "lev", "g.upladder", 1);
sfo_stairway(nhfp, &g.dnladder, "lev", "g.dnladder", 1);
sfo_stairway(nhfp, &g.sstairs, "lev", "g.sstairs", 1);
sfo_dest_area(nhfp, &g.updest, "lev", "g.updest", 1);
sfo_dest_area(nhfp, &g.dndest, "lev", "g.dndest", 1);
sfo_levelflags(nhfp, &g.level.flags, "lev", "g.level.flags", 1);
for (i = 0; i < DOORMAX; ++i)
sfo_nhcoord(nhfp, &g.doors[i], "lev", "door", 1);
}
save_rooms(nhfp); /* no dynamic memory to reclaim */ save_rooms(nhfp); /* no dynamic memory to reclaim */
/* from here on out, saving also involves allocated memory cleanup */ /* from here on out, saving also involves allocated memory cleanup */
@@ -719,10 +641,6 @@ boolean rlecomp;
bwrite(nhfp->fd, (genericptr_t) &match, sizeof (uchar)); bwrite(nhfp->fd, (genericptr_t) &match, sizeof (uchar));
bwrite(nhfp->fd, (genericptr_t) rgrm, sizeof (struct rm)); bwrite(nhfp->fd, (genericptr_t) rgrm, sizeof (struct rm));
} }
if (nhfp->fieldlevel) {
sfo_uchar(nhfp, &match, "levl", "match", 1);
sfo_rm(nhfp, rgrm, "levl", "rgrm", 1);
}
/* start encoding again. we have at least 1 rm /* start encoding again. we have at least 1 rm
in the next run, viz. this one. */ in the next run, viz. this one. */
match = 1; match = 1;
@@ -735,10 +653,6 @@ boolean rlecomp;
bwrite(nhfp->fd, (genericptr_t) &match, sizeof (uchar)); bwrite(nhfp->fd, (genericptr_t) &match, sizeof (uchar));
bwrite(nhfp->fd, (genericptr_t) rgrm, sizeof (struct rm)); bwrite(nhfp->fd, (genericptr_t) rgrm, sizeof (struct rm));
} }
if (nhfp->fieldlevel) {
sfo_uchar(nhfp, &match, "levl", "match", 1);
sfo_rm(nhfp, rgrm, "levl", "rgrm", 1);
}
} }
return; return;
} }
@@ -748,13 +662,6 @@ boolean rlecomp;
if (nhfp->structlevel) { if (nhfp->structlevel) {
bwrite(nhfp->fd, (genericptr_t) levl, sizeof levl); bwrite(nhfp->fd, (genericptr_t) levl, sizeof levl);
} }
if (nhfp->fieldlevel) {
int c, r;
for (c = 0; c < COLNO; ++c)
for (r = 0; r < ROWNO; ++r)
sfo_rm(nhfp, &g.level.locations[c][r], "room", "levl", 1);
}
} }
/* used when saving a level and also when saving dungeon overview data */ /* used when saving a level and also when saving dungeon overview data */
@@ -770,8 +677,6 @@ struct cemetery **cemeteryaddr;
if (perform_bwrite(nhfp)) { if (perform_bwrite(nhfp)) {
if (nhfp->structlevel) if (nhfp->structlevel)
bwrite(nhfp->fd, (genericptr_t) &flag, sizeof flag); bwrite(nhfp->fd, (genericptr_t) &flag, sizeof flag);
if (nhfp->fieldlevel)
sfo_int(nhfp, &flag, "cemetery", "cemetery_flag", 1);
} }
nextbones = *cemeteryaddr; nextbones = *cemeteryaddr;
while ((thisbones = nextbones) != 0) { while ((thisbones = nextbones) != 0) {
@@ -779,8 +684,6 @@ struct cemetery **cemeteryaddr;
if (perform_bwrite(nhfp)) { if (perform_bwrite(nhfp)) {
if (nhfp->structlevel) if (nhfp->structlevel)
bwrite(nhfp->fd, (genericptr_t) thisbones, sizeof *thisbones); bwrite(nhfp->fd, (genericptr_t) thisbones, sizeof *thisbones);
if (nhfp->fieldlevel)
sfo_cemetery(nhfp, thisbones, "cemetery", "cemetery", 1);
} }
if (release_data(nhfp)) if (release_data(nhfp))
free((genericptr_t) thisbones); free((genericptr_t) thisbones);
@@ -802,15 +705,11 @@ NHFILE *nhfp;
if (perform_bwrite(nhfp)) { if (perform_bwrite(nhfp)) {
if (nhfp->structlevel) if (nhfp->structlevel)
bwrite(nhfp->fd, (genericptr_t) &xl, sizeof xl); bwrite(nhfp->fd, (genericptr_t) &xl, sizeof xl);
if (nhfp->fieldlevel)
sfo_unsigned(nhfp, &xl, "damage", "damage_count", 1);
} }
while (xl--) { while (xl--) {
if (perform_bwrite(nhfp)) { if (perform_bwrite(nhfp)) {
if (nhfp->structlevel) if (nhfp->structlevel)
bwrite(nhfp->fd, (genericptr_t) damageptr, sizeof *damageptr); bwrite(nhfp->fd, (genericptr_t) damageptr, sizeof *damageptr);
if (nhfp->fieldlevel)
sfo_damage(nhfp, damageptr, "damage", "damage", 1);
} }
tmp_dam = damageptr; tmp_dam = damageptr;
damageptr = damageptr->next; damageptr = damageptr->next;
@@ -833,22 +732,14 @@ struct obj *otmp;
bwrite(nhfp->fd, (genericptr_t) &buflen, sizeof buflen); bwrite(nhfp->fd, (genericptr_t) &buflen, sizeof buflen);
bwrite(nhfp->fd, (genericptr_t) otmp, buflen); bwrite(nhfp->fd, (genericptr_t) otmp, buflen);
} }
if (nhfp->fieldlevel) {
sfo_int(nhfp, &buflen, "obj", "obj_length", 1);
sfo_obj(nhfp, otmp, "obj", "obj", 1);
}
if (otmp->oextra) { if (otmp->oextra) {
buflen = ONAME(otmp) ? (int) strlen(ONAME(otmp)) + 1 : 0; buflen = ONAME(otmp) ? (int) strlen(ONAME(otmp)) + 1 : 0;
if (nhfp->structlevel) if (nhfp->structlevel)
bwrite(nhfp->fd, (genericptr_t) &buflen, sizeof buflen); bwrite(nhfp->fd, (genericptr_t) &buflen, sizeof buflen);
if (nhfp->fieldlevel)
sfo_int(nhfp, &buflen, "obj", "oname_length", 1);
if (buflen > 0) { if (buflen > 0) {
if (nhfp->structlevel) if (nhfp->structlevel)
bwrite(nhfp->fd, (genericptr_t) ONAME(otmp), buflen); bwrite(nhfp->fd, (genericptr_t) ONAME(otmp), buflen);
if (nhfp->fieldlevel)
sfo_str(nhfp, ONAME(otmp), "obj", "oname", buflen);
} }
/* defer to savemon() for this one */ /* defer to savemon() for this one */
if (OMONST(otmp)) { if (OMONST(otmp)) {
@@ -856,43 +747,29 @@ struct obj *otmp;
} else { } else {
if (nhfp->structlevel) if (nhfp->structlevel)
bwrite(nhfp->fd, (genericptr_t) &zerobuf, sizeof zerobuf); bwrite(nhfp->fd, (genericptr_t) &zerobuf, sizeof zerobuf);
if (nhfp->fieldlevel)
sfo_int(nhfp, &zerobuf, "obj", "omonst_length", 1);
} }
buflen = OMID(otmp) ? (int) sizeof (unsigned) : 0; buflen = OMID(otmp) ? (int) sizeof (unsigned) : 0;
if (nhfp->structlevel) if (nhfp->structlevel)
bwrite(nhfp->fd, (genericptr_t) &buflen, sizeof buflen); bwrite(nhfp->fd, (genericptr_t) &buflen, sizeof buflen);
if (nhfp->fieldlevel)
sfo_int(nhfp, &buflen, "obj", "omid_length", 1);
if (buflen > 0) { if (buflen > 0) {
if (nhfp->structlevel) if (nhfp->structlevel)
bwrite(nhfp->fd, (genericptr_t) OMID(otmp), buflen); bwrite(nhfp->fd, (genericptr_t) OMID(otmp), buflen);
if (nhfp->fieldlevel)
sfo_int(nhfp, &buflen, "obj", "omid_length", 1);
} }
/* TODO: post 3.6.x, get rid of this */ /* TODO: post 3.6.x, get rid of this */
buflen = OLONG(otmp) ? (int) sizeof (long) : 0; buflen = OLONG(otmp) ? (int) sizeof (long) : 0;
if (nhfp->structlevel) if (nhfp->structlevel)
bwrite(nhfp->fd, (genericptr_t) &buflen, sizeof buflen); bwrite(nhfp->fd, (genericptr_t) &buflen, sizeof buflen);
if (nhfp->fieldlevel)
sfo_int(nhfp, &buflen, "obj", "olong_length", 1);
if (buflen > 0) { if (buflen > 0) {
if (nhfp->structlevel) if (nhfp->structlevel)
bwrite(nhfp->fd, (genericptr_t) OLONG(otmp), buflen); bwrite(nhfp->fd, (genericptr_t) OLONG(otmp), buflen);
if (nhfp->fieldlevel)
sfo_long(nhfp, OLONG(otmp), "obj", "olong", 1);
} }
buflen = OMAILCMD(otmp) ? (int) strlen(OMAILCMD(otmp)) + 1 : 0; buflen = OMAILCMD(otmp) ? (int) strlen(OMAILCMD(otmp)) + 1 : 0;
if (nhfp->structlevel) if (nhfp->structlevel)
bwrite(nhfp->fd, (genericptr_t) &buflen, sizeof buflen); bwrite(nhfp->fd, (genericptr_t) &buflen, sizeof buflen);
if (nhfp->fieldlevel)
sfo_int(nhfp, &buflen, "obj", "omailcmd_length", 1);
if (buflen > 0) { if (buflen > 0) {
if (nhfp->structlevel) if (nhfp->structlevel)
bwrite(nhfp->fd, (genericptr_t) OMAILCMD(otmp), buflen); bwrite(nhfp->fd, (genericptr_t) OMAILCMD(otmp), buflen);
if (nhfp->fieldlevel)
sfo_str(nhfp, OMAILCMD(otmp), "obj", "omailcmd", buflen);
} }
} }
} }
@@ -943,8 +820,6 @@ register struct obj *otmp;
if (perform_bwrite(nhfp)) { if (perform_bwrite(nhfp)) {
if (nhfp->structlevel) if (nhfp->structlevel)
bwrite(nhfp->fd, (genericptr_t) &minusone, sizeof (int)); bwrite(nhfp->fd, (genericptr_t) &minusone, sizeof (int));
if (nhfp->fieldlevel)
sfo_int(nhfp, &minusone, "obj", "obj_length", 1);
} }
} }
@@ -962,83 +837,53 @@ struct monst *mtmp;
bwrite(nhfp->fd, (genericptr_t) &buflen, sizeof buflen); bwrite(nhfp->fd, (genericptr_t) &buflen, sizeof buflen);
bwrite(nhfp->fd, (genericptr_t) mtmp, buflen); bwrite(nhfp->fd, (genericptr_t) mtmp, buflen);
} }
if (nhfp->fieldlevel) {
sfo_int(nhfp, &buflen, "mon", "monst_length", 1);
sfo_monst(nhfp, mtmp, "mon", "monst", 1);
}
if (mtmp->mextra) { if (mtmp->mextra) {
buflen = MNAME(mtmp) ? (int) strlen(MNAME(mtmp)) + 1 : 0; buflen = MNAME(mtmp) ? (int) strlen(MNAME(mtmp)) + 1 : 0;
if (nhfp->structlevel) if (nhfp->structlevel)
bwrite(nhfp->fd, (genericptr_t) &buflen, sizeof buflen); bwrite(nhfp->fd, (genericptr_t) &buflen, sizeof buflen);
if (nhfp->fieldlevel)
sfo_int(nhfp, &buflen, "mon", "mname_length", 1);
if (buflen > 0) { if (buflen > 0) {
if (nhfp->structlevel) if (nhfp->structlevel)
bwrite(nhfp->fd, (genericptr_t) MNAME(mtmp), buflen); bwrite(nhfp->fd, (genericptr_t) MNAME(mtmp), buflen);
if (nhfp->fieldlevel)
sfo_str(nhfp, MNAME(mtmp), "mon", "mname", buflen);
} }
buflen = EGD(mtmp) ? (int) sizeof (struct egd) : 0; buflen = EGD(mtmp) ? (int) sizeof (struct egd) : 0;
if (nhfp->structlevel) if (nhfp->structlevel)
bwrite(nhfp->fd, (genericptr_t) &buflen, sizeof buflen); bwrite(nhfp->fd, (genericptr_t) &buflen, sizeof buflen);
if (nhfp->fieldlevel)
sfo_int(nhfp, &buflen, "mon", "egd_length", 1);
if (buflen > 0) { if (buflen > 0) {
if (nhfp->structlevel) if (nhfp->structlevel)
bwrite(nhfp->fd, (genericptr_t) EGD(mtmp), buflen); bwrite(nhfp->fd, (genericptr_t) EGD(mtmp), buflen);
if (nhfp->fieldlevel)
sfo_egd(nhfp, EGD(mtmp), "mon", "egd", 1);
} }
buflen = EPRI(mtmp) ? (int) sizeof (struct epri) : 0; buflen = EPRI(mtmp) ? (int) sizeof (struct epri) : 0;
if (nhfp->structlevel) if (nhfp->structlevel)
bwrite(nhfp->fd, (genericptr_t) &buflen, sizeof buflen); bwrite(nhfp->fd, (genericptr_t) &buflen, sizeof buflen);
if (nhfp->fieldlevel)
sfo_int(nhfp, &buflen, "mon", "epri_length", 1);
if (buflen > 0) { if (buflen > 0) {
if (nhfp->structlevel) if (nhfp->structlevel)
bwrite(nhfp->fd, (genericptr_t) EPRI(mtmp), buflen); bwrite(nhfp->fd, (genericptr_t) EPRI(mtmp), buflen);
if (nhfp->fieldlevel)
sfo_epri(nhfp, EPRI(mtmp), "mon", "epri", 1);
} }
buflen = ESHK(mtmp) ? (int) sizeof (struct eshk) : 0; buflen = ESHK(mtmp) ? (int) sizeof (struct eshk) : 0;
if (nhfp->structlevel) if (nhfp->structlevel)
bwrite(nhfp->fd, (genericptr_t) &buflen, sizeof (int)); bwrite(nhfp->fd, (genericptr_t) &buflen, sizeof (int));
if (nhfp->fieldlevel)
sfo_int(nhfp, &buflen, "mon", "eshk_length", 1);
if (buflen > 0) { if (buflen > 0) {
if (nhfp->structlevel) if (nhfp->structlevel)
bwrite(nhfp->fd, (genericptr_t) ESHK(mtmp), buflen); bwrite(nhfp->fd, (genericptr_t) ESHK(mtmp), buflen);
if (nhfp->fieldlevel)
sfo_eshk(nhfp, ESHK(mtmp), "mon", "eshk", 1);
} }
buflen = EMIN(mtmp) ? (int) sizeof (struct emin) : 0; buflen = EMIN(mtmp) ? (int) sizeof (struct emin) : 0;
if (nhfp->structlevel) if (nhfp->structlevel)
bwrite(nhfp->fd, (genericptr_t) &buflen, sizeof (int)); bwrite(nhfp->fd, (genericptr_t) &buflen, sizeof (int));
if (nhfp->fieldlevel)
sfo_int(nhfp, &buflen, "mon", "emin_length", 1);
if (buflen > 0) { if (buflen > 0) {
if (nhfp->structlevel) if (nhfp->structlevel)
bwrite(nhfp->fd, (genericptr_t) EMIN(mtmp), buflen); bwrite(nhfp->fd, (genericptr_t) EMIN(mtmp), buflen);
if (nhfp->fieldlevel)
sfo_emin(nhfp, EMIN(mtmp), "mon", "emin", 1);
} }
buflen = EDOG(mtmp) ? (int) sizeof (struct edog) : 0; buflen = EDOG(mtmp) ? (int) sizeof (struct edog) : 0;
if (nhfp->structlevel) if (nhfp->structlevel)
bwrite(nhfp->fd, (genericptr_t) &buflen, sizeof (int)); bwrite(nhfp->fd, (genericptr_t) &buflen, sizeof (int));
if (nhfp->fieldlevel)
sfo_int(nhfp, &buflen, "mon", "edog_length", 1);
if (buflen > 0) { if (buflen > 0) {
if (nhfp->structlevel) if (nhfp->structlevel)
bwrite(nhfp->fd, (genericptr_t) EDOG(mtmp), buflen); bwrite(nhfp->fd, (genericptr_t) EDOG(mtmp), buflen);
if (nhfp->fieldlevel)
sfo_edog(nhfp, EDOG(mtmp), "mon", "edog", 1);
} }
/* mcorpsenm is inline int rather than pointer to something, /* mcorpsenm is inline int rather than pointer to something,
so doesn't need to be preceded by a length field */ so doesn't need to be preceded by a length field */
if (nhfp->structlevel) if (nhfp->structlevel)
bwrite(nhfp->fd, (genericptr_t) &MCORPSENM(mtmp), sizeof MCORPSENM(mtmp)); bwrite(nhfp->fd, (genericptr_t) &MCORPSENM(mtmp), sizeof MCORPSENM(mtmp));
if (nhfp->fieldlevel)
sfo_int(nhfp, &MCORPSENM(mtmp), "mon", "mcorpsenm", 1);
} }
} }
@@ -1073,8 +918,6 @@ register struct monst *mtmp;
if (perform_bwrite(nhfp)) { if (perform_bwrite(nhfp)) {
if (nhfp->structlevel) if (nhfp->structlevel)
bwrite(nhfp->fd, (genericptr_t) &minusone, sizeof (int)); bwrite(nhfp->fd, (genericptr_t) &minusone, sizeof (int));
if (nhfp->fieldlevel)
sfo_int(nhfp, &minusone, "mon", "monst_length", 1);
} }
} }
@@ -1092,8 +935,6 @@ register struct trap *trap;
if (perform_bwrite(nhfp)) { if (perform_bwrite(nhfp)) {
if (nhfp->structlevel) if (nhfp->structlevel)
bwrite(nhfp->fd, (genericptr_t) trap, sizeof *trap); bwrite(nhfp->fd, (genericptr_t) trap, sizeof *trap);
if (nhfp->fieldlevel)
sfo_trap(nhfp, trap, "trap", "trap", 1);
} }
if (release_data(nhfp)) if (release_data(nhfp))
dealloc_trap(trap); dealloc_trap(trap);
@@ -1102,8 +943,6 @@ register struct trap *trap;
if (perform_bwrite(nhfp)) { if (perform_bwrite(nhfp)) {
if (nhfp->structlevel) if (nhfp->structlevel)
bwrite(nhfp->fd, (genericptr_t) &zerotrap, sizeof zerotrap); bwrite(nhfp->fd, (genericptr_t) &zerotrap, sizeof zerotrap);
if (nhfp->fieldlevel)
sfo_trap(nhfp, &zerotrap, "trap", "trap", 1);
} }
} }
@@ -1125,8 +964,6 @@ NHFILE *nhfp;
if (f1->fid >= 0 && perform_bwrite(nhfp)) { if (f1->fid >= 0 && perform_bwrite(nhfp)) {
if (nhfp->structlevel) if (nhfp->structlevel)
bwrite(nhfp->fd, (genericptr_t) f1, sizeof *f1); bwrite(nhfp->fd, (genericptr_t) f1, sizeof *f1);
if (nhfp->fieldlevel)
sfo_fruit(nhfp, f1, "fruit", "fruit", 1);
} }
if (release_data(nhfp)) if (release_data(nhfp))
dealloc_fruit(f1); dealloc_fruit(f1);
@@ -1135,8 +972,6 @@ NHFILE *nhfp;
if (perform_bwrite(nhfp)) { if (perform_bwrite(nhfp)) {
if (nhfp->structlevel) if (nhfp->structlevel)
bwrite(nhfp->fd, (genericptr_t) &zerofruit, sizeof zerofruit); bwrite(nhfp->fd, (genericptr_t) &zerofruit, sizeof zerofruit);
if (nhfp->fieldlevel)
sfo_fruit(nhfp, &zerofruit, "fruit", "terminator", 1);
} }
if (release_data(nhfp)) if (release_data(nhfp))
g.ffruit = 0; g.ffruit = 0;
@@ -1156,16 +991,12 @@ NHFILE *nhfp;
if (perform_bwrite(nhfp)) { if (perform_bwrite(nhfp)) {
if (nhfp->structlevel) if (nhfp->structlevel)
bwrite(nhfp->fd, (genericptr_t) &cnt, sizeof cnt); bwrite(nhfp->fd, (genericptr_t) &cnt, sizeof cnt);
if (nhfp->fieldlevel)
sfo_int(nhfp, &cnt, "levchn", "lev_count", 1);
} }
for (tmplev = g.sp_levchn; tmplev; tmplev = tmplev2) { for (tmplev = g.sp_levchn; tmplev; tmplev = tmplev2) {
tmplev2 = tmplev->next; tmplev2 = tmplev->next;
if (perform_bwrite(nhfp)) { if (perform_bwrite(nhfp)) {
if (nhfp->structlevel) if (nhfp->structlevel)
bwrite(nhfp->fd, (genericptr_t) tmplev, sizeof *tmplev); bwrite(nhfp->fd, (genericptr_t) tmplev, sizeof *tmplev);
if (nhfp->fieldlevel)
sfo_s_level(nhfp, tmplev, "levchn", "s_level", 1);
} }
if (release_data(nhfp)) if (release_data(nhfp))
free((genericptr_t) tmplev); free((genericptr_t) tmplev);
@@ -1187,10 +1018,6 @@ NHFILE *nhfp;
bwrite(nhfp->fd, (genericptr_t) g.plname, plsiztmp); bwrite(nhfp->fd, (genericptr_t) g.plname, plsiztmp);
bufon(nhfp->fd); bufon(nhfp->fd);
} }
if (nhfp->fieldlevel) {
sfo_int(nhfp, &plsiztmp, "plname", "plname_size", 1);
sfo_str(nhfp, g.plname, "plname", "g.plname", plsiztmp);
}
return; return;
} }
@@ -1218,16 +1045,10 @@ NHFILE *nhfp;
bwrite(nhfp->fd, (genericptr_t) &msglen, sizeof msglen); bwrite(nhfp->fd, (genericptr_t) &msglen, sizeof msglen);
bwrite(nhfp->fd, (genericptr_t) msg, msglen); bwrite(nhfp->fd, (genericptr_t) msg, msglen);
} }
if (nhfp->fieldlevel) {
sfo_int(nhfp, &msglen, "msghistory", "msghistory_length", 1);
sfo_str(nhfp, msg, "msghistory", "msg", msglen);
}
++msgcount; ++msgcount;
} }
if (nhfp->structlevel) if (nhfp->structlevel)
bwrite(nhfp->fd, (genericptr_t) &minusone, sizeof (int)); bwrite(nhfp->fd, (genericptr_t) &minusone, sizeof (int));
if (nhfp->fieldlevel)
sfo_int(nhfp, &minusone, "msghistory", "msghistory_length", 1);
} }
debugpline1("Stored %d messages into savefile.", msgcount); debugpline1("Stored %d messages into savefile.", msgcount);
/* note: we don't attempt to handle release_data() here */ /* note: we don't attempt to handle release_data() here */
@@ -1254,9 +1075,6 @@ NHFILE *nhfp;
bwrite(nhfp->fd, (genericptr_t) &sfsaveinfo, (unsigned) sizeof sfsaveinfo); bwrite(nhfp->fd, (genericptr_t) &sfsaveinfo, (unsigned) sizeof sfsaveinfo);
bufon(nhfp->fd); bufon(nhfp->fd);
} }
if (nhfp->fieldlevel) {
sfo_savefile_info(nhfp, &sfsaveinfo, "savefileinfo", "savefile_info", 1);
}
return; return;
} }
-1233
View File
File diff suppressed because it is too large Load Diff
-646
View File
@@ -1,646 +0,0 @@
/* NetHack 3.7 sf_base.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */
/* Copyright (c) Michael Allison, 2019. */
/* NetHack may be freely redistributed. See license for details. */
#include "hack.h"
#include "integer.h"
#include "sfprocs.h"
struct sf_procs sfoprocs[4], sfiprocs[4],
zerosfoprocs = {0}, zerosfiprocs = {0};
void FDECL(sfi_log, (NHFILE *, const char *, const char *, const char *, int));
/*
*----------------------------------------------------------------------------
* initialize the function pointers. These are called from initoptions_init().
*----------------------------------------------------------------------------
*/
void
sf_init()
{
sfoprocs[invalid] = zerosfoprocs;
sfiprocs[invalid] = zerosfiprocs;
sfoprocs[historical] = zerosfoprocs;
sfiprocs[historical] = zerosfiprocs;
sfoprocs[lendian] = lendian_sfo_procs;
sfiprocs[lendian] = lendian_sfi_procs;
sfoprocs[ascii] = ascii_sfo_procs;
sfiprocs[ascii] = ascii_sfi_procs;
}
/*
*----------------------------------------
* routines called from engine core and
* from functions in generated sfdata.c
*----------------------------------------
*/
void
sfo_any(nhfp, d_any, myparent, myname, cnt)
NHFILE *nhfp;
union any *d_any;
const char *myparent;
const char *myname;
int cnt;
{
(*sfoprocs[nhfp->fnidx].fn.sf_any)(nhfp, d_any, myparent, myname, cnt);
}
void
sfo_aligntyp(nhfp, d_aligntyp, myparent, myname, cnt)
NHFILE *nhfp;
aligntyp *d_aligntyp;
const char *myparent;
const char *myname;
int cnt;
{
(*sfoprocs[nhfp->fnidx].fn.sf_aligntyp)(nhfp, d_aligntyp, myparent, myname, cnt);
}
void
sfo_bitfield(nhfp, d_bitfield, myparent, myname, cnt)
NHFILE *nhfp;
uint8_t *d_bitfield;
const char *myparent;
const char *myname;
int cnt;
{
(*sfoprocs[nhfp->fnidx].fn.sf_bitfield)(nhfp, d_bitfield, myparent, myname, cnt);
}
void
sfo_boolean(nhfp, d_boolean, myparent, myname, cnt)
NHFILE *nhfp;
boolean *d_boolean;
const char *myparent;
const char *myname;
int cnt;
{
(*sfoprocs[nhfp->fnidx].fn.sf_boolean)(nhfp, d_boolean, myparent, myname, cnt);
}
void
sfo_char(nhfp, d_char, myparent, myname, cnt)
NHFILE *nhfp;
char *d_char;
const char *myparent;
const char *myname;
int cnt;
{
(*sfoprocs[nhfp->fnidx].fn.sf_char)(nhfp, d_char, myparent, myname, cnt);
}
void
sfo_genericptr(nhfp, d_genericptr, myparent, myname, cnt)
NHFILE *nhfp;
genericptr_t d_genericptr;
const char *myparent;
const char *myname;
int cnt;
{
(*sfoprocs[nhfp->fnidx].fn.sf_genericptr)(nhfp, d_genericptr, myparent, myname, cnt);
}
void
sfo_int(nhfp, d_int, myparent, myname, cnt)
NHFILE *nhfp;
int *d_int;
const char *myparent;
const char *myname;
int cnt;
{
(*sfoprocs[nhfp->fnidx].fn.sf_int)(nhfp, d_int, myparent, myname, cnt);
}
void
sfo_long(nhfp, d_long, myparent, myname, cnt)
NHFILE *nhfp;
long *d_long;
const char *myparent;
const char *myname;
int cnt;
{
(*sfoprocs[nhfp->fnidx].fn.sf_long)(nhfp, d_long, myparent, myname, cnt);
}
void
sfo_schar(nhfp, d_schar, myparent, myname, cnt)
NHFILE *nhfp;
schar *d_schar;
const char *myparent;
const char *myname;
int cnt;
{
(*sfoprocs[nhfp->fnidx].fn.sf_schar)(nhfp, d_schar, myparent, myname, cnt);
}
void
sfo_short(nhfp, d_short, myparent, myname, cnt)
NHFILE *nhfp;
short *d_short;
const char *myparent;
const char *myname;
int cnt;
{
(*sfoprocs[nhfp->fnidx].fn.sf_short)(nhfp, d_short, myparent, myname, cnt);
}
void
sfo_size_t(nhfp, d_size_t, myparent, myname, cnt)
NHFILE *nhfp;
size_t *d_size_t;
const char *myparent;
const char *myname;
int cnt;
{
(*sfoprocs[nhfp->fnidx].fn.sf_size_t)(nhfp, d_size_t, myparent, myname, cnt);
}
void
sfo_time_t(nhfp, d_time_t, myparent, myname, cnt)
NHFILE *nhfp;
time_t *d_time_t;
const char *myparent;
const char *myname;
int cnt;
{
(*sfoprocs[nhfp->fnidx].fn.sf_time_t)(nhfp, d_time_t, myparent, myname, cnt);
}
void
sfo_unsigned(nhfp, d_unsigned, myparent, myname, cnt)
NHFILE *nhfp;
unsigned *d_unsigned;
const char *myparent;
const char *myname;
int cnt;
{
(*sfoprocs[nhfp->fnidx].fn.sf_unsigned)(nhfp, d_unsigned, myparent, myname, cnt);
}
void
sfo_uchar(nhfp, d_uchar, myparent, myname, cnt)
NHFILE *nhfp;
unsigned char *d_uchar;
const char *myparent;
const char *myname;
int cnt;
{
(*sfoprocs[nhfp->fnidx].fn.sf_uchar)(nhfp, d_uchar, myparent, myname, cnt);
}
void
sfo_uint(nhfp, d_uint, myparent, myname, cnt)
NHFILE *nhfp;
unsigned int *d_uint;
const char *myparent;
const char *myname;
int cnt;
{
(*sfoprocs[nhfp->fnidx].fn.sf_uint)(nhfp, d_uint, myparent, myname, cnt);
}
void
sfo_ulong(nhfp, d_ulong, myparent, myname, cnt)
NHFILE *nhfp;
unsigned long *d_ulong;
const char *myparent;
const char *myname;
int cnt;
{
(*sfoprocs[nhfp->fnidx].fn.sf_ulong)(nhfp, d_ulong, myparent, myname, cnt);
}
void
sfo_ushort(nhfp, d_ushort, myparent, myname, cnt)
NHFILE *nhfp;
unsigned short *d_ushort;
const char *myparent;
const char *myname;
int cnt;
{
(*sfoprocs[nhfp->fnidx].fn.sf_ushort)(nhfp, d_ushort, myparent, myname, cnt);
}
void
sfo_xchar(nhfp, d_xchar, myparent, myname, cnt)
NHFILE *nhfp;
xchar *d_xchar;
const char *myparent;
const char *myname;
int cnt;
{
(*sfoprocs[nhfp->fnidx].fn.sf_xchar)(nhfp, d_xchar, myparent, myname, cnt);
}
void
sfo_str(nhfp, d_str, myparent, myname, cnt)
NHFILE *nhfp;
char *d_str;
const char *myparent;
const char *myname;
int cnt;
{
(*sfoprocs[nhfp->fnidx].fn.sf_str)(nhfp, d_str, myparent, myname, cnt);
}
void
sfo_addinfo(nhfp, parent, action, myname, index)
NHFILE *nhfp;
const char *parent, *action, *myname;
int index;
{
(*sfoprocs[nhfp->fnidx].fn.sf_addinfo)(nhfp, parent, action, myname, index);
}
/*
*----------------------------------------------------------------------------
* routines called from core and from functions in generated sfi_data.c
*----------------------------------------------------------------------------
*/
void
sfi_any(nhfp, d_any, myparent, myname, cnt)
NHFILE *nhfp;
union any *d_any;
const char *myparent;
const char *myname;
int cnt;
{
const char *parent = "any";
sfi_log(nhfp, myparent, myname, parent, cnt);
(*sfiprocs[nhfp->fnidx].fn.sf_any)(nhfp, d_any, myparent, myname, cnt);
#ifdef DO_DEBUG
if (nhfp->fpdebug)
fprintf(nhfp->fpdebug, "(%ld)\n", d_any->a_long);
#endif
}
void
sfi_aligntyp(nhfp, d_aligntyp, myparent, myname, cnt)
NHFILE *nhfp;
aligntyp *d_aligntyp;
const char *myparent;
const char *myname;
int cnt;
{
const char *parent = "aligntyp";
sfi_log(nhfp, myparent, myname, parent, cnt);
(*sfiprocs[nhfp->fnidx].fn.sf_aligntyp)(nhfp, d_aligntyp, myparent, myname, cnt);
#ifdef DO_DEBUG
if (nhfp->fpdebug)
fprintf(nhfp->fpdebug, "(%d)\n", *d_aligntyp);
#endif
}
void
sfi_bitfield(nhfp, d_bitfield, myparent, myname, cnt)
NHFILE *nhfp;
uint8_t *d_bitfield;
const char *myparent;
const char *myname;
int cnt;
{
const char *parent = "bitfield";
sfi_log(nhfp, myparent, myname, parent, cnt);
(*sfiprocs[nhfp->fnidx].fn.sf_bitfield)(nhfp, d_bitfield, myparent, myname, cnt);
#ifdef DO_DEBUG
if (nhfp->fpdebug)
fprintf(nhfp->fpdebug, "(%hd)\n", *d_bitfield);
#endif
}
void
sfi_boolean(nhfp, d_boolean, myparent, myname, cnt)
NHFILE *nhfp;
boolean *d_boolean;
const char *myparent;
const char *myname;
int cnt;
{
const char *parent = "boolean";
sfi_log(nhfp, myparent, myname, parent, cnt);
(*sfiprocs[nhfp->fnidx].fn.sf_boolean)(nhfp, d_boolean, myparent, myname, cnt);
#ifdef DO_DEBUG
if (nhfp->fpdebug)
fprintf(nhfp->fpdebug, "(%s)\n", (*d_boolean) ? "true" : "false");
#endif
}
void
sfi_char(nhfp, d_char, myparent, myname, cnt)
NHFILE *nhfp;
char *d_char;
const char *myparent;
const char *myname;
int cnt;
{
const char *parent = "char";
sfi_log(nhfp, myparent, myname, parent, cnt);
(*sfiprocs[nhfp->fnidx].fn.sf_char)(nhfp, d_char, myparent, myname, cnt);
#ifdef DO_DEBUG
if (nhfp->fpdebug)
fprintf(nhfp->fpdebug, "(%s)\n", d_char ? d_char : "");
#endif
}
void
sfi_genericptr(nhfp, d_genericptr, myparent, myname, cnt)
NHFILE *nhfp;
genericptr_t d_genericptr;
const char *myparent;
const char *myname;
int cnt;
{
const char *parent = "genericptr";
sfi_log(nhfp, myparent, myname, parent, cnt);
(*sfiprocs[nhfp->fnidx].fn.sf_genericptr)(nhfp, d_genericptr, myparent, myname, cnt);
#ifdef DO_DEBUG
if (nhfp->fpdebug)
fprintf(nhfp->fpdebug, "(%s)\n", (d_genericptr) ? "set" : "null");
#endif
}
void
sfi_int(nhfp, d_int, myparent, myname, cnt)
NHFILE *nhfp;
int *d_int;
const char *myparent;
const char *myname;
int cnt;
{
const char *parent = "int";
sfi_log(nhfp, myparent, myname, parent, cnt);
(*sfiprocs[nhfp->fnidx].fn.sf_int)(nhfp, d_int, myparent, myname, cnt);
#ifdef DO_DEBUG
if (nhfp->fpdebug)
fprintf(nhfp->fpdebug, "(%d)\n", *d_int);
#endif
}
void
sfi_long(nhfp, d_long, myparent, myname, cnt)
NHFILE *nhfp;
long *d_long;
const char *myparent;
const char *myname;
int cnt;
{
const char *parent = "long";
sfi_log(nhfp, myparent, myname, parent, cnt);
(*sfiprocs[nhfp->fnidx].fn.sf_long)(nhfp, d_long, myparent, myname, cnt);
#ifdef DO_DEBUG
if (nhfp->fpdebug)
fprintf(nhfp->fpdebug, "(%ld)\n", *d_long);
#endif
}
void
sfi_schar(nhfp, d_schar, myparent, myname, cnt)
NHFILE *nhfp;
schar *d_schar;
const char *myparent;
const char *myname;
int cnt;
{
const char *parent = "schar";
sfi_log(nhfp, myparent, myname, parent, cnt);
(*sfiprocs[nhfp->fnidx].fn.sf_schar)(nhfp, d_schar, myparent, myname, cnt);
#ifdef DO_DEBUG
if (nhfp->fpdebug)
fprintf(nhfp->fpdebug, "(%hd)\n", (short) *d_schar);
#endif
}
void
sfi_short(nhfp, d_short, myparent, myname, cnt)
NHFILE *nhfp;
short *d_short;
const char *myparent;
const char *myname;
int cnt;
{
const char *parent = "short";
sfi_log(nhfp, myparent, myname, parent, cnt);
(*sfiprocs[nhfp->fnidx].fn.sf_short)(nhfp, d_short, myparent, myname, cnt);
#ifdef DO_DEBUG
if (nhfp->fpdebug)
fprintf(nhfp->fpdebug, "(%hd)\n", *d_short);
#endif
}
void
sfi_size_t(nhfp, d_size_t, myparent, myname, cnt)
NHFILE *nhfp;
size_t *d_size_t;
const char *myparent;
const char *myname;
int cnt;
{
const char *parent = "size_t";
sfi_log(nhfp, myparent, myname, parent, cnt);
(*sfiprocs[nhfp->fnidx].fn.sf_size_t)(nhfp, d_size_t, myparent, myname, cnt);
#ifdef DO_DEBUG
if (nhfp->fpdebug)
fprintf(nhfp->fpdebug, "(%lu)\n", (unsigned long) *d_size_t);
#endif
}
void
sfi_time_t(nhfp, d_time_t, myparent, myname, cnt)
NHFILE *nhfp;
time_t *d_time_t;
const char *myparent;
const char *myname;
int cnt;
{
const char *parent = "time_t";
sfi_log(nhfp, myparent, myname, parent, cnt);
(*sfiprocs[nhfp->fnidx].fn.sf_time_t)(nhfp, d_time_t, myparent, myname, cnt);
#ifdef DO_DEBUG
if (nhfp->fpdebug)
fprintf(nhfp->fpdebug, "(%s)\n", yyyymmddhhmmss(*d_time_t));
#endif
}
void
sfi_unsigned(nhfp, d_unsigned, myparent, myname, cnt)
NHFILE *nhfp;
unsigned *d_unsigned;
const char *myparent;
const char *myname;
int cnt;
{
const char *parent = "unsigned";
sfi_log(nhfp, myparent, myname, parent, cnt);
(*sfiprocs[nhfp->fnidx].fn.sf_unsigned)(nhfp, d_unsigned, myparent, myname, cnt);
#ifdef DO_DEBUG
if (nhfp->fpdebug)
fprintf(nhfp->fpdebug, "(%u)\n", *d_unsigned);
#endif
}
void
sfi_uchar(nhfp, d_uchar, myparent, myname, cnt)
NHFILE *nhfp;
unsigned char *d_uchar;
const char *myparent;
const char *myname;
int cnt;
{
const char *parent = "uchar";
sfi_log(nhfp, myparent, myname, parent, cnt);
(*sfiprocs[nhfp->fnidx].fn.sf_uchar)(nhfp, d_uchar, myparent, myname, cnt);
#ifdef DO_DEBUG
if (nhfp->fpdebug)
fprintf(nhfp->fpdebug, "(%hu)\n", (unsigned short) *d_uchar);
#endif
}
void
sfi_uint(nhfp, d_uint, myparent, myname, cnt)
NHFILE *nhfp;
unsigned int *d_uint;
const char *myparent;
const char *myname;
int cnt;
{
const char *parent = "uint";
sfi_log(nhfp, myparent, myname, parent, cnt);
(*sfiprocs[nhfp->fnidx].fn.sf_uint)(nhfp, d_uint, myparent, myname, cnt);
#ifdef DO_DEBUG
if (nhfp->fpdebug)
fprintf(nhfp->fpdebug, "(%u)\n", *d_uint);
#endif
}
void
sfi_ulong(nhfp, d_ulong, myparent, myname, cnt)
NHFILE *nhfp;
unsigned long *d_ulong;
const char *myparent;
const char *myname;
int cnt;
{
const char *parent = "ulong";
sfi_log(nhfp, myparent, myname, parent, cnt);
(*sfiprocs[nhfp->fnidx].fn.sf_ulong)(nhfp, d_ulong, myparent, myname, cnt);
#ifdef DO_DEBUG
if (nhfp->fpdebug)
fprintf(nhfp->fpdebug, "(%lu)\n", *d_ulong);
#endif
}
void
sfi_ushort(nhfp, d_ushort, myparent, myname, cnt)
NHFILE *nhfp;
unsigned short *d_ushort;
const char *myparent;
const char *myname;
int cnt;
{
const char *parent = "ushort";
sfi_log(nhfp, myparent, myname, parent, cnt);
(*sfiprocs[nhfp->fnidx].fn.sf_ushort)(nhfp, d_ushort, myparent, myname, cnt);
#ifdef DO_DEBUG
if (nhfp->fpdebug)
fprintf(nhfp->fpdebug, "(%hu)\n", *d_ushort);
#endif
}
void
sfi_xchar(nhfp, d_xchar, myparent, myname, cnt)
NHFILE *nhfp;
xchar *d_xchar;
const char *myparent;
const char *myname;
int cnt;
{
const char *parent = "xchar";
sfi_log(nhfp, myparent, myname, parent, cnt);
(*sfiprocs[nhfp->fnidx].fn.sf_xchar)(nhfp, d_xchar, myparent, myname, cnt);
#ifdef DO_DEBUG
if (nhfp->fpdebug)
fprintf(nhfp->fpdebug, "(%hd)\n", (short) *d_xchar);
#endif
}
void
sfi_str(nhfp, d_str, myparent, myname, cnt)
NHFILE *nhfp;
char *d_str;
const char *myparent;
const char *myname;
int cnt;
{
const char *parent = "str";
sfi_log(nhfp, myparent, myname, parent, cnt);
(*sfiprocs[nhfp->fnidx].fn.sf_str)(nhfp, d_str, myparent, myname, cnt);
#ifdef DO_DEBUG
if (nhfp->fpdebug)
fprintf(nhfp->fpdebug, "(\"%s\")\n", d_str);
#endif
}
void
sfi_addinfo(nhfp, myparent, action, myname, index)
NHFILE *nhfp;
const char *myparent, *action, *myname;
int index;
{
if (nhfp) {
if (nhfp->fplog)
(void) fprintf(nhfp->fplog, "# %s %s %s %d\n", myparent, action, myname, index);
#ifdef DO_DEBUG
if (nhfp->fpdebug)
(void) fprintf(nhfp->fpdebug, "# %s %s %s %d\n", myparent, action, myname, index);
#endif
}
(*sfiprocs[nhfp->fnidx].fn.sf_addinfo)(nhfp, myparent, action, myname, index);
}
void
sfi_log(nhfp, t1, t2, t3, cnt)
NHFILE *nhfp;
const char *t1, *t2, *t3;
int cnt;
{
#ifdef DO_DEBUG
#ifdef SAVEFILE_DEBUGGING
if (nhfp) {
if (nhfp->fplog)
(void) fprintf(nhfp->fplog, "%s %s %s cnt=%d\n", t1, t2, t3, cnt);
if (nhfp->fpdebug)
(void) fprintf(nhfp->fpdebug, "%s %s %s cnt=%d ", t1, t2, t3, cnt);
}
#endif
#else
nhUse(nhfp);
nhUse(t1);
nhUse(t2);
nhUse(t3);
nhUse(cnt);
#endif
}
-6052
View File
File diff suppressed because it is too large Load Diff
-1339
View File
File diff suppressed because it is too large Load Diff
+1
View File
@@ -2655,6 +2655,7 @@ lua_State *L;
tmpobj.recharged = 0; tmpobj.recharged = 0;
tmpobj.greased = 0; tmpobj.greased = 0;
tmpobj.broken = 0; tmpobj.broken = 0;
tmpobj.containment = 0;
if (argc == 1 && lua_type(L, 1) == LUA_TSTRING) { if (argc == 1 && lua_type(L, 1) == LUA_TSTRING) {
const char *paramstr = luaL_checkstring(L, 1); const char *paramstr = luaL_checkstring(L, 1);
+7 -2
View File
@@ -260,8 +260,13 @@ teleok(x, y, trapok)
register int x, y; register int x, y;
boolean trapok; boolean trapok;
{ {
if (!trapok && t_at(x, y)) if (!trapok) {
return FALSE; /* allow teleportation onto vibrating square, it's not a real trap */
struct trap *trap = t_at(x, y);
if (trap && trap->ttyp != VIBRATING_SQUARE) {
return FALSE;
}
}
if (!goodpos(x, y, &g.youmonst, 0)) if (!goodpos(x, y, &g.youmonst, 0))
return FALSE; return FALSE;
if (!tele_jump_ok(u.ux, u.uy, x, y)) if (!tele_jump_ok(u.ux, u.uy, x, y))
-22
View File
@@ -5,8 +5,6 @@
#include "hack.h" #include "hack.h"
#include "lev.h" /* for checking save modes */ #include "lev.h" /* for checking save modes */
#include "sfproto.h"
static void NDECL(stoned_dialogue); static void NDECL(stoned_dialogue);
static void NDECL(vomiting_dialogue); static void NDECL(vomiting_dialogue);
@@ -2165,16 +2163,12 @@ timer_element *timer;
/* assume no pointers in arg */ /* assume no pointers in arg */
if (nhfp->structlevel) if (nhfp->structlevel)
bwrite(nhfp->fd, (genericptr_t) timer, sizeof(timer_element)); bwrite(nhfp->fd, (genericptr_t) timer, sizeof(timer_element));
if (nhfp->fieldlevel)
sfo_fe(nhfp, timer, "timers", "timer", 1);
break; break;
case TIMER_OBJECT: case TIMER_OBJECT:
if (timer->needs_fixup) { if (timer->needs_fixup) {
if (nhfp->structlevel) if (nhfp->structlevel)
bwrite(nhfp->fd, (genericptr_t)timer, sizeof(timer_element)); bwrite(nhfp->fd, (genericptr_t)timer, sizeof(timer_element));
if (nhfp->fieldlevel)
sfo_fe(nhfp, timer, "timers", "timer", 1);
} else { } else {
/* replace object pointer with id */ /* replace object pointer with id */
arg_save.a_obj = timer->arg.a_obj; arg_save.a_obj = timer->arg.a_obj;
@@ -2183,8 +2177,6 @@ timer_element *timer;
timer->needs_fixup = 1; timer->needs_fixup = 1;
if (nhfp->structlevel) if (nhfp->structlevel)
bwrite(nhfp->fd, (genericptr_t)timer, sizeof(timer_element)); bwrite(nhfp->fd, (genericptr_t)timer, sizeof(timer_element));
if (nhfp->fieldlevel)
sfo_fe(nhfp, timer, "timers", "timer", 1);
timer->arg.a_obj = arg_save.a_obj; timer->arg.a_obj = arg_save.a_obj;
timer->needs_fixup = 0; timer->needs_fixup = 0;
} }
@@ -2194,8 +2186,6 @@ timer_element *timer;
if (timer->needs_fixup) { if (timer->needs_fixup) {
if (nhfp->structlevel) if (nhfp->structlevel)
bwrite(nhfp->fd, (genericptr_t)timer, sizeof(timer_element)); bwrite(nhfp->fd, (genericptr_t)timer, sizeof(timer_element));
if (nhfp->fieldlevel)
sfo_fe(nhfp, timer, "timers", "timer", 1);
} else { } else {
/* replace monster pointer with id */ /* replace monster pointer with id */
arg_save.a_monst = timer->arg.a_monst; arg_save.a_monst = timer->arg.a_monst;
@@ -2204,8 +2194,6 @@ timer_element *timer;
timer->needs_fixup = 1; timer->needs_fixup = 1;
if (nhfp->structlevel) if (nhfp->structlevel)
bwrite(nhfp->fd, (genericptr_t)timer, sizeof(timer_element)); bwrite(nhfp->fd, (genericptr_t)timer, sizeof(timer_element));
if (nhfp->fieldlevel)
sfo_fe(nhfp, timer, "timers", "timer", 1);
timer->arg.a_monst = arg_save.a_monst; timer->arg.a_monst = arg_save.a_monst;
timer->needs_fixup = 0; timer->needs_fixup = 0;
} }
@@ -2343,14 +2331,10 @@ int range;
if (range == RANGE_GLOBAL) { if (range == RANGE_GLOBAL) {
if (nhfp->structlevel) if (nhfp->structlevel)
bwrite(nhfp->fd, (genericptr_t) &g.timer_id, sizeof(g.timer_id)); bwrite(nhfp->fd, (genericptr_t) &g.timer_id, sizeof(g.timer_id));
if (nhfp->fieldlevel)
sfo_ulong(nhfp, &g.timer_id, "timers", "g.timer_id", 1);
} }
count = maybe_write_timer(nhfp, range, FALSE); count = maybe_write_timer(nhfp, range, FALSE);
if (nhfp->structlevel) if (nhfp->structlevel)
bwrite(nhfp->fd, (genericptr_t) &count, sizeof count); bwrite(nhfp->fd, (genericptr_t) &count, sizeof count);
if (nhfp->fieldlevel)
sfo_int(nhfp, &count, "timers", "timer_count", 1);
(void) maybe_write_timer(nhfp, range, TRUE); (void) maybe_write_timer(nhfp, range, TRUE);
} }
@@ -2389,22 +2373,16 @@ long adjust; /* how much to adjust timeout */
if (range == RANGE_GLOBAL) { if (range == RANGE_GLOBAL) {
if (nhfp->structlevel) if (nhfp->structlevel)
mread(nhfp->fd, (genericptr_t) &g.timer_id, sizeof g.timer_id); mread(nhfp->fd, (genericptr_t) &g.timer_id, sizeof g.timer_id);
if (nhfp->fieldlevel)
sfi_ulong(nhfp, &g.timer_id, "timers", "g.timer_id", 1);
} }
/* restore elements */ /* restore elements */
if (nhfp->structlevel) if (nhfp->structlevel)
mread(nhfp->fd, (genericptr_t) &count, sizeof count); mread(nhfp->fd, (genericptr_t) &count, sizeof count);
if (nhfp->fieldlevel)
sfi_int(nhfp, &count, "timers", "timer_count", 1);
while (count-- > 0) { while (count-- > 0) {
curr = (timer_element *) alloc(sizeof(timer_element)); curr = (timer_element *) alloc(sizeof(timer_element));
if (nhfp->structlevel) if (nhfp->structlevel)
mread(nhfp->fd, (genericptr_t) curr, sizeof(timer_element)); mread(nhfp->fd, (genericptr_t) curr, sizeof(timer_element));
if (nhfp->fieldlevel)
sfi_fe(nhfp, curr, "timers", "timer", 1);
if (ghostly) if (ghostly)
curr->timeout += adjust; curr->timeout += adjust;
insert_timer(curr); insert_timer(curr);
+7 -33
View File
@@ -7,7 +7,6 @@
#include "dlb.h" #include "dlb.h"
#include "date.h" #include "date.h"
#include "lev.h" #include "lev.h"
#include "sfproto.h"
/* /*
* All the references to the contents of patchlevel.h have been moved * All the references to the contents of patchlevel.h have been moved
@@ -399,26 +398,17 @@ unsigned long utdflags;
if (rlen == 0) if (rlen == 0)
return FALSE; return FALSE;
} }
if (nhfp->fieldlevel) {
sfi_char(nhfp, &indicator, "indicate", "format", 1);
sfi_int(nhfp, &filecmc, "validate", "critical_members_count", 1);
cmc = critical_members_count();
}
if (cmc != filecmc) if (cmc != filecmc)
return FALSE; return FALSE;
if (nhfp->fieldlevel && (nhfp->fnidx > historical)) { rlen = read(nhfp->fd, (genericptr_t) &vers_info, sizeof vers_info);
sfi_version_info(nhfp, &vers_info, "version", "version_info", 1); minit(); /* ZEROCOMP */
} else { if (rlen == 0) {
rlen = read(nhfp->fd, (genericptr_t) &vers_info, sizeof vers_info); if (verbose) {
minit(); /* ZEROCOMP */ pline("File \"%s\" is empty?", name);
if (rlen == 0) { wait_synch();
if (verbose) {
pline("File \"%s\" is empty?", name);
wait_synch();
}
return FALSE;
} }
return FALSE;
} }
if (!check_version(&vers_info, name, verbose, utdflags)) { if (!check_version(&vers_info, name, verbose, utdflags)) {
@@ -437,17 +427,6 @@ NHFILE *nhfp;
int cmc = 0; int cmc = 0;
if (nhfp->mode & WRITING) { if (nhfp->mode & WRITING) {
if (nhfp->fieldlevel) {
indicate = (nhfp->fnidx == ascii) ? 'a' : 'l';
sfo_char(nhfp, &indicate, "indicate", "format", 1);
cmc = critical_members_count();
{
#if 0
pline("critical-members=%d.", cmc);
#endif
}
sfo_int(nhfp, &cmc, "validate", "critical_members_count", 1);
}
if (nhfp->structlevel) { if (nhfp->structlevel) {
indicate = 'h'; /* historical */ indicate = 'h'; /* historical */
bwrite(nhfp->fd, (genericptr_t) &indicate, sizeof indicate); bwrite(nhfp->fd, (genericptr_t) &indicate, sizeof indicate);
@@ -485,11 +464,6 @@ NHFILE *nhfp;
(unsigned) (sizeof version_data)); (unsigned) (sizeof version_data));
bufon(nhfp->fd); bufon(nhfp->fd);
} }
if (nhfp->fieldlevel) {
store_formatindicator(nhfp);
sfo_version_info(nhfp, (struct version_info *) &version_data,
"version", "version_info", 1);
}
return; return;
} }
-22
View File
@@ -5,8 +5,6 @@
#include "hack.h" #include "hack.h"
#include "lev.h" #include "lev.h"
#include "sfproto.h"
#define newseg() (struct wseg *) alloc(sizeof (struct wseg)) #define newseg() (struct wseg *) alloc(sizeof (struct wseg))
#define dealloc_seg(wseg) free((genericptr_t) (wseg)) #define dealloc_seg(wseg) free((genericptr_t) (wseg))
@@ -493,8 +491,6 @@ NHFILE *nhfp;
/* Save number of segments */ /* Save number of segments */
if (nhfp->structlevel) if (nhfp->structlevel)
bwrite(nhfp->fd, (genericptr_t) &count, sizeof(int)); bwrite(nhfp->fd, (genericptr_t) &count, sizeof(int));
if (nhfp->fieldlevel)
sfo_int(nhfp, &count, "worm", "segment_count", 1);
/* Save segment locations of the monster. */ /* Save segment locations of the monster. */
if (count) { if (count) {
for (curr = wtails[i]; curr; curr = curr->nseg) { for (curr = wtails[i]; curr; curr = curr->nseg) {
@@ -502,20 +498,12 @@ NHFILE *nhfp;
bwrite(nhfp->fd, (genericptr_t) &(curr->wx), sizeof(xchar)); bwrite(nhfp->fd, (genericptr_t) &(curr->wx), sizeof(xchar));
bwrite(nhfp->fd, (genericptr_t) &(curr->wy), sizeof(xchar)); bwrite(nhfp->fd, (genericptr_t) &(curr->wy), sizeof(xchar));
} }
if (nhfp->fieldlevel) {
sfo_xchar(nhfp, &(curr->wx), "worm", "wx", 1);
sfo_xchar(nhfp, &(curr->wy), "worm", "wy", 1);
}
} }
} }
} }
if (nhfp->structlevel) { if (nhfp->structlevel) {
bwrite(nhfp->fd, (genericptr_t) wgrowtime, sizeof(wgrowtime)); bwrite(nhfp->fd, (genericptr_t) wgrowtime, sizeof(wgrowtime));
} }
if (nhfp->fieldlevel) {
for (i = 0; i < MAX_NUM_WORMS; ++i)
sfo_long(nhfp, &wgrowtime[i], "worm", "wgrowtime", 1);
}
} }
if (release_data(nhfp)) { if (release_data(nhfp)) {
@@ -550,8 +538,6 @@ NHFILE *nhfp;
for (i = 1; i < MAX_NUM_WORMS; i++) { for (i = 1; i < MAX_NUM_WORMS; i++) {
if (nhfp->structlevel) if (nhfp->structlevel)
mread(nhfp->fd, (genericptr_t) &count, sizeof(int)); mread(nhfp->fd, (genericptr_t) &count, sizeof(int));
if (nhfp->fieldlevel)
sfi_int(nhfp, &count, "worm", "segment_count", 1);
/* Get the segments. */ /* Get the segments. */
for (curr = (struct wseg *) 0, j = 0; j < count; j++) { for (curr = (struct wseg *) 0, j = 0; j < count; j++) {
@@ -561,10 +547,6 @@ NHFILE *nhfp;
mread(nhfp->fd, (genericptr_t) &(temp->wx), sizeof(xchar)); mread(nhfp->fd, (genericptr_t) &(temp->wx), sizeof(xchar));
mread(nhfp->fd, (genericptr_t) &(temp->wy), sizeof(xchar)); mread(nhfp->fd, (genericptr_t) &(temp->wy), sizeof(xchar));
} }
if (nhfp->fieldlevel) {
sfi_xchar(nhfp, &(temp->wx), "worm", "wx", 1);
sfi_xchar(nhfp, &(temp->wy), "worm", "wy", 1);
}
if (curr) if (curr)
curr->nseg = temp; curr->nseg = temp;
else else
@@ -576,10 +558,6 @@ NHFILE *nhfp;
if (nhfp->structlevel) { if (nhfp->structlevel) {
mread(nhfp->fd, (genericptr_t) wgrowtime, sizeof(wgrowtime)); mread(nhfp->fd, (genericptr_t) wgrowtime, sizeof(wgrowtime));
} }
if (nhfp->fieldlevel) {
for (i = 0; i < MAX_NUM_WORMS; ++i)
sfi_long(nhfp, &wgrowtime[i], "worm", "wgrowtime", 1);
}
} }
/* /*
+3 -3
View File
@@ -308,8 +308,7 @@ VOBJ20 = $(O)vis_tab.o $(O)weapon.o $(O)were.o $(O)wield.o $(O)windows.
VOBJ21 = $(O)wintty.o $(O)wizard.o $(O)worm.o $(O)worn.o $(O)write.o VOBJ21 = $(O)wintty.o $(O)wizard.o $(O)worm.o $(O)worn.o $(O)write.o
VOBJ22 = $(O)zap.o $(O)light.o $(O)dlb.o $(O)dig.o $(O)teleport.o VOBJ22 = $(O)zap.o $(O)light.o $(O)dlb.o $(O)dig.o $(O)teleport.o
VOBJ23 = $(O)region.o $(O)sys.o $(REGEX) $(O)isaac64.o VOBJ23 = $(O)region.o $(O)sys.o $(REGEX) $(O)isaac64.o
VOBJ24 = $(O)sfbase.o $(O)sfdata.o VOBJ24 = $(O)sfstruct.o
VOBJ25 = $(O)sfstruct.o $(O)sfascii.o $(O)sflendian.o
SOBJ = $(O)msdos.o $(O)pcsys.o $(O)tty.o $(O)unix.o \ SOBJ = $(O)msdos.o $(O)pcsys.o $(O)tty.o $(O)unix.o \
$(O)video.o $(O)vidtxt.o $(O)pckeys.o $(O)video.o $(O)vidtxt.o $(O)pckeys.o
@@ -317,7 +316,7 @@ SOBJ = $(O)msdos.o $(O)pcsys.o $(O)tty.o $(O)unix.o \
VVOBJ = $(O)version.o VVOBJ = $(O)version.o
ifeq "$(ADD_LUA)" "Y" ifeq "$(ADD_LUA)" "Y"
LUAOBJ = $(O)nhlua.o $(O)nhlsel.o LUAOBJ = $(O)nhlua.o $(O)nhlsel.o $(O)nhlobj.o
LUA_QTEXT_FILE = "quest.lua" LUA_QTEXT_FILE = "quest.lua"
endif endif
@@ -1455,6 +1454,7 @@ $(O)muse.o: muse.c $(HACK_H)
$(O)music.o: music.c $(HACK_H) #interp.c $(O)music.o: music.c $(HACK_H) #interp.c
$(O)nhlua.o: nhlua.c $(HACK_H) $(O)nhlua.o: nhlua.c $(HACK_H)
$(O)nhlsel.o: nhlsel.c $(HACK_H) $(O)nhlsel.o: nhlsel.c $(HACK_H)
$(O)nhlobj.o: nhlobj.c $(HACK_H)
$(O)o_init.o: o_init.c $(HACK_H) $(INCL)/lev.h $(O)o_init.o: o_init.c $(HACK_H) $(INCL)/lev.h
$(O)objects.o: objects.c $(CONFIG_H) $(INCL)/obj.h $(INCL)/objclass.h \ $(O)objects.o: objects.c $(CONFIG_H) $(INCL)/obj.h $(INCL)/objclass.h \
$(INCL)/prop.h $(INCL)/skills.h $(INCL)/color.h $(INCL)/prop.h $(INCL)/skills.h $(INCL)/color.h
+2 -3
View File
@@ -310,8 +310,7 @@ VOBJ20 = $(O)vis_tab.o $(O)weapon.o $(O)were.o $(O)wield.o $(O)windows.
VOBJ21 = $(O)wintty.o $(O)wizard.o $(O)worm.o $(O)worn.o $(O)write.o VOBJ21 = $(O)wintty.o $(O)wizard.o $(O)worm.o $(O)worn.o $(O)write.o
VOBJ22 = $(O)zap.o $(O)light.o $(O)dlb.o $(O)dig.o $(O)teleport.o VOBJ22 = $(O)zap.o $(O)light.o $(O)dlb.o $(O)dig.o $(O)teleport.o
VOBJ23 = $(O)region.o $(O)sys.o $(REGEX) $(O)isaac64.o $(VIDEO_OBJ) VOBJ23 = $(O)region.o $(O)sys.o $(REGEX) $(O)isaac64.o $(VIDEO_OBJ)
VOBJ24 = $(O)sfbase.o $(O)sfdata.o VOBJ24 = $(O)sfstruct.o
VOBJ25 = $(O)sfstruct.o $(O)sfascii.o $(O)sflendian.o
SOBJ = $(O)msdos.o $(O)pcsys.o $(O)tty.o $(O)unix.o \ SOBJ = $(O)msdos.o $(O)pcsys.o $(O)tty.o $(O)unix.o \
$(O)video.o $(O)vidtxt.o $(O)pckeys.o $(O)video.o $(O)vidtxt.o $(O)pckeys.o
@@ -321,7 +320,7 @@ VVOBJ = $(O)version.o
MDLIB = $(O)mdlib.o MDLIB = $(O)mdlib.o
ifeq "$(ADD_LUA)" "Y" ifeq "$(ADD_LUA)" "Y"
LUAOBJ = $(O)nhlua.o $(O)nhlsel.o LUAOBJ = $(O)nhlua.o $(O)nhlsel.o $(O)nhlobj.o
LUA_QTEXT_FILE = "quest.lua" LUA_QTEXT_FILE = "quest.lua"
endif endif
-3
View File
@@ -7,7 +7,6 @@
#include "hack.h" #include "hack.h"
#include "dlb.h" #include "dlb.h"
#include "sfproto.h"
#ifndef NO_SIGNAL #ifndef NO_SIGNAL
#include <signal.h> #include <signal.h>
@@ -450,8 +449,6 @@ _CrtSetReportFile(_CRT_ASSERT, _CRTDBG_FILE_STDERR);*/
g.hackpid = 1; g.hackpid = 1;
if (nhfp->structlevel) if (nhfp->structlevel)
write(nhfp->fd, (genericptr_t) &g.hackpid, sizeof(g.hackpid)); write(nhfp->fd, (genericptr_t) &g.hackpid, sizeof(g.hackpid));
if (nhfp->fieldlevel)
sfi_int(nhfp, &g.hackpid, "locking", "g.hackpid", 1);
close_nhfile(nhfp); close_nhfile(nhfp);
} }
#ifdef MFLOPPY #ifdef MFLOPPY
+4 -4
View File
@@ -65,11 +65,11 @@ rip.xpm: ../win/X11/rip.xpm
mapbg.xpm: ../win/gnome/mapbg.xpm mapbg.xpm: ../win/gnome/mapbg.xpm
cp ../win/gnome/mapbg.xpm mapbg.xpm cp ../win/gnome/mapbg.xpm mapbg.xpm
nhsplash.xpm: ../win/Qt/nhsplash.xpm nhsplash.xpm: ../win/share/nhsplash.xpm
cp ../win/Qt/nhsplash.xpm nhsplash.xpm cp ../win/share/nhsplash.xpm nhsplash.xpm
nethack.icns: ../win/Qt/nhicns.uu nethack.icns: ../win/share/nhicns.uu
$(UUDECODE) ../win/Qt/nhicns.uu $(UUDECODE) ../win/share/nhicns.uu
Info.plist: ../win/Qt/Info.pli Info.plist: ../win/Qt/Info.pli
cp ../win/Qt/Info.pli Info.plist cp ../win/Qt/Info.pli Info.plist
+247 -212
View File
@@ -1,5 +1,5 @@
# NetHack Makefile. # NetHack Makefile.
# NetHack 3.6 Makefile.src $NHDT-Date: 1575076770 2019/11/30 01:19:30 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.79 $ # NetHack 3.6 Makefile.src $NHDT-Date: 1575932543 2019/12/09 23:02:23 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.87 $
# Copyright (c) 2018 by Pasi Kallinen # Copyright (c) 2018 by Pasi Kallinen
# NetHack may be freely redistributed. See license for details. # NetHack may be freely redistributed. See license for details.
@@ -224,26 +224,27 @@ WINX11SRC = ../win/X11/Window.c ../win/X11/dialogs.c ../win/X11/winX.c \
WINX11OBJ = Window.o dialogs.o winX.o winmap.o winmenu.o winmesg.o \ WINX11OBJ = Window.o dialogs.o winX.o winmap.o winmenu.o winmesg.o \
winmisc.o winstat.o wintext.o winval.o tile.o winmisc.o winstat.o wintext.o winval.o tile.o
# #
# Files for a Qt port # Files for a Qt 3 port (renamed since nethack 3.6.x)
# #
WINQTSRC = ../win/Qt/qt_win.cpp ../win/Qt/qt_clust.cpp ../win/Qt/qttableview.cpp WINQT3SRC = ../win/Qt3/qt3_win.cpp ../win/Qt3/qt3_clust.cpp \
WINQTOBJ = qt_win.o qt_clust.o qttableview.o tile.o ../win/Qt3/qt3tableview.cpp
WINQT3OBJ = qt3_win.o qt3_clust.o qt3tableview.o tile.o
# #
# Files for a Qt 4 or 5 port # Files for a Qt 4 or 5 port
# #
WINQT4SRC = ../win/Qt4/qt4bind.cpp ../win/Qt4/qt4click.cpp \ WINQTSRC = ../win/Qt/qt_bind.cpp ../win/Qt/qt_click.cpp \
../win/Qt4/qt4clust.cpp ../win/Qt4/qt4delay.cpp \ ../win/Qt/qt_clust.cpp ../win/Qt/qt_delay.cpp \
../win/Qt4/qt4glyph.cpp ../win/Qt4/qt4icon.cpp ../win/Qt4/qt4inv.cpp \ ../win/Qt/qt_glyph.cpp ../win/Qt/qt_icon.cpp ../win/Qt/qt_inv.cpp \
../win/Qt4/qt4key.cpp ../win/Qt4/qt4line.cpp ../win/Qt4/qt4main.cpp \ ../win/Qt/qt_key.cpp ../win/Qt/qt_line.cpp ../win/Qt/qt_main.cpp \
../win/Qt4/qt4map.cpp ../win/Qt4/qt4menu.cpp ../win/Qt4/qt4msg.cpp \ ../win/Qt/qt_map.cpp ../win/Qt/qt_menu.cpp ../win/Qt/qt_msg.cpp \
../win/Qt4/qt4plsel.cpp ../win/Qt4/qt4rip.cpp ../win/Qt4/qt4set.cpp \ ../win/Qt/qt_plsel.cpp ../win/Qt/qt_rip.cpp ../win/Qt/qt_set.cpp \
../win/Qt4/qt4stat.cpp ../win/Qt4/qt4str.cpp ../win/Qt4/qt4streq.cpp \ ../win/Qt/qt_stat.cpp ../win/Qt/qt_str.cpp ../win/Qt/qt_streq.cpp \
../win/Qt4/qt4svsel.cpp ../win/Qt4/qt4win.cpp ../win/Qt4/qt4xcmd.cpp \ ../win/Qt/qt_svsel.cpp ../win/Qt/qt_win.cpp ../win/Qt/qt_xcmd.cpp \
../win/Qt4/qt4yndlg.cpp ../win/Qt/qt_yndlg.cpp
WINQT4OBJ = qt4bind.o qt4click.o qt4clust.o qt4delay.o qt4glyph.o qt4icon.o \ WINQTOBJ = qt_bind.o qt_click.o qt_clust.o qt_delay.o qt_glyph.o qt_icon.o \
qt4inv.o qt4key.o qt4line.o qt4main.o qt4map.o qt4menu.o qt4msg.o \ qt_inv.o qt_key.o qt_line.o qt_main.o qt_map.o qt_menu.o qt_msg.o \
qt4plsel.o qt4rip.o qt4set.o qt4stat.o qt4str.o qt4streq.o qt4svsel.o \ qt_plsel.o qt_rip.o qt_set.o qt_stat.o qt_str.o qt_streq.o qt_svsel.o \
qt4win.o qt4xcmd.o qt4yndlg.o tile.o qt_win.o qt_xcmd.o qt_yndlg.o tile.o
# #
# Files for a Gnome port # Files for a Gnome port
# #
@@ -302,12 +303,12 @@ WINBEOBJ =
# #
# #
# libraries for Qt 3 # libraries for Qt 3
WINQTLIB = -L$(QTDIR)/lib -lqt WINQT3LIB = -L$(QTDIR)/lib -lqt
# #
# libraries for Qt 4 # libraries for Qt 4
WINQT4LIB = `pkg-config QtGui --libs` WINQT4LIB = `pkg-config QtGui --libs`
# #
# libraries for Qt 5 (use with WINQT4SRC and WINQT4OBJ) # libraries for Qt 5 (use with WINQTSRC and WINQTOBJ)
WINQT5LIB = `pkg-config Qt5Gui Qt5Widgets Qt5Multimedia --libs` WINQT5LIB = `pkg-config Qt5Gui Qt5Widgets Qt5Multimedia --libs`
# #
# libraries for KDE (with Qt) # libraries for KDE (with Qt)
@@ -448,11 +449,10 @@ HACKCSRC = allmain.c alloc.c apply.c artifact.c attrib.c ball.c bones.c \
lock.c mail.c makemon.c mapglyph.c mcastu.c mdlib.c mhitm.c \ lock.c mail.c makemon.c mapglyph.c mcastu.c mdlib.c mhitm.c \
mhitu.c minion.c mklev.c mkmap.c mkmaze.c mkobj.c mkroom.c mon.c \ mhitu.c minion.c mklev.c mkmap.c mkmaze.c mkobj.c mkroom.c mon.c \
mondata.c monmove.c monst.c mplayer.c mthrowu.c muse.c music.c \ mondata.c monmove.c monst.c mplayer.c mthrowu.c muse.c music.c \
nhlua.c nhlsel.c o_init.c objects.c objnam.c \ nhlua.c nhlsel.c nhlobj.c o_init.c objects.c objnam.c \
options.c pager.c pickup.c pline.c polyself.c potion.c pray.c \ options.c pager.c pickup.c pline.c polyself.c potion.c pray.c \
priest.c quest.c questpgr.c read.c rect.c region.c restore.c \ priest.c quest.c questpgr.c read.c rect.c region.c restore.c \
rip.c rnd.c role.c rumors.c save.c sfstruct.c \ rip.c rnd.c role.c rumors.c save.c sfstruct.c \
sfbase.c sfdata.c sfascii.c sflendian.c \
shk.c shknam.c sit.c sounds.c \ shk.c shknam.c sit.c sounds.c \
sp_lev.c spell.c steal.c steed.c sys.c teleport.c timeout.c \ sp_lev.c spell.c steal.c steed.c sys.c teleport.c timeout.c \
topten.c track.c trap.c u_init.c \ topten.c track.c trap.c u_init.c \
@@ -469,12 +469,12 @@ SYSCSRC = ../sys/atari/tos.c ../sys/share/pcmain.c ../sys/share/pcsys.c \
SYSCXXSRC = ../sys/share/cppregex.cpp SYSCXXSRC = ../sys/share/cppregex.cpp
# generated source files (tile.c is handled separately via WINxxxSRC) # generated source files (tile.c is handled separately via WINxxxSRC)
GENCSRC = vis_tab.c sfdata.c #tile.c GENCSRC = vis_tab.c #tile.c
# all windowing-system-dependent .c (for dependencies and such) # all windowing-system-dependent .c (for dependencies and such)
WINCSRC = $(WINTTYSRC) $(WINCURSESSRC) $(WINX11SRC) $(WINGNOMESRC) $(WINGEMSRC) WINCSRC = $(WINTTYSRC) $(WINCURSESSRC) $(WINX11SRC) $(WINGNOMESRC) $(WINGEMSRC)
# all windowing-system-dependent .cpp (for dependencies and such) # all windowing-system-dependent .cpp (for dependencies and such)
WINCXXSRC = $(WINQTSRC) $(WINQT4SRC) $(WINBESRC) WINCXXSRC = $(WINQTSRC) $(WINQT3SRC) $(WINBESRC)
# Files for window system chaining. Requires SYSCF; include via HINTSRC/HINTOBJ # Files for window system chaining. Requires SYSCF; include via HINTSRC/HINTOBJ
CHAINSRC = ../win/chain/wc_chainin.c ../win/chain/wc_chainout.c \ CHAINSRC = ../win/chain/wc_chainin.c ../win/chain/wc_chainout.c \
@@ -516,11 +516,10 @@ HOBJ = $(FIRSTOBJ) allmain.o alloc.o apply.o artifact.o attrib.o ball.o \
light.o lock.o mail.o makemon.o mapglyph.o mcastu.o mdlib.o mhitm.o \ light.o lock.o mail.o makemon.o mapglyph.o mcastu.o mdlib.o mhitm.o \
mhitu.o minion.o mklev.o mkmap.o mkmaze.o mkobj.o mkroom.o mon.o \ mhitu.o minion.o mklev.o mkmap.o mkmaze.o mkobj.o mkroom.o mon.o \
mondata.o monmove.o mplayer.o mthrowu.o muse.o music.o \ mondata.o monmove.o mplayer.o mthrowu.o muse.o music.o \
nhlua.o nhlsel.o o_init.o objnam.o options.o \ nhlua.o nhlsel.o nhlobj.o o_init.o objnam.o options.o \
pager.o pickup.o pline.o polyself.o potion.o pray.o priest.o \ pager.o pickup.o pline.o polyself.o potion.o pray.o priest.o \
quest.o questpgr.o read.o rect.o region.o restore.o rip.o rnd.o \ quest.o questpgr.o read.o rect.o region.o restore.o rip.o rnd.o \
role.o rumors.o save.o sfstruct.o \ role.o rumors.o save.o sfstruct.o \
sfbase.o sfdata.o sfascii.o sflendian.o \
shk.o shknam.o sit.o sounds.o sp_lev.o spell.o sys.o \ shk.o shknam.o sit.o sounds.o sp_lev.o spell.o sys.o \
steal.o steed.o teleport.o timeout.o topten.o track.o trap.o u_init.o \ steal.o steed.o teleport.o timeout.o topten.o track.o trap.o u_init.o \
uhitm.o vault.o vision.o vis_tab.o weapon.o were.o wield.o windows.o \ uhitm.o vault.o vision.o vis_tab.o weapon.o were.o wield.o windows.o \
@@ -528,6 +527,10 @@ HOBJ = $(FIRSTOBJ) allmain.o alloc.o apply.o artifact.o attrib.o ball.o \
$(REGEXOBJ) $(RANDOBJ) $(SYSOBJ) $(WINOBJ) $(HINTOBJ) version.o $(REGEXOBJ) $(RANDOBJ) $(SYSOBJ) $(WINOBJ) $(HINTOBJ) version.o
# the .o files from the HACKCSRC, SYSSRC, and WINSRC lists # the .o files from the HACKCSRC, SYSSRC, and WINSRC lists
# first target is also the default target for 'make' without any arguments
all: $(GAME)
@echo ""
$(GAME): $(SYSTEM) $(GAME): $(SYSTEM)
@echo "$(GAME) is up to date." @echo "$(GAME) is up to date."
@@ -583,8 +586,6 @@ DUMB.Setup: ../include/extern.h
cp ../include/extern.DUMB ../include/extern.h cp ../include/extern.DUMB ../include/extern.h
@touch DUMB.Setup @touch DUMB.Setup
all: $(GAME)
../lib/lua/liblua.a ../include/nhlua.h: ../lib/lua/liblua.a ../include/nhlua.h:
@( cd .. ; $(MAKE) lua_support ) @( cd .. ; $(MAKE) lua_support )
@@ -603,36 +604,34 @@ objects.o:
@rm -f $(MAKEDEFS) @rm -f $(MAKEDEFS)
# Qt 3 windowport meta-object-compiler output # Qt 3 windowport meta-object-compiler output
qt_kde0.moc: ../include/qt_kde0.h qt3_kde0.moc: ../win/Qt3/qt3_kde0.h
$(QTDIR)/bin/moc -o qt_kde0.moc ../include/qt_kde0.h $(QTDIR)/bin/moc -o qt3kde0.moc ../win/Qt3/qt3_kde0.h
qt3_win.moc: ../win/Qt3/qt3_win.h
qt_win.moc: ../include/qt_win.h $(QTDIR)/bin/moc -o qt3win.moc ../win/Qt3/qt3_win.h
$(QTDIR)/bin/moc -o qt_win.moc ../include/qt_win.h qt3tableview.moc: ../win/Qt3/qt3tableview.h
$(QTDIR)/bin/moc -o qt3tableview.moc ../win/Qt/qt3tableview.h
qttableview.moc: ../include/qttableview.h
$(QTDIR)/bin/moc -o qttableview.moc ../include/qttableview.h
# Qt 4 windowport meta-object-compiler output # Qt 4 windowport meta-object-compiler output
qt4kde0.moc : ../win/Qt4/qt4kde0.h qt_kde0.moc : ../win/Qt/qt_kde0.h
$(QTDIR)/bin/$(MOC) -o qt4kde0.moc ../win/Qt4/qt4kde0.h $(QTDIR)/bin/$(MOC) -o qt_kde0.moc ../win/Qt/qt_kde0.h
qt4main.moc : ../win/Qt4/qt4main.h qt_main.moc : ../win/Qt/qt_main.h
$(QTDIR)/bin/$(MOC) -o qt4main.moc ../win/Qt4/qt4main.h $(QTDIR)/bin/$(MOC) -o qt_main.moc ../win/Qt/qt_main.h
qt4map.moc : ../win/Qt4/qt4map.h qt_map.moc : ../win/Qt/qt_map.h
$(QTDIR)/bin/$(MOC) -o qt4map.moc ../win/Qt4/qt4map.h $(QTDIR)/bin/$(MOC) -o qt_map.moc ../win/Qt/qt_map.h
qt4menu.moc : ../win/Qt4/qt4menu.h qt_menu.moc : ../win/Qt/qt_menu.h
$(QTDIR)/bin/$(MOC) -o qt4menu.moc ../win/Qt4/qt4menu.h $(QTDIR)/bin/$(MOC) -o qt_menu.moc ../win/Qt/qt_menu.h
qt4msg.moc : ../win/Qt4/qt4msg.h qt_msg.moc : ../win/Qt/qt_msg.h
$(QTDIR)/bin/$(MOC) -o qt4msg.moc ../win/Qt4/qt4msg.h $(QTDIR)/bin/$(MOC) -o qt_msg.moc ../win/Qt/qt_msg.h
qt4plsel.moc : ../win/Qt4/qt4plsel.h qt_plsel.moc : ../win/Qt/qt_plsel.h
$(QTDIR)/bin/$(MOC) -o qt4plsel.moc ../win/Qt4/qt4plsel.h $(QTDIR)/bin/$(MOC) -o qt_plsel.moc ../win/Qt/qt_plsel.h
qt4set.moc : ../win/Qt4/qt4set.h qt_set.moc : ../win/Qt/qt_set.h
$(QTDIR)/bin/$(MOC) -o qt4set.moc ../win/Qt4/qt4set.h $(QTDIR)/bin/$(MOC) -o qt_set.moc ../win/Qt/qt_set.h
qt4stat.moc : ../win/Qt4/qt4stat.h qt_stat.moc : ../win/Qt/qt_stat.h
$(QTDIR)/bin/$(MOC) -o qt4stat.moc ../win/Qt4/qt4stat.h $(QTDIR)/bin/$(MOC) -o qt_stat.moc ../win/Qt/qt_stat.h
qt4xcmd.moc : ../win/Qt4/qt4xcmd.h qt_xcmd.moc : ../win/Qt/qt_xcmd.h
$(QTDIR)/bin/$(MOC) -o qt4xcmd.moc ../win/Qt4/qt4xcmd.h $(QTDIR)/bin/$(MOC) -o qt_xcmd.moc ../win/Qt/qt_xcmd.h
qt4yndlg.moc : ../win/Qt4/qt4yndlg.h qt_yndlg.moc : ../win/Qt/qt_yndlg.h
$(QTDIR)/bin/$(MOC) -o qt4yndlg.moc ../win/Qt4/qt4yndlg.h $(QTDIR)/bin/$(MOC) -o qt_yndlg.moc ../win/Qt/qt_yndlg.h
# build monst.o and objects.o before executing '$(MAKE) makedefs' # build monst.o and objects.o before executing '$(MAKE) makedefs'
$(MAKEDEFS): $(FIRSTOBJ) \ $(MAKEDEFS): $(FIRSTOBJ) \
@@ -666,26 +665,7 @@ tile.c: ../win/share/tilemap.c $(HACK_H)
../win/gnome/gn_rip.h: ../win/X11/rip.xpm ../win/gnome/gn_rip.h: ../win/X11/rip.xpm
cp ../win/X11/rip.xpm ../win/gnome/gn_rip.h cp ../win/X11/rip.xpm ../win/gnome/gn_rip.h
# readtags dependencies
#
#
sfstruct.o: sfstruct.c $(HACK_H) sfstruct.o: sfstruct.c $(HACK_H)
sfbase.o: sfbase.c $(HACK_H) ../include/sfproto.h ../include/sfprocs.h
sfascii.o: sfascii.c $(HACK_H) ../include/sfprocs.h
sflendian.o: sflendian.c $(HACK_H) ../include/sfprocs.h
sfdata.o: sfdata.c $(HACK_H) ../include/sfprocs.h
#../util/readtags:
# @( cd ../util ; $(MAKE) readtags )
#
#../util/nethack.tags:
# @( cd ../util ; $(MAKE) nethack.tags )
#
#sfdata.c: ../util/readtags ../util/nethack.tags
# @( cd ../util ; ./readtags )
#
#../include/sfproto.h: ../util/readtags ../util/nethack.tags
# @( cd ../util ; ./readtags )
# date.h should be remade any time any of the source or include code # date.h should be remade any time any of the source or include code
# is modified. Unfortunately, this would make the contents of this # is modified. Unfortunately, this would make the contents of this
@@ -730,7 +710,7 @@ spotless: clean
depend: ../sys/unix/depend.awk \ depend: ../sys/unix/depend.awk \
$(SYSCSRC) $(WINCSRC) $(SYSCXXSRC) $(WINCXXSRC) \ $(SYSCSRC) $(WINCSRC) $(SYSCXXSRC) $(WINCXXSRC) \
$(CHAINSRC) $(GENCSRC) $(HACKCSRC) $(CHAINSRC) $(GENCSRC) $(HACKCSRC)
$(AWK) -f ../sys/unix/depend.awk ../include/*.h \ $(AWK) -f ../sys/unix/depend.awk ../include/*.h ../win/*/*.h \
$(SYSCSRC) $(WINCSRC) $(SYSCXXSRC) $(WINCXXSRC) \ $(SYSCSRC) $(WINCSRC) $(SYSCXXSRC) $(WINCXXSRC) \
$(CHAINSRC) $(GENCSRC) $(HACKCSRC) >makedep $(CHAINSRC) $(GENCSRC) $(HACKCSRC) >makedep
@echo '/^# DO NOT DELETE THIS LINE OR CHANGE ANYTHING BEYOND IT/+2,$$d' >eddep @echo '/^# DO NOT DELETE THIS LINE OR CHANGE ANYTHING BEYOND IT/+2,$$d' >eddep
@@ -750,11 +730,10 @@ depend: ../sys/unix/depend.awk \
# config.h timestamp # config.h timestamp
$(CONFIG_H): ../include/config.h ../include/config1.h ../include/tradstdc.h \ $(CONFIG_H): ../include/config.h ../include/config1.h ../include/tradstdc.h \
../include/global.h ../include/coord.h ../include/vmsconf.h \ ../include/global.h ../include/coord.h ../include/vmsconf.h \
../include/system.h ../include/unixconf.h ../include/os2conf.h \ ../include/system.h ../include/nhlua.h ../include/unixconf.h \
../include/micro.h ../include/pcconf.h ../include/tosconf.h \ ../include/os2conf.h ../include/micro.h ../include/pcconf.h \
../include/amiconf.h ../include/macconf.h ../include/beconf.h \ ../include/tosconf.h ../include/amiconf.h ../include/macconf.h \
../include/wceconf.h ../include/ntconf.h \ ../include/beconf.h ../include/wceconf.h ../include/ntconf.h
../include/nhlua.h
touch $(CONFIG_H) touch $(CONFIG_H)
# hack.h timestamp # hack.h timestamp
$(HACK_H): ../include/hack.h $(CONFIG_H) ../include/lint.h ../include/align.h \ $(HACK_H): ../include/hack.h $(CONFIG_H) ../include/lint.h ../include/align.h \
@@ -762,15 +741,16 @@ $(HACK_H): ../include/hack.h $(CONFIG_H) ../include/lint.h ../include/align.h \
../include/objclass.h ../include/youprop.h ../include/prop.h \ ../include/objclass.h ../include/youprop.h ../include/prop.h \
../include/permonst.h ../include/monattk.h \ ../include/permonst.h ../include/monattk.h \
../include/monflag.h ../include/mondata.h ../include/pm.h \ ../include/monflag.h ../include/mondata.h ../include/pm.h \
../include/wintype.h ../include/context.h ../include/decl.h \ ../include/wintype.h ../include/context.h ../include/rm.h \
../include/quest.h ../include/spell.h ../include/color.h \ ../include/botl.h ../include/qtext.h ../include/rect.h \
../include/obj.h ../include/you.h ../include/attrib.h \ ../include/region.h ../include/decl.h ../include/quest.h \
../include/monst.h ../include/mextra.h ../include/skills.h \ ../include/spell.h ../include/color.h ../include/obj.h \
../include/onames.h ../include/timeout.h ../include/trap.h \ ../include/you.h ../include/attrib.h ../include/monst.h \
../include/flag.h ../include/rm.h ../include/vision.h \ ../include/mextra.h ../include/skills.h ../include/onames.h \
../include/display.h ../include/engrave.h ../include/rect.h \ ../include/timeout.h ../include/trap.h ../include/flag.h \
../include/region.h ../include/winprocs.h ../include/botl.h \ ../include/vision.h ../include/display.h ../include/engrave.h \
../include/sys.h ../include/wintty.h ../include/trampoli.h ../include/winprocs.h ../include/sys.h ../include/wintty.h \
../include/trampoli.h
touch $(HACK_H) touch $(HACK_H)
# #
tos.o: ../sys/atari/tos.c $(HACK_H) ../include/tcap.h tos.o: ../sys/atari/tos.c $(HACK_H) ../include/tcap.h
@@ -862,44 +842,82 @@ tile.o: tile.c $(HACK_H)
gnaskstr.o: ../win/gnome/gnaskstr.c ../win/gnome/gnaskstr.h \ gnaskstr.o: ../win/gnome/gnaskstr.c ../win/gnome/gnaskstr.h \
../win/gnome/gnmain.h ../win/gnome/gnmain.h
$(CC) $(CFLAGS) $(GNOMEINC) -c -o $@ ../win/gnome/gnaskstr.c $(CC) $(CFLAGS) $(GNOMEINC) -c -o $@ ../win/gnome/gnaskstr.c
gnbind.o: ../win/gnome/gnbind.c ../win/gnome/gnbind.h ../win/gnome/gnmain.h \ gnbind.o: ../win/gnome/gnbind.c ../win/gnome/gnbind.h ../win/gnome/gnomeprv.h \
../win/gnome/gnmenu.h ../win/gnome/gnaskstr.h \ $(HACK_H) ../include/dlb.h ../include/patchlevel.h \
../win/gnome/gnyesno.h ../include/winGnome.h ../win/gnome/gnmain.h \
../win/gnome/gnmap.h ../win/gnome/gnmenu.h \
../win/gnome/gnplayer.h ../win/gnome/gnsignal.h \
../win/gnome/gnglyph.h ../win/gnome/gnstatus.h \
../win/gnome/gntext.h ../win/gnome/gnmesg.h \
../win/gnome/gnyesno.h ../win/gnome/gnworn.h \
../win/gnome/gnaskstr.h
$(CC) $(CFLAGS) $(GNOMEINC) -c -o $@ ../win/gnome/gnbind.c $(CC) $(CFLAGS) $(GNOMEINC) -c -o $@ ../win/gnome/gnbind.c
gnglyph.o: ../win/gnome/gnglyph.c ../win/gnome/gnglyph.h ../include/tile2x11.h gnglyph.o: ../win/gnome/gnglyph.c ../win/gnome/gnglyph.h $(CONFIG_H) \
../include/tile2x11.h
$(CC) $(CFLAGS) $(GNOMEINC) -c -o $@ ../win/gnome/gnglyph.c $(CC) $(CFLAGS) $(GNOMEINC) -c -o $@ ../win/gnome/gnglyph.c
gnmain.o: ../win/gnome/gnmain.c ../win/gnome/gnmain.h ../win/gnome/gnsignal.h \ gnmain.o: ../win/gnome/gnmain.c ../win/gnome/gnmain.h ../win/gnome/gnsignal.h \
../win/gnome/gnbind.h ../win/gnome/gnopts.h $(HACK_H) \ ../win/gnome/gnomeprv.h $(HACK_H) ../include/dlb.h \
../include/date.h ../include/patchlevel.h ../include/winGnome.h \
../win/gnome/gnglyph.h ../win/gnome/gnbind.h \
../win/gnome/gnmap.h ../win/gnome/gnmenu.h \
../win/gnome/gnplayer.h ../win/gnome/gnstatus.h \
../win/gnome/gntext.h ../win/gnome/gnmesg.h \
../win/gnome/gnyesno.h ../win/gnome/gnworn.h \
../win/gnome/gnopts.h ../include/date.h
$(CC) $(CFLAGS) $(GNOMEINC) -c -o $@ ../win/gnome/gnmain.c $(CC) $(CFLAGS) $(GNOMEINC) -c -o $@ ../win/gnome/gnmain.c
gnmap.o: ../win/gnome/gnmap.c ../win/gnome/gnmap.h ../win/gnome/gnglyph.h \ gnmap.o: ../win/gnome/gnmap.c ../win/gnome/gnmap.h $(CONFIG_H) \
../win/gnome/gnsignal.h $(HACK_H) ../win/gnome/gnglyph.h ../win/gnome/gnsignal.h \
../win/gnome/gnomeprv.h $(HACK_H) ../include/dlb.h \
../include/patchlevel.h ../include/winGnome.h
$(CC) $(CFLAGS) $(GNOMEINC) -c -o $@ ../win/gnome/gnmap.c $(CC) $(CFLAGS) $(GNOMEINC) -c -o $@ ../win/gnome/gnmap.c
gnmenu.o: ../win/gnome/gnmenu.c ../win/gnome/gnmenu.h ../win/gnome/gnmain.h \ gnmenu.o: ../win/gnome/gnmenu.c ../win/gnome/gnmenu.h $(CONFIG_H) \
../win/gnome/gnbind.h ../include/func_tab.h ../win/gnome/gnomeprv.h $(HACK_H) ../include/dlb.h \
../include/patchlevel.h ../include/winGnome.h \
../win/gnome/gnmain.h ../win/gnome/gnbind.h \
../win/gnome/gnmap.h ../win/gnome/gnplayer.h \
../win/gnome/gnsignal.h ../win/gnome/gnglyph.h \
../win/gnome/gnstatus.h ../win/gnome/gntext.h \
../win/gnome/gnmesg.h ../win/gnome/gnyesno.h \
../win/gnome/gnworn.h ../include/func_tab.h
$(CC) $(CFLAGS) $(GNOMEINC) -c -o $@ ../win/gnome/gnmenu.c $(CC) $(CFLAGS) $(GNOMEINC) -c -o $@ ../win/gnome/gnmenu.c
gnmesg.o: ../win/gnome/gnmesg.c ../win/gnome/gnmesg.h ../win/gnome/gnsignal.h gnmesg.o: ../win/gnome/gnmesg.c ../win/gnome/gnmesg.h $(CONFIG_H) \
../win/gnome/gnsignal.h ../win/gnome/gnomeprv.h $(HACK_H) \
../include/dlb.h ../include/patchlevel.h ../include/winGnome.h \
../win/gnome/gnglyph.h
$(CC) $(CFLAGS) $(GNOMEINC) -c -o $@ ../win/gnome/gnmesg.c $(CC) $(CFLAGS) $(GNOMEINC) -c -o $@ ../win/gnome/gnmesg.c
gnopts.o: ../win/gnome/gnopts.c ../win/gnome/gnopts.h ../win/gnome/gnglyph.h \ gnopts.o: ../win/gnome/gnopts.c ../win/gnome/gnopts.h ../win/gnome/gnglyph.h \
../win/gnome/gnmain.h ../win/gnome/gnmap.h $(HACK_H) $(CONFIG_H) ../win/gnome/gnmain.h ../win/gnome/gnmap.h $(HACK_H)
$(CC) $(CFLAGS) $(GNOMEINC) -c -o $@ ../win/gnome/gnopts.c $(CC) $(CFLAGS) $(GNOMEINC) -c -o $@ ../win/gnome/gnopts.c
gnplayer.o: ../win/gnome/gnplayer.c ../win/gnome/gnplayer.h \ gnplayer.o: ../win/gnome/gnplayer.c ../win/gnome/gnplayer.h \
../win/gnome/gnmain.h $(HACK_H) ../win/gnome/gnmain.h $(HACK_H)
$(CC) $(CFLAGS) $(GNOMEINC) -c -o $@ ../win/gnome/gnplayer.c $(CC) $(CFLAGS) $(GNOMEINC) -c -o $@ ../win/gnome/gnplayer.c
gnsignal.o: ../win/gnome/gnsignal.c ../win/gnome/gnsignal.h \ gnsignal.o: ../win/gnome/gnsignal.c ../win/gnome/gnsignal.h \
../win/gnome/gnmain.h ../win/gnome/gnomeprv.h $(HACK_H) ../include/dlb.h \
../include/patchlevel.h ../include/winGnome.h \
../win/gnome/gnglyph.h ../win/gnome/gnmain.h
$(CC) $(CFLAGS) $(GNOMEINC) -c -o $@ ../win/gnome/gnsignal.c $(CC) $(CFLAGS) $(GNOMEINC) -c -o $@ ../win/gnome/gnsignal.c
gnstatus.o: ../win/gnome/gnstatus.c ../win/gnome/gnstatus.h \ gnstatus.o: ../win/gnome/gnstatus.c ../win/gnome/gnstatus.h $(CONFIG_H) \
../win/gnome/gnsignal.h ../win/gnome/gn_xpms.h \ ../win/gnome/gnsignal.h ../win/gnome/gnomeprv.h $(HACK_H) \
../win/gnome/gnomeprv.h ../include/dlb.h ../include/patchlevel.h ../include/winGnome.h \
../win/gnome/gnglyph.h ../win/gnome/gn_xpms.h
$(CC) $(CFLAGS) $(GNOMEINC) -c -o $@ ../win/gnome/gnstatus.c $(CC) $(CFLAGS) $(GNOMEINC) -c -o $@ ../win/gnome/gnstatus.c
gntext.o: ../win/gnome/gntext.c ../win/gnome/gntext.h ../win/gnome/gnmain.h \ gntext.o: ../win/gnome/gntext.c ../win/gnome/gntext.h $(CONFIG_H) \
../win/gnome/gn_rip.h ../win/gnome/gnmain.h ../win/gnome/gn_rip.h
$(CC) $(CFLAGS) $(GNOMEINC) -c -o $@ ../win/gnome/gntext.c $(CC) $(CFLAGS) $(GNOMEINC) -c -o $@ ../win/gnome/gntext.c
gnyesno.o: ../win/gnome/gnyesno.c ../win/gnome/gnbind.h ../win/gnome/gnyesno.h gnyesno.o: ../win/gnome/gnyesno.c ../win/gnome/gnbind.h \
../win/gnome/gnomeprv.h $(HACK_H) ../include/dlb.h \
../include/patchlevel.h ../include/winGnome.h \
../win/gnome/gnmain.h ../win/gnome/gnmap.h \
../win/gnome/gnmenu.h ../win/gnome/gnplayer.h \
../win/gnome/gnsignal.h ../win/gnome/gnglyph.h \
../win/gnome/gnstatus.h ../win/gnome/gntext.h \
../win/gnome/gnmesg.h ../win/gnome/gnyesno.h \
../win/gnome/gnworn.h
$(CC) $(CFLAGS) $(GNOMEINC) -c -o $@ ../win/gnome/gnyesno.c $(CC) $(CFLAGS) $(GNOMEINC) -c -o $@ ../win/gnome/gnyesno.c
gnworn.o: ../win/gnome/gnworn.c ../win/gnome/gnworn.h ../win/gnome/gnglyph.h \ gnworn.o: ../win/gnome/gnworn.c ../win/gnome/gnworn.h $(CONFIG_H) \
../win/gnome/gnsignal.h ../win/gnome/gnomeprv.h ../win/gnome/gnglyph.h ../win/gnome/gnsignal.h \
../win/gnome/gnomeprv.h $(HACK_H) ../include/dlb.h \
../include/patchlevel.h ../include/winGnome.h
$(CC) $(CFLAGS) $(GNOMEINC) -c -o $@ ../win/gnome/gnworn.c $(CC) $(CFLAGS) $(GNOMEINC) -c -o $@ ../win/gnome/gnworn.c
wingem.o: ../win/gem/wingem.c $(HACK_H) ../include/func_tab.h ../include/dlb.h \ wingem.o: ../win/gem/wingem.c $(HACK_H) ../include/func_tab.h ../include/dlb.h \
../include/patchlevel.h ../include/wingem.h ../include/patchlevel.h ../include/wingem.h
@@ -914,92 +932,105 @@ gr_rect.o: ../win/gem/gr_rect.c ../include/gr_rect.h
tile.o: tile.c $(HACK_H) tile.o: tile.c $(HACK_H)
cppregex.o: ../sys/share/cppregex.cpp cppregex.o: ../sys/share/cppregex.cpp
$(CXX) $(CXXFLAGS) -c -o $@ ../sys/share/cppregex.cpp $(CXX) $(CXXFLAGS) -c -o $@ ../sys/share/cppregex.cpp
qt_win.o: ../win/Qt/qt_win.cpp $(HACK_H) ../include/func_tab.h \ qt_bind.o: ../win/Qt/qt_bind.cpp $(HACK_H) ../win/Qt/qt_bind.h \
../include/dlb.h ../include/patchlevel.h ../include/tile2x11.h \ ../win/Qt/qt_main.h ../win/Qt/qt_kde0.h ../win/Qt/qt_click.h \
../include/qt_win.h ../include/qt_clust.h ../include/qt_kde0.h \ ../win/Qt/qt_delay.h ../win/Qt/qt_xcmd.h ../win/Qt/qt_key.h \
../include/qt_xpms.h qt_win.moc qt_kde0.moc qttableview.moc ../win/Qt/qt_map.h ../win/Qt/qt_win.h ../win/Qt/qt_clust.h \
$(CXX) $(CXXFLAGS) -c -o $@ ../win/Qt/qt_win.cpp ../win/Qt/qt_menu.h ../win/Qt/qt_rip.h ../win/Qt/qt_msg.h \
qt_clust.o: ../win/Qt/qt_clust.cpp ../include/qt_clust.h ../win/Qt/qt_plsel.h ../win/Qt/qt_svsel.h ../win/Qt/qt_set.h \
../win/Qt/qt_stat.h ../win/Qt/qt_icon.h ../win/Qt/qt_streq.h \
../win/Qt/qt_line.h ../win/Qt/qt_yndlg.h ../win/Qt/qt_str.h \
../include/dlb.h
$(CXX) $(CXXFLAGS) -c -o $@ ../win/Qt/qt_bind.cpp
qt_click.o: ../win/Qt/qt_click.cpp $(HACK_H) ../win/Qt/qt_click.h
$(CXX) $(CXXFLAGS) -c -o $@ ../win/Qt/qt_click.cpp
qt_clust.o: ../win/Qt/qt_clust.cpp ../win/Qt/qt_clust.h
$(CXX) $(CXXFLAGS) -c -o $@ ../win/Qt/qt_clust.cpp $(CXX) $(CXXFLAGS) -c -o $@ ../win/Qt/qt_clust.cpp
qttableview.o: ../win/Qt/qttableview.cpp ../include/qttableview.h qt_delay.o: ../win/Qt/qt_delay.cpp $(HACK_H) ../win/Qt/qt_delay.h
$(CXX) $(CXXFLAGS) -c -o $@ ../win/Qt/qttableview.cpp $(CXX) $(CXXFLAGS) -c -o $@ ../win/Qt/qt_delay.cpp
qt4bind.o: ../win/Qt4/qt4bind.cpp $(HACK_H) ../win/Qt4/qt4bind.h \ qt_glyph.o: ../win/Qt/qt_glyph.cpp $(HACK_H) ../include/tile2x11.h \
../win/Qt4/qt4click.h ../win/Qt4/qt4delay.h \ ../win/Qt/qt_glyph.h ../win/Qt/qt_set.h ../win/Qt/qt_str.h
../win/Qt4/qt4xcmd.h ../win/Qt4/qt4key.h ../win/Qt4/qt4map.h \ $(CXX) $(CXXFLAGS) -c -o $@ ../win/Qt/qt_glyph.cpp
../win/Qt4/qt4menu.h ../win/Qt4/qt4msg.h ../win/Qt4/qt4plsel.h \ qt_icon.o: ../win/Qt/qt_icon.cpp $(HACK_H) ../win/Qt/qt_icon.h
../win/Qt4/qt4svsel.h ../win/Qt4/qt4set.h ../win/Qt4/qt4stat.h \ $(CXX) $(CXXFLAGS) -c -o $@ ../win/Qt/qt_icon.cpp
../win/Qt4/qt4streq.h ../win/Qt4/qt4yndlg.h \ qt_inv.o: ../win/Qt/qt_inv.cpp $(HACK_H) ../win/Qt/qt_inv.h \
../win/Qt4/qt4str.h ../include/dlb.h ../win/Qt/qt_glyph.h ../win/Qt/qt_set.h
$(CXX) $(CXXFLAGS) -c -o $@ ../win/Qt4/qt4bind.cpp $(CXX) $(CXXFLAGS) -c -o $@ ../win/Qt/qt_inv.cpp
qt4click.o: ../win/Qt4/qt4click.cpp $(HACK_H) ../win/Qt4/qt4click.h qt_key.o: ../win/Qt/qt_key.cpp $(HACK_H) ../win/Qt/qt_key.h
$(CXX) $(CXXFLAGS) -c -o $@ ../win/Qt4/qt4click.cpp $(CXX) $(CXXFLAGS) -c -o $@ ../win/Qt/qt_key.cpp
qt4clust.o: ../win/Qt4/qt4clust.cpp ../win/Qt4/qt4clust.h qt_line.o: ../win/Qt/qt_line.cpp $(HACK_H) ../win/Qt/qt_line.h
$(CXX) $(CXXFLAGS) -c -o $@ ../win/Qt4/qt4clust.cpp $(CXX) $(CXXFLAGS) -c -o $@ ../win/Qt/qt_line.cpp
qt4delay.o: ../win/Qt4/qt4delay.cpp $(HACK_H) ../win/Qt4/qt4delay.h qt_main.o: ../win/Qt/qt_main.cpp $(HACK_H) ../include/patchlevel.h \
$(CXX) $(CXXFLAGS) -c -o $@ ../win/Qt4/qt4delay.cpp ../win/Qt/qt_main.h ../win/Qt/qt_kde0.h qt_main.moc \
qt4glyph.o: ../win/Qt4/qt4glyph.cpp $(HACK_H) ../include/tile2x11.h \ ../win/Qt/qt_bind.h ../win/Qt/qt_glyph.h ../win/Qt/qt_inv.h \
../win/Qt4/qt4glyph.h ../win/Qt4/qt4set.h ../win/Qt4/qt4str.h ../win/Qt/qt_key.h ../win/Qt/qt_map.h ../win/Qt/qt_win.h \
$(CXX) $(CXXFLAGS) -c -o $@ ../win/Qt4/qt4glyph.cpp ../win/Qt/qt_clust.h ../win/Qt/qt_msg.h ../win/Qt/qt_set.h \
qt4icon.o: ../win/Qt4/qt4icon.cpp $(HACK_H) ../win/Qt4/qt4icon.h ../win/Qt/qt_stat.h ../win/Qt/qt_icon.h ../win/Qt/qt_str.h \
$(CXX) $(CXXFLAGS) -c -o $@ ../win/Qt4/qt4icon.cpp qt_kde0.moc
qt4inv.o: ../win/Qt4/qt4inv.cpp $(HACK_H) ../win/Qt4/qt4inv.h \ $(CXX) $(CXXFLAGS) -c -o $@ ../win/Qt/qt_main.cpp
../win/Qt4/qt4glyph.h ../win/Qt4/qt4set.h qt_map.o: ../win/Qt/qt_map.cpp $(HACK_H) ../win/Qt/qt_map.h ../win/Qt/qt_win.h \
$(CXX) $(CXXFLAGS) -c -o $@ ../win/Qt4/qt4inv.cpp ../win/Qt/qt_clust.h qt_map.moc ../win/Qt/qt_click.h \
qt4key.o: ../win/Qt4/qt4key.cpp $(HACK_H) ../win/Qt4/qt4key.h ../win/Qt/qt_glyph.h ../win/Qt/qt_xpms.h ../win/Qt/qt_set.h \
$(CXX) $(CXXFLAGS) -c -o $@ ../win/Qt4/qt4key.cpp ../win/Qt/qt_str.h
qt4line.o: ../win/Qt4/qt4line.cpp $(HACK_H) ../win/Qt4/qt4line.h $(CXX) $(CXXFLAGS) -c -o $@ ../win/Qt/qt_map.cpp
$(CXX) $(CXXFLAGS) -c -o $@ ../win/Qt4/qt4line.cpp qt_menu.o: ../win/Qt/qt_menu.cpp $(HACK_H) ../win/Qt/qt_menu.h \
qt4main.o: ../win/Qt4/qt4main.cpp $(HACK_H) ../include/patchlevel.h \ ../win/Qt/qt_win.h ../win/Qt/qt_rip.h qt_menu.moc \
../win/Qt4/qt4main.h qt4main.moc ../win/Qt4/qt4bind.h \ ../win/Qt/qt_glyph.h ../win/Qt/qt_set.h ../win/Qt/qt_streq.h \
../win/Qt4/qt4glyph.h ../win/Qt4/qt4inv.h ../win/Qt4/qt4key.h \ ../win/Qt/qt_line.h ../win/Qt/qt_str.h
../win/Qt4/qt4map.h ../win/Qt4/qt4msg.h ../win/Qt4/qt4set.h \ $(CXX) $(CXXFLAGS) -c -o $@ ../win/Qt/qt_menu.cpp
../win/Qt4/qt4stat.h ../win/Qt4/qt4str.h qt4kde0.moc qt_msg.o: ../win/Qt/qt_msg.cpp $(HACK_H) ../win/Qt/qt_msg.h ../win/Qt/qt_win.h \
$(CXX) $(CXXFLAGS) -c -o $@ ../win/Qt4/qt4main.cpp qt_msg.moc ../win/Qt/qt_map.h ../win/Qt/qt_clust.h \
qt4map.o: ../win/Qt4/qt4map.cpp $(HACK_H) ../win/Qt4/qt4map.h qt4map.moc \ ../win/Qt/qt_set.h ../win/Qt/qt_str.h
../win/Qt4/qt4click.h ../win/Qt4/qt4glyph.h \ $(CXX) $(CXXFLAGS) -c -o $@ ../win/Qt/qt_msg.cpp
../include/qt_xpms.h ../win/Qt4/qt4set.h ../win/Qt4/qt4str.h qt_plsel.o: ../win/Qt/qt_plsel.cpp $(HACK_H) ../win/Qt/qt_plsel.h qt_plsel.moc \
$(CXX) $(CXXFLAGS) -c -o $@ ../win/Qt4/qt4map.cpp ../win/Qt/qt_bind.h ../win/Qt/qt_main.h ../win/Qt/qt_kde0.h \
qt4menu.o: ../win/Qt4/qt4menu.cpp $(HACK_H) ../win/Qt4/qt4menu.h qt4menu.moc \ ../win/Qt/qt_glyph.h ../win/Qt/qt_set.h ../win/Qt/qt_str.h
../win/Qt4/qt4glyph.h ../win/Qt4/qt4set.h \ $(CXX) $(CXXFLAGS) -c -o $@ ../win/Qt/qt_plsel.cpp
../win/Qt4/qt4streq.h ../win/Qt4/qt4str.h qt_rip.o: ../win/Qt/qt_rip.cpp $(HACK_H) ../win/Qt/qt_rip.h \
$(CXX) $(CXXFLAGS) -c -o $@ ../win/Qt4/qt4menu.cpp ../win/Qt/qt_bind.h ../win/Qt/qt_main.h ../win/Qt/qt_kde0.h \
qt4msg.o: ../win/Qt4/qt4msg.cpp $(HACK_H) ../win/Qt4/qt4msg.h qt4msg.moc \ ../win/Qt/qt_str.h
../win/Qt4/qt4map.h ../win/Qt4/qt4set.h ../win/Qt4/qt4str.h $(CXX) $(CXXFLAGS) -c -o $@ ../win/Qt/qt_rip.cpp
$(CXX) $(CXXFLAGS) -c -o $@ ../win/Qt4/qt4msg.cpp qt_set.o: ../win/Qt/qt_set.cpp $(HACK_H) ../win/Qt/qt_set.h qt_set.moc \
qt4plsel.o: ../win/Qt4/qt4plsel.cpp $(HACK_H) ../win/Qt4/qt4plsel.h \ ../win/Qt/qt_glyph.h ../win/Qt/qt_str.h
qt4plsel.moc ../win/Qt4/qt4bind.h ../win/Qt4/qt4glyph.h \ $(CXX) $(CXXFLAGS) -c -o $@ ../win/Qt/qt_set.cpp
../win/Qt4/qt4set.h ../win/Qt4/qt4str.h qt_stat.o: ../win/Qt/qt_stat.cpp $(HACK_H) ../win/Qt/qt_stat.h \
$(CXX) $(CXXFLAGS) -c -o $@ ../win/Qt4/qt4plsel.cpp ../win/Qt/qt_win.h ../win/Qt/qt_icon.h qt_stat.moc \
qt4rip.o: ../win/Qt4/qt4rip.cpp $(HACK_H) ../win/Qt4/qt4rip.h \ ../win/Qt/qt_set.h ../win/Qt/qt_str.h ../win/Qt/qt_xpms.h
../win/Qt4/qt4bind.h ../win/Qt4/qt4str.h $(CXX) $(CXXFLAGS) -c -o $@ ../win/Qt/qt_stat.cpp
$(CXX) $(CXXFLAGS) -c -o $@ ../win/Qt4/qt4rip.cpp qt_str.o: ../win/Qt/qt_str.cpp ../win/Qt/qt_str.h
qt4set.o: ../win/Qt4/qt4set.cpp $(HACK_H) ../win/Qt4/qt4set.h qt4set.moc \ $(CXX) $(CXXFLAGS) -c -o $@ ../win/Qt/qt_str.cpp
../win/Qt4/qt4glyph.h ../win/Qt4/qt4str.h qt_streq.o: ../win/Qt/qt_streq.cpp $(HACK_H) ../win/Qt/qt_streq.h \
$(CXX) $(CXXFLAGS) -c -o $@ ../win/Qt4/qt4set.cpp ../win/Qt/qt_line.h ../win/Qt/qt_str.h
qt4stat.o: ../win/Qt4/qt4stat.cpp $(HACK_H) ../win/Qt4/qt4stat.h qt4stat.moc \ $(CXX) $(CXXFLAGS) -c -o $@ ../win/Qt/qt_streq.cpp
../win/Qt4/qt4set.h ../win/Qt4/qt4str.h ../include/qt_xpms.h qt_svsel.o: ../win/Qt/qt_svsel.cpp $(HACK_H) ../win/Qt/qt_svsel.h \
$(CXX) $(CXXFLAGS) -c -o $@ ../win/Qt4/qt4stat.cpp ../win/Qt/qt_bind.h ../win/Qt/qt_main.h ../win/Qt/qt_kde0.h \
qt4str.o: ../win/Qt4/qt4str.cpp ../win/Qt4/qt4str.h ../win/Qt/qt_str.h
$(CXX) $(CXXFLAGS) -c -o $@ ../win/Qt4/qt4str.cpp $(CXX) $(CXXFLAGS) -c -o $@ ../win/Qt/qt_svsel.cpp
qt4streq.o: ../win/Qt4/qt4streq.cpp $(HACK_H) ../win/Qt4/qt4streq.h \ qt_win.o: ../win/Qt/qt_win.cpp $(HACK_H) ../win/Qt/qt_win.h \
../win/Qt4/qt4str.h ../win/Qt/qt_bind.h ../win/Qt/qt_main.h ../win/Qt/qt_kde0.h \
$(CXX) $(CXXFLAGS) -c -o $@ ../win/Qt4/qt4streq.cpp ../win/Qt/qt_click.h ../win/Qt/qt_glyph.h ../win/Qt/qt_inv.h \
qt4svsel.o: ../win/Qt4/qt4svsel.cpp $(HACK_H) ../win/Qt4/qt4svsel.h \ ../win/Qt/qt_key.h ../win/Qt/qt_icon.h ../win/Qt/qt_map.h \
../win/Qt4/qt4bind.h ../win/Qt4/qt4str.h ../win/Qt/qt_clust.h ../win/Qt/qt_menu.h ../win/Qt/qt_rip.h \
$(CXX) $(CXXFLAGS) -c -o $@ ../win/Qt4/qt4svsel.cpp ../win/Qt/qt_msg.h ../win/Qt/qt_set.h
qt4win.o: ../win/Qt4/qt4win.cpp $(HACK_H) ../win/Qt4/qt4win.h \ $(CXX) $(CXXFLAGS) -c -o $@ ../win/Qt/qt_win.cpp
../win/Qt4/qt4bind.h ../win/Qt4/qt4click.h \ qt_xcmd.o: ../win/Qt/qt_xcmd.cpp $(HACK_H) ../include/func_tab.h \
../win/Qt4/qt4glyph.h ../win/Qt4/qt4inv.h ../win/Qt4/qt4key.h \ ../win/Qt/qt_xcmd.h qt_xcmd.moc ../win/Qt/qt_bind.h \
../win/Qt4/qt4icon.h ../win/Qt4/qt4map.h ../win/Qt4/qt4menu.h \ ../win/Qt/qt_main.h ../win/Qt/qt_kde0.h ../win/Qt/qt_set.h \
../win/Qt4/qt4msg.h ../win/Qt4/qt4set.h ../win/Qt4/qt4clust.h ../win/Qt/qt_str.h
$(CXX) $(CXXFLAGS) -c -o $@ ../win/Qt4/qt4win.cpp $(CXX) $(CXXFLAGS) -c -o $@ ../win/Qt/qt_xcmd.cpp
qt4xcmd.o: ../win/Qt4/qt4xcmd.cpp $(HACK_H) ../include/func_tab.h \ qt_yndlg.o: ../win/Qt/qt_yndlg.cpp $(HACK_H) ../win/Qt/qt_yndlg.h qt_yndlg.moc \
../win/Qt4/qt4xcmd.h qt4xcmd.moc ../win/Qt4/qt4bind.h \ ../win/Qt/qt_str.h
../win/Qt4/qt4set.h ../win/Qt4/qt4str.h $(CXX) $(CXXFLAGS) -c -o $@ ../win/Qt/qt_yndlg.cpp
$(CXX) $(CXXFLAGS) -c -o $@ ../win/Qt4/qt4xcmd.cpp qt3_win.o: ../win/Qt3/qt3_win.cpp $(HACK_H) ../include/func_tab.h \
qt4yndlg.o: ../win/Qt4/qt4yndlg.cpp $(HACK_H) ../win/Qt4/qt4yndlg.h \ ../include/dlb.h ../include/patchlevel.h ../include/tile2x11.h \
qt4yndlg.moc ../win/Qt4/qt4str.h ../win/Qt3/qt3_win.h ../win/Qt3/qt3_clust.h \
$(CXX) $(CXXFLAGS) -c -o $@ ../win/Qt4/qt4yndlg.cpp ../win/Qt3/qt3_kde0.h ../win/Qt3/qt3_xpms.h qt3_win.moc \
qt3_kde0.moc qt3tableview.moc
$(CXX) $(CXXFLAGS) -c -o $@ ../win/Qt3/qt3_win.cpp
qt3_clust.o: ../win/Qt3/qt3_clust.cpp ../win/Qt3/qt3_clust.h
$(CXX) $(CXXFLAGS) -c -o $@ ../win/Qt3/qt3_clust.cpp
qt3tableview.o: ../win/Qt3/qt3tableview.cpp ../win/Qt3/qt3tableview.h
$(CXX) $(CXXFLAGS) -c -o $@ ../win/Qt3/qt3tableview.cpp
wc_chainin.o: ../win/chain/wc_chainin.c $(HACK_H) wc_chainin.o: ../win/chain/wc_chainin.c $(HACK_H)
$(CC) $(CFLAGS) -c -o $@ ../win/chain/wc_chainin.c $(CC) $(CFLAGS) -c -o $@ ../win/chain/wc_chainin.c
wc_chainout.o: ../win/chain/wc_chainout.c $(HACK_H) wc_chainout.o: ../win/chain/wc_chainout.c $(HACK_H)
@@ -1021,7 +1052,7 @@ decl.o: decl.c $(HACK_H)
detect.o: detect.c $(HACK_H) ../include/artifact.h detect.o: detect.c $(HACK_H) ../include/artifact.h
dig.o: dig.c $(HACK_H) dig.o: dig.c $(HACK_H)
display.o: display.c $(HACK_H) display.o: display.c $(HACK_H)
dlb.o: dlb.c $(CONFIG_H) ../include/dlb.h dlb.o: dlb.c $(CONFIG_H) ../include/dlb.h ../include/patchlevel.h
do.o: do.c $(HACK_H) ../include/lev.h do.o: do.c $(HACK_H) ../include/lev.h
do_name.o: do_name.c $(HACK_H) do_name.o: do_name.c $(HACK_H)
do_wear.o: do_wear.c $(HACK_H) do_wear.o: do_wear.c $(HACK_H)
@@ -1038,23 +1069,26 @@ engrave.o: engrave.c $(HACK_H) ../include/lev.h
exper.o: exper.c $(HACK_H) exper.o: exper.c $(HACK_H)
explode.o: explode.c $(HACK_H) explode.o: explode.c $(HACK_H)
extralev.o: extralev.c $(HACK_H) extralev.o: extralev.c $(HACK_H)
files.o: files.c $(HACK_H) ../include/dlb.h #zlib.h files.o: files.c $(HACK_H) ../include/dlb.h ../include/lev.h #zlib.h
fountain.o: fountain.c $(HACK_H) fountain.o: fountain.c $(HACK_H)
hack.o: hack.c $(HACK_H) hack.o: hack.c $(HACK_H)
hacklib.o: hacklib.c $(HACK_H) hacklib.o: hacklib.c $(HACK_H)
invent.o: invent.c $(HACK_H) invent.o: invent.c $(HACK_H)
isaac64.o: isaac64.c $(CONFIG_H) ../include/isaac64.h ../include/integer.h isaac64.o: isaac64.c $(CONFIG_H) ../include/isaac64.h
light.o: light.c $(HACK_H) ../include/lev.h light.o: light.c $(HACK_H) ../include/lev.h
lock.o: lock.c $(HACK_H) lock.o: lock.c $(HACK_H)
mail.o: mail.c $(HACK_H) ../include/mail.h mail.o: mail.c $(HACK_H) ../include/mail.h
makemon.o: makemon.c $(HACK_H) makemon.o: makemon.c $(HACK_H)
mapglyph.o: mapglyph.c $(HACK_H) mapglyph.o: mapglyph.c $(HACK_H)
mcastu.o: mcastu.c $(HACK_H) mcastu.o: mcastu.c $(HACK_H)
mdlib.o: mdlib.c $(CONFIG_H) ../include/permonst.h ../include/objclass.h \ mdlib.o: mdlib.c $(CONFIG_H) ../include/permonst.h ../include/align.h \
../include/monsym.h ../include/artilist.h \ ../include/monattk.h ../include/monflag.h \
../include/dungeon.h ../include/obj.h ../include/monst.h \ ../include/objclass.h ../include/monsym.h \
../include/you.h ../include/context.h ../include/flag.h \ ../include/artilist.h ../include/dungeon.h ../include/obj.h \
../include/dlb.h ../include/patchlevel.h ../include/monst.h ../include/mextra.h ../include/you.h \
../include/attrib.h ../include/prop.h ../include/skills.h \
../include/context.h ../include/flag.h ../include/dlb.h \
../include/patchlevel.h
mhitm.o: mhitm.c $(HACK_H) ../include/artifact.h mhitm.o: mhitm.c $(HACK_H) ../include/artifact.h
mhitu.o: mhitu.c $(HACK_H) ../include/artifact.h mhitu.o: mhitu.c $(HACK_H) ../include/artifact.h
minion.o: minion.c $(HACK_H) minion.o: minion.c $(HACK_H)
@@ -1072,9 +1106,9 @@ monst.o: monst.c $(CONFIG_H) ../include/permonst.h ../include/align.h \
mplayer.o: mplayer.c $(HACK_H) mplayer.o: mplayer.c $(HACK_H)
mthrowu.o: mthrowu.c $(HACK_H) mthrowu.o: mthrowu.c $(HACK_H)
muse.o: muse.c $(HACK_H) muse.o: muse.c $(HACK_H)
music.o: music.c $(HACK_H) #interp.c music.o: music.c $(HACK_H)
nhlua.o: nhlua.c $(HACK_H) nhlua.o: nhlua.c $(HACK_H) ../include/dlb.h
nhlsel.o: nhlsel.c $(HACK_H) nhlsel.o: nhlsel.c $(HACK_H) ../include/sp_lev.h
o_init.o: o_init.c $(HACK_H) ../include/lev.h o_init.o: o_init.c $(HACK_H) ../include/lev.h
objects.o: objects.c $(CONFIG_H) ../include/obj.h ../include/objclass.h \ objects.o: objects.c $(CONFIG_H) ../include/obj.h ../include/objclass.h \
../include/prop.h ../include/skills.h ../include/color.h ../include/prop.h ../include/skills.h ../include/color.h
@@ -1088,22 +1122,23 @@ polyself.o: polyself.c $(HACK_H)
potion.o: potion.c $(HACK_H) potion.o: potion.c $(HACK_H)
pray.o: pray.c $(HACK_H) pray.o: pray.c $(HACK_H)
priest.o: priest.c $(HACK_H) ../include/mfndpos.h priest.o: priest.c $(HACK_H) ../include/mfndpos.h
quest.o: quest.c $(HACK_H) ../include/qtext.h quest.o: quest.c $(HACK_H)
questpgr.o: questpgr.c $(HACK_H) ../include/dlb.h ../include/qtext.h questpgr.o: questpgr.c $(HACK_H) ../include/dlb.h
read.o: read.c $(HACK_H) read.o: read.c $(HACK_H)
rect.o: rect.c $(HACK_H) rect.o: rect.c $(HACK_H)
region.o: region.c $(HACK_H) ../include/lev.h region.o: region.c $(HACK_H) ../include/lev.h
restore.o: restore.c $(HACK_H) ../include/lev.h ../include/tcap.h restore.o: restore.c $(HACK_H) ../include/lev.h ../include/tcap.h
rip.o: rip.c $(HACK_H) rip.o: rip.c $(HACK_H)
rnd.o: rnd.c $(HACK_H) rnd.o: rnd.c $(HACK_H) ../include/isaac64.h
role.o: role.c $(HACK_H) role.o: role.c $(HACK_H)
rumors.o: rumors.c $(HACK_H) ../include/lev.h ../include/dlb.h rumors.o: rumors.c $(HACK_H) ../include/lev.h ../include/dlb.h
save.o: save.c $(HACK_H) ../include/lev.h save.o: save.c $(HACK_H) ../include/lev.h
sfstruct.o: sfstruct.c $(HACK_H)
shk.o: shk.c $(HACK_H) shk.o: shk.c $(HACK_H)
shknam.o: shknam.c $(HACK_H) shknam.o: shknam.c $(HACK_H)
sit.o: sit.c $(HACK_H) ../include/artifact.h sit.o: sit.c $(HACK_H) ../include/artifact.h
sounds.o: sounds.c $(HACK_H) sounds.o: sounds.c $(HACK_H)
sp_lev.o: sp_lev.c $(HACK_H) ../include/dlb.h ../include/sp_lev.h sp_lev.o: sp_lev.c $(HACK_H) ../include/sp_lev.h
spell.o: spell.c $(HACK_H) spell.o: spell.c $(HACK_H)
steal.o: steal.c $(HACK_H) steal.o: steal.c $(HACK_H)
steed.o: steed.c $(HACK_H) steed.o: steed.c $(HACK_H)
@@ -1117,13 +1152,13 @@ u_init.o: u_init.c $(HACK_H)
uhitm.o: uhitm.c $(HACK_H) uhitm.o: uhitm.c $(HACK_H)
vault.o: vault.c $(HACK_H) vault.o: vault.c $(HACK_H)
version.o: version.c $(HACK_H) ../include/dlb.h ../include/date.h \ version.o: version.c $(HACK_H) ../include/dlb.h ../include/date.h \
../include/patchlevel.h ../include/lev.h ../include/patchlevel.h
vision.o: vision.c $(HACK_H) ../include/vis_tab.h vision.o: vision.c $(HACK_H) ../include/vis_tab.h
weapon.o: weapon.c $(HACK_H) weapon.o: weapon.c $(HACK_H)
were.o: were.c $(HACK_H) were.o: were.c $(HACK_H)
wield.o: wield.c $(HACK_H) wield.o: wield.c $(HACK_H)
windows.o: windows.c $(HACK_H) ../include/wingem.h ../include/winGnome.h windows.o: windows.c $(HACK_H) ../include/wingem.h ../include/winGnome.h
wizard.o: wizard.c $(HACK_H) ../include/qtext.h wizard.o: wizard.c $(HACK_H)
worm.o: worm.c $(HACK_H) ../include/lev.h worm.o: worm.c $(HACK_H) ../include/lev.h
worn.o: worn.c $(HACK_H) worn.o: worn.c $(HACK_H)
write.o: write.c $(HACK_H) write.o: write.c $(HACK_H)
+9 -8
View File
@@ -1,5 +1,5 @@
# NetHack Top-level Makefile. # NetHack Top-level Makefile.
# NetHack 3.6 Makefile.top $NHDT-Date: 1574825215 2019/11/27 03:26:55 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.43 $ # NetHack 3.6 Makefile.top $NHDT-Date: 1575932543 2019/12/09 23:02:23 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.44 $
# Copyright (c) 2015 by Kenneth Lorber, Kensington, Maryland # Copyright (c) 2015 by Kenneth Lorber, Kensington, Maryland
# NetHack may be freely redistributed. See license for details. # NetHack may be freely redistributed. See license for details.
@@ -94,6 +94,14 @@ DATNODLB = $(VARDATND) license symbols
DATDLB = $(DATHELP) dungeon.lua tribute $(SPEC_LEVS) $(QUEST_LEVS) $(VARDATD) DATDLB = $(DATHELP) dungeon.lua tribute $(SPEC_LEVS) $(QUEST_LEVS) $(VARDATD)
DAT = $(DATNODLB) $(DATDLB) DAT = $(DATNODLB) $(DATDLB)
# first target is also the default target for 'make' without any arguments
all: $(GAME) recover Guidebook $(VARDAT) spec_levs check-dlb
true; $(MOREALL)
@echo "Done."
$(GAME): lua_support
( cd src ; $(MAKE) $(GAME) )
lua_support: lib/lua/liblua.a include/nhlua.h lua_support: lib/lua/liblua.a include/nhlua.h
@true @true
lib/lua-$(LUA_VERSION)/src/liblua.a: lib/lua-$(LUA_VERSION)/src/lua.h lib/lua-$(LUA_VERSION)/src/liblua.a: lib/lua-$(LUA_VERSION)/src/lua.h
@@ -110,13 +118,6 @@ include/nhlua.h: lib/lua/liblua.a
@echo '#include "../lib/lua-$(LUA_VERSION)/src/lauxlib.h"' >> $@ @echo '#include "../lib/lua-$(LUA_VERSION)/src/lauxlib.h"' >> $@
@echo '/*nhlua.h*/' >> $@ @echo '/*nhlua.h*/' >> $@
$(GAME): lua_support
( cd src ; $(MAKE) )
all: $(GAME) recover Guidebook $(VARDAT) spec_levs check-dlb
true; $(MOREALL)
@echo "Done."
# Note: many of the dependencies below are here to allow parallel make # Note: many of the dependencies below are here to allow parallel make
# to generate valid output # to generate valid output
-70
View File
@@ -129,11 +129,6 @@ LEXYYC = lex.yy.c
# YTABH = y_tab.h # YTABH = y_tab.h
# LEXYYC = lexyy.c # LEXYYC = lexyy.c
# This is the universal ctags utility which produces the tags in the
# format that util/readtags requires.
# https://github.com/universal-ctags/ctags.git
CTAGSCMD = universal-ctags
# if you change this to 1, feedback while building will omit -Dthis -Wthat # if you change this to 1, feedback while building will omit -Dthis -Wthat
# -Isomewhere so that each file being compiled is listed on one short line; # -Isomewhere so that each file being compiled is listed on one short line;
# it requires support for '$<' in rules with more than one prerequisite # it requires support for '$<' in rules with more than one prerequisite
@@ -189,7 +184,6 @@ MAKESRC = makedefs.c ../src/mdlib.c
RECOVSRC = recover.c RECOVSRC = recover.c
DLBSRC = dlb_main.c DLBSRC = dlb_main.c
UTILSRCS = $(MAKESRC) panic.c $(DGNCOMPSRC) $(RECOVSRC) $(DLBSRC) UTILSRCS = $(MAKESRC) panic.c $(DGNCOMPSRC) $(RECOVSRC) $(DLBSRC)
READTAGSSRC = readtags.c
# files that define all monsters and objects # files that define all monsters and objects
CMONOBJ = ../src/monst.c ../src/objects.c CMONOBJ = ../src/monst.c ../src/objects.c
@@ -210,9 +204,6 @@ RECOVOBJS = recover.o
# object files for the data librarian # object files for the data librarian
DLBOBJS = dlb_main.o $(OBJDIR)/dlb.o $(OALLOC) DLBOBJS = dlb_main.o $(OBJDIR)/dlb.o $(OALLOC)
# object files for readtags
READTAGSOBJS = readtags.o
# flags for creating distribution versions of sys/share/*_lex.c, using # flags for creating distribution versions of sys/share/*_lex.c, using
# a more portable flex skeleton, which is not included in the distribution. # a more portable flex skeleton, which is not included in the distribution.
# hopefully keeping this out of the section to be edited will keep too # hopefully keeping this out of the section to be edited will keep too
@@ -369,67 +360,6 @@ tileedit: tileedit.cpp $(TEXT_IO)
$(CC) -o tileedit -I../include -I$(QTDIR)/include -L$(QTDIR)/lib \ $(CC) -o tileedit -I../include -I$(QTDIR)/include -L$(QTDIR)/lib \
tileedit.cpp $(TEXT_IO) -lqt tileedit.cpp $(TEXT_IO) -lqt
# dependencies for readtags
#
CTAGDEP = ../include/align.h ../include/artifact.h ../include/artilist.h \
../include/attrib.h ../include/context.h ../include/coord.h \
../include/decl.h ../include/dungeon.h ../include/engrave.h \
../include/flag.h ../include/func_tab.h ../include/global.h \
../include/hack.h ../include/lev.h ../include/mextra.h \
../include/mkroom.h ../include/monst.h ../include/monsym.h \
../include/obj.h ../include/objclass.h ../include/prop.h \
../include/quest.h ../include/rect.h ../include/region.h \
../include/rm.h ../include/skills.h ../include/spell.h \
../include/sys.h ../include/timeout.h ../include/trap.h \
../include/you.h ../include/onames.h ../include/wintype.h
# ../include/permonst.h
CTAGSOPT = --language-force=c --sort=no -D"Bitfield(x,n)=unsigned x : n" --excmd=pattern
readtags: $(READTAGSOBJS)
$(CC) $(LFLAGS) -o readtags $(READTAGSOBJS) $(LIBS)
readtags.o: readtags.c $(HACK_H)
$(CC) $(CFLAGS) -c readtags.c
nethack.tags: $(CTAGDEP)
#
# tested with universal ctags from https://github.com/universal-ctags/ctags.git
#
$(CTAGSCMD) $(CTAGSOPT) -f nethack.tags ../include/align.h
$(CTAGSCMD) $(CTAGSOPT) -a -f nethack.tags ../include/artifact.h
$(CTAGSCMD) $(CTAGSOPT) -a -f nethack.tags ../include/artilist.h
$(CTAGSCMD) $(CTAGSOPT) -a -f nethack.tags ../include/attrib.h
$(CTAGSCMD) $(CTAGSOPT) -a -f nethack.tags ../include/context.h
$(CTAGSCMD) $(CTAGSOPT) -a -f nethack.tags ../include/coord.h
$(CTAGSCMD) $(CTAGSOPT) -a -f nethack.tags ../include/decl.h
$(CTAGSCMD) $(CTAGSOPT) -a -f nethack.tags ../include/dungeon.h
$(CTAGSCMD) $(CTAGSOPT) -a -f nethack.tags ../include/engrave.h
$(CTAGSCMD) $(CTAGSOPT) -a -f nethack.tags ../include/flag.h
$(CTAGSCMD) $(CTAGSOPT) -a -f nethack.tags ../include/func_tab.h
$(CTAGSCMD) $(CTAGSOPT) -a -f nethack.tags ../include/global.h
$(CTAGSCMD) $(CTAGSOPT) -a -f nethack.tags ../include/hack.h
$(CTAGSCMD) $(CTAGSOPT) -a -f nethack.tags ../include/lev.h
$(CTAGSCMD) $(CTAGSOPT) -a -f nethack.tags ../include/mextra.h
$(CTAGSCMD) $(CTAGSOPT) -a -f nethack.tags ../include/mkroom.h
$(CTAGSCMD) $(CTAGSOPT) -a -f nethack.tags ../include/monst.h
$(CTAGSCMD) $(CTAGSOPT) -a -f nethack.tags ../include/monsym.h
$(CTAGSCMD) $(CTAGSOPT) -a -f nethack.tags ../include/obj.h
$(CTAGSCMD) $(CTAGSOPT) -a -f nethack.tags ../include/objclass.h
# $(CTAGSCMD) $(CTAGSOPT) -a -f nethack.tags ../include/permonst.h
$(CTAGSCMD) $(CTAGSOPT) -a -f nethack.tags ../include/prop.h
$(CTAGSCMD) $(CTAGSOPT) -a -f nethack.tags ../include/quest.h
$(CTAGSCMD) $(CTAGSOPT) -a -f nethack.tags ../include/rect.h
$(CTAGSCMD) $(CTAGSOPT) -a -f nethack.tags ../include/region.h
$(CTAGSCMD) $(CTAGSOPT) -a -f nethack.tags ../include/rm.h
$(CTAGSCMD) $(CTAGSOPT) -a -f nethack.tags ../include/skills.h
$(CTAGSCMD) $(CTAGSOPT) -a -f nethack.tags ../include/spell.h
$(CTAGSCMD) $(CTAGSOPT) -a -f nethack.tags ../include/sys.h
$(CTAGSCMD) $(CTAGSOPT) -a -f nethack.tags ../include/timeout.h
$(CTAGSCMD) $(CTAGSOPT) -a -f nethack.tags ../include/trap.h
$(CTAGSCMD) $(CTAGSOPT) -a -f nethack.tags ../include/you.h
$(CTAGSCMD) $(CTAGSOPT) -a -f nethack.tags ../include/onames.h
$(CTAGSCMD) $(CTAGSOPT) -a -f nethack.tags ../include/wintype.h
# using dependencies like # using dependencies like
# ../src/foo:: # ../src/foo::
# @( cd ../src ; $(MAKE) foo ) # @( cd ../src ; $(MAKE) foo )
@@ -142,10 +142,6 @@
31B8A46021A26AE70055BD01 /* dlb_main.c in Sources */ = {isa = PBXBuildFile; fileRef = 31B8A45F21A26AE70055BD01 /* dlb_main.c */; }; 31B8A46021A26AE70055BD01 /* dlb_main.c in Sources */ = {isa = PBXBuildFile; fileRef = 31B8A45F21A26AE70055BD01 /* dlb_main.c */; };
31B8A46121A26AF60055BD01 /* panic.c in Sources */ = {isa = PBXBuildFile; fileRef = 31B8A42721A267E60055BD01 /* panic.c */; }; 31B8A46121A26AF60055BD01 /* panic.c in Sources */ = {isa = PBXBuildFile; fileRef = 31B8A42721A267E60055BD01 /* panic.c */; };
31B8A46221A26B020055BD01 /* alloc.c in Sources */ = {isa = PBXBuildFile; fileRef = 31B8A36521A238040055BD01 /* alloc.c */; }; 31B8A46221A26B020055BD01 /* alloc.c in Sources */ = {isa = PBXBuildFile; fileRef = 31B8A36521A238040055BD01 /* alloc.c */; };
544768A323994965004B9739 /* sfascii.c in Sources */ = {isa = PBXBuildFile; fileRef = 544768A223994965004B9739 /* sfascii.c */; };
544768A5239949A8004B9739 /* sfbase.c in Sources */ = {isa = PBXBuildFile; fileRef = 544768A4239949A8004B9739 /* sfbase.c */; };
544768A9239949FA004B9739 /* sfdata.c in Sources */ = {isa = PBXBuildFile; fileRef = 544768A6239949FA004B9739 /* sfdata.c */; };
544768AA239949FA004B9739 /* sflendian.c in Sources */ = {isa = PBXBuildFile; fileRef = 544768A7239949FA004B9739 /* sflendian.c */; };
544768AB239949FA004B9739 /* sfstruct.c in Sources */ = {isa = PBXBuildFile; fileRef = 544768A8239949FA004B9739 /* sfstruct.c */; }; 544768AB239949FA004B9739 /* sfstruct.c in Sources */ = {isa = PBXBuildFile; fileRef = 544768A8239949FA004B9739 /* sfstruct.c */; };
544768AE23994A17004B9739 /* nhlsel.c in Sources */ = {isa = PBXBuildFile; fileRef = 544768AC23994A17004B9739 /* nhlsel.c */; }; 544768AE23994A17004B9739 /* nhlsel.c in Sources */ = {isa = PBXBuildFile; fileRef = 544768AC23994A17004B9739 /* nhlsel.c */; };
544768AF23994A17004B9739 /* nhlua.c in Sources */ = {isa = PBXBuildFile; fileRef = 544768AD23994A17004B9739 /* nhlua.c */; }; 544768AF23994A17004B9739 /* nhlua.c in Sources */ = {isa = PBXBuildFile; fileRef = 544768AD23994A17004B9739 /* nhlua.c */; };
@@ -486,18 +482,12 @@
31B8A45F21A26AE70055BD01 /* dlb_main.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = dlb_main.c; path = ../../util/dlb_main.c; sourceTree = "<group>"; }; 31B8A45F21A26AE70055BD01 /* dlb_main.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = dlb_main.c; path = ../../util/dlb_main.c; sourceTree = "<group>"; };
31B8A46421A278AC0055BD01 /* dgn_comp.y */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.yacc; name = dgn_comp.y; path = ../../util/dgn_comp.y; sourceTree = "<group>"; }; 31B8A46421A278AC0055BD01 /* dgn_comp.y */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.yacc; name = dgn_comp.y; path = ../../util/dgn_comp.y; sourceTree = "<group>"; };
31B8A46821A288770055BD01 /* dgn_comp.l */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.lex; name = dgn_comp.l; path = ../../util/dgn_comp.l; sourceTree = "<group>"; }; 31B8A46821A288770055BD01 /* dgn_comp.l */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.lex; name = dgn_comp.l; path = ../../util/dgn_comp.l; sourceTree = "<group>"; };
544768A223994965004B9739 /* sfascii.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = sfascii.c; path = ../../src/sfascii.c; sourceTree = "<group>"; };
544768A4239949A8004B9739 /* sfbase.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = sfbase.c; path = ../../src/sfbase.c; sourceTree = "<group>"; };
544768A6239949FA004B9739 /* sfdata.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = sfdata.c; path = ../../src/sfdata.c; sourceTree = "<group>"; };
544768A7239949FA004B9739 /* sflendian.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = sflendian.c; path = ../../src/sflendian.c; sourceTree = "<group>"; };
544768A8239949FA004B9739 /* sfstruct.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = sfstruct.c; path = ../../src/sfstruct.c; sourceTree = "<group>"; }; 544768A8239949FA004B9739 /* sfstruct.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = sfstruct.c; path = ../../src/sfstruct.c; sourceTree = "<group>"; };
544768AC23994A17004B9739 /* nhlsel.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = nhlsel.c; path = ../../src/nhlsel.c; sourceTree = "<group>"; }; 544768AC23994A17004B9739 /* nhlsel.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = nhlsel.c; path = ../../src/nhlsel.c; sourceTree = "<group>"; };
544768AD23994A17004B9739 /* nhlua.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = nhlua.c; path = ../../src/nhlua.c; sourceTree = "<group>"; }; 544768AD23994A17004B9739 /* nhlua.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = nhlua.c; path = ../../src/nhlua.c; sourceTree = "<group>"; };
544768B023994A2C004B9739 /* mdlib.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = mdlib.c; path = ../../src/mdlib.c; sourceTree = "<group>"; }; 544768B023994A2C004B9739 /* mdlib.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = mdlib.c; path = ../../src/mdlib.c; sourceTree = "<group>"; };
544768B423995447004B9739 /* isaac64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = isaac64.h; path = ../../include/isaac64.h; sourceTree = "<group>"; }; 544768B423995447004B9739 /* isaac64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = isaac64.h; path = ../../include/isaac64.h; sourceTree = "<group>"; };
544768B523995488004B9739 /* nhlua.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = nhlua.h; path = ../../include/nhlua.h; sourceTree = "<group>"; }; 544768B523995488004B9739 /* nhlua.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = nhlua.h; path = ../../include/nhlua.h; sourceTree = "<group>"; };
544768B623995488004B9739 /* sfprocs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = sfprocs.h; path = ../../include/sfprocs.h; sourceTree = "<group>"; };
544768B723995488004B9739 /* sfproto.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = sfproto.h; path = ../../include/sfproto.h; sourceTree = "<group>"; };
544768B923995BB7004B9739 /* liblua.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = liblua.a; path = ../../lib/lua/liblua.a; sourceTree = "<group>"; }; 544768B923995BB7004B9739 /* liblua.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = liblua.a; path = ../../lib/lua/liblua.a; sourceTree = "<group>"; };
54FCE8282223261F00F393C8 /* isaac64.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = isaac64.c; path = ../../src/isaac64.c; sourceTree = "<group>"; }; 54FCE8282223261F00F393C8 /* isaac64.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = isaac64.c; path = ../../src/isaac64.c; sourceTree = "<group>"; };
/* End PBXFileReference section */ /* End PBXFileReference section */
@@ -567,11 +557,7 @@
544768B023994A2C004B9739 /* mdlib.c */, 544768B023994A2C004B9739 /* mdlib.c */,
544768AC23994A17004B9739 /* nhlsel.c */, 544768AC23994A17004B9739 /* nhlsel.c */,
544768AD23994A17004B9739 /* nhlua.c */, 544768AD23994A17004B9739 /* nhlua.c */,
544768A6239949FA004B9739 /* sfdata.c */,
544768A7239949FA004B9739 /* sflendian.c */,
544768A8239949FA004B9739 /* sfstruct.c */, 544768A8239949FA004B9739 /* sfstruct.c */,
544768A4239949A8004B9739 /* sfbase.c */,
544768A223994965004B9739 /* sfascii.c */,
31B8A35521A238030055BD01 /* allmain.c */, 31B8A35521A238030055BD01 /* allmain.c */,
31B8A36521A238040055BD01 /* alloc.c */, 31B8A36521A238040055BD01 /* alloc.c */,
31B8A35E21A238040055BD01 /* apply.c */, 31B8A35E21A238040055BD01 /* apply.c */,
@@ -710,8 +696,6 @@
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
544768B523995488004B9739 /* nhlua.h */, 544768B523995488004B9739 /* nhlua.h */,
544768B623995488004B9739 /* sfprocs.h */,
544768B723995488004B9739 /* sfproto.h */,
544768B423995447004B9739 /* isaac64.h */, 544768B423995447004B9739 /* isaac64.h */,
3186A3B721A4B0FD0052BF02 /* align.h */, 3186A3B721A4B0FD0052BF02 /* align.h */,
3186A38021A4B0FB0052BF02 /* amiconf.h */, 3186A38021A4B0FB0052BF02 /* amiconf.h */,
@@ -1460,7 +1444,6 @@
files = ( files = (
31B8A3BC21A238060055BD01 /* eat.c in Sources */, 31B8A3BC21A238060055BD01 /* eat.c in Sources */,
31B8A3A921A238060055BD01 /* music.c in Sources */, 31B8A3A921A238060055BD01 /* music.c in Sources */,
544768A9239949FA004B9739 /* sfdata.c in Sources */,
544768B123994A2C004B9739 /* mdlib.c in Sources */, 544768B123994A2C004B9739 /* mdlib.c in Sources */,
31B8A3D221A238060055BD01 /* engrave.c in Sources */, 31B8A3D221A238060055BD01 /* engrave.c in Sources */,
31B8A3A021A238060055BD01 /* exper.c in Sources */, 31B8A3A021A238060055BD01 /* exper.c in Sources */,
@@ -1479,7 +1462,6 @@
31B8A41921A244940055BD01 /* objects.c in Sources */, 31B8A41921A244940055BD01 /* objects.c in Sources */,
31B8A3AA21A238060055BD01 /* wizard.c in Sources */, 31B8A3AA21A238060055BD01 /* wizard.c in Sources */,
31B8A3D021A238060055BD01 /* explode.c in Sources */, 31B8A3D021A238060055BD01 /* explode.c in Sources */,
544768A5239949A8004B9739 /* sfbase.c in Sources */,
31B8A3DE21A238060055BD01 /* sys.c in Sources */, 31B8A3DE21A238060055BD01 /* sys.c in Sources */,
31B8A38021A238060055BD01 /* sit.c in Sources */, 31B8A38021A238060055BD01 /* sit.c in Sources */,
31B8A3AF21A238060055BD01 /* lock.c in Sources */, 31B8A3AF21A238060055BD01 /* lock.c in Sources */,
@@ -1580,7 +1562,6 @@
31B8A38E21A238060055BD01 /* quest.c in Sources */, 31B8A38E21A238060055BD01 /* quest.c in Sources */,
31B8A3D621A238060055BD01 /* region.c in Sources */, 31B8A3D621A238060055BD01 /* region.c in Sources */,
31B8A3D421A238060055BD01 /* worm.c in Sources */, 31B8A3D421A238060055BD01 /* worm.c in Sources */,
544768AA239949FA004B9739 /* sflendian.c in Sources */,
31B8A3C921A238060055BD01 /* sounds.c in Sources */, 31B8A3C921A238060055BD01 /* sounds.c in Sources */,
31B8A37C21A238060055BD01 /* pager.c in Sources */, 31B8A37C21A238060055BD01 /* pager.c in Sources */,
31B8A39F21A238060055BD01 /* fountain.c in Sources */, 31B8A39F21A238060055BD01 /* fountain.c in Sources */,
@@ -1589,7 +1570,6 @@
31B8A3D321A238060055BD01 /* cmd.c in Sources */, 31B8A3D321A238060055BD01 /* cmd.c in Sources */,
31B8A3AB21A238060055BD01 /* mplayer.c in Sources */, 31B8A3AB21A238060055BD01 /* mplayer.c in Sources */,
31B8A3CC21A238060055BD01 /* pickup.c in Sources */, 31B8A3CC21A238060055BD01 /* pickup.c in Sources */,
544768A323994965004B9739 /* sfascii.c in Sources */,
31B8A39721A238060055BD01 /* invent.c in Sources */, 31B8A39721A238060055BD01 /* invent.c in Sources */,
31B8A40021A23E6E0055BD01 /* getline.c in Sources */, 31B8A40021A23E6E0055BD01 /* getline.c in Sources */,
31B8A3B521A238060055BD01 /* rect.c in Sources */, 31B8A3B521A238060055BD01 /* rect.c in Sources */,
+18 -7
View File
@@ -1,6 +1,6 @@
# depend.awk -- awk script used to construct makefile dependencies # depend.awk -- awk script used to construct makefile dependencies
# for nethack's source files (`make depend' support for Makefile.src). # for nethack's source files (`make depend' support for Makefile.src).
# $NHDT-Date: 1546220373 2018/12/31 01:39:33 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.8 $ # $NHDT-Date: 1575916941 2019/12/09 18:42:21 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.10 $
# #
# usage: # usage:
# cd src ; nawk -f depend.awk ../include/*.h list-of-.c/.cpp-files # cd src ; nawk -f depend.awk ../include/*.h list-of-.c/.cpp-files
@@ -41,14 +41,25 @@ FNR == 1 { output_dep() #finish previous file
#[3.4.0: gnomehack headers currently aren't in include] #[3.4.0: gnomehack headers currently aren't in include]
#[3.6.2: Qt4 headers aren't in include either] #[3.6.2: Qt4 headers aren't in include either]
#[3.6.2: curses headers likewise] #[3.6.2: curses headers likewise]
#[3.7.0: Qt headers have moved]
if (incl ~ /\.h$/) { if (incl ~ /\.h$/) {
if (incl ~ "curses\.h") if (incl ~ "curses\.h")
incl = "" # skip "curses.h"; it should be <curses.h> incl = "" # skip "curses.h"; it should be <curses.h>
else if (incl ~ /^..\/lib\/lua-.*\/src\/l/)
incl = "" # skip lua headers
else if (incl ~ /^curs/) # curses special case else if (incl ~ /^curs/) # curses special case
incl = "../win/curses/" incl incl = "../win/curses/" incl
else if (incl ~ /^qt4/) # Qt v4 special case else if (incl ~ /^qt/) { # Qt special cases
incl = "../win/Qt4/" incl # qtext.h is a core header that accidentally matches...
else if (incl ~ /^gn/) # gnomehack special case if (incl ~ /^qtext.h/) # ...the Qt exception
incl = "../include/" incl
# Qt v3 headers are in ../win/Qt3
# Qt v4/v5 headers are in ../win/Qt
else if (FILENAME ~ /^\.\.\/win\/Qt3\/.*/)
incl = "../win/Qt3/" incl
else # Qt v4
incl = "../win/Qt/" incl
} else if (incl ~ /^gn/) # gnomehack special case
incl = "../win/gnome/" incl incl = "../win/gnome/" incl
else else
incl = "../include/" incl incl = "../include/" incl
@@ -100,7 +111,7 @@ function output_specials( i, sp, alt_sp)
# write a target and its dependency list in pretty-printed format; # write a target and its dependency list in pretty-printed format;
# if target's primary source file has a path prefix, also write build command # if target's primary source file has a path prefix, also write build command
# #
function format_dep(target, source, n, i, list) function format_dep(target, source, col, n, i, list)
{ {
split("", done) #``for (x in done) delete done[x]'' split("", done) #``for (x in done) delete done[x]''
printf("%s:", target); col = length(target) + 1 printf("%s:", target); col = length(target) + 1
+2 -2
View File
@@ -33,8 +33,8 @@ CFLAGS+=`pkg-config Qt5Gui Qt5Widgets Qt5Multimedia --cflags` -fPIC
LINK=g++ LINK=g++
CXX=g++ -std=gnu++11 CXX=g++ -std=gnu++11
WINSRC = $(WINQT4SRC) WINSRC = $(WINQTSRC)
WINOBJ = $(WINQT4OBJ) WINOBJ = $(WINQTOBJ)
WINLIB = $(WINQT5LIB) WINLIB = $(WINQT5LIB)
#MOC = moc #MOC = moc
MOC = moc-qt5 MOC = moc-qt5
+1 -1
View File
@@ -320,7 +320,7 @@ $ gosub compile_list
$! $!
$! Files added in 3.7 $! Files added in 3.7
$! $!
$ c_list = "sfbase,sfdata,sfstruct,sflendian,sfascii,nhlua,nhlsel" $ c_list = "sfstruct,nhlua,nhlsel"
$ gosub compile_list $ gosub compile_list
$! $!
$! 3.7 runtime LUA level parser/loader $! 3.7 runtime LUA level parser/loader
+3 -3
View File
@@ -323,12 +323,11 @@ VOBJ24 = $(O)track.o $(O)trap.o $(O)u_init.o $(O)uhitm.o
VOBJ25 = $(O)vault.o $(O)vis_tab.o $(O)vision.o $(O)weapon.o VOBJ25 = $(O)vault.o $(O)vis_tab.o $(O)vision.o $(O)weapon.o
VOBJ26 = $(O)were.o $(O)wield.o $(O)windows.o $(O)wizard.o VOBJ26 = $(O)were.o $(O)wield.o $(O)windows.o $(O)wizard.o
VOBJ27 = $(O)worm.o $(O)worn.o $(O)write.o $(O)zap.o VOBJ27 = $(O)worm.o $(O)worn.o $(O)write.o $(O)zap.o
VOBJ28 = $(O)sfbase.o $(O)sfdata.o VOBJ28 = $(O)sfstruct.o
VOBJ29 = $(O)sfstruct.o $(O)sfascii.o $(O)sflendian.o
#VOBJ31 = $(O)win10.o #VOBJ31 = $(O)win10.o
ifeq "$(ADD_LUA)" "Y" ifeq "$(ADD_LUA)" "Y"
LUAOBJ = $(O)nhlua.o $(O)nhlsel.o LUAOBJ = $(O)nhlua.o $(O)nhlsel.o $(O)nhlobj.o
LUA_QTEXT_FILE = "quest.lua" LUA_QTEXT_FILE = "quest.lua"
endif endif
@@ -1594,6 +1593,7 @@ $(O)muse.o: muse.c $(HACK_H)
$(O)music.o: music.c $(HACK_H) #interp.c $(O)music.o: music.c $(HACK_H) #interp.c
$(O)nhlua.o: nhlua.c $(HACK_H) $(O)nhlua.o: nhlua.c $(HACK_H)
$(O)nhlsel.o: nhlsel.c $(HACK_H) $(O)nhlsel.o: nhlsel.c $(HACK_H)
$(O)nhlobj.o: nhlobj.c $(HACK_H)
$(O)o_init.o: o_init.c $(HACK_H) $(INCL)/lev.h $(O)o_init.o: o_init.c $(HACK_H) $(INCL)/lev.h
$(O)objects.o: objects.c $(CONFIG_H) $(INCL)/obj.h $(INCL)/objclass.h \ $(O)objects.o: objects.c $(CONFIG_H) $(INCL)/obj.h $(INCL)/objclass.h \
$(INCL)/prop.h $(INCL)/skills.h $(INCL)/color.h $(INCL)/prop.h $(INCL)/skills.h $(INCL)/color.h
+4 -84
View File
@@ -325,10 +325,9 @@ VOBJ24 = $(O)track.o $(O)trap.o $(O)u_init.o $(O)uhitm.o
VOBJ25 = $(O)vault.o $(O)vis_tab.o $(O)vision.o $(O)weapon.o VOBJ25 = $(O)vault.o $(O)vis_tab.o $(O)vision.o $(O)weapon.o
VOBJ26 = $(O)were.o $(O)wield.o $(O)windows.o $(O)wizard.o VOBJ26 = $(O)were.o $(O)wield.o $(O)windows.o $(O)wizard.o
VOBJ27 = $(O)worm.o $(O)worn.o $(O)write.o $(O)zap.o VOBJ27 = $(O)worm.o $(O)worn.o $(O)write.o $(O)zap.o
VOBJ28 = $(O)sfbase.o $(O)sfdata.o VOBJ28 = $(O)sfstruct.o
VOBJ29 = $(O)sfstruct.o $(O)sfascii.o $(O)sflendian.o
LUAOBJ = $(O)nhlua.o $(O)nhlsel.o LUAOBJ = $(O)nhlua.o $(O)nhlsel.o $(O)nhlobj.o
LUA_QTEXT_FILE = "quest.lua" LUA_QTEXT_FILE = "quest.lua"
!IFDEF CROSSCOMPILE_HOST !IFDEF CROSSCOMPILE_HOST
@@ -1604,92 +1603,12 @@ $(O)ttystub.o: $(HACK_H) $(MSWSYS)\stubs.c
# #
#============================================ #============================================
# fieldlevel save dependencies # save dependencies
#============================================ #============================================
$(O)sfbase.o: $(HACK_H) $(INCL)\sfproto.h $(INCL)\sfprocs.h \
$(SRC)\sfbase.c
# @$(cc) $(cflagsBuild) -Fo$@ $(SRC)\sfbase.c
$(O)sfdata.o: $(HACK_H) $(INCL)\sfprocs.h $(SRC)\sfdata.c
# @$(cc) $(cflagsBuild) -Fo$@ $(SRC)\sfdata.c
$(O)sfstruct.o: $(HACK_H) $(SRC)\sfstruct.c $(O)sfstruct.o: $(HACK_H) $(SRC)\sfstruct.c
# @$(cc) $(cflagsBuild) -Fo$@ $(SRC)\sfstruct.c # @$(cc) $(cflagsBuild) -Fo$@ $(SRC)\sfstruct.c
$(O)sfascii.o: $(HACK_H) $(INCL)\sfprocs.h $(SRC)\sfascii.c
# @$(cc) $(cflagsBuild) -Fo$@ $(SRC)\sfascii.c
$(O)sflendian.o: $(HACK_H) $(INCL)\sfprocs.h $(SRC)\sflendian.c
# @$(cc) $(cflagsBuild) -Fo$@ $(SRC)\sflendian.c
$(SRC)\sfdata.c: $(U)readtags.exe $(U)nethack.tags
$(U)readtags.exe
$(INCL)\sfproto.h: $(U)readtags.exe $(U)nethack.tags
$(U)readtags.exe
$(U)readtags.exe: $(O)readtags$(HOST).o
@$(link) $(lflagsBuild) -out:$@ $(O)readtags$(HOST).o
$(O)readtags$(HOST).o: $(U)readtags.c $(U)nethack.tags $(CONFIG_H) $(PATCHLEVEL_H)
@$(cc) $(cflagsBuild) $(CROSSCOMPILE) $(CROSSCOMPILE_HOST) $(TEMPL) -Fo$@ $(U)readtags.c
#
#tested only with exuberant ctags from http://ctags.sourceforge.net
#
CTAGDEP = ..\include\align.h ..\include\artifact.h ..\include\artilist.h \
..\include\attrib.h ..\include\context.h ..\include\coord.h \
..\include\decl.h ..\include\dungeon.h ..\include\engrave.h \
..\include\flag.h ..\include\func_tab.h ..\include\global.h \
..\include\hack.h ..\include\lev.h ..\include\mextra.h \
..\include\mkroom.h ..\include\monst.h ..\include\monsym.h \
..\include\obj.h ..\include\objclass.h ..\include\prop.h \
..\include\quest.h ..\include\rect.h ..\include\region.h \
..\include\rm.h ..\include\skills.h ..\include\spell.h \
..\include\sys.h ..\include\timeout.h ..\include\trap.h \
..\include\you.h ..\include\onames.h ..\include\wintype.h
$(U)nethack.tags: $(CTAGDEP)
$(CTAGSCMD) $(CTAGSOPT) -f $(U)nethack.tags $(TINC)/align.h
$(CTAGSCMD) $(CTAGSOPT) -a -f $(U)nethack.tags $(TINC)/artifact.h
$(CTAGSCMD) $(CTAGSOPT) -a -f $(U)nethack.tags $(TSRC)/artifact.c
$(CTAGSCMD) $(CTAGSOPT) -a -f $(U)nethack.tags $(TINC)/artilist.h
$(CTAGSCMD) $(CTAGSOPT) -a -f $(U)nethack.tags $(TINC)/attrib.h
$(CTAGSCMD) $(CTAGSOPT) -a -f $(U)nethack.tags $(TSRC)/bones.c
$(CTAGSCMD) $(CTAGSOPT) -a -f $(U)nethack.tags $(TINC)/context.h
$(CTAGSCMD) $(CTAGSOPT) -a -f $(U)nethack.tags $(TINC)/coord.h
$(CTAGSCMD) $(CTAGSOPT) -a -f $(U)nethack.tags $(TINC)/decl.h
$(CTAGSCMD) $(CTAGSOPT) -a -f $(U)nethack.tags $(TSRC)/decl.c
$(CTAGSCMD) $(CTAGSOPT) -a -f $(U)nethack.tags $(TINC)/dungeon.h
$(CTAGSCMD) $(CTAGSOPT) -a -f $(U)nethack.tags $(TINC)/engrave.h
$(CTAGSCMD) $(CTAGSOPT) -a -f $(U)nethack.tags $(TSRC)/engrave.c
$(CTAGSCMD) $(CTAGSOPT) -a -f $(U)nethack.tags $(TINC)/flag.h
$(CTAGSCMD) $(CTAGSOPT) -a -f $(U)nethack.tags $(TINC)/func_tab.h
$(CTAGSCMD) $(CTAGSOPT) -a -f $(U)nethack.tags $(TINC)/global.h
$(CTAGSCMD) $(CTAGSOPT) -a -f $(U)nethack.tags $(TINC)/hack.h
$(CTAGSCMD) $(CTAGSOPT) -a -f $(U)nethack.tags $(TINC)/lev.h
$(CTAGSCMD) $(CTAGSOPT) -a -f $(U)nethack.tags $(TINC)/mextra.h
$(CTAGSCMD) $(CTAGSOPT) -a -f $(U)nethack.tags $(TINC)/mkroom.h
$(CTAGSCMD) $(CTAGSOPT) -a -f $(U)nethack.tags $(TINC)/monst.h
$(CTAGSCMD) $(CTAGSOPT) -a -f $(U)nethack.tags $(TINC)/monsym.h
$(CTAGSCMD) $(CTAGSOPT) -a -f $(U)nethack.tags $(TINC)/obj.h
$(CTAGSCMD) $(CTAGSOPT) -a -f $(U)nethack.tags $(TINC)/objclass.h
# $(CTAGSCMD) $(CTAGSOPT) -a -f $(U)nethack.tags $(TINC)/permonst.h
$(CTAGSCMD) $(CTAGSOPT) -a -f $(U)nethack.tags $(TINC)/prop.h
$(CTAGSCMD) $(CTAGSOPT) -a -f $(U)nethack.tags $(TINC)/quest.h
$(CTAGSCMD) $(CTAGSOPT) -a -f $(U)nethack.tags $(TINC)/rect.h
$(CTAGSCMD) $(CTAGSOPT) -a -f $(U)nethack.tags $(TINC)/region.h
$(CTAGSCMD) $(CTAGSOPT) -a -f $(U)nethack.tags $(TINC)/rm.h
$(CTAGSCMD) $(CTAGSOPT) -a -f $(U)nethack.tags $(TINC)/skills.h
$(CTAGSCMD) $(CTAGSOPT) -a -f $(U)nethack.tags $(TINC)/spell.h
$(CTAGSCMD) $(CTAGSOPT) -a -f $(U)nethack.tags $(TINC)/sys.h
$(CTAGSCMD) $(CTAGSOPT) -a -f $(U)nethack.tags $(TINC)/timeout.h
$(CTAGSCMD) $(CTAGSOPT) -a -f $(U)nethack.tags $(TINC)/trap.h
$(CTAGSCMD) $(CTAGSOPT) -a -f $(U)nethack.tags $(TINC)/you.h
$(CTAGSCMD) $(CTAGSOPT) -a -f $(U)nethack.tags $(TINC)/onames.h
$(CTAGSCMD) $(CTAGSOPT) -a -f $(U)nethack.tags $(TINC)/wintype.h
# #
# util dependencies # util dependencies
# These have dual-roles and need to be build for host and targt platforms. # These have dual-roles and need to be build for host and targt platforms.
@@ -1963,6 +1882,7 @@ $(O)muse.o: muse.c $(HACK_H)
$(O)music.o: music.c $(HACK_H) #interp.c $(O)music.o: music.c $(HACK_H) #interp.c
$(O)nhlua.o: nhlua.c $(HACK_H) $(O)nhlua.o: nhlua.c $(HACK_H)
$(O)nhlsel.o: nhlsel.c $(HACK_H) $(O)nhlsel.o: nhlsel.c $(HACK_H)
$(O)nhlobj.o: nhlobj.c $(HACK_H)
$(O)o_init.o: o_init.c $(HACK_H) $(INCL)\lev.h $(O)o_init.o: o_init.c $(HACK_H) $(INCL)\lev.h
$(O)objnam.o: objnam.c $(HACK_H) $(O)objnam.o: objnam.c $(HACK_H)
$(O)options.o: options.c $(CONFIG_H) $(INCL)\objclass.h $(INCL)\flag.h \ $(O)options.o: options.c $(CONFIG_H) $(INCL)\objclass.h $(INCL)\flag.h \
+66
View File
@@ -0,0 +1,66 @@
local o = obj.new("rock");
o:placeobj(u.ux, u.uy);
local o2 = obj.at(u.ux, u.uy);
local o2tbl = o2:totable();
if (o2tbl.otyp_name ~= "rock") then
error("no rock under you");
end
local box = obj.new("empty large box");
local boxtbl = box:totable();
if (boxtbl.has_contents ~= 0) then
error("empty box has contents");
end
box:addcontent(obj.new("diamond"));
boxtbl = box:totable();
if (boxtbl.has_contents ~= 1) then
error("box has no contents");
end
local diamond = box:contents():totable();
if (diamond.otyp_name ~= "diamond") then
error("box contents is not a diamond");
end
box:placeobj(u.ux, u.uy);
local o3 = obj.at(u.ux, u.uy);
local o3tbl = o3:totable();
if (o3tbl.otyp_name ~= "large box") then
error("no large box under you");
end
local o4 = o3:next();
local o4tbl = o4:totable();
if (o4tbl.otyp_name ~= "rock") then
error("no rock under the large box");
end
local oc = obj.class(o4tbl.otyp);
if (oc.name ~= "rock") then
error("object class is not rock, part 1");
end
if (oc.class ~= "*") then
error("object class is not *, part 1");
end
local oc2 = obj.class(o);
if (oc2.name ~= "rock") then
error("object class is not rock, part 2");
end
if (oc2.class ~= "*") then
error("object class is not *, part 2");
end
local oc3 = obj.class(obj.new("rock"));
if (oc3.name ~= "rock") then
error("object class is not rock, part 3");
end
if (oc3.class ~= "*") then
error("object class is not *, part 3");
end
+64
View File
@@ -0,0 +1,64 @@
local wishtest_objects = {
["a rock"] = { otyp_name = "rock", quan = 1, oclass = "*" },
["5 +3 blessed silver daggers"] = { otyp_name = "silver dagger", blessed = 1, cursed = 0, spe = 3, quan = 5 },
["an empty locked large box"] = { otyp_name = "large box", is_container = 1, has_contents = 0, olocked = 1 },
["an empty trapped unlocked chest"] = { otyp_name = "chest", is_container = 1, has_contents = 0, olocked = 0, otrapped = 1 },
["an empty untrapped locked chest"] = { otyp_name = "chest", is_container = 1, has_contents = 0, olocked = 1, otrapped = 0 },
["an empty locked broken chest"] = { otyp_name = "chest", is_container = 1, has_contents = 0, olocked = 0, obroken = 1 },
["broken empty chest"] = { otyp_name = "chest", obroken = 1 },
["potion of holy water"] = { otyp_name = "water", oclass = "!", blessed = 1, cursed = 0 },
["potion of unholy water"] = { otyp_name = "water", oclass = "!", blessed = 0, cursed = 1 },
["cursed greased +2 grey dragon scale mail"] = { otyp_name = "gray dragon scale mail", oclass = "[", blessed = 0, cursed = 1, spe = 2, greased = 1 },
["uncursed magic marker (11)"] = { otyp_name = "magic marker", blessed = 0, cursed = 0, spe = 11 },
["lit oil lamp"] = { otyp_name = "oil lamp", lamplit = 1 },
["6 burning tallow candles"] = { otyp_name = "tallow candle", lamplit = 1, quan = 6 },
["unlit oil lamp"] = { otyp_name = "oil lamp", lamplit = 0 },
["7 extinguished wax candles"] = { otyp_name = "wax candle", lamplit = 0, quan = 7 },
["2 blank scrolls"] = { otyp_name = "blank paper", quan = 2 },
["3 unlabeled scrolls"] = { otyp_name = "blank paper", quan = 3 },
["1 unlabelled scroll"] = { otyp_name = "blank paper", quan = 1 },
["3 rusty poisoned darts"] = { otyp_name = "dart", quan = 3, opoisoned = 1, oeroded = 1 },
["4 diluted dark green potions named whisky"] = { otyp_descr = "dark green", oclass = "!", quan = 4, odiluted = 1, has_oname = 1, oname = "whisky" },
["poisoned food ration"] = { otyp_name = "food ration", oclass = "%", age = 1 },
["empty tin"] = { otyp_name = "tin", oclass = "%", corpsenm = -1, spe = 0 },
["blessed tin of spinach"] = { otyp_name = "tin", oclass = "%", corpsenm = -1, spe = 1, blessed = 1 },
["trapped tin of floating eye meat"] = { otyp_name = "tin", oclass = "%", otrapped = 1, corpsenm_name = "floating eye" },
["hill orc corpse"] = { otyp_name = "corpse", oclass = "%", corpsenm_name = "hill orc" },
["destroy armor"] = { otyp_name = "destroy armor", oclass = "?" },
["enchant weapon"] = { otyp_name = "enchant weapon", oclass = "?" },
["scroll of food detection"] = { otyp_name = "food detection", oclass = "?" },
["scroll of detect food"] = { otyp_name = "food detection", oclass = "?" },
["spellbook of food detection"] = { otyp_name = "detect food", oclass = "+" },
["spell"] = { NO_OBJ = 1 },
["-1 ring mail"] = { otyp_name = "ring mail", oclass = "[", spe = -1 },
["studded leather armor"] = { otyp_name = "studded leather armor", oclass = "[" },
["leather armor"] = { otyp_name = "leather armor", oclass = "[" },
["tooled horn"] = { otyp_name = "tooled horn", oclass = "(" },
["meat ring"] = { otyp_name = "meat ring", oclass = "%" },
["beartrap"] = { otyp_name = "beartrap", oclass = "(" },
["bear trap"] = { otyp_name = "beartrap", oclass = "(" },
["landmine"] = { otyp_name = "land mine", oclass = "(" },
["land mine"] = { otyp_name = "land mine", oclass = "(" },
["blessed historic statue of woodland-elf named Foo"] = { otyp_name = "statue", blessed = 1, historic = 1, corpsenm_name = "Woodland-elf", oname = "Foo" },
["blessed figurine of a ki-rin"] = { otyp_name = "figurine", blessed = 1, corpsenm_name = "ki-rin" },
["partly eaten orange"] = { otyp_name = "orange", oclass = "%", oeaten = function ()
local oc = obj.class(obj.new("orange"));
return (oc.nutrition // 2);
end },
};
for str, tbl in pairs(wishtest_objects) do
local o = obj.new(str):totable();
for field, value in pairs(tbl) do
local val;
if (type(value) == "function") then
val = value();
else
val = value;
end
if (o[field] ~= val) then
error("wished " .. str .. ", but " .. field .. " is " .. o[field] .. ", not " .. val);
end
end
end
-1677
View File
File diff suppressed because it is too large Load Diff
+1 -4
View File
@@ -1,4 +1 @@
Install.Qt NHSUBST * NH_filestag=(file%s_for_the_Qt_4_or_5_widget_library_-_X11,_Windows,_Mac_OS_X)
qpe-nethack.control NH_header=no
knethack.lnk NH_header=no
* NH_filestag=(file%s_for_the_Qt_3_widget_library_-_X11,_Windows,_Mac_OS_X,_or_Qtopia)
+58 -58
View File
@@ -2,7 +2,7 @@
// Qt4 conversion copyright (c) Ray Chason, 2012-2014. // Qt4 conversion copyright (c) Ray Chason, 2012-2014.
// NetHack may be freely redistributed. See license for details. // NetHack may be freely redistributed. See license for details.
// qt4bind.cpp -- bindings between the Qt 4 interface and the main code // qt_bind.cpp -- bindings between the Qt 4 interface and the main code
extern "C" { extern "C" {
#include "hack.h" #include "hack.h"
@@ -25,23 +25,23 @@ extern "C" {
#else #else
#include <QtGui/QSound> #include <QtGui/QSound>
#endif #endif
#include "qt4bind.h" #include "qt_bind.h"
#include "qt4click.h" #include "qt_click.h"
#ifdef TIMED_DELAY #ifdef TIMED_DELAY
#include "qt4delay.h" #include "qt_delay.h"
#endif #endif
#include "qt4xcmd.h" #include "qt_xcmd.h"
#include "qt4key.h" #include "qt_key.h"
#include "qt4map.h" #include "qt_map.h"
#include "qt4menu.h" #include "qt_menu.h"
#include "qt4msg.h" #include "qt_msg.h"
#include "qt4plsel.h" #include "qt_plsel.h"
#include "qt4svsel.h" #include "qt_svsel.h"
#include "qt4set.h" #include "qt_set.h"
#include "qt4stat.h" #include "qt_stat.h"
#include "qt4streq.h" #include "qt_streq.h"
#include "qt4yndlg.h" #include "qt_yndlg.h"
#include "qt4str.h" #include "qt_str.h"
extern "C" { extern "C" {
#include "dlb.h" #include "dlb.h"
@@ -51,7 +51,7 @@ extern "C" {
extern int qt_compact_mode; extern int qt_compact_mode;
// end temporary // end temporary
namespace nethack_qt4 { namespace nethack_qt_ {
// XXX Should be from Options // XXX Should be from Options
// //
@@ -721,7 +721,7 @@ boolean NetHackQtBind::msgs_initd = false;
static void Qt_positionbar(char *) {} static void Qt_positionbar(char *) {}
} // namespace nethack_qt4 } // namespace nethack_qt_
struct window_procs Qt_procs = { struct window_procs Qt_procs = {
"Qt", "Qt",
@@ -731,48 +731,48 @@ struct window_procs Qt_procs = {
| WC_PLAYER_SELECTION | WC_SPLASH_SCREEN, | WC_PLAYER_SELECTION | WC_SPLASH_SCREEN,
0L, 0L,
{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, /* color availability */ {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, /* color availability */
nethack_qt4::NetHackQtBind::qt_init_nhwindows, nethack_qt_::NetHackQtBind::qt_init_nhwindows,
nethack_qt4::NetHackQtBind::qt_player_selection, nethack_qt_::NetHackQtBind::qt_player_selection,
nethack_qt4::NetHackQtBind::qt_askname, nethack_qt_::NetHackQtBind::qt_askname,
nethack_qt4::NetHackQtBind::qt_get_nh_event, nethack_qt_::NetHackQtBind::qt_get_nh_event,
nethack_qt4::NetHackQtBind::qt_exit_nhwindows, nethack_qt_::NetHackQtBind::qt_exit_nhwindows,
nethack_qt4::NetHackQtBind::qt_suspend_nhwindows, nethack_qt_::NetHackQtBind::qt_suspend_nhwindows,
nethack_qt4::NetHackQtBind::qt_resume_nhwindows, nethack_qt_::NetHackQtBind::qt_resume_nhwindows,
nethack_qt4::NetHackQtBind::qt_create_nhwindow, nethack_qt_::NetHackQtBind::qt_create_nhwindow,
nethack_qt4::NetHackQtBind::qt_clear_nhwindow, nethack_qt_::NetHackQtBind::qt_clear_nhwindow,
nethack_qt4::NetHackQtBind::qt_display_nhwindow, nethack_qt_::NetHackQtBind::qt_display_nhwindow,
nethack_qt4::NetHackQtBind::qt_destroy_nhwindow, nethack_qt_::NetHackQtBind::qt_destroy_nhwindow,
nethack_qt4::NetHackQtBind::qt_curs, nethack_qt_::NetHackQtBind::qt_curs,
nethack_qt4::NetHackQtBind::qt_putstr, nethack_qt_::NetHackQtBind::qt_putstr,
genl_putmixed, genl_putmixed,
nethack_qt4::NetHackQtBind::qt_display_file, nethack_qt_::NetHackQtBind::qt_display_file,
nethack_qt4::NetHackQtBind::qt_start_menu, nethack_qt_::NetHackQtBind::qt_start_menu,
nethack_qt4::NetHackQtBind::qt_add_menu, nethack_qt_::NetHackQtBind::qt_add_menu,
nethack_qt4::NetHackQtBind::qt_end_menu, nethack_qt_::NetHackQtBind::qt_end_menu,
nethack_qt4::NetHackQtBind::qt_select_menu, nethack_qt_::NetHackQtBind::qt_select_menu,
genl_message_menu, /* no need for X-specific handling */ genl_message_menu, /* no need for X-specific handling */
nethack_qt4::NetHackQtBind::qt_update_inventory, nethack_qt_::NetHackQtBind::qt_update_inventory,
nethack_qt4::NetHackQtBind::qt_mark_synch, nethack_qt_::NetHackQtBind::qt_mark_synch,
nethack_qt4::NetHackQtBind::qt_wait_synch, nethack_qt_::NetHackQtBind::qt_wait_synch,
#ifdef CLIPPING #ifdef CLIPPING
nethack_qt4::NetHackQtBind::qt_cliparound, nethack_qt_::NetHackQtBind::qt_cliparound,
#endif #endif
#ifdef POSITIONBAR #ifdef POSITIONBAR
nethack_qt4::Qt_positionbar, nethack_qt_::Qt_positionbar,
#endif #endif
nethack_qt4::NetHackQtBind::qt_print_glyph, nethack_qt_::NetHackQtBind::qt_print_glyph,
//NetHackQtBind::qt_print_glyph_compose, //NetHackQtBind::qt_print_glyph_compose,
nethack_qt4::NetHackQtBind::qt_raw_print, nethack_qt_::NetHackQtBind::qt_raw_print,
nethack_qt4::NetHackQtBind::qt_raw_print_bold, nethack_qt_::NetHackQtBind::qt_raw_print_bold,
nethack_qt4::NetHackQtBind::qt_nhgetch, nethack_qt_::NetHackQtBind::qt_nhgetch,
nethack_qt4::NetHackQtBind::qt_nh_poskey, nethack_qt_::NetHackQtBind::qt_nh_poskey,
nethack_qt4::NetHackQtBind::qt_nhbell, nethack_qt_::NetHackQtBind::qt_nhbell,
nethack_qt4::NetHackQtBind::qt_doprev_message, nethack_qt_::NetHackQtBind::qt_doprev_message,
nethack_qt4::NetHackQtBind::qt_yn_function, nethack_qt_::NetHackQtBind::qt_yn_function,
nethack_qt4::NetHackQtBind::qt_getlin, nethack_qt_::NetHackQtBind::qt_getlin,
nethack_qt4::NetHackQtBind::qt_get_ext_cmd, nethack_qt_::NetHackQtBind::qt_get_ext_cmd,
nethack_qt4::NetHackQtBind::qt_number_pad, nethack_qt_::NetHackQtBind::qt_number_pad,
nethack_qt4::NetHackQtBind::qt_delay_output, nethack_qt_::NetHackQtBind::qt_delay_output,
#ifdef CHANGE_COLOR /* only a Mac option currently */ #ifdef CHANGE_COLOR /* only a Mac option currently */
donull, donull,
donull, donull,
@@ -780,17 +780,17 @@ struct window_procs Qt_procs = {
donull, donull,
#endif #endif
/* other defs that really should go away (they're tty specific) */ /* other defs that really should go away (they're tty specific) */
nethack_qt4::NetHackQtBind::qt_start_screen, nethack_qt_::NetHackQtBind::qt_start_screen,
nethack_qt4::NetHackQtBind::qt_end_screen, nethack_qt_::NetHackQtBind::qt_end_screen,
#ifdef GRAPHIC_TOMBSTONE #ifdef GRAPHIC_TOMBSTONE
nethack_qt4::NetHackQtBind::qt_outrip, nethack_qt_::NetHackQtBind::qt_outrip,
#else #else
genl_outrip, genl_outrip,
#endif #endif
genl_preference_update, genl_preference_update,
nethack_qt4::NetHackQtBind::qt_getmsghistory, nethack_qt_::NetHackQtBind::qt_getmsghistory,
nethack_qt4::NetHackQtBind::qt_putmsghistory, nethack_qt_::NetHackQtBind::qt_putmsghistory,
genl_status_init, genl_status_init,
genl_status_finish, genl_status_enablefield, genl_status_finish, genl_status_enablefield,
#ifdef STATUS_HILITES #ifdef STATUS_HILITES
+4 -4
View File
@@ -2,14 +2,14 @@
// Qt4 conversion copyright (c) Ray Chason, 2012-2014. // Qt4 conversion copyright (c) Ray Chason, 2012-2014.
// NetHack may be freely redistributed. See license for details. // NetHack may be freely redistributed. See license for details.
// qt4bind.h -- bindings between the Qt 4 interface and the main code // qt_bind.h -- bindings between the Qt 4 interface and the main code
#ifndef QT4BIND_H #ifndef QT4BIND_H
#define QT4BIND_H #define QT4BIND_H
#include "qt4main.h" #include "qt_main.h"
namespace nethack_qt4 { namespace nethack_qt_ {
class NetHackQtClickBuffer; class NetHackQtClickBuffer;
@@ -94,6 +94,6 @@ private:
static boolean msgs_initd; static boolean msgs_initd;
}; };
} // namespace nethack_qt4 } // namespace nethack_qt_
#endif #endif
+4 -4
View File
@@ -2,7 +2,7 @@
// Qt4 conversion copyright (c) Ray Chason, 2012-2014. // Qt4 conversion copyright (c) Ray Chason, 2012-2014.
// NetHack may be freely redistributed. See license for details. // NetHack may be freely redistributed. See license for details.
// qt4click.cpp -- a mouse click buffer // qt_click.cpp -- a mouse click buffer
#include "hack.h" #include "hack.h"
#undef Invisible #undef Invisible
@@ -16,9 +16,9 @@
#undef max #undef max
#include <QtGui/QtGui> #include <QtGui/QtGui>
#include "qt4click.h" #include "qt_click.h"
namespace nethack_qt4 { namespace nethack_qt_ {
NetHackQtClickBuffer::NetHackQtClickBuffer() : NetHackQtClickBuffer::NetHackQtClickBuffer() :
in(0), out(0) in(0), out(0)
@@ -45,4 +45,4 @@ void NetHackQtClickBuffer::Get()
out=(out+1)%maxclick; out=(out+1)%maxclick;
} }
} // namespace nethack_qt4 } // namespace nethack_qt_
+3 -3
View File
@@ -2,12 +2,12 @@
// Qt4 conversion copyright (c) Ray Chason, 2012-2014. // Qt4 conversion copyright (c) Ray Chason, 2012-2014.
// NetHack may be freely redistributed. See license for details. // NetHack may be freely redistributed. See license for details.
// qt4click.h -- a mouse click buffer // qt_click.h -- a mouse click buffer
#ifndef QT4CLICK_H #ifndef QT4CLICK_H
#define QT4CLICK_H #define QT4CLICK_H
namespace nethack_qt4 { namespace nethack_qt_ {
class NetHackQtClickBuffer { class NetHackQtClickBuffer {
public: public:
@@ -32,6 +32,6 @@ private:
int in,out; int in,out;
}; };
} // namespace nethack_qt4 } // namespace nethack_qt_
#endif #endif
+5 -6
View File
@@ -1,10 +1,9 @@
/* NetHack 3.6 qt_clust.cpp $NHDT-Date: 1524684507 2018/04/25 19:28:27 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.8 $ */ /* SCCS Id: @(#)qt_clust.cpp 3.4 1999/11/19 */
/* Copyright (c) Warwick Allison, 1999. */ /* Copyright (c) Warwick Allison, 1999. */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
#include "qt_clust.h" #include "qt_clust.h"
static static void include(QRect& r, const QRect& rect)
void include(QRect& r, const QRect& rect)
{ {
if (rect.left()<r.left()) { if (rect.left()<r.left()) {
r.setLeft(rect.left()); r.setLeft(rect.left());
@@ -75,7 +74,7 @@ void Clusterizer::add(const QRect& rect)
- cluster[cursor].width()*cluster[cursor].height(); - cluster[cursor].width()*cluster[cursor].height();
if (cost < lowestcost) { if (cost < lowestcost) {
bool bad=FALSE; bool bad=false;
for (int c=0; c<count && !bad; c++) { for (int c=0; c<count && !bad; c++) {
bad=cluster[c].intersects(larger) && c!=cursor; bad=cluster[c].intersects(larger) && c!=cursor;
} }
@@ -108,7 +107,7 @@ void Clusterizer::add(const QRect& rect)
int cost=larger.width()*larger.height() int cost=larger.width()*larger.height()
- cluster[cursor].width()*cluster[cursor].height(); - cluster[cursor].width()*cluster[cursor].height();
if (cost < lowestcost) { if (cost < lowestcost) {
bool bad=FALSE; bool bad=false;
for (int c=0; c<count && !bad; c++) { for (int c=0; c<count && !bad; c++) {
bad=cluster[c].intersects(larger) && c!=cursor; bad=cluster[c].intersects(larger) && c!=cursor;
} }
@@ -134,7 +133,7 @@ void Clusterizer::add(const QRect& rect)
- cluster[merge1].width()*cluster[merge1].height() - cluster[merge1].width()*cluster[merge1].height()
- cluster[merge2].width()*cluster[merge2].height(); - cluster[merge2].width()*cluster[merge2].height();
if (cost < lowestcost) { if (cost < lowestcost) {
bool bad=FALSE; bool bad=false;
for (int c=0; c<count && !bad; c++) { for (int c=0; c<count && !bad; c++) {
bad=cluster[c].intersects(larger) && c!=cursor; bad=cluster[c].intersects(larger) && c!=cursor;
} }
+4 -4
View File
@@ -2,7 +2,7 @@
// Qt4 conversion copyright (c) Ray Chason, 2012-2014. // Qt4 conversion copyright (c) Ray Chason, 2012-2014.
// NetHack may be freely redistributed. See license for details. // NetHack may be freely redistributed. See license for details.
// qt4delay.cpp -- implement a delay // qt_delay.cpp -- implement a delay
#include "hack.h" #include "hack.h"
#undef Invisible #undef Invisible
@@ -16,9 +16,9 @@
#undef max #undef max
#include <QtGui/QtGui> #include <QtGui/QtGui>
#include "qt4delay.h" #include "qt_delay.h"
namespace nethack_qt4 { namespace nethack_qt_ {
// RLC Can we use QTimer::single_shot for this? // RLC Can we use QTimer::single_shot for this?
NetHackQtDelay::NetHackQtDelay(int ms) : NetHackQtDelay::NetHackQtDelay(int ms) :
@@ -39,4 +39,4 @@ void NetHackQtDelay::timerEvent(QTimerEvent* timer)
m_timer = 0; m_timer = 0;
} }
} // namespace nethack_qt4 } // namespace nethack_qt_
+3 -3
View File
@@ -2,12 +2,12 @@
// Qt4 conversion copyright (c) Ray Chason, 2012-2014. // Qt4 conversion copyright (c) Ray Chason, 2012-2014.
// NetHack may be freely redistributed. See license for details. // NetHack may be freely redistributed. See license for details.
// qt4delay.h -- implement a delay // qt_delay.h -- implement a delay
#ifndef QT4DELAY_H #ifndef QT4DELAY_H
#define QT4DELAY_H #define QT4DELAY_H
namespace nethack_qt4 { namespace nethack_qt_ {
class NetHackQtDelay : QObject { class NetHackQtDelay : QObject {
private: private:
@@ -21,6 +21,6 @@ public:
virtual void timerEvent(QTimerEvent* timer); virtual void timerEvent(QTimerEvent* timer);
}; };
} // namespace nethack_qt4 } // namespace nethack_qt_
#endif #endif
+6 -6
View File
@@ -2,7 +2,7 @@
// Qt4 conversion copyright (c) Ray Chason, 2012-2014. // Qt4 conversion copyright (c) Ray Chason, 2012-2014.
// NetHack may be freely redistributed. See license for details. // NetHack may be freely redistributed. See license for details.
// qt4glyph.cpp -- class to manage the glyphs in a tile set // qt_glyph.cpp -- class to manage the glyphs in a tile set
extern "C" { extern "C" {
#include "hack.h" #include "hack.h"
@@ -22,13 +22,13 @@ extern "C" {
#if QT_VERSION >= 0x050000 #if QT_VERSION >= 0x050000
#include <QtWidgets/QtWidgets> #include <QtWidgets/QtWidgets>
#endif #endif
#include "qt4glyph.h" #include "qt_glyph.h"
#include "qt4set.h" #include "qt_set.h"
#include "qt4str.h" #include "qt_str.h"
extern short glyph2tile[]; // from tile.c extern short glyph2tile[]; // from tile.c
namespace nethack_qt4 { namespace nethack_qt_ {
static int tilefile_tile_W=16; static int tilefile_tile_W=16;
static int tilefile_tile_H=16; static int tilefile_tile_H=16;
@@ -138,4 +138,4 @@ void NetHackQtGlyphs::setSize(int w, int h)
(was1 ? pm2 : pm1) = pm; (was1 ? pm2 : pm1) = pm;
} }
} // namespace nethack_qt4 } // namespace nethack_qt_
+3 -3
View File
@@ -2,12 +2,12 @@
// Qt4 conversion copyright (c) Ray Chason, 2012-2014. // Qt4 conversion copyright (c) Ray Chason, 2012-2014.
// NetHack may be freely redistributed. See license for details. // NetHack may be freely redistributed. See license for details.
// qt4glyph.h -- class to manage the glyphs in a tile set // qt_glyph.h -- class to manage the glyphs in a tile set
#ifndef QT4GLYPH_H #ifndef QT4GLYPH_H
#define QT4GLYPH_H #define QT4GLYPH_H
namespace nethack_qt4 { namespace nethack_qt_ {
class NetHackQtGlyphs { class NetHackQtGlyphs {
public: public:
@@ -29,6 +29,6 @@ private:
int tiles_per_row; int tiles_per_row;
}; };
} // namespace nethack_qt4 } // namespace nethack_qt_
#endif #endif
+4 -4
View File
@@ -2,7 +2,7 @@
// Qt4 conversion copyright (c) Ray Chason, 2012-2014. // Qt4 conversion copyright (c) Ray Chason, 2012-2014.
// NetHack may be freely redistributed. See license for details. // NetHack may be freely redistributed. See license for details.
// qt4icon.cpp -- a labelled icon // qt_icon.cpp -- a labelled icon
#include "hack.h" #include "hack.h"
#undef Invisible #undef Invisible
@@ -19,9 +19,9 @@
#if QT_VERSION >= 0x050000 #if QT_VERSION >= 0x050000
#include <QtWidgets/QtWidgets> #include <QtWidgets/QtWidgets>
#endif #endif
#include "qt4icon.h" #include "qt_icon.h"
namespace nethack_qt4 { namespace nethack_qt_ {
NetHackQtLabelledIcon::NetHackQtLabelledIcon(QWidget* parent, const char* l) : NetHackQtLabelledIcon::NetHackQtLabelledIcon(QWidget* parent, const char* l) :
QWidget(parent), QWidget(parent),
@@ -200,4 +200,4 @@ void NetHackQtLabelledIcon::setAlignments()
if (icon) icon->setAlignment(Qt::AlignHCenter|Qt::AlignVCenter); if (icon) icon->setAlignment(Qt::AlignHCenter|Qt::AlignVCenter);
} }
} // namespace nethack_qt4 } // namespace nethack_qt_
+3 -3
View File
@@ -2,12 +2,12 @@
// Qt4 conversion copyright (c) Ray Chason, 2012-2014. // Qt4 conversion copyright (c) Ray Chason, 2012-2014.
// NetHack may be freely redistributed. See license for details. // NetHack may be freely redistributed. See license for details.
// qt4icon.cpp -- a labelled icon // qt_icon.cpp -- a labelled icon
#ifndef QT4ICON_H #ifndef QT4ICON_H
#define QT4ICON_H #define QT4ICON_H
namespace nethack_qt4 { namespace nethack_qt_ {
class NetHackQtLabelledIcon : public QWidget { class NetHackQtLabelledIcon : public QWidget {
public: public:
@@ -48,6 +48,6 @@ private:
QLabel* icon; QLabel* icon;
}; };
} // namespace nethack_qt4 } // namespace nethack_qt_
#endif #endif
+6 -6
View File
@@ -2,7 +2,7 @@
// Qt4 conversion copyright (c) Ray Chason, 2012-2014. // Qt4 conversion copyright (c) Ray Chason, 2012-2014.
// NetHack may be freely redistributed. See license for details. // NetHack may be freely redistributed. See license for details.
// qt4inv.cpp -- inventory usage window // qt_inv.cpp -- inventory usage window
// This is at the top center of the main window // This is at the top center of the main window
extern "C" { extern "C" {
@@ -22,11 +22,11 @@ extern "C" {
#if QT_VERSION >= 0x050000 #if QT_VERSION >= 0x050000
#include <QtWidgets/QtWidgets> #include <QtWidgets/QtWidgets>
#endif #endif
#include "qt4inv.h" #include "qt_inv.h"
#include "qt4glyph.h" #include "qt_glyph.h"
#include "qt4set.h" #include "qt_set.h"
namespace nethack_qt4 { namespace nethack_qt_ {
NetHackQtInvUsageWindow::NetHackQtInvUsageWindow(QWidget* parent) : NetHackQtInvUsageWindow::NetHackQtInvUsageWindow(QWidget* parent) :
QWidget(parent) QWidget(parent)
@@ -96,4 +96,4 @@ QSize NetHackQtInvUsageWindow::sizeHint(void) const
} }
} }
} // namespace nethack_qt4 } // namespace nethack_qt_
+3 -3
View File
@@ -2,13 +2,13 @@
// Qt4 conversion copyright (c) Ray Chason, 2012-2014. // Qt4 conversion copyright (c) Ray Chason, 2012-2014.
// NetHack may be freely redistributed. See license for details. // NetHack may be freely redistributed. See license for details.
// qt4inv.h -- inventory usage window // qt_inv.h -- inventory usage window
// This is at the top center of the main window // This is at the top center of the main window
#ifndef QT4INV_H #ifndef QT4INV_H
#define QT4INV_H #define QT4INV_H
namespace nethack_qt4 { namespace nethack_qt_ {
class NetHackQtInvUsageWindow : public QWidget { class NetHackQtInvUsageWindow : public QWidget {
public: public:
@@ -20,6 +20,6 @@ private:
void drawWorn(QPainter& painter, obj*, int x, int y, bool canbe=true); void drawWorn(QPainter& painter, obj*, int x, int y, bool canbe=true);
}; };
} // namespace nethack_qt4 } // namespace nethack_qt_
#endif #endif
+1 -1
View File
@@ -4,7 +4,7 @@
#ifndef QT_DUMMYKDE #ifndef QT_DUMMYKDE
#define QT_DUMMYKDE #define QT_DUMMYKDE
namespace nethack_qt4 { namespace nethack_qt_ {
class KTopLevelWidget : public QMainWindow { class KTopLevelWidget : public QMainWindow {
Q_OBJECT Q_OBJECT
+4 -4
View File
@@ -2,7 +2,7 @@
// Qt4 conversion copyright (c) Ray Chason, 2012-2014. // Qt4 conversion copyright (c) Ray Chason, 2012-2014.
// NetHack may be freely redistributed. See license for details. // NetHack may be freely redistributed. See license for details.
// qt4key.cpp -- a key buffer // qt_key.cpp -- a key buffer
#include "hack.h" #include "hack.h"
#undef Invisible #undef Invisible
@@ -16,9 +16,9 @@
#undef max #undef max
#include <QtGui/QtGui> #include <QtGui/QtGui>
#include "qt4key.h" #include "qt_key.h"
namespace nethack_qt4 { namespace nethack_qt_ {
NetHackQtKeyBuffer::NetHackQtKeyBuffer() : NetHackQtKeyBuffer::NetHackQtKeyBuffer() :
in(0), out(0) in(0), out(0)
@@ -88,4 +88,4 @@ Qt::KeyboardModifiers NetHackQtKeyBuffer::TopState() const
return state[out]; return state[out];
} }
} // namespace nethack_qt4 } // namespace nethack_qt_
+3 -3
View File
@@ -2,12 +2,12 @@
// Qt4 conversion copyright (c) Ray Chason, 2012-2014. // Qt4 conversion copyright (c) Ray Chason, 2012-2014.
// NetHack may be freely redistributed. See license for details. // NetHack may be freely redistributed. See license for details.
// qt4key.h -- a key buffer // qt_key.h -- a key buffer
#ifndef QT4KEY_H #ifndef QT4KEY_H
#define QT4KEY_H #define QT4KEY_H
namespace nethack_qt4 { namespace nethack_qt_ {
class NetHackQtKeyBuffer { class NetHackQtKeyBuffer {
public: public:
@@ -35,6 +35,6 @@ private:
int in,out; int in,out;
}; };
} // namespace nethack_qt4 } // namespace nethack_qt_
#endif #endif
+4 -4
View File
@@ -2,7 +2,7 @@
// Qt4 conversion copyright (c) Ray Chason, 2012-2014. // Qt4 conversion copyright (c) Ray Chason, 2012-2014.
// NetHack may be freely redistributed. See license for details. // NetHack may be freely redistributed. See license for details.
// qt4line.cpp -- a one line input window // qt_line.cpp -- a one line input window
#include "hack.h" #include "hack.h"
#undef Invisible #undef Invisible
@@ -19,9 +19,9 @@
#if QT_VERSION >= 0x050000 #if QT_VERSION >= 0x050000
#include <QtWidgets/QtWidgets> #include <QtWidgets/QtWidgets>
#endif #endif
#include "qt4line.h" #include "qt_line.h"
namespace nethack_qt4 { namespace nethack_qt_ {
NetHackQtLineEdit::NetHackQtLineEdit() : NetHackQtLineEdit::NetHackQtLineEdit() :
QLineEdit(0) QLineEdit(0)
@@ -39,4 +39,4 @@ void NetHackQtLineEdit::fakeEvent(int key, int ascii, Qt::KeyboardModifiers stat
keyPressEvent(&fake); keyPressEvent(&fake);
} }
} // namespace nethack_qt4 } // namespace nethack_qt_
+3 -3
View File
@@ -2,12 +2,12 @@
// Qt4 conversion copyright (c) Ray Chason, 2012-2014. // Qt4 conversion copyright (c) Ray Chason, 2012-2014.
// NetHack may be freely redistributed. See license for details. // NetHack may be freely redistributed. See license for details.
// qt4line.h -- a one line input window // qt_line.h -- a one line input window
#ifndef QT4LINE_H #ifndef QT4LINE_H
#define QT4LINE_H #define QT4LINE_H
namespace nethack_qt4 { namespace nethack_qt_ {
class NetHackQtLineEdit : public QLineEdit { class NetHackQtLineEdit : public QLineEdit {
public: public:
@@ -17,6 +17,6 @@ public:
void fakeEvent(int key, int ascii, Qt::KeyboardModifiers state); void fakeEvent(int key, int ascii, Qt::KeyboardModifiers state);
}; };
} // namespace nethack_qt4 } // namespace nethack_qt_
#endif #endif
+15 -15
View File
@@ -2,7 +2,7 @@
// Qt4 conversion copyright (c) Ray Chason, 2012-2014. // Qt4 conversion copyright (c) Ray Chason, 2012-2014.
// NetHack may be freely redistributed. See license for details. // NetHack may be freely redistributed. See license for details.
// qt4main.cpp -- the main window // qt_main.cpp -- the main window
extern "C" { extern "C" {
#include "hack.h" #include "hack.h"
@@ -22,20 +22,20 @@ extern "C" {
#if QT_VERSION >= 0x050000 #if QT_VERSION >= 0x050000
#include <QtWidgets/QtWidgets> #include <QtWidgets/QtWidgets>
#endif #endif
#include "qt4main.h" #include "qt_main.h"
#include "qt4main.moc" #include "qt_main.moc"
#include "qt4bind.h" #include "qt_bind.h"
#include "qt4glyph.h" #include "qt_glyph.h"
#include "qt4inv.h" #include "qt_inv.h"
#include "qt4key.h" #include "qt_key.h"
#include "qt4map.h" #include "qt_map.h"
#include "qt4msg.h" #include "qt_msg.h"
#include "qt4set.h" #include "qt_set.h"
#include "qt4stat.h" #include "qt_stat.h"
#include "qt4str.h" #include "qt_str.h"
#ifndef KDE #ifndef KDE
#include "qt4kde0.moc" #include "qt_kde0.moc"
#endif #endif
// temporary // temporary
@@ -44,7 +44,7 @@ extern char *qt_tileheight;
extern int qt_compact_mode; extern int qt_compact_mode;
// end temporary // end temporary
namespace nethack_qt4 { namespace nethack_qt_ {
// temporary // temporary
void centerOnMain( QWidget* w ); void centerOnMain( QWidget* w );
@@ -1073,4 +1073,4 @@ void NetHackQtMainWindow::ShowIfReady()
} }
} }
} // namespace nethack_qt4 } // namespace nethack_qt_
+4 -4
View File
@@ -2,7 +2,7 @@
// Qt4 conversion copyright (c) Ray Chason, 2012-2014. // Qt4 conversion copyright (c) Ray Chason, 2012-2014.
// NetHack may be freely redistributed. See license for details. // NetHack may be freely redistributed. See license for details.
// qt4main.h -- the main window // qt_main.h -- the main window
#ifndef QT4MAIN_H #ifndef QT4MAIN_H
#define QT4MAIN_H #define QT4MAIN_H
@@ -11,10 +11,10 @@
#include <kapp.h> #include <kapp.h>
#include <ktopwidget.h> #include <ktopwidget.h>
#else #else
#include "qt4kde0.h" #include "qt_kde0.h"
#endif #endif
namespace nethack_qt4 { namespace nethack_qt_ {
class NetHackQtInvUsageWindow; class NetHackQtInvUsageWindow;
class NetHackQtKeyBuffer; class NetHackQtKeyBuffer;
@@ -90,6 +90,6 @@ private:
int dirkey; int dirkey;
}; };
} // namespace nethack_qt4 } // namespace nethack_qt_
#endif #endif
+9 -9
View File
@@ -2,7 +2,7 @@
// Qt4 conversion copyright (c) Ray Chason, 2012-2014. // Qt4 conversion copyright (c) Ray Chason, 2012-2014.
// NetHack may be freely redistributed. See license for details. // NetHack may be freely redistributed. See license for details.
// qt4map.cpp -- the map window // qt_map.cpp -- the map window
extern "C" { extern "C" {
#include "hack.h" #include "hack.h"
@@ -21,19 +21,19 @@ extern "C" {
#if QT_VERSION >= 0x050000 #if QT_VERSION >= 0x050000
#include <QtWidgets/QtWidgets> #include <QtWidgets/QtWidgets>
#endif #endif
#include "qt4map.h" #include "qt_map.h"
#include "qt4map.moc" #include "qt_map.moc"
#include "qt4click.h" #include "qt_click.h"
#include "qt4glyph.h" #include "qt_glyph.h"
#include "qt_xpms.h" #include "qt_xpms.h"
#include "qt4set.h" #include "qt_set.h"
#include "qt4str.h" #include "qt_str.h"
// temporary // temporary
extern int qt_compact_mode; extern int qt_compact_mode;
// end temporary // end temporary
namespace nethack_qt4 { namespace nethack_qt_ {
#ifdef TEXTCOLOR #ifdef TEXTCOLOR
static const QPen& nhcolor_to_pen(int c) static const QPen& nhcolor_to_pen(int c)
@@ -971,4 +971,4 @@ void NetHackQtMapWindow::Changed(int x, int y)
} }
#endif #endif
} // namespace nethack_qt4 } // namespace nethack_qt_
+5 -5
View File
@@ -2,15 +2,15 @@
// Qt4 conversion copyright (c) Ray Chason, 2012-2014. // Qt4 conversion copyright (c) Ray Chason, 2012-2014.
// NetHack may be freely redistributed. See license for details. // NetHack may be freely redistributed. See license for details.
// qt4map.h -- the map window // qt_map.h -- the map window
#ifndef QT4MAP_H #ifndef QT4MAP_H
#define QT4MAP_H #define QT4MAP_H
#include "qt4win.h" #include "qt_win.h"
#include "qt4clust.h" #include "qt_clust.h"
namespace nethack_qt4 { namespace nethack_qt_ {
class NetHackQtClickBuffer; class NetHackQtClickBuffer;
@@ -77,6 +77,6 @@ private:
QString messages; QString messages;
}; };
} // namespace nethack_qt4 } // namespace nethack_qt_
#endif #endif
+9 -9
View File
@@ -2,7 +2,7 @@
// Qt4 conversion copyright (c) Ray Chason, 2012-2014. // Qt4 conversion copyright (c) Ray Chason, 2012-2014.
// NetHack may be freely redistributed. See license for details. // NetHack may be freely redistributed. See license for details.
// qt4menu.cpp -- a menu or text-list widget // qt_menu.cpp -- a menu or text-list widget
extern "C" { extern "C" {
#include "hack.h" #include "hack.h"
@@ -21,12 +21,12 @@ extern "C" {
#if QT_VERSION >= 0x050000 #if QT_VERSION >= 0x050000
#include <QtWidgets/QtWidgets> #include <QtWidgets/QtWidgets>
#endif #endif
#include "qt4menu.h" #include "qt_menu.h"
#include "qt4menu.moc" #include "qt_menu.moc"
#include "qt4glyph.h" #include "qt_glyph.h"
#include "qt4set.h" #include "qt_set.h"
#include "qt4streq.h" #include "qt_streq.h"
#include "qt4str.h" #include "qt_str.h"
// temporary // temporary
extern "C" int qt_compact_mode; extern "C" int qt_compact_mode;
@@ -34,7 +34,7 @@ extern "C" int qt_compact_mode;
extern "C" struct menucoloring *menu_colorings; extern "C" struct menucoloring *menu_colorings;
namespace nethack_qt4 { namespace nethack_qt_ {
// temporary // temporary
void centerOnMain( QWidget* w ); void centerOnMain( QWidget* w );
@@ -827,4 +827,4 @@ int NetHackQtMenuOrTextWindow::SelectMenu(int how, MENU_ITEM_P **menu_list)
return actual->SelectMenu(how,menu_list); return actual->SelectMenu(how,menu_list);
} }
} // namespace nethack_qt4 } // namespace nethack_qt_
+5 -5
View File
@@ -2,15 +2,15 @@
// Qt4 conversion copyright (c) Ray Chason, 2012-2014. // Qt4 conversion copyright (c) Ray Chason, 2012-2014.
// NetHack may be freely redistributed. See license for details. // NetHack may be freely redistributed. See license for details.
// qt4menu.cpp -- a menu or text-list widget // qt_menu.cpp -- a menu or text-list widget
#ifndef QT4MENU_H #ifndef QT4MENU_H
#define QT4MENU_H #define QT4MENU_H
#include "qt4win.h" #include "qt_win.h"
#include "qt4rip.h" #include "qt_rip.h"
namespace nethack_qt4 { namespace nethack_qt_ {
class NetHackQtTextListBox : public QListWidget { class NetHackQtTextListBox : public QListWidget {
public: public:
@@ -178,6 +178,6 @@ public:
}; };
} // namespace nethack_qt4 } // namespace nethack_qt_
#endif #endif
+8 -8
View File
@@ -2,7 +2,7 @@
// Qt4 conversion copyright (c) Ray Chason, 2012-2014. // Qt4 conversion copyright (c) Ray Chason, 2012-2014.
// NetHack may be freely redistributed. See license for details. // NetHack may be freely redistributed. See license for details.
// qt4msg.cpp -- a message window // qt_msg.cpp -- a message window
extern "C" { extern "C" {
#include "hack.h" #include "hack.h"
@@ -21,13 +21,13 @@ extern "C" {
#if QT_VERSION >= 0x050000 #if QT_VERSION >= 0x050000
#include <QtWidgets/QtWidgets> #include <QtWidgets/QtWidgets>
#endif #endif
#include "qt4msg.h" #include "qt_msg.h"
#include "qt4msg.moc" #include "qt_msg.moc"
#include "qt4map.h" #include "qt_map.h"
#include "qt4set.h" #include "qt_set.h"
#include "qt4str.h" #include "qt_str.h"
namespace nethack_qt4 { namespace nethack_qt_ {
NetHackQtMessageWindow::NetHackQtMessageWindow() : NetHackQtMessageWindow::NetHackQtMessageWindow() :
list(new QListWidget()) list(new QListWidget())
@@ -152,4 +152,4 @@ void NetHackQtMessageWindow::PutStr(int attr, const QString& text)
map->putMessage(attr, text2); map->putMessage(attr, text2);
} }
} // namespace nethack_qt4 } // namespace nethack_qt_
+4 -4
View File
@@ -2,14 +2,14 @@
// Qt4 conversion copyright (c) Ray Chason, 2012-2014. // Qt4 conversion copyright (c) Ray Chason, 2012-2014.
// NetHack may be freely redistributed. See license for details. // NetHack may be freely redistributed. See license for details.
// qt4msg.h -- a message window // qt_msg.h -- a message window
#ifndef QT4MSG_H #ifndef QT4MSG_H
#define QT4MSG_H #define QT4MSG_H
#include "qt4win.h" #include "qt_win.h"
namespace nethack_qt4 { namespace nethack_qt_ {
class NetHackQtMapWindow2; class NetHackQtMapWindow2;
@@ -40,6 +40,6 @@ private slots:
void updateFont(); void updateFont();
}; };
} // namespace nethack_qt4 } // namespace nethack_qt_
#endif #endif
+9 -9
View File
@@ -2,7 +2,7 @@
// Qt4 conversion copyright (c) Ray Chason, 2012-2014. // Qt4 conversion copyright (c) Ray Chason, 2012-2014.
// NetHack may be freely redistributed. See license for details. // NetHack may be freely redistributed. See license for details.
// qt4plsel.cpp -- player selector dialog // qt_plsel.cpp -- player selector dialog
extern "C" { extern "C" {
#include "hack.h" #include "hack.h"
@@ -21,17 +21,17 @@ extern "C" {
#if QT_VERSION >= 0x050000 #if QT_VERSION >= 0x050000
#include <QtWidgets/QtWidgets> #include <QtWidgets/QtWidgets>
#endif #endif
#include "qt4plsel.h" #include "qt_plsel.h"
#include "qt4plsel.moc" #include "qt_plsel.moc"
#include "qt4bind.h" #include "qt_bind.h"
#include "qt4glyph.h" #include "qt_glyph.h"
#include "qt4set.h" #include "qt_set.h"
#include "qt4str.h" #include "qt_str.h"
// Warwick prefers it this way... // Warwick prefers it this way...
#define QT_CHOOSE_RACE_FIRST #define QT_CHOOSE_RACE_FIRST
namespace nethack_qt4 { namespace nethack_qt_ {
// temporary // temporary
void centerOnMain( QWidget* w ); void centerOnMain( QWidget* w );
@@ -533,4 +533,4 @@ bool NetHackQtPlayerSelector::Choose()
} }
} }
} // namespace nethack_qt4 } // namespace nethack_qt_
+3 -3
View File
@@ -2,12 +2,12 @@
// Qt4 conversion copyright (c) Ray Chason, 2012-2014. // Qt4 conversion copyright (c) Ray Chason, 2012-2014.
// NetHack may be freely redistributed. See license for details. // NetHack may be freely redistributed. See license for details.
// qt4plsel.h -- player selector dialog // qt_plsel.h -- player selector dialog
#ifndef QT4PLSEL_H #ifndef QT4PLSEL_H
#define QT4PLSEL_H #define QT4PLSEL_H
namespace nethack_qt4 { namespace nethack_qt_ {
class NetHackQtKeyBuffer; class NetHackQtKeyBuffer;
@@ -43,6 +43,6 @@ private:
int chosen_align; int chosen_align;
}; };
} // namespace nethack_qt4 } // namespace nethack_qt_
#endif #endif
+6 -6
View File
@@ -2,7 +2,7 @@
// Qt4 conversion copyright (c) Ray Chason, 2012-2014. // Qt4 conversion copyright (c) Ray Chason, 2012-2014.
// NetHack may be freely redistributed. See license for details. // NetHack may be freely redistributed. See license for details.
// qt4rip.cpp -- tombstone window // qt_rip.cpp -- tombstone window
#include "hack.h" #include "hack.h"
#undef Invisible #undef Invisible
@@ -19,11 +19,11 @@
#if QT_VERSION >= 0x050000 #if QT_VERSION >= 0x050000
#include <QtWidgets/QtWidgets> #include <QtWidgets/QtWidgets>
#endif #endif
#include "qt4rip.h" #include "qt_rip.h"
#include "qt4bind.h" #include "qt_bind.h"
#include "qt4str.h" #include "qt_str.h"
namespace nethack_qt4 { namespace nethack_qt_ {
QPixmap* NetHackQtRIP::pixmap=0; QPixmap* NetHackQtRIP::pixmap=0;
@@ -91,4 +91,4 @@ void NetHackQtRIP::paintEvent(QPaintEvent* event)
} }
} }
} // namespace nethack_qt4 } // namespace nethack_qt_
+3 -3
View File
@@ -2,12 +2,12 @@
// Qt4 conversion copyright (c) Ray Chason, 2012-2014. // Qt4 conversion copyright (c) Ray Chason, 2012-2014.
// NetHack may be freely redistributed. See license for details. // NetHack may be freely redistributed. See license for details.
// qt4rip.h -- tombstone window // qt_rip.h -- tombstone window
#ifndef QT4RIP_H #ifndef QT4RIP_H
#define QT4RIP_H #define QT4RIP_H
namespace nethack_qt4 { namespace nethack_qt_ {
class NetHackQtRIP : public QWidget { class NetHackQtRIP : public QWidget {
private: private:
@@ -25,6 +25,6 @@ protected:
QSize sizeHint() const; QSize sizeHint() const;
}; };
} // namespace nethack_qt4 } // namespace nethack_qt_
#endif #endif
+7 -7
View File
@@ -2,7 +2,7 @@
// Qt4 conversion copyright (c) Ray Chason, 2012-2014. // Qt4 conversion copyright (c) Ray Chason, 2012-2014.
// NetHack may be freely redistributed. See license for details. // NetHack may be freely redistributed. See license for details.
// qt4set.cpp -- the Qt settings // qt_set.cpp -- the Qt settings
#include "hack.h" #include "hack.h"
#undef Invisible #undef Invisible
@@ -19,10 +19,10 @@
#if QT_VERSION >= 0x050000 #if QT_VERSION >= 0x050000
#include <QtWidgets/QtWidgets> #include <QtWidgets/QtWidgets>
#endif #endif
#include "qt4set.h" #include "qt_set.h"
#include "qt4set.moc" #include "qt_set.moc"
#include "qt4glyph.h" #include "qt_glyph.h"
#include "qt4str.h" #include "qt_str.h"
/* Used by tile/font-size patch below and in ../../src/files.c */ /* Used by tile/font-size patch below and in ../../src/files.c */
char *qt_tilewidth=NULL; char *qt_tilewidth=NULL;
@@ -34,7 +34,7 @@ int qt_compact_mode = 1;
int qt_compact_mode = 0; int qt_compact_mode = 0;
#endif #endif
namespace nethack_qt4 { namespace nethack_qt_ {
#define TILEWMIN 6 #define TILEWMIN 6
#define TILEHMIN 6 #define TILEHMIN 6
@@ -192,4 +192,4 @@ bool NetHackQtSettings::ynInMessages()
NetHackQtSettings* qt_settings; NetHackQtSettings* qt_settings;
} // namespace nethack_qt4 } // namespace nethack_qt_
+3 -3
View File
@@ -2,12 +2,12 @@
// Qt4 conversion copyright (c) Ray Chason, 2012-2014. // Qt4 conversion copyright (c) Ray Chason, 2012-2014.
// NetHack may be freely redistributed. See license for details. // NetHack may be freely redistributed. See license for details.
// qt4set.h -- the Qt settings // qt_set.h -- the Qt settings
#ifndef QT4SET_H #ifndef QT4SET_H
#define QT4SET_H #define QT4SET_H
namespace nethack_qt4 { namespace nethack_qt_ {
class NetHackQtGlyphs; class NetHackQtGlyphs;
@@ -54,6 +54,6 @@ private slots:
extern NetHackQtSettings* qt_settings; extern NetHackQtSettings* qt_settings;
} // namespace nethack_qt4 } // namespace nethack_qt_
#endif #endif
+7 -7
View File
@@ -2,7 +2,7 @@
// Qt4 conversion copyright (c) Ray Chason, 2012-2014. // Qt4 conversion copyright (c) Ray Chason, 2012-2014.
// NetHack may be freely redistributed. See license for details. // NetHack may be freely redistributed. See license for details.
// qt4stat.cpp -- bindings between the Qt 4 interface and the main code // qt_stat.cpp -- bindings between the Qt 4 interface and the main code
extern "C" { extern "C" {
#include "hack.h" #include "hack.h"
@@ -21,16 +21,16 @@ extern "C" {
#if QT_VERSION >= 0x050000 #if QT_VERSION >= 0x050000
#include <QtWidgets/QtWidgets> #include <QtWidgets/QtWidgets>
#endif #endif
#include "qt4stat.h" #include "qt_stat.h"
#include "qt4stat.moc" #include "qt_stat.moc"
#include "qt4set.h" #include "qt_set.h"
#include "qt4str.h" #include "qt_str.h"
#include "qt_xpms.h" #include "qt_xpms.h"
extern const char *enc_stat[]; /* from botl.c */ extern const char *enc_stat[]; /* from botl.c */
extern const char *hu_stat[]; /* from eat.c */ extern const char *hu_stat[]; /* from eat.c */
namespace nethack_qt4 { namespace nethack_qt_ {
NetHackQtStatusWindow::NetHackQtStatusWindow() : NetHackQtStatusWindow::NetHackQtStatusWindow() :
// Notes: // Notes:
@@ -537,4 +537,4 @@ void NetHackQtStatusWindow::checkTurnEvents()
{ {
} }
} // namespace nethack_qt4 } // namespace nethack_qt_
+5 -5
View File
@@ -2,15 +2,15 @@
// Qt4 conversion copyright (c) Ray Chason, 2012-2014. // Qt4 conversion copyright (c) Ray Chason, 2012-2014.
// NetHack may be freely redistributed. See license for details. // NetHack may be freely redistributed. See license for details.
// qt4stat.h -- bindings between the Qt 4 interface and the main code // qt_stat.h -- bindings between the Qt 4 interface and the main code
#ifndef QT4STAT_H #ifndef QT4STAT_H
#define QT4STAT_H #define QT4STAT_H
#include "qt4win.h" #include "qt_win.h"
#include "qt4icon.h" #include "qt_icon.h"
namespace nethack_qt4 { namespace nethack_qt_ {
class NetHackQtStatusWindow : QWidget, public NetHackQtWindow { class NetHackQtStatusWindow : QWidget, public NetHackQtWindow {
Q_OBJECT Q_OBJECT
@@ -101,6 +101,6 @@ private:
void checkTurnEvents(); void checkTurnEvents();
}; };
} // namespace nethack_qt4 } // namespace nethack_qt_
#endif #endif
+4 -4
View File
@@ -2,13 +2,13 @@
// Qt4 conversion copyright (c) Ray Chason, 2012-2014. // Qt4 conversion copyright (c) Ray Chason, 2012-2014.
// NetHack may be freely redistributed. See license for details. // NetHack may be freely redistributed. See license for details.
// qt4str.cpp -- some string functions // qt_str.cpp -- some string functions
#include <QtCore/QString> #include <QtCore/QString>
#include <QtCore/QStringList> #include <QtCore/QStringList>
#include "qt4str.h" #include "qt_str.h"
namespace nethack_qt4 { namespace nethack_qt_ {
// Bounded string copy // Bounded string copy
size_t str_copy(char *dest, const char *src, size_t max) size_t str_copy(char *dest, const char *src, size_t max)
@@ -80,4 +80,4 @@ int cp437(int ch)
return cp437table[(unsigned char)ch]; return cp437table[(unsigned char)ch];
} }
} // namespace nethack_qt4 } // namespace nethack_qt_
+3 -3
View File
@@ -2,12 +2,12 @@
// Qt4 conversion copyright (c) Ray Chason, 2012-2014. // Qt4 conversion copyright (c) Ray Chason, 2012-2014.
// NetHack may be freely redistributed. See license for details. // NetHack may be freely redistributed. See license for details.
// qt4str.h -- various string functions // qt_str.h -- various string functions
#ifndef QT4STR_H #ifndef QT4STR_H
#define QT4STR_H #define QT4STR_H
namespace nethack_qt4 { namespace nethack_qt_ {
// Bounded string copy // Bounded string copy
extern size_t str_copy(char *dest, const char *src, size_t max); extern size_t str_copy(char *dest, const char *src, size_t max);
@@ -19,6 +19,6 @@ extern QString nh_capitalize_words(const QString& str);
// Map symbol conversion // Map symbol conversion
extern int cp437(int ch); extern int cp437(int ch);
} // namespace nethack_qt4 } // namespace nethack_qt_
#endif #endif
+5 -5
View File
@@ -2,7 +2,7 @@
// Qt4 conversion copyright (c) Ray Chason, 2012-2014. // Qt4 conversion copyright (c) Ray Chason, 2012-2014.
// NetHack may be freely redistributed. See license for details. // NetHack may be freely redistributed. See license for details.
// qt4streq.cpp -- string requestor // qt_streq.cpp -- string requestor
#include "hack.h" #include "hack.h"
#undef Invisible #undef Invisible
@@ -19,10 +19,10 @@
#if QT_VERSION >= 0x050000 #if QT_VERSION >= 0x050000
#include <QtWidgets/QtWidgets> #include <QtWidgets/QtWidgets>
#endif #endif
#include "qt4streq.h" #include "qt_streq.h"
#include "qt4str.h" #include "qt_str.h"
namespace nethack_qt4 { namespace nethack_qt_ {
// temporary // temporary
void centerOnMain(QWidget *); void centerOnMain(QWidget *);
@@ -99,4 +99,4 @@ bool NetHackQtStringRequestor::Get(char* buffer, int maxchar)
} }
} }
} // namespace nethack_qt4 } // namespace nethack_qt_

Some files were not shown because too many files have changed in this diff Show More