Merge branch 'win32-x64-working'

This commit is contained in:
nhmall
2015-05-09 08:02:19 -04:00
81 changed files with 7000 additions and 1235 deletions

View File

@@ -61,10 +61,15 @@ boolean resuming;
set_wear((struct obj *)0); /* for side-effects of worn starting gear */
(void) pickup(1); /* autopickup at initial location */
} else { /* restore old game */
#ifndef WIN32
update_inventory(); /* for perm_invent */
#endif
read_engr_at(u.ux, u.uy); /* subset of pickup() */
}
#ifdef WIN32
update_inventory(); /* for perm_invent */
#endif
(void) encumber_msg(); /* in case they auto-picked up something */
if (defer_see_monsters) {
defer_see_monsters = FALSE;

View File

@@ -926,7 +926,7 @@ assign_hilite(sa,sb,sc,sd)
char *sa, *sb, *sc, *sd;
{
char *tmp, *how;
int i, dt, idx = -1;
int i = -1, dt = -1, idx = -1;
int coloridx[2] = {-1, -1};
boolean inverse[2] = {FALSE, FALSE};
boolean bold[2] = {FALSE, FALSE};

View File

@@ -3745,10 +3745,8 @@ dotravel(VOID_ARGS)
}
#ifdef PORT_DEBUG
# ifdef WIN32CON
extern void NDECL(win32con_debug_keystrokes);
extern void NDECL(win32con_handler_info);
# endif
int
wiz_port_debug()
@@ -3762,9 +3760,9 @@ wiz_port_debug()
char *menutext;
void NDECL((*fn));
} menu_selections[] = {
#ifdef WIN32CON
{"test win32 keystrokes", win32con_debug_keystrokes},
{"show keystroke handler information", win32con_handler_info},
#ifdef WIN32
{"test win32 keystrokes (tty only)", win32con_debug_keystrokes},
{"show keystroke handler information (tty only)", win32con_handler_info},
#endif
{(char *)0, (void NDECL((*)))0} /* array terminator */
};

View File

