DoInput now selectively clears the input state.

Addresses bugs #378 and #379.


git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@983 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
mcmartin
2003-06-19 05:28:45 +00:00
parent c894d8cc76
commit b8d5ce1988
18 changed files with 26 additions and 21 deletions
+2
View File
@@ -1,4 +1,6 @@
Changes towards version 0.3:
- Fixed some "false key cancels" in the input system, addressing bugs
#378 and #379 -Michael
- Completely reworked the input system
- Added PC version outtakes, from chmmravatar
- Fix crash in PlayStream when whole file is prebuffered and its not
+1 -1
View File
@@ -2049,7 +2049,7 @@ HailAlien (void)
LastActivity |= CHECK_LOAD; /* prevent spurious input */
(*CommData.init_encounter_func) ();
DoInput ((PVOID)&ES);
DoInput ((PVOID)&ES, TRUE);
if (!(GLOBAL (CurrentActivity) & (CHECK_ABORT | CHECK_LOAD)))
(*CommData.uninit_encounter_func) ();
+1 -1
View File
@@ -312,7 +312,7 @@ InitEncounter (void)
SetFlashRect ((PRECT)~0L, (FRAME)0);
ClearSemaphore (GraphicsSem);
DoInput ((PVOID)&MenuState);
DoInput ((PVOID)&MenuState, TRUE);
SetSemaphore (GraphicsSem);
SetFlashRect (NULL_PTR, (FRAME)0);
+5 -2
View File
@@ -54,7 +54,6 @@ static void
_clear_menu_state (void)
{
DWORD initTime = GetTimeCounter ();
TFB_ResetControls ();
CurrentMenuState.up = 0;
CurrentMenuState.down = 0;
CurrentMenuState.left = 0;
@@ -188,9 +187,13 @@ SetDefaultMenuRepeatDelay ()
}
void
DoInput (PVOID pInputState)
DoInput (PVOID pInputState, BOOLEAN resetInput)
{
SetMenuRepeatDelay (ACCELERATION_INCREMENT, MENU_REPEAT_DELAY, ACCELERATION_INCREMENT);
if (resetInput)
{
TFB_ResetControls ();
}
do
{
TaskSwitch ();
+3 -3
View File
@@ -421,7 +421,7 @@ DoNaming (PMENU_STATE pMS)
ClearSemaphore (GraphicsSem);
EnableCharacterMode ();
DoInput (pMS);
DoInput (pMS, TRUE);
DisableCharacterMode ();
pMS->InputFunc = DoSettings;
@@ -1162,7 +1162,7 @@ PickGame (PMENU_STATE pMS)
pMS->CurString = (STRING)&desc_array[0];
ClearSemaphore (GraphicsSem);
DoInput (pMS);
DoInput (pMS, TRUE);
SetSemaphore (GraphicsSem);
pMS->Initialized = -1;
@@ -1279,7 +1279,7 @@ GameOptions (void)
MenuState.InputFunc = DoGameOptions;
MenuState.CurState = SAVE_GAME;
DoInput ((PVOID)&MenuState);
DoInput ((PVOID)&MenuState, TRUE);
pLocMenuState = 0;
+1 -1
View File
@@ -1594,7 +1594,7 @@ UnbatchGraphics ();
SetFlashRect ((PRECT)~0L, (FRAME)0);
ClearSemaphore (GraphicsSem);
DoInput ((PVOID)&MenuState);
DoInput ((PVOID)&MenuState, TRUE);
SetSemaphore (GraphicsSem);
SetFlashRect (NULL_PTR, (FRAME)0);
+1 -1
View File
@@ -1893,7 +1893,7 @@ Melee (void)
MenuState.side = 0;
MenuState.star_bucks[0] = GetTeamValue (&MenuState.TeamImage[0]);
MenuState.star_bucks[1] = GetTeamValue (&MenuState.TeamImage[1]);
DoInput ((PVOID)&MenuState);
DoInput ((PVOID)&MenuState, TRUE);
WaitForSoundEnd (TFBSOUND_WAIT_ALL);
+1 -1
View File
@@ -249,7 +249,7 @@ OldContext = SetContext (SpaceContext);
ClearSemaphore (GraphicsSem);
pMenuState = &MenuState;
DoInput ((PVOID)&MenuState);
DoInput ((PVOID)&MenuState, TRUE);
pMenuState = 0;
SetSemaphore (GraphicsSem);
+1 -1
View File
@@ -358,7 +358,7 @@ Cargo (PMENU_STATE pMS)
DrawStatusMessage ((UNICODE *)~0);
ClearSemaphore (GraphicsSem);
DoInput ((PVOID)pMS);
DoInput ((PVOID)pMS, TRUE);
pMS->InputFunc = DoFlagshipCommands;
pMS->CurState = CARGO + 1;
+1 -1
View File
@@ -625,7 +625,7 @@ Devices (PMENU_STATE pMS)
pMS->CurFrame = (FRAME)DeviceMap;
TFB_ResetControls ();
DoManipulateDevices (pMS); /* to make sure it's initialized */
DoInput ((PVOID)pMS);
DoInput ((PVOID)pMS, TRUE);
pMS->CurFrame = 0;
pMS->InputFunc = DoFlagshipCommands;
+1 -1
View File
@@ -1968,7 +1968,7 @@ PlanetSide (PMENU_STATE pMS)
pMS->Initialized = FALSE;
pMS->InputFunc = DoPlanetSide;
DoInput ((PVOID)pMS);
DoInput ((PVOID)pMS, FALSE);
if (!(GLOBAL (CurrentActivity) & CHECK_ABORT))
{
+1 -1
View File
@@ -1126,7 +1126,7 @@ DoStarMap (void)
OldMenuSounds = MenuSounds;
MenuSounds = 0;
DoInput ((PVOID)&MenuState);
DoInput ((PVOID)&MenuState, FALSE);
MenuSounds = OldMenuSounds;
pMenuState = 0;
+1 -1
View File
@@ -436,7 +436,7 @@ Roster (void)
MenuState.flash_frame0 = (FRAME)ship_pos;
MenuState.flash_frame1 = (FRAME)modified_ship_pos;
DoInput ((PVOID)&MenuState);
DoInput ((PVOID)&MenuState, TRUE);
pMenuState = pOldMenuState;
+1 -1
View File
@@ -1233,7 +1233,7 @@ ScanSystem (void)
PrintCoarseScan3DO ();
pMenuState = &MenuState;
DoInput ((PVOID)&MenuState);
DoInput ((PVOID)&MenuState, FALSE);
pMenuState = 0;
if (ScanContext)
+1 -1
View File
@@ -1917,7 +1917,7 @@ ExploreSolarSys (void)
SolarSysState.GenFunc = GenerateIP (CurStarDescPtr->Index);
InitSolarSys ();
DoInput ((PVOID)&SolarSysState.MenuState);
DoInput ((PVOID)&SolarSysState.MenuState, TRUE);
UninitSolarSys ();
pSolarSysState = 0;
}
+1 -1
View File
@@ -244,7 +244,7 @@ LastActivity = WON_LAST_BATTLE;
UnbatchGraphics ();
FlushInput ();
DoInput ((PVOID)&MenuState);
DoInput ((PVOID)&MenuState, TRUE);
SetSemaphore (GraphicsSem);
SetFlashRect ((PRECT)0, (FRAME)0);
+2 -2
View File
@@ -384,7 +384,7 @@ ExitStarBase:
break;
}
DoInput ((PVOID)pMS);
DoInput ((PVOID)pMS, TRUE);
pMS->Initialized = FALSE;
pMS->CurState = OldState;
@@ -497,7 +497,7 @@ TimePassage:
}
OldContext = SetContext (ScreenContext);
DoInput ((PVOID)pMenuState);
DoInput ((PVOID)pMenuState, TRUE);
SetContext (OldContext);
pMenuState = 0;
+1 -1
View File
@@ -185,7 +185,7 @@ extern BOOLEAN ConfirmExit (void);
extern DWORD SeedRandomNumbers (void);
extern BOOLEAN StarConDiskError (PSTR pFileName);
extern void ReportDiskError (PSTR pFileName, DISK_ERROR ErrorCondition);
extern void DoInput (PVOID pInputState);
extern void DoInput (PVOID pInputState, BOOLEAN resetInput);
extern BOOLEAN Battle (void);
extern void EncounterBattle (void);
extern void SetPlayerInput (void);