The utter destruction of pMenuState

git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@3320 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
avolkov
2009-11-18 13:27:48 +00:00
parent 4a7f6c22f8
commit be294b091b
6 changed files with 11 additions and 39 deletions
-2
View File
@@ -48,8 +48,6 @@ typedef struct menu_state
void *Extra;
} MENU_STATE;
extern MENU_STATE *pMenuState;
#endif /* _MENUSTAT_H */
-2
View File
@@ -278,10 +278,8 @@ OldContext = SetContext (SpaceContext);
MenuState.flash_rect1.extent.width = 0;
UnlockMutex (GraphicsLock);
pMenuState = &MenuState;
SetMenuSounds (MENU_SOUND_ARROWS, MENU_SOUND_SELECT);
DoInput (&MenuState, FALSE);
pMenuState = 0;
LockMutex (GraphicsLock);
SetFlashRect (NULL);
-5
View File
@@ -1590,7 +1590,6 @@ DoStarMap (void)
RECT clip_r;
CONTEXT OldContext;
pMenuState = &MenuState;
memset (&MenuState, 0, sizeof (MenuState));
zoomLevel = 0;
@@ -1638,8 +1637,6 @@ DoStarMap (void)
DoInput (&MenuState, FALSE);
SetMenuSounds (MENU_SOUND_ARROWS, MENU_SOUND_SELECT);
pMenuState = 0;
LockMutex (GraphicsLock);
DrawHyperCoords (universe);
@@ -1717,10 +1714,8 @@ DoFlagshipCommands (MENU_STATE *pMS)
break;
case EQUIP_DEVICE:
{
pMenuState = pMS;
if (!Devices (pMS))
select = FALSE;
pMenuState = 0;
if (GET_GAME_STATE (PORTAL_COUNTER)) {
// A player-induced portal to QuasiSpace is
// opening.
-6
View File
@@ -390,10 +390,6 @@ Roster (void)
if (num_support_ships)
{
MENU_STATE MenuState;
MENU_STATE *pOldMenuState;
pOldMenuState = pMenuState;
pMenuState = &MenuState;
// Get the ship positions we will use and sort on X then Y
assert (sizeof (sorted_ship_pos) == sizeof (ship_pos));
@@ -409,8 +405,6 @@ Roster (void)
SetMenuSounds (MENU_SOUND_ARROWS, MENU_SOUND_SELECT);
DoInput (&MenuState, TRUE);
pMenuState = pOldMenuState;
return TRUE;
}
-2
View File
@@ -1205,10 +1205,8 @@ ScanSystem (void)
else
PrintCoarseScan3DO ();
pMenuState = &MenuState;
SetMenuSounds (MENU_SOUND_ARROWS, MENU_SOUND_SELECT);
DoInput (&MenuState, FALSE);
pMenuState = 0;
if (ScanContext)
{
+11 -22
View File
@@ -34,8 +34,6 @@
#include "libs/tasklib.h"
MENU_STATE *pMenuState;
static void CleanupAfterStarBase (void);
static void
@@ -473,8 +471,6 @@ VisitStarBase (void)
HSHIPFRAG hStarShip;
SHIP_FRAGMENT *FragPtr;
pMenuState = 0;
// Unallied Starbase conversation
SetCommIntroMode (CIM_CROSSFADE_SCREEN, 0);
InitCommunication (COMMANDER_CONVERSATION);
@@ -501,25 +497,17 @@ VisitStarBase (void)
return; // Killed by Ilwrath
// After Ilwrath battle, about-to-ally Starbase conversation
{
pMenuState = &MenuState;
SetCommIntroMode (CIM_CROSSFADE_SCREEN, 0);
InitCommunication (COMMANDER_CONVERSATION);
if (GLOBAL (CurrentActivity) & CHECK_ABORT)
return;
// XXX: InitCommunication() clears these flags, and we need them
// This marks that we are in Starbase.
SET_GAME_STATE (GLOBAL_FLAGS_AND_DATA, (BYTE)~0);
}
SetCommIntroMode (CIM_CROSSFADE_SCREEN, 0);
InitCommunication (COMMANDER_CONVERSATION);
if (GLOBAL (CurrentActivity) & CHECK_ABORT)
return;
// XXX: InitCommunication() clears these flags, and we need them
// This marks that we are in Starbase.
SET_GAME_STATE (GLOBAL_FLAGS_AND_DATA, (BYTE)~0);
}
prevMsgMode = SetStatusMessageMode (SMM_RES_UNITS);
pMenuState = &MenuState;
memset (&MenuState, 0, sizeof (MenuState));
MenuState.InputFunc = DoStarBase;
if (GET_GAME_STATE (MOONBASE_ON_SHIP)
|| GET_GAME_STATE (CHMMR_BOMB_STATE) == 2)
{ // Go immediately into a conversation with the Commander when the
@@ -538,13 +526,14 @@ VisitStarBase (void)
SET_GAME_STATE (GLOBAL_FLAGS_AND_DATA, (BYTE)~0);
}
memset (&MenuState, 0, sizeof (MenuState));
MenuState.InputFunc = DoStarBase;
OldContext = SetContext (ScreenContext);
DoInput (pMenuState, TRUE);
DoInput (&MenuState, TRUE);
SetContext (OldContext);
pMenuState = 0;
SetStatusMessageMode (prevMsgMode);
CleanupAfterStarBase ();
}