Starmap flash current location task retired
git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@3288 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
@@ -92,32 +92,25 @@ dispyToUniverse (COORD dy)
|
|||||||
|
|
||||||
static BOOLEAN transition_pending;
|
static BOOLEAN transition_pending;
|
||||||
|
|
||||||
static int
|
static void
|
||||||
flash_cursor_func (void *data)
|
flashCurrentLocation (POINT *where)
|
||||||
{
|
{
|
||||||
BYTE c, val;
|
static BYTE c = 0;
|
||||||
POINT universe;
|
static int val = -2;
|
||||||
STAMP s;
|
static POINT universe;
|
||||||
Task task = (Task) data;
|
static TimeCount NextTime = 0;
|
||||||
|
|
||||||
if (LOBYTE (GLOBAL (CurrentActivity)) != IN_HYPERSPACE)
|
if (where)
|
||||||
universe = CurStarDescPtr->star_pt;
|
universe = *where;
|
||||||
else
|
|
||||||
{
|
|
||||||
universe.x = LOGX_TO_UNIVERSE (GLOBAL_SIS (log_x));
|
|
||||||
universe.y = LOGY_TO_UNIVERSE (GLOBAL_SIS (log_y));
|
|
||||||
}
|
|
||||||
s.frame = IncFrameIndex (pMenuState->CurFrame);
|
|
||||||
|
|
||||||
c = 0x00;
|
if (GetTimeCounter () >= NextTime)
|
||||||
val = -0x02;
|
|
||||||
while (!Task_ReadState(task, TASK_EXIT))
|
|
||||||
{
|
{
|
||||||
DWORD TimeIn;
|
|
||||||
COLOR OldColor;
|
COLOR OldColor;
|
||||||
CONTEXT OldContext;
|
CONTEXT OldContext;
|
||||||
|
STAMP s;
|
||||||
|
|
||||||
TimeIn = GetTimeCounter ();
|
NextTime = GetTimeCounter () + (ONE_SECOND / 16);
|
||||||
|
|
||||||
LockMutex (GraphicsLock);
|
LockMutex (GraphicsLock);
|
||||||
OldContext = SetContext (SpaceContext);
|
OldContext = SetContext (SpaceContext);
|
||||||
|
|
||||||
@@ -127,15 +120,13 @@ flash_cursor_func (void *data)
|
|||||||
OldColor = SetContextForeGroundColor (BUILD_COLOR (MAKE_RGB15 (c, c, c), c));
|
OldColor = SetContextForeGroundColor (BUILD_COLOR (MAKE_RGB15 (c, c, c), c));
|
||||||
s.origin.x = UNIVERSE_TO_DISPX (universe.x);
|
s.origin.x = UNIVERSE_TO_DISPX (universe.x);
|
||||||
s.origin.y = UNIVERSE_TO_DISPY (universe.y);
|
s.origin.y = UNIVERSE_TO_DISPY (universe.y);
|
||||||
|
s.frame = IncFrameIndex (pMenuState->CurFrame);
|
||||||
DrawFilledStamp (&s);
|
DrawFilledStamp (&s);
|
||||||
SetContextForeGroundColor (OldColor);
|
SetContextForeGroundColor (OldColor);
|
||||||
|
|
||||||
SetContext (OldContext);
|
SetContext (OldContext);
|
||||||
UnlockMutex (GraphicsLock);
|
UnlockMutex (GraphicsLock);
|
||||||
SleepThreadUntil (TimeIn + (ONE_SECOND >> 4));
|
|
||||||
}
|
}
|
||||||
FinishTask (task);
|
|
||||||
return (0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -609,7 +600,7 @@ ZoomStarMap (SIZE dir)
|
|||||||
pMenuState->flash_rect1.corner = pMenuState->first_item;
|
pMenuState->flash_rect1.corner = pMenuState->first_item;
|
||||||
|
|
||||||
DrawStarMap (0, NULL);
|
DrawStarMap (0, NULL);
|
||||||
SleepThread (ONE_SECOND >> 3);
|
SleepThread (ONE_SECOND / 8);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (dir < 0)
|
else if (dir < 0)
|
||||||
@@ -626,7 +617,7 @@ ZoomStarMap (SIZE dir)
|
|||||||
--pMenuState->delta_item;
|
--pMenuState->delta_item;
|
||||||
|
|
||||||
DrawStarMap (0, NULL);
|
DrawStarMap (0, NULL);
|
||||||
SleepThread (ONE_SECOND >> 3);
|
SleepThread (ONE_SECOND / 8);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1176,6 +1167,8 @@ OnStarNameFrame (TEXTENTRY_STATE *pTES)
|
|||||||
UpdateFuelRequirement (pMS);
|
UpdateFuelRequirement (pMS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
flashCurrentLocation (NULL);
|
||||||
|
|
||||||
SleepThread (ONE_SECOND / 30);
|
SleepThread (ONE_SECOND / 30);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
@@ -1234,18 +1227,25 @@ DoMoveCursor (MENU_STATE *pMS)
|
|||||||
static UNICODE last_buf[CURSOR_INFO_BUFSIZE];
|
static UNICODE last_buf[CURSOR_INFO_BUFSIZE];
|
||||||
DWORD TimeIn = GetTimeCounter ();
|
DWORD TimeIn = GetTimeCounter ();
|
||||||
|
|
||||||
pMS->MenuRepeatDelay = (COUNT)pMS->CurState;
|
|
||||||
if (!pMS->Initialized)
|
if (!pMS->Initialized)
|
||||||
{
|
{
|
||||||
|
POINT universe;
|
||||||
|
|
||||||
pMS->Initialized = TRUE;
|
pMS->Initialized = TRUE;
|
||||||
pMS->InputFunc = DoMoveCursor;
|
pMS->InputFunc = DoMoveCursor;
|
||||||
|
|
||||||
SetMenuSounds (MENU_SOUND_NONE, MENU_SOUND_NONE);
|
SetMenuSounds (MENU_SOUND_NONE, MENU_SOUND_NONE);
|
||||||
SetMenuRepeatDelay (MIN_ACCEL_DELAY, MAX_ACCEL_DELAY, STEP_ACCEL_DELAY, TRUE);
|
SetMenuRepeatDelay (MIN_ACCEL_DELAY, MAX_ACCEL_DELAY, STEP_ACCEL_DELAY, TRUE);
|
||||||
|
|
||||||
pMS->flash_task = AssignTask (flash_cursor_func, 2048,
|
if (LOBYTE (GLOBAL (CurrentActivity)) != IN_HYPERSPACE)
|
||||||
"flash location on star map");
|
universe = CurStarDescPtr->star_pt;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
universe.x = LOGX_TO_UNIVERSE (GLOBAL_SIS (log_x));
|
||||||
|
universe.y = LOGY_TO_UNIVERSE (GLOBAL_SIS (log_y));
|
||||||
|
}
|
||||||
|
flashCurrentLocation (&universe);
|
||||||
|
|
||||||
last_buf[0] = '\0';
|
last_buf[0] = '\0';
|
||||||
UpdateCursorInfo (pMS, last_buf);
|
UpdateCursorInfo (pMS, last_buf);
|
||||||
UpdateFuelRequirement (pMS);
|
UpdateFuelRequirement (pMS);
|
||||||
@@ -1254,13 +1254,7 @@ DoMoveCursor (MENU_STATE *pMS)
|
|||||||
}
|
}
|
||||||
else if (PulsedInputState.menu[KEY_MENU_CANCEL])
|
else if (PulsedInputState.menu[KEY_MENU_CANCEL])
|
||||||
{
|
{
|
||||||
if (pMS->flash_task)
|
return FALSE;
|
||||||
{
|
|
||||||
ConcludeTask (pMS->flash_task);
|
|
||||||
pMS->flash_task = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
return (FALSE);
|
|
||||||
}
|
}
|
||||||
else if (PulsedInputState.menu[KEY_MENU_SELECT])
|
else if (PulsedInputState.menu[KEY_MENU_SELECT])
|
||||||
{
|
{
|
||||||
@@ -1269,11 +1263,6 @@ DoMoveCursor (MENU_STATE *pMS)
|
|||||||
if (instantMove)
|
if (instantMove)
|
||||||
{
|
{
|
||||||
PlayMenuSound (MENU_SOUND_INVOKED);
|
PlayMenuSound (MENU_SOUND_INVOKED);
|
||||||
if (pMS->flash_task)
|
|
||||||
{
|
|
||||||
ConcludeTask (pMS->flash_task);
|
|
||||||
pMS->flash_task = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (LOBYTE (GLOBAL (CurrentActivity)) == IN_HYPERSPACE)
|
if (LOBYTE (GLOBAL (CurrentActivity)) == IN_HYPERSPACE)
|
||||||
{
|
{
|
||||||
@@ -1289,7 +1278,7 @@ DoMoveCursor (MENU_STATE *pMS)
|
|||||||
debugHook = doInstantMove;
|
debugHook = doInstantMove;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (FALSE);
|
return FALSE;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
DrawStarMap (0, NULL);
|
DrawStarMap (0, NULL);
|
||||||
@@ -1347,18 +1336,9 @@ DoMoveCursor (MENU_STATE *pMS)
|
|||||||
SleepThreadUntil (TimeIn + MIN_ACCEL_DELAY);
|
SleepThreadUntil (TimeIn + MIN_ACCEL_DELAY);
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
flashCurrentLocation (NULL);
|
||||||
BOOLEAN result = !(GLOBAL (CurrentActivity & CHECK_ABORT));
|
|
||||||
if (!result)
|
return !(GLOBAL (CurrentActivity) & CHECK_ABORT);
|
||||||
{
|
|
||||||
if (pMS->flash_task)
|
|
||||||
{
|
|
||||||
ConcludeTask (pMS->flash_task);
|
|
||||||
pMS->flash_task = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -1807,7 +1787,7 @@ DoFlagshipCommands (MENU_STATE *pMS)
|
|||||||
pMS->Initialized = 1;
|
pMS->Initialized = 1;
|
||||||
}
|
}
|
||||||
else if (pMS->flash_task)
|
else if (pMS->flash_task)
|
||||||
{
|
{ // In planet orbit
|
||||||
FreePlanet ();
|
FreePlanet ();
|
||||||
LockMutex (GraphicsLock);
|
LockMutex (GraphicsLock);
|
||||||
LoadSolarSys ();
|
LoadSolarSys ();
|
||||||
|
|||||||
Reference in New Issue
Block a user