From: <av...@us...> - 2009-11-18 13:27:58
|
Revision: 3320 http://sc2.svn.sourceforge.net/sc2/?rev=3320&view=rev Author: avolkov Date: 2009-11-18 13:27:48 +0000 (Wed, 18 Nov 2009) Log Message: ----------- The utter destruction of pMenuState Modified Paths: -------------- trunk/sc2/src/uqm/menustat.h trunk/sc2/src/uqm/pickship.c trunk/sc2/src/uqm/planets/pstarmap.c trunk/sc2/src/uqm/planets/roster.c trunk/sc2/src/uqm/planets/scan.c trunk/sc2/src/uqm/starbase.c Modified: trunk/sc2/src/uqm/menustat.h =================================================================== --- trunk/sc2/src/uqm/menustat.h 2009-11-18 12:55:10 UTC (rev 3319) +++ trunk/sc2/src/uqm/menustat.h 2009-11-18 13:27:48 UTC (rev 3320) @@ -48,8 +48,6 @@ void *Extra; } MENU_STATE; -extern MENU_STATE *pMenuState; - #endif /* _MENUSTAT_H */ Modified: trunk/sc2/src/uqm/pickship.c =================================================================== --- trunk/sc2/src/uqm/pickship.c 2009-11-18 12:55:10 UTC (rev 3319) +++ trunk/sc2/src/uqm/pickship.c 2009-11-18 13:27:48 UTC (rev 3320) @@ -278,10 +278,8 @@ 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); Modified: trunk/sc2/src/uqm/planets/pstarmap.c =================================================================== --- trunk/sc2/src/uqm/planets/pstarmap.c 2009-11-18 12:55:10 UTC (rev 3319) +++ trunk/sc2/src/uqm/planets/pstarmap.c 2009-11-18 13:27:48 UTC (rev 3320) @@ -1590,7 +1590,6 @@ RECT clip_r; CONTEXT OldContext; - pMenuState = &MenuState; memset (&MenuState, 0, sizeof (MenuState)); zoomLevel = 0; @@ -1638,8 +1637,6 @@ DoInput (&MenuState, FALSE); SetMenuSounds (MENU_SOUND_ARROWS, MENU_SOUND_SELECT); - pMenuState = 0; - LockMutex (GraphicsLock); DrawHyperCoords (universe); @@ -1717,10 +1714,8 @@ 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. Modified: trunk/sc2/src/uqm/planets/roster.c =================================================================== --- trunk/sc2/src/uqm/planets/roster.c 2009-11-18 12:55:10 UTC (rev 3319) +++ trunk/sc2/src/uqm/planets/roster.c 2009-11-18 13:27:48 UTC (rev 3320) @@ -390,11 +390,7 @@ 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)); memcpy (sorted_ship_pos, ship_pos, sizeof (ship_pos)); @@ -409,8 +405,6 @@ SetMenuSounds (MENU_SOUND_ARROWS, MENU_SOUND_SELECT); DoInput (&MenuState, TRUE); - pMenuState = pOldMenuState; - return TRUE; } Modified: trunk/sc2/src/uqm/planets/scan.c =================================================================== --- trunk/sc2/src/uqm/planets/scan.c 2009-11-18 12:55:10 UTC (rev 3319) +++ trunk/sc2/src/uqm/planets/scan.c 2009-11-18 13:27:48 UTC (rev 3320) @@ -1205,10 +1205,8 @@ else PrintCoarseScan3DO (); - pMenuState = &MenuState; SetMenuSounds (MENU_SOUND_ARROWS, MENU_SOUND_SELECT); DoInput (&MenuState, FALSE); - pMenuState = 0; if (ScanContext) { Modified: trunk/sc2/src/uqm/starbase.c =================================================================== --- trunk/sc2/src/uqm/starbase.c 2009-11-18 12:55:10 UTC (rev 3319) +++ trunk/sc2/src/uqm/starbase.c 2009-11-18 13:27:48 UTC (rev 3320) @@ -34,8 +34,6 @@ #include "libs/tasklib.h" -MENU_STATE *pMenuState; - static void CleanupAfterStarBase (void); static void @@ -473,8 +471,6 @@ HSHIPFRAG hStarShip; SHIP_FRAGMENT *FragPtr; - pMenuState = 0; - // Unallied Starbase conversation SetCommIntroMode (CIM_CROSSFADE_SCREEN, 0); InitCommunication (COMMANDER_CONVERSATION); @@ -501,25 +497,17 @@ 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 @@ 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 (); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |