First set of changes to move globals to instance_globals.

This commit is contained in:
Bart House
2018-11-23 21:29:19 -08:00
parent 616a469f0f
commit 912886a73f
51 changed files with 680 additions and 565 deletions

View File

@@ -203,6 +203,8 @@ char *argv[];
}
#endif
objects_globals_init();
tilecount = 0;
xoffset = yoffset = 0;
initflag = 0;
@@ -360,3 +362,10 @@ pixel (*pixels)[TILE_X];
}
}
}
/* nhassert_failed is called when an nhassert's condition is false */
void nhassert_failed(const char * exp, const char * file, int line)
{
Fprintf(stderr, "NHASSERT(%s) in '%s' at line %d\n", exp, file, line);
exit(EXIT_FAILURE);
}

View File

@@ -113,7 +113,6 @@ int set, entry;
we're linked properly.
*/
monst_init();
objects_init();
(void) def_char_to_objclass(']');
condnum = tilenum = 0;

View File

@@ -648,9 +648,6 @@ boolean restoring_msghist;
{
static boolean initd = FALSE;
int idx;
#ifdef DUMPLOG
extern unsigned saved_pline_index; /* pline.c */
#endif
if (restoring_msghist && !initd) {
/* we're restoring history from the previous session, but new
@@ -662,7 +659,7 @@ boolean restoring_msghist;
initd = TRUE;
#ifdef DUMPLOG
/* this suffices; there's no need to scrub saved_pline[] pointers */
saved_pline_index = 0;
g.saved_pline_index = 0;
#endif
}

View File

@@ -3217,7 +3217,6 @@ void
tty_cliparound(x, y)
int x, y;
{
extern boolean restoring;
int oldx = clipx, oldy = clipy;
HUPSKIP();
@@ -3238,7 +3237,7 @@ int x, y;
clipy = clipymax - (LI - 3);
}
if (clipx != oldx || clipy != oldy) {
if (on_level(&u.uz0, &u.uz) && !restoring)
if (on_level(&u.uz0, &u.uz) && !g.restoring)
(void) doredraw();
}
}