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: 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 - Completely reworked the input system
- Added PC version outtakes, from chmmravatar - Added PC version outtakes, from chmmravatar
- Fix crash in PlayStream when whole file is prebuffered and its not - 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 */ LastActivity |= CHECK_LOAD; /* prevent spurious input */
(*CommData.init_encounter_func) (); (*CommData.init_encounter_func) ();
DoInput ((PVOID)&ES); DoInput ((PVOID)&ES, TRUE);
if (!(GLOBAL (CurrentActivity) & (CHECK_ABORT | CHECK_LOAD))) if (!(GLOBAL (CurrentActivity) & (CHECK_ABORT | CHECK_LOAD)))
(*CommData.uninit_encounter_func) (); (*CommData.uninit_encounter_func) ();
+1 -1
View File
@@ -312,7 +312,7 @@ InitEncounter (void)
SetFlashRect ((PRECT)~0L, (FRAME)0); SetFlashRect ((PRECT)~0L, (FRAME)0);
ClearSemaphore (GraphicsSem); ClearSemaphore (GraphicsSem);
DoInput ((PVOID)&MenuState); DoInput ((PVOID)&MenuState, TRUE);
SetSemaphore (GraphicsSem); SetSemaphore (GraphicsSem);
SetFlashRect (NULL_PTR, (FRAME)0); SetFlashRect (NULL_PTR, (FRAME)0);
+5 -2
View File
@@ -54,7 +54,6 @@ static void
_clear_menu_state (void) _clear_menu_state (void)
{ {
DWORD initTime = GetTimeCounter (); DWORD initTime = GetTimeCounter ();
TFB_ResetControls ();
CurrentMenuState.up = 0; CurrentMenuState.up = 0;
CurrentMenuState.down = 0; CurrentMenuState.down = 0;
CurrentMenuState.left = 0; CurrentMenuState.left = 0;
@@ -188,9 +187,13 @@ SetDefaultMenuRepeatDelay ()
} }
void void
DoInput (PVOID pInputState) DoInput (PVOID pInputState, BOOLEAN resetInput)
{ {
SetMenuRepeatDelay (ACCELERATION_INCREMENT, MENU_REPEAT_DELAY, ACCELERATION_INCREMENT); SetMenuRepeatDelay (ACCELERATION_INCREMENT, MENU_REPEAT_DELAY, ACCELERATION_INCREMENT);
if (resetInput)
{
TFB_ResetControls ();
}
do do
{ {
TaskSwitch (); TaskSwitch ();
+3 -3
View File
@@ -421,7 +421,7 @@ DoNaming (PMENU_STATE pMS)
ClearSemaphore (GraphicsSem); ClearSemaphore (GraphicsSem);
EnableCharacterMode (); EnableCharacterMode ();
DoInput (pMS); DoInput (pMS, TRUE);
DisableCharacterMode (); DisableCharacterMode ();
pMS->InputFunc = DoSettings; pMS->InputFunc = DoSettings;
@@ -1162,7 +1162,7 @@ PickGame (PMENU_STATE pMS)
pMS->CurString = (STRING)&desc_array[0]; pMS->CurString = (STRING)&desc_array[0];
ClearSemaphore (GraphicsSem); ClearSemaphore (GraphicsSem);
DoInput (pMS); DoInput (pMS, TRUE);
SetSemaphore (GraphicsSem); SetSemaphore (GraphicsSem);
pMS->Initialized = -1; pMS->Initialized = -1;
@@ -1279,7 +1279,7 @@ GameOptions (void)
MenuState.InputFunc = DoGameOptions; MenuState.InputFunc = DoGameOptions;
MenuState.CurState = SAVE_GAME; MenuState.CurState = SAVE_GAME;
DoInput ((PVOID)&MenuState); DoInput ((PVOID)&MenuState, TRUE);
pLocMenuState = 0; pLocMenuState = 0;
+1 -1
View File
@@ -1594,7 +1594,7 @@ UnbatchGraphics ();
SetFlashRect ((PRECT)~0L, (FRAME)0); SetFlashRect ((PRECT)~0L, (FRAME)0);
ClearSemaphore (GraphicsSem); ClearSemaphore (GraphicsSem);
DoInput ((PVOID)&MenuState); DoInput ((PVOID)&MenuState, TRUE);
SetSemaphore (GraphicsSem); SetSemaphore (GraphicsSem);
SetFlashRect (NULL_PTR, (FRAME)0); SetFlashRect (NULL_PTR, (FRAME)0);
+1 -1
View File
@@ -1893,7 +1893,7 @@ Melee (void)
MenuState.side = 0; MenuState.side = 0;
MenuState.star_bucks[0] = GetTeamValue (&MenuState.TeamImage[0]); MenuState.star_bucks[0] = GetTeamValue (&MenuState.TeamImage[0]);
MenuState.star_bucks[1] = GetTeamValue (&MenuState.TeamImage[1]); MenuState.star_bucks[1] = GetTeamValue (&MenuState.TeamImage[1]);
DoInput ((PVOID)&MenuState); DoInput ((PVOID)&MenuState, TRUE);
WaitForSoundEnd (TFBSOUND_WAIT_ALL); WaitForSoundEnd (TFBSOUND_WAIT_ALL);
+1 -1
View File
@@ -249,7 +249,7 @@ OldContext = SetContext (SpaceContext);
ClearSemaphore (GraphicsSem); ClearSemaphore (GraphicsSem);
pMenuState = &MenuState; pMenuState = &MenuState;
DoInput ((PVOID)&MenuState); DoInput ((PVOID)&MenuState, TRUE);
pMenuState = 0; pMenuState = 0;
SetSemaphore (GraphicsSem); SetSemaphore (GraphicsSem);
+1 -1
View File
@@ -358,7 +358,7 @@ Cargo (PMENU_STATE pMS)
DrawStatusMessage ((UNICODE *)~0); DrawStatusMessage ((UNICODE *)~0);
ClearSemaphore (GraphicsSem); ClearSemaphore (GraphicsSem);
DoInput ((PVOID)pMS); DoInput ((PVOID)pMS, TRUE);
pMS->InputFunc = DoFlagshipCommands; pMS->InputFunc = DoFlagshipCommands;
pMS->CurState = CARGO + 1; pMS->CurState = CARGO + 1;
+1 -1
View File
@@ -625,7 +625,7 @@ Devices (PMENU_STATE pMS)
pMS->CurFrame = (FRAME)DeviceMap; pMS->CurFrame = (FRAME)DeviceMap;
TFB_ResetControls (); TFB_ResetControls ();
DoManipulateDevices (pMS); /* to make sure it's initialized */ DoManipulateDevices (pMS); /* to make sure it's initialized */
DoInput ((PVOID)pMS); DoInput ((PVOID)pMS, TRUE);
pMS->CurFrame = 0; pMS->CurFrame = 0;
pMS->InputFunc = DoFlagshipCommands; pMS->InputFunc = DoFlagshipCommands;
+1 -1
View File
@@ -1968,7 +1968,7 @@ PlanetSide (PMENU_STATE pMS)
pMS->Initialized = FALSE; pMS->Initialized = FALSE;
pMS->InputFunc = DoPlanetSide; pMS->InputFunc = DoPlanetSide;
DoInput ((PVOID)pMS); DoInput ((PVOID)pMS, FALSE);
if (!(GLOBAL (CurrentActivity) & CHECK_ABORT)) if (!(GLOBAL (CurrentActivity) & CHECK_ABORT))
{ {
+1 -1
View File
@@ -1126,7 +1126,7 @@ DoStarMap (void)
OldMenuSounds = MenuSounds; OldMenuSounds = MenuSounds;
MenuSounds = 0; MenuSounds = 0;
DoInput ((PVOID)&MenuState); DoInput ((PVOID)&MenuState, FALSE);
MenuSounds = OldMenuSounds; MenuSounds = OldMenuSounds;
pMenuState = 0; pMenuState = 0;
+1 -1
View File
@@ -436,7 +436,7 @@ Roster (void)
MenuState.flash_frame0 = (FRAME)ship_pos; MenuState.flash_frame0 = (FRAME)ship_pos;
MenuState.flash_frame1 = (FRAME)modified_ship_pos; MenuState.flash_frame1 = (FRAME)modified_ship_pos;
DoInput ((PVOID)&MenuState); DoInput ((PVOID)&MenuState, TRUE);
pMenuState = pOldMenuState; pMenuState = pOldMenuState;
+1 -1
View File
@@ -1233,7 +1233,7 @@ ScanSystem (void)
PrintCoarseScan3DO (); PrintCoarseScan3DO ();
pMenuState = &MenuState; pMenuState = &MenuState;
DoInput ((PVOID)&MenuState); DoInput ((PVOID)&MenuState, FALSE);
pMenuState = 0; pMenuState = 0;
if (ScanContext) if (ScanContext)
+1 -1
View File
@@ -1917,7 +1917,7 @@ ExploreSolarSys (void)
SolarSysState.GenFunc = GenerateIP (CurStarDescPtr->Index); SolarSysState.GenFunc = GenerateIP (CurStarDescPtr->Index);
InitSolarSys (); InitSolarSys ();
DoInput ((PVOID)&SolarSysState.MenuState); DoInput ((PVOID)&SolarSysState.MenuState, TRUE);
UninitSolarSys (); UninitSolarSys ();
pSolarSysState = 0; pSolarSysState = 0;
} }
+1 -1
View File
@@ -244,7 +244,7 @@ LastActivity = WON_LAST_BATTLE;
UnbatchGraphics (); UnbatchGraphics ();
FlushInput (); FlushInput ();
DoInput ((PVOID)&MenuState); DoInput ((PVOID)&MenuState, TRUE);
SetSemaphore (GraphicsSem); SetSemaphore (GraphicsSem);
SetFlashRect ((PRECT)0, (FRAME)0); SetFlashRect ((PRECT)0, (FRAME)0);
+2 -2
View File
@@ -384,7 +384,7 @@ ExitStarBase:
break; break;
} }
DoInput ((PVOID)pMS); DoInput ((PVOID)pMS, TRUE);
pMS->Initialized = FALSE; pMS->Initialized = FALSE;
pMS->CurState = OldState; pMS->CurState = OldState;
@@ -497,7 +497,7 @@ TimePassage:
} }
OldContext = SetContext (ScreenContext); OldContext = SetContext (ScreenContext);
DoInput ((PVOID)pMenuState); DoInput ((PVOID)pMenuState, TRUE);
SetContext (OldContext); SetContext (OldContext);
pMenuState = 0; pMenuState = 0;
+1 -1
View File
@@ -185,7 +185,7 @@ extern BOOLEAN ConfirmExit (void);
extern DWORD SeedRandomNumbers (void); extern DWORD SeedRandomNumbers (void);
extern BOOLEAN StarConDiskError (PSTR pFileName); extern BOOLEAN StarConDiskError (PSTR pFileName);
extern void ReportDiskError (PSTR pFileName, DISK_ERROR ErrorCondition); 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 BOOLEAN Battle (void);
extern void EncounterBattle (void); extern void EncounterBattle (void);
extern void SetPlayerInput (void); extern void SetPlayerInput (void);