@@ -81,7 +81,7 @@ dumpit()
s_level *x;
branch *br;
if (!showdebug(__FILE__)) return;
if (!explicitdebug(__FILE__)) return;
for(i = 0; i < n_dgns; i++) {
fprintf(stderr, "\n#%d \"%s\" (%s):\n", i,

View File

@@ -1068,7 +1068,7 @@ get_saved_games()
#if defined(SELECTSAVED)
int n, j = 0;
char **result = 0;
# ifdef WIN32CON
# ifdef WIN32
{
char *foundfile;
const char *fq_save;
@@ -3256,11 +3256,16 @@ assure_syscf_file() {
#ifdef DEBUG
/* used by debugpline() to decide whether to issue a message
from a partiular source file; caller passes __FILE__ and we check
whether it is in the source file list supplied by SYSCF's DEBUGFILES */
* from a partiular source file; caller passes __FILE__ and we check
* whether it is in the source file list supplied by SYSCF's DEBUGFILES
*
* pass FALSE to override wildcard matching; useful for files
* like dungeon.c and questpgr.c, which generate a ridiculous amount of
* output if DEBUG is defined and effectively block the use of a wildcard */
boolean
showdebug(filename)
debugcore(filename, wildcards)
const char *filename;
boolean wildcards;
{
const char *debugfiles, *p;
@@ -3303,7 +3308,7 @@ const char *filename;
* attempt a wildcard match against each element, but that would be
* overkill for the intended usage.]
*/
if (pmatch(debugfiles, filename))
if (wildcards && pmatch(debugfiles, filename))
return TRUE;
/* check whether filename is an element of the list */
@@ -3316,6 +3321,7 @@ const char *filename;
}
return FALSE;
}
#endif /*DEBUG*/
/* ---------- BEGIN TRIBUTE ----------- */

View File

@@ -1130,7 +1130,7 @@ domove()
register struct monst *mtmp;
register struct rm *tmpr;
register xchar x,y;
struct trap *trap = (struct trap *)0;
struct trap *trap = NULL;
int wtcap;
boolean on_ice;
xchar chainx, chainy, ballx, bally; /* ball&chain new positions */

View File

@@ -939,6 +939,8 @@ struct obj *otmp;
{
int otyp = otmp->otyp, newload = otmp->owt;
struct permonst *mdat = mtmp->data;
short nattk = 0;
boolean glomper = FALSE;
if (notake(mdat)) return FALSE; /* can't carry anything */
@@ -951,6 +953,21 @@ struct obj *otmp;
(otyp != BELL_OF_OPENING || !is_covetous(mdat)))
return FALSE;
/* monsters without hands can't pick up multiple objects at once
* unless they have an engulfing attack
*
* ...dragons, of course, can always carry gold pieces somehow */
if (otmp->quan > 1) {
for (nattk = 0; nattk < NATTK; nattk++)
glomper = (glomper || mtmp->data->mattk[nattk].aatyp == AT_ENGL);
if ((mtmp->data->mflags1 & M1_NOHANDS) && !glomper
&& (!(mtmp->data->mlet == S_DRAGON
&& otmp->oclass == COIN_CLASS))) {
return FALSE;
}
}
/* Steeds don't pick up stuff (to avoid shop abuse) */
if (mtmp == u.usteed) return (FALSE);
if (mtmp->isshk) return(TRUE); /* no limit */

View File

@@ -207,7 +207,7 @@ static struct Bool_Opt
{"toptenwin",&iflags.toptenwin, FALSE, SET_IN_GAME},
{"travel", &flags.travelcmd, TRUE, SET_IN_GAME},
{"use_darkgray", &iflags.wc2_darkgray, TRUE, SET_IN_FILE},
#ifdef WIN32CON
#ifdef WIN32
{"use_inverse", &iflags.wc_inverse, TRUE, SET_IN_GAME}, /*WC*/
#else
{"use_inverse", &iflags.wc_inverse, FALSE, SET_IN_GAME}, /*WC*/
@@ -312,7 +312,7 @@ static struct Comp_Opt
MAXOCLASSES, SET_IN_GAME },
#ifdef CHANGE_COLOR
{ "palette",
# ifndef WIN32CON
# ifndef WIN32
"palette (00c/880/-fff is blue/yellow/reverse white)",
15 , SET_IN_GAME },
# else
@@ -373,7 +373,7 @@ static struct Comp_Opt
{ "videoshades", "gray shades to map to black/gray/white",
32, DISP_IN_GAME },
#endif
#ifdef WIN32CON
#ifdef WIN32
{"subkeyvalue", "override keystroke value", 7, SET_IN_FILE},
#endif
{ "windowcolors", "the foreground/background colors of windows", /*WC*/
@@ -1872,7 +1872,7 @@ boolean tinitial, tfrom_file;
) {
int color_number, color_incr;
# ifndef WIN32CON
# ifndef WIN32
if (duplicate) complain_about_duplicate(opts,1);
# endif
# ifdef MAC
@@ -1894,7 +1894,7 @@ boolean tinitial, tfrom_file;
# ifdef MAC
}
# endif
#ifdef WIN32CON
#ifdef WIN32
op = string_for_opt(opts, TRUE);
if (!alternative_palette(op))
badoption(opts);
@@ -1940,7 +1940,7 @@ boolean tinitial, tfrom_file;
color_number += color_incr;
}
}
# endif /* !WIN32CON */
# endif /* !WIN32 */
if (!initial) {
need_redraw = TRUE;
}
@@ -2061,7 +2061,7 @@ goodfruit:
if (duplicate) complain_about_duplicate(opts,1);
if (negated) bad_negation(fullname, FALSE);
else if ((op = string_for_opt(opts, negated))) {
#ifdef WIN32CON
#ifdef WIN32
(void)strncpy(iflags.altkeyhandler, op, MAX_ALTKEYHANDLER - 5);
load_keyboard_handler();
#endif
@@ -2619,7 +2619,7 @@ goodfruit:
/* no duplicate complaint here */
if (negated) bad_negation(fullname, FALSE);
else {
#if defined(WIN32CON)
#if defined(WIN32)
op = string_for_opt(opts, 0);
map_subkeyvalue(op);
#endif
@@ -3972,7 +3972,7 @@ char *buf;
defopt);
else if (!strcmp(optname,"align"))
Sprintf(buf, "%s", rolestring(flags.initalign, aligns, adj));
#ifdef WIN32CON
#ifdef WIN32
else if (!strcmp(optname,"altkeyhandler"))
Sprintf(buf, "%s", iflags.altkeyhandler[0] ?
iflags.altkeyhandler : "default");

View File

@@ -47,7 +47,7 @@ dump_qtlist() /* dump the character msg list to check appearance */
{
struct qtmsg *msg;
if (!showdebug(__FILE__)) return;
if (!explicitdebug(__FILE__)) return;
for (msg = qt_list.chrole; msg->msgnum > 0; msg++) {
pline("msgnum %d: delivery %c",

View File

@@ -2320,14 +2320,14 @@ create_particular()
pline1(thats_enough_tries);
} else {
if (!randmonst) {
firstchoice = which;
if (cant_revive(&which, FALSE, (struct obj *)0)) {
/* wizard mode can override handling of special monsters */
Sprintf(buf, "Creating %s instead; force %s?",
mons[which].mname, mons[firstchoice].mname);
if (yn(buf) == 'y') which = firstchoice;
}
whichpm = &mons[which];
firstchoice = which;
if (cant_revive(&which, FALSE, (struct obj *)0)) {
/* wizard mode can override handling of special monsters */
Sprintf(buf, "Creating %s instead; force %s?",
mons[which].mname, mons[firstchoice].mname);
if (yn(buf) == 'y') which = firstchoice;
}
whichpm = &mons[which];
}
for (i = 0; i <= multi; i++) {
if (monclass != MAXMCLASSES)

View File

@@ -385,6 +385,10 @@ opvar_free_x(ov)
Free(ov);
}
/* Borland doesn't know __FUNCTION__ */
#ifdef __BORLANDC__
#define __FUNCTION__ __FUNC__
#endif
#define opvar_free(ov) { if (ov) { opvar_free_x(ov); ov = NULL; } else impossible("opvar_free(), %s", __FUNCTION__); }
struct opvar *