Revert "Initial check in of icontext."

This reverts commit 5bbe3cd6bb.
This commit is contained in:
nhmall
2018-11-23 22:17:18 -05:00
parent 93ebcf0071
commit 162018060a
6 changed files with 19 additions and 34 deletions
+2 -14
View File
@@ -439,20 +439,8 @@ struct early_opt {
boolean valallowed; boolean valallowed;
}; };
/* instance_context holds per game instance data that does not need to be /* encumbrance */
* persisted upon game exit. This game instance data is one of the first E int oldcap;
* things initialized during the initialization of the game engine.
* It is initialized with icontext_initial_state found in decl.c */
#define PLAYAGAIN
struct instance_context {
int oldcap; /* encumberance - pickup.c */
};
E struct instance_context icontext;
E void icontext_init();
#undef E #undef E
+5 -14
View File
@@ -215,6 +215,9 @@ NEARDATA struct monst *migrating_mons = (struct monst *) 0;
NEARDATA struct mvitals mvitals[NUMMONS]; NEARDATA struct mvitals mvitals[NUMMONS];
/* originally from pickup.c */
int oldcap = 0; /* encumbrance */
NEARDATA struct c_color_names c_color_names = { NEARDATA struct c_color_names c_color_names = {
"black", "amber", "golden", "light blue", "red", "green", "black", "amber", "golden", "light blue", "red", "green",
"silver", "blue", "purple", "white", "orange" "silver", "blue", "purple", "white", "orange"
@@ -526,6 +529,8 @@ decl_early_init()
ZERO(ubirthday); ZERO(ubirthday);
ZERO(urealtime); ZERO(urealtime);
ZERO(oldcap);
ZEROARRAY(lastseentyp); ZEROARRAY(lastseentyp);
ZEROPTR(invent); ZEROPTR(invent);
@@ -607,18 +612,4 @@ decl_early_init()
} }
#endif #endif
const struct instance_context icontext_initial_state = {
0, /* oldcap - last encumberance in pickup.c */
};
struct instance_context icontext;
void
icontext_init()
{
icontext = icontext_initial_state;
decl_early_init();
};
/*decl.c*/ /*decl.c*/
+3 -3
View File
@@ -1558,7 +1558,7 @@ encumber_msg()
{ {
int newcap = near_capacity(); int newcap = near_capacity();
if (icontext.oldcap < newcap) { if (oldcap < newcap) {
switch (newcap) { switch (newcap) {
case 1: case 1:
Your("movements are slowed slightly because of your load."); Your("movements are slowed slightly because of your load.");
@@ -1576,7 +1576,7 @@ encumber_msg()
break; break;
} }
context.botl = 1; context.botl = 1;
} else if (icontext.oldcap > newcap) { } else if (oldcap > newcap) {
switch (newcap) { switch (newcap) {
case 0: case 0:
Your("movements are now unencumbered."); Your("movements are now unencumbered.");
@@ -1595,7 +1595,7 @@ encumber_msg()
context.botl = 1; context.botl = 1;
} }
icontext.oldcap = newcap; oldcap = newcap;
return newcap; return newcap;
} }
+3 -1
View File
@@ -97,7 +97,9 @@ char *argv[];
nethack_enter(argc, argv); nethack_enter(argc, argv);
icontext_init(); #ifdef PLAYAGAIN
decl_early_init();
#endif
sys_early_init(); sys_early_init();
#if defined(WIN32) && defined(TTY_GRAPHICS) #if defined(WIN32) && defined(TTY_GRAPHICS)
+3 -1
View File
@@ -37,7 +37,9 @@ char *argv[];
{ {
boolean resuming; boolean resuming;
icontext_init(); #ifdef PLAYAGAIN
decl_early_init();
#endif
sys_early_init(); sys_early_init();
Strcpy(default_window_sys, "tty"); Strcpy(default_window_sys, "tty");
resuming = pcmain(argc, argv); resuming = pcmain(argc, argv);
+3 -1
View File
@@ -97,7 +97,9 @@ WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine,
win10_init(); win10_init();
icontext_init(); #ifdef PLAYAGAIN
decl_early_init();
#endif
sys_early_init(); sys_early_init();
/* init applicatio structure */ /* init applicatio structure */