Rely on UpdateInputState's keyrepeat
git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@1317 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
@@ -997,8 +997,6 @@ ScaleSystem (void)
|
|||||||
int IPtask_func(void* data)
|
int IPtask_func(void* data)
|
||||||
{
|
{
|
||||||
#define IP_FRAME_RATE (ONE_SECOND / 30)
|
#define IP_FRAME_RATE (ONE_SECOND / 30)
|
||||||
#define DEBOUNCE_DELAY ((ONE_SECOND >> 1) / IP_FRAME_RATE)
|
|
||||||
BYTE MenuTransition;
|
|
||||||
DWORD NextTime;
|
DWORD NextTime;
|
||||||
Task task = (Task) data;
|
Task task = (Task) data;
|
||||||
BOOLEAN cancel, select;
|
BOOLEAN cancel, select;
|
||||||
@@ -1015,7 +1013,6 @@ int IPtask_func(void* data)
|
|||||||
select = FALSE;
|
select = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
MenuTransition = 0;
|
|
||||||
NextTime = GetTimeCounter ();
|
NextTime = GetTimeCounter ();
|
||||||
while (!Task_ReadState (task, TASK_EXIT))
|
while (!Task_ReadState (task, TASK_EXIT))
|
||||||
{
|
{
|
||||||
@@ -1055,18 +1052,6 @@ int IPtask_func(void* data)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (MenuTransition)
|
|
||||||
{
|
|
||||||
if (MenuTransition < DEBOUNCE_DELAY
|
|
||||||
&& !(cancel || select))
|
|
||||||
MenuTransition = 0;
|
|
||||||
else
|
|
||||||
{
|
|
||||||
--MenuTransition;
|
|
||||||
cancel = select = FALSE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
TheMess:
|
TheMess:
|
||||||
// this is a mess:
|
// this is a mess:
|
||||||
// we have to treat things slightly differently depending on the
|
// we have to treat things slightly differently depending on the
|
||||||
@@ -1091,7 +1076,6 @@ TheMess:
|
|||||||
DrawSystem (pSolarSysState->SunDesc[0].radius, FALSE);
|
DrawSystem (pSolarSysState->SunDesc[0].radius, FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (MenuTransition < DEBOUNCE_DELAY)
|
|
||||||
UndrawShip ();
|
UndrawShip ();
|
||||||
if (pSolarSysState->MenuState.Initialized != 1)
|
if (pSolarSysState->MenuState.Initialized != 1)
|
||||||
select = cancel = FALSE;
|
select = cancel = FALSE;
|
||||||
@@ -1180,14 +1164,13 @@ TheMess:
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
UpdateInputState ();
|
UpdateInputState ();
|
||||||
cancel = ImmediateInputState.key[KEY_MENU_CANCEL];
|
cancel = PulsedInputState.key[KEY_MENU_CANCEL];
|
||||||
select = ImmediateInputState.key[KEY_MENU_SELECT];
|
select = PulsedInputState.key[KEY_MENU_SELECT];
|
||||||
}
|
}
|
||||||
// JournalInput (InputState);
|
// JournalInput (InputState);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
MenuTransition = DEBOUNCE_DELAY;
|
|
||||||
SuspendGameClock ();
|
SuspendGameClock ();
|
||||||
|
|
||||||
LockMutex (GraphicsLock);
|
LockMutex (GraphicsLock);
|
||||||
|
|||||||
Reference in New Issue
Block a user