Pause/exit game dialog problem with planets fixed, GraphicsSem usage
reverted back in RotatePlanet, from PhracturedBlue git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@423 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
@@ -61,9 +61,12 @@ ConfirmExit (void)
|
|||||||
F = CaptureDrawable (LoadDisplayPixmap (&r, (FRAME)0));
|
F = CaptureDrawable (LoadDisplayPixmap (&r, (FRAME)0));
|
||||||
DrawStamp (&s);
|
DrawStamp (&s);
|
||||||
|
|
||||||
ClearSemaphore (GraphicsSem);
|
// Releasing the Semaphore lets the rotate_planet_task
|
||||||
|
// draw a frame. PauseRotate can still allow one more frame
|
||||||
|
// to be drawn, so it is safer to just not release the Semaphore
|
||||||
|
//ClearSemaphore (GraphicsSem);
|
||||||
FlushGraphics ();
|
FlushGraphics ();
|
||||||
SetSemaphore (GraphicsSem);
|
//SetSemaphore (GraphicsSem);
|
||||||
|
|
||||||
{
|
{
|
||||||
INPUT_STATE PressState;
|
INPUT_STATE PressState;
|
||||||
|
|||||||
@@ -115,21 +115,34 @@ RotatePlanet (int x, int da, int dx, int dy, int zoom)
|
|||||||
zoom_from = 0;
|
zoom_from = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
SetSemaphore (GraphicsSem);
|
|
||||||
OldContext = SetContext (SpaceContext);
|
//SetSemaphore (GraphicsSem);
|
||||||
BatchGraphics ();
|
|
||||||
if (rp)
|
// PauseRotate needs to be checked twice. It is first
|
||||||
RepairBackRect (rp);
|
// checked at the rotate_planet_task function to bypass
|
||||||
s.origin.x = dx;
|
// rendering the planet (and thus slowinng down other
|
||||||
s.origin.y = dy;
|
// parts of te code. It is checked here because it is possile
|
||||||
for (i = 0; i < num_frames; i++)
|
// that PauseRotate was set between then and now, and we don't
|
||||||
|
// want too push anything onto the DrawQueue in that case.
|
||||||
|
// If the setSemaphore is moved before the RenderLevelMasks call,
|
||||||
|
// one of the two PauseRotate checks can be removed.
|
||||||
|
//if (((PSOLARSYS_STATE volatile)pSolarSysState)->PauseRotate !=1)
|
||||||
{
|
{
|
||||||
s.frame = pFrame[i];
|
OldContext = SetContext (SpaceContext);
|
||||||
DrawStamp (&s);
|
BatchGraphics ();
|
||||||
|
if (rp)
|
||||||
|
RepairBackRect (rp);
|
||||||
|
s.origin.x = dx;
|
||||||
|
s.origin.y = dy;
|
||||||
|
for (i = 0; i < num_frames; i++)
|
||||||
|
{
|
||||||
|
s.frame = pFrame[i];
|
||||||
|
DrawStamp (&s);
|
||||||
|
}
|
||||||
|
UnbatchGraphics ();
|
||||||
|
SetContext (OldContext);
|
||||||
}
|
}
|
||||||
UnbatchGraphics ();
|
//ClearSemaphore (GraphicsSem);
|
||||||
SetContext (OldContext);
|
|
||||||
ClearSemaphore (GraphicsSem);
|
|
||||||
return (zoom);
|
return (zoom);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1300,6 +1300,14 @@ rotate_planet_task (void *data)
|
|||||||
view_index = MAP_WIDTH;
|
view_index = MAP_WIDTH;
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
|
// This SetSemaphore was placed before the RotatePlanet call
|
||||||
|
// To prevent the thread from being interrupted by the flash
|
||||||
|
// task while computing the Planet Frame. This should help
|
||||||
|
// to smooth out the planet rotation animation.
|
||||||
|
// The PauseRotate needs to be placed after the SetSemaphore,
|
||||||
|
// to gaurantee that PauseRotate doesn't change while waiting
|
||||||
|
// to aquire the GraphicsSem
|
||||||
|
SetSemaphore (GraphicsSem);
|
||||||
if (((PSOLARSYS_STATE volatile)pSS)->PauseRotate !=1
|
if (((PSOLARSYS_STATE volatile)pSS)->PauseRotate !=1
|
||||||
// if (((PSOLARSYS_STATE volatile)pSS)->MenuState.Initialized <= 3
|
// if (((PSOLARSYS_STATE volatile)pSS)->MenuState.Initialized <= 3
|
||||||
&& !(GLOBAL (CurrentActivity) & CHECK_ABORT))
|
&& !(GLOBAL (CurrentActivity) & CHECK_ABORT))
|
||||||
@@ -1319,7 +1327,7 @@ rotate_planet_task (void *data)
|
|||||||
}
|
}
|
||||||
x += i;
|
x += i;
|
||||||
}
|
}
|
||||||
|
ClearSemaphore (GraphicsSem);
|
||||||
SleepThreadUntil (TimeIn + (ONE_SECOND * ROTATION_TIME) / (MAP_WIDTH));
|
SleepThreadUntil (TimeIn + (ONE_SECOND * ROTATION_TIME) / (MAP_WIDTH));
|
||||||
// SleepThreadUntil (TimeIn + (ONE_SECOND * 5 / (MAP_WIDTH-32)));
|
// SleepThreadUntil (TimeIn + (ONE_SECOND * 5 / (MAP_WIDTH-32)));
|
||||||
TimeIn = GetTimeCounter ();
|
TimeIn = GetTimeCounter ();
|
||||||
|
|||||||
@@ -174,9 +174,12 @@ PauseGame (void)
|
|||||||
F = CaptureDrawable (LoadDisplayPixmap (&r, (FRAME)0));
|
F = CaptureDrawable (LoadDisplayPixmap (&r, (FRAME)0));
|
||||||
DrawStamp (&s);
|
DrawStamp (&s);
|
||||||
|
|
||||||
ClearSemaphore (GraphicsSem);
|
// Releasing the Semaphore lets the rotate_planet_task
|
||||||
|
// draw a frame. PauseRotate can still allow one more frame
|
||||||
|
// to be drawn, so it is safer to just not release the Semaphore
|
||||||
|
//ClearSemaphore (GraphicsSem);
|
||||||
FlushGraphics ();
|
FlushGraphics ();
|
||||||
SetSemaphore (GraphicsSem);
|
//SetSemaphore (GraphicsSem);
|
||||||
|
|
||||||
{
|
{
|
||||||
BYTE scan;
|
BYTE scan;
|
||||||
|
|||||||
Reference in New Issue
Block a user