From 3252591a76d5e1512d913bfb75c94511678ce61b Mon Sep 17 00:00:00 2001 From: ghaushe Date: Mon, 23 Dec 2002 16:47:54 +0000 Subject: [PATCH] Planet scan should now take ~2 secs on all machines git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@473 8092fc87-c524-0410-9efc-e669fe64eaf9 --- sc2/ChangeLog | 1 + sc2/src/sc2code/planets/scan.c | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/sc2/ChangeLog b/sc2/ChangeLog index 9ba4c1b6e..72e98e82a 100644 --- a/sc2/ChangeLog +++ b/sc2/ChangeLog @@ -1,4 +1,5 @@ 0.2: +- Planet scan should now take ~2secs on all computers -PhracturedBlue - Updated earth image to look nicer (no vertical lines) -PhracturedBlue - Clock semaphore is now created with a value of 0 -PhracturedBlue - Rewrote Semaphore debugging code to be more useful - PhracturedBlue diff --git a/sc2/src/sc2code/planets/scan.c b/sc2/src/sc2code/planets/scan.c index 8f567fd0d..6a47f2a20 100644 --- a/sc2/src/sc2code/planets/scan.c +++ b/sc2/src/sc2code/planets/scan.c @@ -693,7 +693,7 @@ DoScan (INPUT_STATE InputState, PMENU_STATE pMS) { //STAMP s; - + DWORD TimeIn, WaitTime; if (GLOBAL (CurrentActivity) & CHECK_ABORT) return (FALSE); @@ -846,6 +846,8 @@ DoScan (INPUT_STATE InputState, PMENU_STATE ClearSemaphore (GraphicsSem); PressState = AnyButtonPress (TRUE); + WaitTime = (ONE_SECOND << 1) / MAP_HEIGHT; + TimeIn = GetTimeCounter (); for (i = 0; i < MAP_HEIGHT + NUM_FLASH_COLORS + 1; i++) { ButtonState = AnyButtonPress (TRUE); @@ -866,7 +868,8 @@ DoScan (INPUT_STATE InputState, PMENU_STATE UnbatchGraphics (); ClearSemaphore (GraphicsSem); // FlushGraphics (); - SleepThread (2); + SleepThreadUntil (TimeIn + WaitTime); + TimeIn = GetTimeCounter (); } pSolarSysState->Tint_rgb = 0;