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:
@@ -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
|
||||||
|
|||||||
@@ -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) ();
|
||||||
|
|
||||||
|
|||||||
@@ -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);
|
||||||
|
|||||||
@@ -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 ();
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|
||||||
|
|||||||
@@ -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);
|
||||||
|
|||||||
@@ -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);
|
||||||
|
|
||||||
|
|||||||
@@ -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);
|
||||||
|
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
@@ -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))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|
||||||
|
|||||||
@@ -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)
|
||||||
|
|||||||
@@ -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;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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);
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
@@ -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);
|
||||||
|
|||||||
Reference in New Issue
Block a user